It may sound a stupid question but how can I find out where all the multiboot structure ends (the address) in the RAM?
I know that GRUB gives the pointer to its beginning, but where is the end?
My memory manager needs this to know to mark the RAM pages as used.
GRUB memory map - end address?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: GRUB memory map - end address?
Ever heard of sizeof() ? How does it (not) apply?
Re: GRUB memory map - end address?
Hi,
For the Multiboot 1 structure, you know the size, so just add that on (sizeof()). For Multiboot 2, you can read the structure size from the structure itself (including tags).
If you want to know where everything is (including the memory map etc...), you cannot assume that all the headers are contiguous. The best way may therefore be to cache the headers prior to marking any RAM pages as used (remember to mark and modules as 'used' too).
Cheers,
Adam
For the Multiboot 1 structure, you know the size, so just add that on (sizeof()). For Multiboot 2, you can read the structure size from the structure itself (including tags).
If you want to know where everything is (including the memory map etc...), you cannot assume that all the headers are contiguous. The best way may therefore be to cache the headers prior to marking any RAM pages as used (remember to mark and modules as 'used' too).
Cheers,
Adam