It Turns Out Windows Unconditionally Reserves The First 1MB Of RAM, Linux Was Just Late To Do So
Sent in last weekend to the Linux 5.13 kernel was the change so Linux x86/x86_64 will always reserve the first 1MB of RAM in order to avoid corruption issues with some BIOS and frame-buffers sometimes fiddling with that lowest portion of system memory. While the thought was reserving that first 1MB unconditionally was a bit onerous and that perhaps Windows has some way of determining how much low memory area to reserve, it turns out Windows has been employing this same behavior for years.
While Linus Torvalds landed the change in Linux 5.13 to reserve that first 1MB of RAM on Linux x86/x86_64 systems, he did comment, "This seems a bit draconic. How does this work at all under Windows? There must be some windows knowledge about what the BIOS updates that we're not aware of. I've pulled it, but it does seem like something odd is going on."
Following much interest in the change, a Microsoft engineer was kind enough to check with the Windows team and did comment that in fact Windows has been unconditionally reserving the first 1MB of RAM on both Intel and AMD systems and they have been doing that for many years at this point. "I checked with the Windows team. Peter Anvin's statement from 11 years ago is true. On Intel and AMD processors, Windows unconditionally reserves the 1st megabyte of memory, minus one page used for real mode startup. This is done to work around BIOS bugs."
So indeed it looks like Linux will stick with this new behavior on their front for also reserving the first 1MB of RAM across x86/x86_64 systems to deal with buggy BIOS implementations.
While Linus Torvalds landed the change in Linux 5.13 to reserve that first 1MB of RAM on Linux x86/x86_64 systems, he did comment, "This seems a bit draconic. How does this work at all under Windows? There must be some windows knowledge about what the BIOS updates that we're not aware of. I've pulled it, but it does seem like something odd is going on."
Following much interest in the change, a Microsoft engineer was kind enough to check with the Windows team and did comment that in fact Windows has been unconditionally reserving the first 1MB of RAM on both Intel and AMD systems and they have been doing that for many years at this point. "I checked with the Windows team. Peter Anvin's statement from 11 years ago is true. On Intel and AMD processors, Windows unconditionally reserves the 1st megabyte of memory, minus one page used for real mode startup. This is done to work around BIOS bugs."
So indeed it looks like Linux will stick with this new behavior on their front for also reserving the first 1MB of RAM across x86/x86_64 systems to deal with buggy BIOS implementations.
48 Comments