Memory maps.

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Exabyte256

Memory maps.

Post 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?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re:Memory maps.

Post 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
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:Memory maps.

Post 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.
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Exabyte256

Re:Memory maps.

Post 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?
AR

Re:Memory maps.

Post 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)
Post Reply