The BIOS Data Area (BDA)

The BIOS Data Area (BDA) is a 257-byte1 region of memory located at segment 0x0040 (physical address 0x00400).

It is used by the BIOS to store system variables and state.

OffsetBytesDescriptionIntComments
002COM 1 base address14
022COM 2 base address14
042COM 3 base address14
062COM 4 base address14
082LPT 1 base address17
0A2LPT 2 base address17
0C2LPT 3 base address17
0E2LPT 4 base address17EBDA on PS/2 and later
102Equipment List Flags11See Equipment List Flags
121Reserved
121PCjr: infrared keyboard error count
132Base memory size12Number of kilobytes of RAM
152Reserved
171Keyboard Flag Byte 016See Keyboard Flag Byte 0
181Keyboard Flag Byte 116See Keyboard Flag Byte 1
191Work area for ALT key16Handles ALT + numpad key entry
1A2Keyboard-buffer Head Offset16Head offset into keyboard ring buffer
1C2Keyboard-buffer Tail Offset16Tail offset into keyboard ring buffer
1E32Keyboard Buffer16
3E1Floppy recalibrate status13See Floppy Recalibrate Status
3F1Floppy motor status13See Floppy Motor Status
401Floppy motor timeout13
411Floppy operation status13
427Floppy controller status13See Floppy Controller Status
4930Video info10
491Current Video Mode10
4A2Number of Columns
4C2Size of video buffer (bytes)
4E2Offset of current video page
5016Cursor position of pages 1-8
601Cursor ending scanline
611Cursor starting scanline
621Active display page number
632Base port for active CRTC3B4 for MDA, 3D4 for CGA+
651CGA mode control registerEmulated on EGA+
661CGA current paletteEmulated on EGA+
675PC: Cassette tape control
674AT: POST re-entry pointer
6B1Last Unexpected interrupt
6C4Timer Counter1A
701Timer Overflow1A
711Break key state16
722Reset Flag
741HDD operation status13
751Number of HDDs attached13
762Reserved13
781LPT 1 time-out14
791LPT 2 time-out14
7A1LPT 3 time-out14
7B1Reserved
7C1COM 1 time-out
7D1COM 2 time-out
7E1COM 3 time-out
7F1COM 4 time-out
802Keyboard buffer start ptr16
822Keyboard buffer end ptr16
847Video info10
852EGA: Character line height
851PCjr: Typematic repeat key
861PCjr: Typematic repeat delay
871EGA: Video mode optionsSee Video Mode Options
871PCjr: Current Fn key number
881EGA: Feature / DIP switchesSee EGA Dip Switches
881PCjr: Keyboard status byte 3
891VGA/MCGA: Video Display DataSee VGA Display Data
8A1EGA: Display Combination Code (DCC) index
8B1Floppy media control13See Floppy Media Control
8C1HDD Controller status13
8D1HDD Controller error status13
8E1HDD Interrupt control13
8F1Reserved
901Floppy 0 media status13See Floppy Media Status
911Floppy 1 media status13
921Floppy 2 media status13
931Floppy 3 media status13
941Drive 0 current cylinder13
951Drive 1 current cylinder13
961Keyboard Mode State and Flags16See Keyboard Mode Byte
971Keyboard LED State16See Keyboard LED State
982User wait flag offset15
9A2User wait flag segment15
9C4User wait count (milliseconds)
A01RTC Wait active flag15See RTC Wait Flags
A17Reserved
A84BIOS Video info Pointer10
AC84Reserved
1001Print Screen Status5
Equipment List FlagsBit flags describing the hardware configuration detected by the BIOSEquipment List FlagsBit flags describing the hardware configuration detected by the BIOS40:101514131211109876543210nPRN--GPnCOMDMAnFLOPVMRAMFPUIPL
BitsNameDescription
0IPLFloppy drive installed
1FPUFPU installed
2:3RAMOnboard RAM installed (first 256K)
4:5VMInitial video mode at boot time
6:7nFLOPNumber of floppy drives installed, -1
8DMADMA controller installed (if 0)
9:11nCOMNumber of serial ports installed
12GPGame port installed
13Reserved
14:15nPRNNumber of printer ports installed

Initial Video Mode

