Page 1 of 1
BDA, EBDA and ROM area in Long Mode
Posted: Fri Jan 03, 2014 1:05 pm
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?
Re: BDA, EBDA and ROM area in Long Mode
Posted: Fri Jan 03, 2014 2:16 pm
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
Re: BDA, EBDA and ROM area in Long Mode
Posted: Sun Jan 05, 2014 7:49 am
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).