Page 1 of 1

Memory maps.

Posted: Sun Nov 27, 2005 7:06 am
by Exabyte256
Well, I got frustrated at my sucky system design and started again. Much easier this time around now I know what I'm doing! I've made a new ISO directory bootloader that can load any file from the CD to memory.

But I'm not sure exactly how the memory should be set out. I've seen enough real mode maps, but I need to know just how the memory is set out as a whole. I've looked on google and google image search for maps and the most I've found is some references to where the Linux kernel is loaded. It's weird, somehow it's located 3GB in memory. I'm pretty sure today's computers don't have that much RAM.

So does anyone have a proper map of how the 4GB of memory is layed out including references to hardware like things reserved for video RAM?

Re:Memory maps.

Posted: Sun Nov 27, 2005 7:45 am
by Brendan
Hi,
Exabyte256 wrote:So does anyone have a proper map of how the 4GB of memory is layed out including references to hardware like things reserved for video RAM?
No. :)

Every different computer is different. There are "standard" ways an OS can find out what is where though.

To start with, determine where the RAM is.

Once you've done this everything else is device specific. For PCI devices you can find out by checking the "PCI configuration space" for each device. For ISA there's "ISA Plug & Play" (which wasn't used by much) and ugly manual probing.

The only exception to this is the legacy video area between 0x000A0000 and 0x000BFFFF. Of course it's a legacy area - you'd want to use a linear frame buffer instead if you can.


Cheers,

Brendan

Re:Memory maps.

Posted: Sun Nov 27, 2005 12:09 pm
by Colonel Kernel
Exabyte256 wrote: I've looked on google and google image search for maps and the most I've found is some references to where the Linux kernel is loaded. It's weird, somehow it's located 3GB in memory. I'm pretty sure today's computers don't have that much RAM.
3GB is probably the virtual address at which the Linux kernel is mapped, not the physical address where it's loaded. See HigherHalfKernel in the FAQ.

Re:Memory maps.

Posted: Sun Nov 27, 2005 4:12 pm
by Exabyte256
Thankyou, that's cleared everything up. I think I'll keep the kernel in it's current 1MB place and use the below 1MB for its workspace (Paging will only become a target if I start getting memory-limit errors!).

Printing out the results of the first "0x88" function in bochs shows 14MB of extended RAM as the FAQ said. I can't help notice the lack of reference in the FAQ to the 0xE881 and 0xE802 commands that were mentioned though. Are they they very similar or have they just been missed out?

Edit: Oh, and also while I'm about it, what's the difference between "Configured Memory" and the regular Extended Memory?

Re:Memory maps.

Posted: Sun Nov 27, 2005 4:50 pm
by AR
I rewrote that section of that page a while ago (it originally only mentioned the memory map and 88h), I didn't want to clutter the page with interrupt definitions but you can look them up on Ralf Brown's Interrupt List (there's a link on the wiki page)