Detecting Memory (x86): Difference between revisions
Jump to navigation
Jump to search
[unchecked revision] | [unchecked revision] |
Content deleted Content added
m →Memory Map Via GRUB: Fix dead link to multiboot.h |
Added note about gcc packing multiboot structure wrong |
||
Line 329: | Line 329: | ||
|} |
|} |
||
* '''WARNING:''' If you downloaded the multiboot header from gnu.org, you probably got a version which defines the base address and length fields as one 64-bit unsigned integer each, rather than two 32-bit unsigned integers each. [https://forum.osdev.org/viewtopic.php?t=30318 This may cause gcc to pack the structure incorrectly] which can lead to nonsensical values when you try to read it. |
|||
* "size" is the size of the associated structure in bytes, which can be greater than the minimum of 20 bytes. base_addr_low is the lower 32 bits of the starting address, and base_addr_high is the upper 32 bits, for a total of a 64-bit starting address. length_low is the lower 32 bits of the size of the memory region in bytes, and length_high is the upper 32 bits, for a total of a 64-bit length. type is the variety of address range represented, where a value of 1 indicates available RAM, and all other values currently indicated a reserved area. |
* "size" is the size of the associated structure in bytes, which can be greater than the minimum of 20 bytes. base_addr_low is the lower 32 bits of the starting address, and base_addr_high is the upper 32 bits, for a total of a 64-bit starting address. length_low is the lower 32 bits of the size of the memory region in bytes, and length_high is the upper 32 bits, for a total of a 64-bit length. type is the variety of address range represented, where a value of 1 indicates available RAM, and all other values currently indicated a reserved area. |
||
* GRUB simply uses INT 15h, EAX=E820 to get the detailed memory map, and does not verify the "sanity" of the map. It also will not sort the entries, retrieve any available ACPI 3.0 extended uint32_t (with the "ignore this entry" bit), or clean up the table in any other way. |
* GRUB simply uses INT 15h, EAX=E820 to get the detailed memory map, and does not verify the "sanity" of the map. It also will not sort the entries, retrieve any available ACPI 3.0 extended uint32_t (with the "ignore this entry" bit), or clean up the table in any other way. |
||
Line 649: | Line 650: | ||
===Threads=== |
===Threads=== |
||
* [http://www.osdev.org/phpBB2/viewtopic.php?t=11391 Grub's multiboot memory map], featuring real examples of GRUB/BIOS reported memory map. |
* [http://www.osdev.org/phpBB2/viewtopic.php?t=11391 Grub's multiboot memory map], featuring real examples of GRUB/BIOS reported memory map. |
||
* [https://forum.osdev.org/viewtopic.php?t=30318 QEMU Multiboot Invalid Memory Map], a potential pitfall when detecting memory with GRUB |
|||
[[Category:X86]] |
[[Category:X86]] |