Detecting Memory (x86): Difference between revisions

Jump to navigation Jump to search
m
rename the grub mmap to explicitly say "entry", since it's an entry rather than a whole map.
[unchecked revision][unchecked revision]
m (rename the grub mmap to explicitly say "entry", since it's an entry rather than a whole map.)
Line 348:
 
<source lang="c">
typedef struct multiboot_memory_mapmmap_entry {
unsigned int size;
unsigned int base_addr_low,base_addr_high;
Line 355:
// You can also use: unsigned long long int length; if supported.
unsigned int type;
} mmap_entry_t;
} multiboot_memory_map_t;
 
int main(multiboot_info* mbt, unsigned int magic) {
...
multiboot_memory_map_tmmap_entry_t* mmapentry = mbt->mmap_addr;
while(mmapentry < mbt->mmap_addr + mbt->mmap_length) {
// do something with the entry
...
mmapentry = (multiboot_memory_map_tmmap_entry_t*) ( (unsigned int)mmap entry + mmapentry->size + sizeof(mmapentry->size) );
}
...
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu