Hi,
I am wondering if my option ROM can use Extended BIOS Data Area (EBDA) to store some (very) small data (around 16bytes)? Exactly which area in EBDA is safe and guaranteed for my storage purpose?
Besides, does anybody know any updated documentation about EBDA? I am looking around, but dont see anything good.
Thanks,
J
Use Extended BIOS Data Area?
Re: Use Extended BIOS Data Area?
Hi,
For an option ROM, you could hook the BIOS functions that return the amount of memory (e.g. Int 0x12, Int 0x15, etc) and change the value at 0x0040:0x0013 (which is meant to contain "base memory size in KB"), so that it looks like there's 16 bytes less RAM (and so that you can use the "missing" 16 bytes of RAM).
However, a better idea would be to redesign your code so that it doesn't need these 16 bytes. How you'd do this depends on what those bytes are for. Perhaps you could use 16 bytes of stack space instead, or maybe use 16 bytes of "ROM" (note: for a PCI device's ROM, the BIOS copies it to RAM, then calls the ROM's "init" entry point, then sets the RAM to "write only"; which means the ROM's "init" code can set 16 bytes (or more) to anything it likes before the BIOS sets the area "write only").
Cheers,
Brendan
Sorry - no, because...junkoi wrote:I am wondering if my option ROM can use Extended BIOS Data Area (EBDA) to store some (very) small data (around 16bytes)?
None of it is safe to use.junkoi wrote:Exactly which area in EBDA is safe and guaranteed for my storage purpose?
The EBDA is (literally) the BIOS's data area, used for anything the BIOS feels like, with no standard to dictate what must be where. Therefore each different BIOS may use different parts of the EBDA for different purposes, and any documentation that describes the contents of the EBDA will only apply to a specific BIOS.junkoi wrote:Besides, does anybody know any updated documentation about EBDA? I am looking around, but dont see anything good.
For an option ROM, you could hook the BIOS functions that return the amount of memory (e.g. Int 0x12, Int 0x15, etc) and change the value at 0x0040:0x0013 (which is meant to contain "base memory size in KB"), so that it looks like there's 16 bytes less RAM (and so that you can use the "missing" 16 bytes of RAM).
However, a better idea would be to redesign your code so that it doesn't need these 16 bytes. How you'd do this depends on what those bytes are for. Perhaps you could use 16 bytes of stack space instead, or maybe use 16 bytes of "ROM" (note: for a PCI device's ROM, the BIOS copies it to RAM, then calls the ROM's "init" entry point, then sets the RAM to "write only"; which means the ROM's "init" code can set 16 bytes (or more) to anything it likes before the BIOS sets the area "write only").
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.