Detecting Memory (x86): Difference between revisions

[unchecked revision][unchecked revision]
Content deleted Content added
No edit summary
Line 346:
===Getting a GRUB Memory Map===
 
Declare the appropriate structure, get the pointer to the first instance, grab whatever address and length information you want, and finally skip to the next memory map instance by adding size+4sizeof(mmap->size) to the pointer, tackingbecause onmmap->size thedoes 4not totake itself into account forand because GRUB treating base_addr_low as offset 0 in the structure. You must also use mmap_length to make sure you don't overshoot the entire buffer.
 
<source lang="c">