Are IVT and BDA physical memory addresses and sizes set always the same during boot sequence?

0

During boot sequence, IVT(Interrupt Vector Table) and BDA(BIOS Data Area) are loaded to memory, IVT starting address at 0x00000000 and BDA starting address at 0x00000400 respectively.

IVT 0x00000000 ~ 0x000003FF
BDA 0x00000400 ~ 0x000004FF

Is this 'always' the case regardless of hardwares?

More specifically,

Q1. Is IVT start address always set to 0x00000000?

Q2. Is IVT size always 1024 bytes?

Q3. Is BDA start address always set to 0x00000400?

Q4. Is BDA size always 256 bytes?

The reason why these questions have arisen is, for example, when checking the address pointer such as EBDA(Extended BIOS Data Area) at 0x40E, to make sure whether conditional operation will be necessary.

memory
x86
bootloader
legacy
bios
asked on Stack Overflow Aug 22, 2019 by YoonSeok OH • edited Aug 22, 2019 by Michael Petch

1 Answer

2

Q1. Is IVT start address always set to 0x00000000?

Only for 80x86 systems that support BIOS and booted using BIOS.

Q2. Is IVT size always 1024 bytes? Q3. Is BDA start address always set to 0x00000400?

There isn't any "hard barrier" between these things. The IVT itself is 1 KiB, but various entries (especially near the end) are used for BIOS data, so it's more like the IVT and BDA are intertwined and overlapping.

Q4. Is BDA size always 256 bytes?

For compatibility with ancient DOS stuff the BDA "should" end before 0x00000500. There's no guarantee that the BIOS cared about compatibility with ancient DOS stuff though.

A better (more cautious/conservative) idea is to just ignore the first 4 KiB of RAM until the operating system's boot code no longer needs BIOS anymore, and then treat it like free usable RAM (unlike EBDA, there's no reason for an OS to preserve the data in the BDA).

Note: Even while boot code still needs BIOS there no reason for the boot code to read anything in the BDA itself (it only needs to avoid trashing the data so BIOS can read it). For example, rather than looking at 0x040E you can just use int 0x12 (or int 0x15, eax=0xE820). The only other things I've seen people use BDA for is to determine floppy drive types and number of serial ports (which are things from BIOS settings that are likely to be set wrong by the user, and therefore unreliable and useless).

answered on Stack Overflow Aug 22, 2019 by Brendan

User contributions licensed under CC BY-SA 3.0