系统 RAM 是堆/堆栈所在的唯一部分吗?
[root@ ~]# cat /proc/iomem
00000000-0000ffff : reserved
00010000-0009f7ff : System RAM
0009f800-0009ffff : reserved
000ca000-000cbfff : reserved
000dc000-000e3fff : reserved
000e8000-000fffff : reserved
00100000-3fedffff : System RAM
01000000-013a5eb4 : Kernel code
013a5eb5-0173e0c7 : Kernel data
01805000-05d9d4f7 : Kernel bss
3fee0000-3fefefff : ACPI Tables
3feff000-3fefffff : ACPI Non-volatile Storage
3ff00000-3fffffff : System RAM
40000000-40007fff : 0000:00:0f.0
40008000-4000bfff : 0000:00:10.0
d0000000-d7ffffff : 0000:00:0f.0
d8000000-d87fffff : 0000:00:0f.0
d8800000-d881ffff : 0000:00:10.0
d8800000-d881ffff : mpt
d8820000-d883ffff : 0000:00:10.0
d8820000-d883ffff : mpt
d8900000-d9cfffff : PCI Bus 0000:02
d8900000-d890ffff : 0000:02:01.0
d8900000-d890ffff : e1000
d8910000-d8910fff : 0000:02:03.0
d8910000-d8910fff : ehci_hcd
d8920000-d893ffff : 0000:02:01.0
d8920000-d893ffff : e1000
d9d00000-d9dfffff : PCI Bus 0000:03
d9e00000-d9efffff : PCI Bus 0000:0b
d9f00000-d9ffffff : PCI Bus 0000:13
da000000-da0fffff : PCI Bus 0000:1b
da100000-da1fffff : PCI Bus 0000:04
da200000-da2fffff : PCI Bus 0000:0c
da300000-da3fffff : PCI Bus 0000:14
da400000-da4fffff : PCI Bus 0000:1c
da500000-da5fffff : PCI Bus 0000:05
da600000-da6fffff : PCI Bus 0000:0d
da700000-da7fffff : PCI Bus 0000:15
da800000-da8fffff : PCI Bus 0000:1d
da900000-da9fffff : PCI Bus 0000:06
daa00000-daafffff : PCI Bus 0000:0e
dab00000-dabfffff : PCI Bus 0000:16
dac00000-dacfffff : PCI Bus 0000:1e
dad00000-dadfffff : PCI Bus 0000:07
dae00000-daefffff : PCI Bus 0000:0f
daf00000-daffffff : PCI Bus 0000:17
db000000-db0fffff : PCI Bus 0000:1f
db100000-db1fffff : PCI Bus 0000:08
db200000-db2fffff : PCI Bus 0000:10
db300000-db3fffff : PCI Bus 0000:18
db400000-db4fffff : PCI Bus 0000:20
db500000-db5fffff : PCI Bus 0000:09
db600000-db6fffff : PCI Bus 0000:11
db700000-db7fffff : PCI Bus 0000:19
db800000-db8fffff : PCI Bus 0000:21
db900000-db9fffff : PCI Bus 0000:0a
dba00000-dbafffff : PCI Bus 0000:12
dbb00000-dbbfffff : PCI Bus 0000:1a
dbc00000-dbcfffff : PCI Bus 0000:22
dbe00000-dbffffff : pnp 00:0c
dc400000-dc9fffff : PCI Bus 0000:02
dc400000-dc40ffff : 0000:02:01.0
dca00000-dcafffff : PCI Bus 0000:03
dcb00000-dcbfffff : PCI Bus 0000:0b
dcc00000-dccfffff : PCI Bus 0000:13
dcd00000-dcdfffff : PCI Bus 0000:1b
dce00000-dcefffff : PCI Bus 0000:04
dcf00000-dcffffff : PCI Bus 0000:0c
dd000000-dd0fffff : PCI Bus 0000:14
dd100000-dd1fffff : PCI Bus 0000:1c
dd200000-dd2fffff : PCI Bus 0000:05
dd300000-dd3fffff : PCI Bus 0000:0d
dd400000-dd4fffff : PCI Bus 0000:15
dd500000-dd5fffff : PCI Bus 0000:1d
dd600000-dd6fffff : PCI Bus 0000:06
dd700000-dd7fffff : PCI Bus 0000:0e
dd800000-dd8fffff : PCI Bus 0000:16
dd900000-dd9fffff : PCI Bus 0000:1e
dda00000-ddafffff : PCI Bus 0000:07
ddb00000-ddbfffff : PCI Bus 0000:0f
ddc00000-ddcfffff : PCI Bus 0000:17
ddd00000-dddfffff : PCI Bus 0000:1f
dde00000-ddefffff : PCI Bus 0000:08
ddf00000-ddffffff : PCI Bus 0000:10
de000000-de0fffff : PCI Bus 0000:18
de100000-de1fffff : PCI Bus 0000:20
de200000-de2fffff : PCI Bus 0000:09
de300000-de3fffff : PCI Bus 0000:11
de400000-de4fffff : PCI Bus 0000:19
de500000-de5fffff : PCI Bus 0000:21
de600000-de6fffff : PCI Bus 0000:0a
de700000-de7fffff : PCI Bus 0000:12
de800000-de8fffff : PCI Bus 0000:1a
de900000-de9fffff : PCI Bus 0000:22
e0000000-efffffff : PCI MMCONFIG 0 [00-ff]
e0000000-efffffff : reserved
e0000000-efffffff : pnp 00:0c
fec00000-fec0ffff : reserved
fec00000-fec00fff : IOAPIC 0
fee00000-fee00fff : Local APIC
fee00000-fee00fff : reserved
fffe0000-ffffffff : reserved
当我们操作堆/栈时,我们实际上是在系统RAM上操作吗?
[root@ ~]# cat /proc/iomem
00000000-0000ffff : reserved
00010000-0009f7ff : System RAM
0009f800-0009ffff : reserved
000ca000-000cbfff : reserved
000dc000-000e3fff : reserved
000e8000-000fffff : reserved
00100000-3fedffff : System RAM
01000000-013a5eb4 : Kernel code
013a5eb5-0173e0c7 : Kernel data
01805000-05d9d4f7 : Kernel bss
3fee0000-3fefefff : ACPI Tables
3feff000-3fefffff : ACPI Non-volatile Storage
3ff00000-3fffffff : System RAM
40000000-40007fff : 0000:00:0f.0
40008000-4000bfff : 0000:00:10.0
d0000000-d7ffffff : 0000:00:0f.0
d8000000-d87fffff : 0000:00:0f.0
d8800000-d881ffff : 0000:00:10.0
d8800000-d881ffff : mpt
d8820000-d883ffff : 0000:00:10.0
d8820000-d883ffff : mpt
d8900000-d9cfffff : PCI Bus 0000:02
d8900000-d890ffff : 0000:02:01.0
d8900000-d890ffff : e1000
d8910000-d8910fff : 0000:02:03.0
d8910000-d8910fff : ehci_hcd
d8920000-d893ffff : 0000:02:01.0
d8920000-d893ffff : e1000
d9d00000-d9dfffff : PCI Bus 0000:03
d9e00000-d9efffff : PCI Bus 0000:0b
d9f00000-d9ffffff : PCI Bus 0000:13
da000000-da0fffff : PCI Bus 0000:1b
da100000-da1fffff : PCI Bus 0000:04
da200000-da2fffff : PCI Bus 0000:0c
da300000-da3fffff : PCI Bus 0000:14
da400000-da4fffff : PCI Bus 0000:1c
da500000-da5fffff : PCI Bus 0000:05
da600000-da6fffff : PCI Bus 0000:0d
da700000-da7fffff : PCI Bus 0000:15
da800000-da8fffff : PCI Bus 0000:1d
da900000-da9fffff : PCI Bus 0000:06
daa00000-daafffff : PCI Bus 0000:0e
dab00000-dabfffff : PCI Bus 0000:16
dac00000-dacfffff : PCI Bus 0000:1e
dad00000-dadfffff : PCI Bus 0000:07
dae00000-daefffff : PCI Bus 0000:0f
daf00000-daffffff : PCI Bus 0000:17
db000000-db0fffff : PCI Bus 0000:1f
db100000-db1fffff : PCI Bus 0000:08
db200000-db2fffff : PCI Bus 0000:10
db300000-db3fffff : PCI Bus 0000:18
db400000-db4fffff : PCI Bus 0000:20
db500000-db5fffff : PCI Bus 0000:09
db600000-db6fffff : PCI Bus 0000:11
db700000-db7fffff : PCI Bus 0000:19
db800000-db8fffff : PCI Bus 0000:21
db900000-db9fffff : PCI Bus 0000:0a
dba00000-dbafffff : PCI Bus 0000:12
dbb00000-dbbfffff : PCI Bus 0000:1a
dbc00000-dbcfffff : PCI Bus 0000:22
dbe00000-dbffffff : pnp 00:0c
dc400000-dc9fffff : PCI Bus 0000:02
dc400000-dc40ffff : 0000:02:01.0
dca00000-dcafffff : PCI Bus 0000:03
dcb00000-dcbfffff : PCI Bus 0000:0b
dcc00000-dccfffff : PCI Bus 0000:13
dcd00000-dcdfffff : PCI Bus 0000:1b
dce00000-dcefffff : PCI Bus 0000:04
dcf00000-dcffffff : PCI Bus 0000:0c
dd000000-dd0fffff : PCI Bus 0000:14
dd100000-dd1fffff : PCI Bus 0000:1c
dd200000-dd2fffff : PCI Bus 0000:05
dd300000-dd3fffff : PCI Bus 0000:0d
dd400000-dd4fffff : PCI Bus 0000:15
dd500000-dd5fffff : PCI Bus 0000:1d
dd600000-dd6fffff : PCI Bus 0000:06
dd700000-dd7fffff : PCI Bus 0000:0e
dd800000-dd8fffff : PCI Bus 0000:16
dd900000-dd9fffff : PCI Bus 0000:1e
dda00000-ddafffff : PCI Bus 0000:07
ddb00000-ddbfffff : PCI Bus 0000:0f
ddc00000-ddcfffff : PCI Bus 0000:17
ddd00000-dddfffff : PCI Bus 0000:1f
dde00000-ddefffff : PCI Bus 0000:08
ddf00000-ddffffff : PCI Bus 0000:10
de000000-de0fffff : PCI Bus 0000:18
de100000-de1fffff : PCI Bus 0000:20
de200000-de2fffff : PCI Bus 0000:09
de300000-de3fffff : PCI Bus 0000:11
de400000-de4fffff : PCI Bus 0000:19
de500000-de5fffff : PCI Bus 0000:21
de600000-de6fffff : PCI Bus 0000:0a
de700000-de7fffff : PCI Bus 0000:12
de800000-de8fffff : PCI Bus 0000:1a
de900000-de9fffff : PCI Bus 0000:22
e0000000-efffffff : PCI MMCONFIG 0 [00-ff]
e0000000-efffffff : reserved
e0000000-efffffff : pnp 00:0c
fec00000-fec0ffff : reserved
fec00000-fec00fff : IOAPIC 0
fee00000-fee00fff : Local APIC
fee00000-fee00fff : reserved
fffe0000-ffffffff : reserved
Is it true that when we operate on heap/stack,we are actually operating on the System RAM?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
嗯,它是 RAM,当它被分配给堆时,我们可以将其称为“系统”RAM。不过,为了回答你的问题,我们可以想象或幻想一个系统,其中堆驻留在 RAM 之外的其他地方,但我们并不经常看到这样的系统。所以,是的,实际上堆位于 RAM 中。堆栈 OTOH 属于正在运行的程序,它也位于 RAM 中。
Well, it's RAM and, when it's assigned to the heap we can refer to it as "system" RAM. To answer your question, though, we can imagine or fantasize a system where the heap resides elsewhere than RAM, but we don't very often see such systems. So, yes, the heap in practical terms lives in RAM. The stack, OTOH, belongs to the running program and it, too, lives in RAM.
好吧,最终你必须在“系统 RAM”上运行(我假设你指的是物理 RAM)。你还能是什么?当内核实际给代码提供周期时,堆栈和堆数据必须位于物理 RAM 中。当然,一路上它可以被替换。当它被换入时,它在进程地址空间中的虚拟地址将与它在物理RAM中的地址无关。但当它被操作时,它会存在于物理RAM中。
Well, ultimately you have to be operating on "system RAM" (I assume you mean physical RAM). What else could you be? When the code actually is given cycles by the kernel, the stack and heap data has to be in physical RAM. Along the way it could be swapped out, of course. And its virtual address in the process address space will have no relation to its address in physical RAM when it's swapped in. But it will be living in physical RAM when it's operated on.