For educational purposes, I am trying to write a simple x86 bootloader that boots a dummy OS from a floppy disk image.
I am currently at the stage where I have gotten my bootloader to output "Hello world" via BIOS video interrupts. I would now like to relocate the bootloader to a higher memory address so I can load an OS image to where it is currently located.
Now here is where I am confused: the textbook I am reading suggests to relocate the bootloader (which is 512 bytes large) to segment 0x9800
which is 32 kB before segment 0xA000
. But as far as I understand, the Extended BIOS Data Area (EBDA) can extend up to 128 kB down from address 0xA0000
and should not be overwritten.
So is my textbook wrong? Should I instead move the bootloader to segment 0x7800
(or a bit higher if the EBDA is smaller)?