Hi,
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
For most computers, the area from 0x00000500 to 0x0009FBFF
should be safe to use.
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