Get Memory Map without int15 ax=e820
Get Memory Map without int15 ax=e820
Hi,
I know that the interrupt int15 ax=e820 will get the system memory map, and allow you to know where memory mapped devices are. But how do I do this without this function?
Thanks.
I know that the interrupt int15 ax=e820 will get the system memory map, and allow you to know where memory mapped devices are. But how do I do this without this function?
Thanks.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Get Memory Map without int15 ax=e820
why don't you want to use it ?
Well, i guess it uses PCI probing to know which devices are present and where in the memory area they are located, then it probably goes with a classical "ram detection routine" (read some address, try to write smthg else, read again, compare, re-write the previous value) in the "gaps" between memory-mapped devices
Well, i guess it uses PCI probing to know which devices are present and where in the memory area they are located, then it probably goes with a classical "ram detection routine" (read some address, try to write smthg else, read again, compare, re-write the previous value) in the "gaps" between memory-mapped devices
Re:Get Memory Map without int15 ax=e820
It's easy to bypass the BIOS memory map function. All you need to do is ring up the company that made your motherboard and ask them for the technical specs of the chipset. A disassembly of the BIOS source code might be useful too. Of course, you'll have to pay them for all this, and you'll have to do it for every type of motherboard you come across.
You mean you don't want to do all that? Hmm, better use int 15h/0e280h then...
You mean you don't want to do all that? Hmm, better use int 15h/0e280h then...
Re:Get Memory Map without int15 ax=e820
Well Gee, I guess you have never heard of a BIOS that dont support this function , unfortunately I have, because I have one. I bought my computer a little over 2 years ago and when I try to access the function it dosen't work. I tried this a few times and could not get it to work, so I thought that I would post here, but no-one replied to the post so I thought I would ask if there was a way to do it without this function.
Maybe if someone could give me a small example to try so that I can be sure that I was not doing something wrong.
Thanks.
Maybe if someone could give me a small example to try so that I can be sure that I was not doing something wrong.
Thanks.
Re:Get Memory Map without int15 ax=e820
This isn't the only memory map function available to you.
There's e881, e801, e802 (For some specific motherboard), and last but not least (If you don't mind non-spefic information and you know ram is <64mb), 88.
From information on Ralf Brown's interrupt list, windows uses e881 as a fallback if e820 is unavailable.
From Ralf Brown's Intterupt List:
INT 15 - Phoenix BIOS v4.0 - GET MEMORY SIZE FOR >64M CONFIGURATIONS (32-bit)
AX = E881h
Return: CF clear if successful
EAX = extended memory between 1M and 16M, in K (max 3C00h = 15MB)
EBX = extended memory above 16M, in 64K blocks
ECX = configured memory 1M to 16M, in K
EDX = configured memory above 16M, in 64K blocks
CF set on error
Notes: supported by AMI BIOSes dated 8/23/94 or later
this interface is used by Windows NT 3.1, OS/2 v2.11/2.20, and is
used as a fall-back by newer versions if AX=E820h is not supported
SeeAlso: AX=E801h"Phoenix",AX=E820h"Phoenix"
Most of the larger OSes try a few different ways to get the memory map, with the final resort being the (Almost) always available int 15, ah=88h. From memory this is one of the reasons early versions of Linux were limited to detecting 64mb of ram.
Curufir
There's e881, e801, e802 (For some specific motherboard), and last but not least (If you don't mind non-spefic information and you know ram is <64mb), 88.
From information on Ralf Brown's interrupt list, windows uses e881 as a fallback if e820 is unavailable.
From Ralf Brown's Intterupt List:
INT 15 - Phoenix BIOS v4.0 - GET MEMORY SIZE FOR >64M CONFIGURATIONS (32-bit)
AX = E881h
Return: CF clear if successful
EAX = extended memory between 1M and 16M, in K (max 3C00h = 15MB)
EBX = extended memory above 16M, in 64K blocks
ECX = configured memory 1M to 16M, in K
EDX = configured memory above 16M, in 64K blocks
CF set on error
Notes: supported by AMI BIOSes dated 8/23/94 or later
this interface is used by Windows NT 3.1, OS/2 v2.11/2.20, and is
used as a fall-back by newer versions if AX=E820h is not supported
SeeAlso: AX=E801h"Phoenix",AX=E820h"Phoenix"
Most of the larger OSes try a few different ways to get the memory map, with the final resort being the (Almost) always available int 15, ah=88h. From memory this is one of the reasons early versions of Linux were limited to detecting 64mb of ram.
Curufir
Re:Get Memory Map without int15 ax=e820
What happens about the memory mapped devices, when using these other methods. Could someone explain memory mapped devices, as I do not really understand how they work.
Thanks.
Thanks.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Get Memory Map without int15 ax=e820
basically they inform the bus logic to hook some of the memory address space to their own registers. for instance, your video card is the owner of the 0xb8000 .. 0xbfffff memory area. If you want to know the hooked areas, you have to send PCI probes (see a pci tutorial, maybe this draft) and get the list of locked regions.
Re:Get Memory Map without int15 ax=e820
No, because the system RAM isn't on the PCI bus, but on the front-side bus along with the CPU. The only system component that knows the layout of RAM (i.e. what DIMMs are installed) is the motherboard, and hence the BIOS/CMOS.
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:Get Memory Map without int15 ax=e820
my purpose was to
1) ask PCI for the list of reserved areas (memory-mapped devices)
2) in the remaining memory, perform a "classic" memory scanning
1) ask PCI for the list of reserved areas (memory-mapped devices)
2) in the remaining memory, perform a "classic" memory scanning
Code: Select all
for (megs=(int*)0; megs<HARD_LIMIT;
megs+=1024*1024/sizeof(int))
{
int save;
if (!mapped(megs)) {
save = *megs;
*megs=0x55555555;
if (*megs!=0x55555555) break;
*megs=save;
}
}
print("we have %i MB installed",((int) megs)/(1024*1024));
Re:Get Memory Map without int15 ax=e820
Does this e881 function work if the system has < 64MB of RAM?Curufir wrote:From Ralf Brown's Intterupt List:
INT 15 - Phoenix BIOS v4.0 - GET MEMORY SIZE FOR >64M CONFIGURATIONS (32-bit)
???AX = E881h
Return: CF clear if successful
??? EAX = extended memory between 1M and 16M, in K (max 3C00h = 15MB)
??? EBX = extended memory above 16M, in 64K blocks
??? ECX = configured memory 1M to 16M, in K
??? EDX = configured memory above 16M, in 64K blocks
???CF set on error
Notes:???supported by AMI BIOSes dated 8/23/94 or later
???this interface is used by Windows NT 3.1, OS/2 v2.11/2.20, and is
??? used as a fall-back by newer versions if AX=E820h is not supported
SeeAlso: AX=E801h"Phoenix",AX=E820h"Phoenix"