BDA, EBDA and ROM area in Long Mode

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
gusc
Member
Member
Posts: 50
Joined: Tue Feb 05, 2013 1:42 pm

BDA, EBDA and ROM area in Long Mode

Post by gusc »

It's been a while since I did some bare metal coding, but now I'm stuck with the good ol' memory management problem, and I have question to ask - it's about the EBDA and basically all the space between 0x000000 and 0x100000 - is it still used by anything after the jump to the Long Mode? Well I know you look up for RSDP pointer there, but is there anything else worth saving, or on contrary should I pronounce it a dead space and leave it as is without ever touching it?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: BDA, EBDA and ROM area in Long Mode

Post by Brendan »

Hi,
gusc wrote:It's been a while since I did some bare metal coding, but now I'm stuck with the good ol' memory management problem, and I have question to ask - it's about the EBDA and basically all the space between 0x000000 and 0x100000 - is it still used by anything after the jump to the Long Mode? Well I know you look up for RSDP pointer there, but is there anything else worth saving, or on contrary should I pronounce it a dead space and leave it as is without ever touching it?
For BIOS systems; after you're finished with the BIOS (but not before):
  • the BDA will not be used and you can use it as normal RAM
  • the EBDA can/will be used by the firmware's SMM code and you can't touch that, ever
  • anything in the area from 0x000A0000 to 0x000FFFFF is too annoying to bother with and shouldn't be touched (it's theoretically possible to reclaim some of it and use it as RAM, but it's far too much hassle for far too little extra RAM)
This mostly means that you end up with usable RAM from 0x00000000 to the start of the EBDA, then "unusable" space from the start of the EBDA up to 0x000FFFFF.


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.
gusc
Member
Member
Posts: 50
Joined: Tue Feb 05, 2013 1:42 pm

Re: BDA, EBDA and ROM area in Long Mode

Post by gusc »

Thanks! This might be helpful for other noobs like me, maybe somebody should point it out somewhere in the Wiki, as there are almos no info about what happens to all the legacy stuff on your x86 in 64bit mode (except for the missing BIOS interrupts, that are 16bit only).
Post Reply