One chunk of RAM, two house numbers 同一块内存,两个门牌号

Your machine has 16 GiB installed and reports 16 GiB. Nothing is missing — but the gigabyte you are reading is not at the number the module would give it. Something swapped its plate. 机器插了 16 GiB,系统也报 16 GiB,一点没少。可你正在读的那 1 GiB,并不在内存条给它的那个号上——有人给它换了块门牌。

DIMM 0x0
The module itself is one continuous stretch: chip after chip, counted from zero at the gold fingers. Nothing on the stick knows what a hole is. 内存条本身是连续的一整条:一颗接一颗,从金手指那头的 0 号开始数。条子上没有「空洞」这回事

Who took the number away 号是被谁占走的

Devices need addresses too. A graphics card, a network card, the interrupt controller — each needs a stretch of numbers the CPU can write to, and those numbers come out of the same pool as memory. Firmware carves that stretch out below the 4 GiB mark, and whatever DRAM was sitting there is now covered: the number belongs to a device, so reading it reaches the device, not the memory. 设备也要门牌。显卡、网卡、中断控制器——每样都要一段 CPU 能写的号,而这些号和内存的号出自同一个池子。固件在 4 GiB 以下切出这么一段,原本坐在那儿的 DRAM 就被盖住了:那个号已经归设备了,读它读到的是设备,不是内存。

A building has four floors, one flat each. But the plates read 1, 2, 5, 4 — the third plate was needed elsewhere, so this flat was given a spare number. The flat did not move; its plate did. Ask for “number 5” and you arrive at the third floor. Ask for “the third floor” and the postman has no idea what you mean, because plates are all he carries. 一栋楼四层,一层一户。可门牌上写的是 1、2、5、4——3 号那块牌子被别处占用了,这一户只好领了个备用号。房子没动,动的是牌子。你说「找 5 号」,来的就是三楼;你说「找三楼」,邮差反而不懂——他手上只有门牌。

Two books, side by side 两本本子,并排放

The memory is still on the stick and still working — it is only unreachable at its own number. So firmware hands it a second one, above the top of everything else. Put the two books side by side and the whole thing becomes one picture. 那块内存还在条子上、还好好的,只是在自己的号上够不着。于是固件另给它一个号,安排在所有东西的最上头。把两本本子并排放,这件事就是一张图。

DRAM MMIO DRAM 搬上来的那 1 GiB the moved gigabyte DRAM 被空洞盖住的一段 the covered slice 系统看到的那本 what the system sees 内存条上真实的那本 what the DIMM holds TOUUD TOLUD 0x0 重映射 remap
Two books, never merged. The right one is what the DIMM holds: one continuous stretch, and shorter than the left, because a machine can number far more than it has installed. The left one is what the system sees — memory at the bottom, the hatched MMIO hole above it (hatching always means “this is not memory”), memory again, and at the very top the yellow band: the covered gigabyte, back under a second number. The violet line joins the two — same silicon, two plates. Every boundary gets its own leader, because a boundary is an address while a band is a range; TOLUD marks where the low memory ends and the hole begins. Band heights are not to scale, and low addresses are at the bottom. 两本本子,永不合并。右边那本是内存条上真实的一条:连续,而且比左边——机器能编的号远比它插的内存多。左边那本是系统看到的:底下是内存,往上是画斜纹的 MMIO 空洞(斜纹的意思始终是「这一段不是内存」),再往上又是内存,最顶上那条黄色的,就是被盖住的那 1 GiB 换了个号回来了。紫线把两段连起来——同一块硅片,两块门牌。每条分界各拉一条引线,因为分界是一个地址、段是一个范围TOLUD 标的是低端内存到头、空洞开始的那一处。段高不按比例,低地址在下。