Bits 5,4Description
00Unused
0140x25 color
1080x25 color
1180x25 monochrome
Keyboard Flag Byte 0Primary keyboard status flagsKeyboard Flag Byte 0Primary keyboard status flags40:1776543210INSCAPSNUMSCRLALTCTRLLSHFTRSHFT
BitsNameDescription
0RSHFTRight Shift key depressed
1LSHFTLeft Shift key depressed
2CTRLCTRL key depressed
3ALTALT key depressed
4SCRLScroll-Lock active
5NUMNum-Lock active
6CAPSCaps-Lock active
7INSInsert active
Keyboard Flag Byte 1Secondary keyboard status flagsKeyboard Flag Byte 1Secondary keyboard status flags40:1876543210INSCAPSNUMSCRLSUSPSYSLALTLCTRL
BitsNameDescription
0LCTRLLeft CTRL key depressed
1LALTLeft ALT key depressed
2SYSSystem key depressed and held
3SUSPSuspend key has been toggled
4SCRLScroll-Lock key depressed
5NUMNum-Lock key depressed
6CAPSCaps-Lock key depressed
7INSInsert key depressed
Floppy Recalibration StatusInterrupt and calibration status for floppy drivesFloppy Recalibration StatusInterrupt and calibration status for floppy drives40:3E76543210INT--DRV3DRV2DRV1DRV0
BitsNameDescription
0DRV01 = Recalibrate drive 0
1DRV11 = Recalibrate drive 1
2DRV21 = Recalibrate drive 2
3DRV31 = Recalibrate drive 3
4:6Unused
7INTWorking interrupt flag (1=working)
Floppy Motor StatusCurrent state of floppy drive motorsFloppy Motor StatusCurrent state of floppy drive motors40:3F76543210WR--DRV3DRV2DRV1DRV0
BitsNameDescription
0DRV01 = Drive 0 motor on
1DRV11 = Drive 1 motor on
2DRV21 = Drive 2 motor on
3DRV31 = Drive 3 motor on
4:6Unused
7WRWrite operation in progress
Floppy Controller StatusStatus bytes returned from the floppy controller from the last disk operation (INT 13,1)Floppy Controller StatusStatus bytes returned from the floppy controller from the last disk operation (INT 13,1)40:4176543210TMOSEEKFAILCRCDMASECADDRCMD
BitsNameDescription
0CMDInvalid floppy controller command
1ADDRAddress mark not found
2SECSector not found
3DMAFloppy controller DMA error
4CRCCRC check / data error
5FAILFloppy controller failure
6SEEKSeek to track failed
7TMOFloppy time-out
Video Mode Options (EGA+)EGA/VGA video mode flagsVideo Mode Options (EGA+)EGA/VGA video mode flags40:8776543210MODERAM--INACT--MONOCURS
BitsNameDescription
0CURS1 = Alphanumeric cursor emulation enabled
1MONO1 = Video subsystem attached to monochrome
2Reserved
3INACT1 = Video subsystem is inactive
4Reserved
5:6RAMVideo RAM: 00=64K, 01=128K, 10=192K, 11=256K
7MODEVideo mode number passed to INT 10, function 0 (Bit 7)
EGA DIP and Feature SwitchesEGA feature bit switches (emulated on VGA)EGA DIP and Feature SwitchesEGA feature bit switches (emulated on VGA)40:8876543210FEAT1FEAT1FEAT0FEAT0SW4SW3SW2SW1
BitsNameDescription
0SW1EGA SW1 config (1=off)
1SW2EGA SW2 config (1=off)
2SW3EGA SW3 config (1=off)
3SW4EGA SW4 config (1=off)
4FEAT0Input FEAT0 (ISR0 bit 5) after output on FCR0
5FEAT0Input FEAT0 (ISR0 bit 6) after output on FCR0
6FEAT1Input FEAT1 (ISR0 bit 5) after output on FCR1
7FEAT1Input FEAT1 (ISR0 bit 6) after output on FCR1
Video Display Data (MCGA/VGA)MCGA and VGA specific status. Bits 7 and 4 control scan lines.Video Display Data (MCGA/VGA)MCGA and VGA specific status. Bits 7 and 4 control scan lines.40:8976543210SL_HI--SL_LOPALMONOGRAYVGA
BitsNameDescription
0VGA1 = VGA is active
1GRAY1 = Gray scale is enabled
2MONO1 = Using monochrome monitor
3PAL1 = Default palette loading is disabled
4SL_LOScan Line Select Bit 0
5:6Reserved
7SL_HIScan Line Select Bit 1 (00=350, 01=400, 10=200)
Floppy Media ControlLast selected floppy drive data and step ratesFloppy Media ControlLast selected floppy drive data and step rates40:8B76543210RATESTEP--
BitsNameDescription
0:3Reserved
4:5STEPStep Rate: 00=0C, 01=0D, 10=0A
6:7RATEData Rate: 00=500K, 01=300K, 10=250K
Floppy Media StatusMedia status for Drives 0-3 (4 copies at 40:90..93)Floppy Media StatusMedia status for Drives 0-3 (4 copies at 40:90..93)40:9076543210RATEDBLEST--STATE
BitsNameDescription
0:2STATEDrive/Media State
3Reserved
4EST1 = Media/drive established
5DBLDouble stepping required
6:7RATEData Rate: 00=500K, 01=300K, 10=250K
Keyboard Mode/TypeExtended keyboard status flagsKeyboard Mode/TypeExtended keyboard status flags40:9676543210RD_IDID_CHNUM101R_ALTR_CTLE0E1
BitsNameDescription
0E1Last code was the E1 hidden code
1E0Last code was the E0 hidden code
2R_CTLRight CTRL key depressed
3R_ALTRight ALT key depressed
4101101/102 enhanced keyboard installed
5NUMForce Num-Lock if Rd ID & KBX
6ID_CHLast char was first ID char
7RD_IDRead ID in process
Keyboard LED FlagsStatus of keyboard indicators and transmissionKeyboard LED FlagsStatus of keyboard indicators and transmission40:9776543210ERRMODERSNDACKCIRCCAPSNUMSCRL
BitsNameDescription
0SCRLScroll-Lock indicator
1NUMNum-Lock indicator
2CAPSCaps-Lock indicator
3CIRCCircus system indicator
4ACKACK received
5RSNDRe-send received flag
6MODEMode indicator update
7ERRKeyboard transmit error flag
RTC Wait Function FlagsINT 15,86 RTC wait function statusRTC Wait Function FlagsINT 15,86 RTC wait function status40:A076543210ELAP--PEND
BitsNameDescription
0PEND1 = Wait pending
1:6Unused
7ELAP1 = INT 15,86 wait time elapsed

Primary Emulation Resources

References


  1. Intel® Platform Innovation Framework for EFI Compatibility Support Module Specification, Revision 0.97, September 4, 2007.