Hello.
I'm using the memory map provided by GRUB to see available memory and reserved memory.
I want to overwrite the available memory, but I'm afraid that I'll lose the GRUB memory map.
I figure the simplest solution would be to just not overwrite the memory map in the first place.
However I would like to hear other ideas, for solutions more elegant than "skipping" over the mmap.
Thanks.
Preserving the GRUB memory map
Re: Preserving the GRUB memory map
Use grub's memory map to initialize your physical memory manager. Your PMM should keep track of used and available memory, so once it's initialized, you don't need grub's memory map anymore. For the reserved memory sections in grub's memory map, just mark the memory as used in your PMM.
In my OS, i use a bitmap to mark used regions of memory. Seeing as it fits in with virtual memory pages, i have 1 bit in the bitmap represent a 4kb block of physical memory.
http://wiki.osdev.org/Page_Frame_Allocation
In my OS, i use a bitmap to mark used regions of memory. Seeing as it fits in with virtual memory pages, i have 1 bit in the bitmap represent a 4kb block of physical memory.
http://wiki.osdev.org/Page_Frame_Allocation
Re: Preserving the GRUB memory map
If you want to keep the memory map after parsing it, just mark the area of memory it's in as used.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
If you're new, check this out.