Reporting low memory memory map

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
lopidas
Member
Member
Posts: 65
Joined: Sun May 26, 2013 10:12 am

Reporting low memory memory map

Post by lopidas »

I read here in http://www.uruk.org/orig-grub/mem64mb.html in Assumptions and limitations that e820 does report whole low memory as free (type 1). Is it true (I am running on emulators)? How can I get reliable map of this space (without making assumptions)? Does SMBIOS returns reliable map?
User avatar
Combuster
Member
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: Reporting low memory memory map

Post by Combuster »

e820 returns the memory available for protected mode OSes - which includes the IVT and BDA as free space, but not the part the BIOS needs for it's 32-bit functions like the EBDA which is reserved. Which means it does not technically return all of lower memory, just what you're allowed to use which is the more interesting figure in the end.

Don't use the SMBIOS. it's designed to tell you what the system actually contains, rather than what's safe and available for you to use.


Bottom line, E820 is the designated method for querying the memory map, so you should use it when possible.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
lopidas
Member
Member
Posts: 65
Joined: Sun May 26, 2013 10:12 am

Re: Reporting low memory memory map

Post by lopidas »

I am not sure, if it can help, but I have found in Table. 7-9 in SMBIOS specification. Which looks like mapping all non-RAM related devices. Does it do it?
tom9876543
Member
Member
Posts: 170
Joined: Wed Jul 18, 2007 5:51 am

Re: Reporting low memory memory map

Post by tom9876543 »

The low memory map is fixed.

0:0 - 0:03FF Interrupt Descriptor Table
40:0 - 40:FF Bios Data Area http://www.bioscentral.com/misc/bda.htm

As you know, you need to find the address of the EBDA via BIOS Interrupt.
This is explained at http://wiki.osdev.org/Detecting_Memory_%28x86%29
lopidas
Member
Member
Posts: 65
Joined: Sun May 26, 2013 10:12 am

Re: Reporting low memory memory map

Post by lopidas »

I want to clarify one thing: are these parts coppied to RAM, which are mapped to that range or mapped on the addresses of that range?
tom9876543
Member
Member
Posts: 170
Joined: Wed Jul 18, 2007 5:51 am

Re: Reporting low memory memory map

Post by tom9876543 »

It is normal RAM, not memory mapped I/O.
Post Reply