Low Memory Area
Low Memory Area
Could anyone please supply a good website or own knowledge with detailed information on the exact boundries that cannot be accessed below the 1MB mark and there function... i really need to find extra areas of memory for use before loading my protected mode kernel.
Thankyou in advance
Thankyou in advance
Read this:http://my.execpc.com/~geezer/osd/ram/index.htm
There is a mistake in alomost ALL tutorials.The first free byte is 0x600(linear address) not 0x500.So the free convencional memory is between 0x600- 0x9FBFF(linear address)
There is a mistake in alomost ALL tutorials.The first free byte is 0x600(linear address) not 0x500.So the free convencional memory is between 0x600- 0x9FBFF(linear address)
- smiddy
- Member
- Posts: 127
- Joined: Sun Oct 24, 2004 11:00 pm
- Location: In my cube, like a good leming. ;-)
Here are a few more references:
IVT:
http://www.bioscentral.com/misc/interrupts.htm
BDA:
http://bioscentral.com/misc/bda.htm
DOS Data Area(s):
http://www.freeinfosociety.com/site.php?postnum=403
BDA and DOS Data Area(s):
http://heim.ifi.uio.no/~stanisls/helppc ... _area.html
EBDA (along with everything else):
http://www.frontiernet.net/~fys/rombios.htm
Hope this helps!
IVT:
http://www.bioscentral.com/misc/interrupts.htm
BDA:
http://bioscentral.com/misc/bda.htm
DOS Data Area(s):
http://www.freeinfosociety.com/site.php?postnum=403
BDA and DOS Data Area(s):
http://heim.ifi.uio.no/~stanisls/helppc ... _area.html
EBDA (along with everything else):
http://www.frontiernet.net/~fys/rombios.htm
Hope this helps!
Hi,
Also, the area from 0x000C8000 to 0x000EFFFF may contain device ROMs (network, SCSI, etc), may contain RAM, or could be a memory hole (nothing). IIRC Windows 95 used to scan this area and use any RAM it found. This isn't really recommended as modern "many-CPU" computers can use this area for SMRAM, and Windows 95 didn't work on some (rare at the time) systems unless this memory scan was disabled.
Despite this, it would be possible for a chipset driver to scan this area and make any RAM found available to the OS. It'd also be possible for the chipset driver to remove any PCI device ROMs beforehand (potentially freeing up an extra 160 KB of RAM). Of course suitable warnings apply....
Cheers,
Brendan
The EBDA may or may not exist, and can be larger than 1 KB in some cases. Also, in some (rare and/or unusual) situations there can be nothing between 0x00080000 and 0x0009FFFF (a memory hole), or some BIOS code (e.g. network boot UNDI/PXE stack). Use BIOS Int 0x12 to determine how much you can/can't use starting at 0x00000000.muisei wrote:Read this:http://my.execpc.com/~geezer/osd/ram/index.htm
There is a mistake in alomost ALL tutorials.The first free byte is 0x600(linear address) not 0x500.So the free convencional memory is between 0x600- 0x9FBFF(linear address)
Also, the area from 0x000C8000 to 0x000EFFFF may contain device ROMs (network, SCSI, etc), may contain RAM, or could be a memory hole (nothing). IIRC Windows 95 used to scan this area and use any RAM it found. This isn't really recommended as modern "many-CPU" computers can use this area for SMRAM, and Windows 95 didn't work on some (rare at the time) systems unless this memory scan was disabled.
Despite this, it would be possible for a chipset driver to scan this area and make any RAM found available to the OS. It'd also be possible for the chipset driver to remove any PCI device ROMs beforehand (potentially freeing up an extra 160 KB of RAM). Of course suitable warnings apply....
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.
since when? someone needs to tell MS, since there bootloader uses 0x500-0x600 as free memory -- that must be why windows wont install on most computers -- oh wait, it works without problem on all systemsmuisei wrote:Read this:http://my.execpc.com/~geezer/osd/ram/index.htm
There is a mistake in alomost ALL tutorials.The first free byte is 0x600(linear address) not 0x500.So the free conventional memory is between 0x600- 0x9FBFF(linear address)
MS MBRs reload themselves to 0x500-0x700 before loading the bootsector at 0x7C00, MS bootsectors also load the MBR into this space (unnecessary if loaded by MS MBR, but since that isnt necessarily the case, so it reloads it anyway)
Take a look at this: http://www.frontiernet.net/~fys/rombios.htm
Is this wrong?
Is this wrong?
- smiddy
- Member
- Posts: 127
- Joined: Sun Oct 24, 2004 11:00 pm
- Location: In my cube, like a good leming. ;-)
I don't think it is wrong and I don't think JAAman is wrong either. Some folks for the purposes of devlopment, write their OS' to be able to run ontop of DOS. DOS uses linear 500h - 600h-ish for those items mentioned and more I presume. If you don't intend to use DOS as a devlopment tool to launch your OS you are fine using that area. As JAAman points out, MS uses those areas for their OS'. To be safe, even if you're not launching from DOS, you could simply use 600h - A0000h (if no EBDA).muisei wrote:Take a look at this: http://www.frontiernet.net/~fys/rombios.htm
Is this wrong?
- smiddy
- Member
- Posts: 127
- Joined: Sun Oct 24, 2004 11:00 pm
- Location: In my cube, like a good leming. ;-)
Sorry Tyler, everything is relative. Call it Einstein-ish or whatever, the fact is there are too many permutation with the number of machines, there is no definitive answer. So, in order to be compatible a certain degree of acceptance has to be done in order to move forward, or you pull all your hair out trying to solve an insolveable situation, so you compromise. I hope you didn't take it as derogatory, that wasn't my intention. I'm cynical due to my own experience dealing with PCs and other devices. That is all I was conveying with "for the most part"
Hi,
However...
Some computers do use a larger EBDA, and there isn't really anything that specifies a limit for how large the EBDA can be. For example, it's possible for the BIOS in a large server to use 4 KB, or for a SCSI card ROM to use an extra 1 KB for it's own purposes.
If you ever want to use network boot, then the area from 0x00080000 to the beginning of the EBDA is off limits, because it is used by the networking code (BIOS, network card ROM or utility like etherboot).
Some chipsets (including recent Intel chipsets) support a memory hole at 0x00080000. I've never seen a BIOS provide an option to enable this memory hole, and don't quite know why the chipset still supports it, but some do.
I think part of this comes from backwards compatability with old XTs, where it's possible to have 512 KB of RAM and nothing else, and programmers used BIOS Int 0x12 to find out how much RAM was installed. This led to people not using RAM above 0x00080000 without checking BIOS Int 0x12 first, and allowed things like the EBDA to be added to the architecture later.
Therefore, in general, if you want your OS to support even the most unusual modern computers possible (or network boot), then don't use memory above 0x00080000 without checking BIOS Int 0x12 first. If you do use memory from 0x00000500 to 0x0009FBFF without checking, then your OS will probably only work on 99.8% of "80x86 compatible" computers when network boot isn't used.
For my OS, I use RAM from 0x00001000 to 0x0007FFFF, and 2 MB or more of RAM starting at 0x00100000 without finding out if there's any usable RAM in these areas first.
AFAIK the area at 0x00100000 is safe if (and only if) there's enough RAM installed. E.g. for a computer with 4 MB of RAM installed it should be safe to use from 0x00100000 to 0x003FFFFF. For computers with more than 16 MB of RAM, this area is only safe up to 0x00EFFFFF as there can be a memory hole from 15 MB to 16 MB.
BTW curious people might want to click this link - it's the results of a google search, and contains a large number of people complaining about an "EBDA too big" error message from LILO and being unable to boot. It seems LILO has a "LARGE_EBDA" option in it's makefile...
Cheers,
Brendan
For most computers, the area from 0x00000500 to 0x0009FBFF should be safe to use.Tyler wrote:i love that... you think its sorted and then someone comes in with "for the most part"... i dont even want to know what is wrong with it
However...
Some computers do use a larger EBDA, and there isn't really anything that specifies a limit for how large the EBDA can be. For example, it's possible for the BIOS in a large server to use 4 KB, or for a SCSI card ROM to use an extra 1 KB for it's own purposes.
If you ever want to use network boot, then the area from 0x00080000 to the beginning of the EBDA is off limits, because it is used by the networking code (BIOS, network card ROM or utility like etherboot).
Some chipsets (including recent Intel chipsets) support a memory hole at 0x00080000. I've never seen a BIOS provide an option to enable this memory hole, and don't quite know why the chipset still supports it, but some do.
I think part of this comes from backwards compatability with old XTs, where it's possible to have 512 KB of RAM and nothing else, and programmers used BIOS Int 0x12 to find out how much RAM was installed. This led to people not using RAM above 0x00080000 without checking BIOS Int 0x12 first, and allowed things like the EBDA to be added to the architecture later.
Therefore, in general, if you want your OS to support even the most unusual modern computers possible (or network boot), then don't use memory above 0x00080000 without checking BIOS Int 0x12 first. If you do use memory from 0x00000500 to 0x0009FBFF without checking, then your OS will probably only work on 99.8% of "80x86 compatible" computers when network boot isn't used.
For my OS, I use RAM from 0x00001000 to 0x0007FFFF, and 2 MB or more of RAM starting at 0x00100000 without finding out if there's any usable RAM in these areas first.
AFAIK the area at 0x00100000 is safe if (and only if) there's enough RAM installed. E.g. for a computer with 4 MB of RAM installed it should be safe to use from 0x00100000 to 0x003FFFFF. For computers with more than 16 MB of RAM, this area is only safe up to 0x00EFFFFF as there can be a memory hole from 15 MB to 16 MB.
BTW curious people might want to click this link - it's the results of a google search, and contains a large number of people complaining about an "EBDA too big" error message from LILO and being unable to boot. It seems LILO has a "LARGE_EBDA" option in it's makefile...
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.