For starters, I _DID_ read the FAQ on this, so don't start reacting with your guns blazing
I don't see why the code in the faq is supposed to work: it uses int's where they say that there are 4 bytes per field, so a long should be used right? I'm probably just confused so set me straight if I'm wrong.
Other than that, they also add sizeof(unsigned int) to the size of the memory map entry, why is that? To get the base_addr_low at offset 0? won't that mess up the structure and put the base_addr_low in the size field?
The memory_map structure from multiboot.h looks correct though, so why can't I use that one?
However, using:
Code: Select all
struct memory_map* mmap = (struct memory_map*)mbd->mmap_addr;
while(mmap < (struct memory_map*) mbd->mmap_addr + mbd->mmap_length) {
puts("Base address: ");
puts_longhex(mmap->base_addr_low);
puts(" - Size: ");
puts_longdec(mmap->length_low);
puts("\n");
mmap = mmap + mmap->size;
}
And why are we using 2 longs per address? 64bit address space, for non 32bit systems compatibility? Can I just use the lower 32bits on a 32bit x86?
This is just what pops into mind at 0:44, maybe it's just me being to tired to write an OS right now, but it just looks plain wrong