Use Extended BIOS Data Area?

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
junkoi
Member
Member
Posts: 63
Joined: Wed Jan 23, 2008 8:55 pm

Use Extended BIOS Data Area?

Post by junkoi »

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
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Use Extended BIOS Data Area?

Post by Brendan »

Hi,
junkoi wrote:I am wondering if my option ROM can use Extended BIOS Data Area (EBDA) to store some (very) small data (around 16bytes)?
Sorry - no, because...
junkoi wrote:Exactly which area in EBDA is safe and guaranteed for my storage purpose?
None of it is safe to use.
junkoi wrote:Besides, does anybody know any updated documentation about EBDA? I am looking around, but dont see anything good.
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.

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.
Post Reply