Hi,
I'm just starting in OS dev and I'm presently trying to hunt down all the information that I need in preparation for my first attempt at writing my own kernel.
In that process I came to the point of using GRUB to generate a memory map that I could use.
My question is: Does GRUB memory map includes all the memory available on the system or is there a size limit (ala 32bit <4gig)?
Question about GRUB memory map
- BASICFreak
- Member

- Posts: 284
- Joined: Fri Jan 16, 2009 8:34 pm
- Location: Louisiana, USA
Re: Question about GRUB memory map
The quick answer is mostly.AMenard wrote:Does GRUB memory map includes all the memory available on the system
The limit is 64-bit address ranges.or is there a size limit (ala 32bit <4gig)?
GRUB uses the same BIOS methods to grab a memory map (when it can) as anyone else would use in real mode. INT 0x15 E820h, Which uses QWORDS (64-bit) base and length. If it cannot get a map from there it has a few fallback routines which may or may not give the full range in RAM.
Detecting Memory (x86) - Getting a GRUB Memory Map
Grub Multiboot Spec Tutorial (Best one I know of)
BOS Source Thanks to GitHub
BOS Expanded Commentary
Both under active development!
BOS Expanded Commentary
Both under active development!
Sortie wrote:
- Don't play the role of an operating systems developer, be one.
- Be truly afraid of undefined [behavior].
- Your operating system should be itself, not fight what it is.
Re: Question about GRUB memory map
Thanks!
64-bits address range is quite enough for my need
64-bits address range is quite enough for my need
Re: Question about GRUB memory map
Note that you can't use more than 4GiB in Protectedmode.
Without PAE
Without PAE
Last edited by Techel on Fri Oct 02, 2015 11:31 am, edited 2 times in total.
Re: Question about GRUB memory map
Why not? Has something bad happened to PAE recently?Roflo wrote:Note that you can't use more than 4GiB in Protectedmode.
If something looks overcomplicated, most likely it is.
Re: Question about GRUB memory map
Yes you can use PAE. It's what he meant by "PEA", probably just a typo.
Re: Question about GRUB memory map
No I just forgot PAE can be used to extend the space and edited my post 
Re: Question about GRUB memory map
I ultimately intend to run in x86_64 mode, but I understand that I still have to set the PAE to do so after reading the "Entering Long Long Mode" entry on the wiki.
I'm in no hurry and I'm in full research mode at the moment. I'm in the pen and paper stage of my os so to speak
I prefer to work out a blueprint before I start writing code. Less chance of pumping out spaghetti code that way. I also have to get back to Tannenbaum and brush up my x86 assembly skill. I haven't use it for quite a while.
I'm in no hurry and I'm in full research mode at the moment. I'm in the pen and paper stage of my os so to speak
I prefer to work out a blueprint before I start writing code. Less chance of pumping out spaghetti code that way. I also have to get back to Tannenbaum and brush up my x86 assembly skill. I haven't use it for quite a while.

