[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Format of BIOS Data Segment at segment 40h

                {items in curly braces not documented by IBM}
Offset Size    Description
 00h   WORD    Base I/O address of 1st serial I/O port, zero if none
 02h   WORD    Base I/O address of 2nd serial I/O port, zero if none
 04h   WORD    Base I/O address of 3rd serial I/O port, zero if none
 06h   WORD    Base I/O address of 4th serial I/O port, zero if none

          Note: Above fields filled in turn by POST as it finds serial
           ports. POST never leaves gaps. DOS and BIOS serial device
           numbers may be redefined by re-assigning these fields.
 08h   WORD    Base I/O address of 1st parallel I/O port, zero if none
 0Ah   WORD    Base I/O address of 2nd parallel I/O port, zero if none
 0Ch   WORD    Base I/O address of 3rd parallel I/O port, zero if none
 0Eh   WORD    [non-PS] Base I/O address of 4th parallel port, zero if none
       [PS] {Segment of Extended BIOS Data Segment}

           Note: Above fields filled in turn by POST as it finds
           parallel ports. POST never leaves gaps. DOS and BIOS
           parallel device numbers may de redefined by re-assigning
           these fields.
 10h   WORD    Installed hardware:
           bits 15-14: number of parallel devices
           bit     13: [Conv, PS/2-55LS] Internal modem
           bit     12: reserved
           bits 11- 9: number of serial devices
           bit      8: reserved
           bits  7- 6: number of diskette drives minus one
           bits  5- 4: Initial video mode:
                   00b = EGA,VGA,PGA
                   01b = 40 x 25 color
                   10b = 80 x 25 color
                   11b = 80 x 25 mono
           bit      3: reserved
           bit      2: [PS] =1 if pointing device
               [non-PS] reserved
           bit      1: =1 if math co-processor
           bit      0: =1 if diskette available for boot
 12h   BYTE    [Conv] POST status
       [AT] {Manufacturing test initialisation flags}
       [PS/2-25] POST system flag
           bit 0: optional memory failed; memory remapped
           bit 1: real-time clock installed
 13h   WORD    Base memory size in kbytes (0-640)
 15h   BYTE    [AT] {Manufacturing test scratch pad}
 16h   BYTE    [AT] {Manufacturing test scratch pad}
       [PS/2 Mod 30] {BIOS control flags}
 17h   BYTE    Keyboard status flags 1:
           bit 7 =1 INSert active
           bit 6 =1 Caps Lock active
           bit 5 =1 Num Lock active
           bit 4 =1 Scroll Lock active
           bit 3 =1 either Alt pressed
           bit 2 =1 either Ctrl pressed
           bit 1 =1 Left Shift pressed
           bit 0 =1 Right Shift pressed
 18h   BYTE    Keyboard status flags 2:
           bit 7 =1 INSert pressed
           bit 6 =1 Caps Lock pressed
           bit 5 =1 Num Lock pressed
           bit 4 =1 Scroll Lock pressed
           bit 3 =1 Pause state active
           bit 2 =1 Sys Req pressed
           bit 1 =1 Left Alt pressed
           bit 0 =1 Left Ctrl pressed
 19h   BYTE    Keyboard: Alt-nnn keypad workspace
 1Ah   WORD    Keyboard: ptr to next character in keyboard buffer
 1Ch   WORD    Keyboard: ptr to first free slot in keyboard buffer
 1Eh 16 WORDs  Keyboard circular buffer (but see 80h, 82h for override)
 3Eh   BYTE    Diskette recalibrate status:
           bit 7 =1 Diskette hardware interrupt occurred
           bits 6-4 reserved
           bit 3 =1 Recalibrate diskette 3
           bit 2 =1 Recalibrate diskette 2
           bit 1 =1 Recalibrate diskette 1
           bit 0 =1 Recalibrate diskette 0
 3Fh   BYTE    Diskette motor status:
           bit 7 =1 current operation is write or format
             =0 current operation is read or verify
           bit 6    reserved
           bits 5-4 diskette drive number selected (0-3)
           bit 3 =1 diskette 3 motor on
           bit 2 =1 diskette 2 motor on
           bit 1 =1 diskette 1 motor on
           bit 0 =1 diskette 0 motor on
 40h   BYTE    Diskette motor turn-off time-out count
 41h   BYTE    Diskette last operation status (0 = OK)
           bit 7 =1 drive not ready
           bit 6 =1 seek error
           bit 5 =1 general controller failure
           bits 4-0:
               00h no error
               01h invalid request/parameter
               02h address mark not found
               03h write-protect error
               04h sector not found
               06h diskette change line active
               08h DMA overrun
               09h DMA across 64k boundary
               0Ch media type unknown
               10h CRC error on read

           Note: the following values for this byte differ somewhat
           from the bitfield definition above:
               30h drive does not support media sense
               31h no media in drive
               32h drive does not support media type
               AAh diskette drive not ready
 42h  7 BYTEs  Diskette/Fixed disk status/command bytes
    42h BYTE   XT: command byte to hard disk controller
       AT: write precompensation cylinder number / 4
    43h    BYTE    XT: bit 5 = drive number, bits 3-0=head number
       AT: sector count
    44h BYTE   XT: bits 6,7 = high bits of track, bits 5-0 = start sector-1
       AT: starting sector
    45h BYTE   low byte of track number
    46h BYTE   XT: sector count
       AT: high bits of track number
    47h BYTE   XT: controlbyte from HD parameters (step rate,...)
       AT: 101DHHHH, D=drive number, HHHH=head number
    48h BYTE   XT: INT 13h subfunction number
       AT: comand byte to hard disk controller
 49h   BYTE    Video current mode
 4Ah   WORD    Video columns on screen
 4Ch   WORD    Video page (regen buffer) size in bytes
 4Eh   WORD    Video current page start address in regen buffer
 50h 16 BYTEs  Video cursor position (col, row) for eight pages, 0 based
 60h   WORD    Video cursor type, 6845 compatible, hi=startline, lo=endline
 62h   BYTE    Video current page number
 63h   WORD    Video CRT controller base address: color=03D4h, mono=03B4h
 65h   BYTE    Video current setting of mode select register 03D8h/03B8h
 66h   BYTE    Video current setting of CGA palette register 03D9h
 67h   DWORD   {POST real mode re-entry point after certain resets}
       [PS except Mod 25,30] pointer to reset code upon system reset
           with memory preserved (see offset 72h)
 6Bh   BYTE    POST last unexpected interrupt
 6Ch   DWORD   Timer ticks since midnight
 70h   BYTE    Timer overflow, non-zero if has counted past midnight
 71h   BYTE    Ctrl-Break flag: bit 7=1
 72h   WORD    POST reset flag:
           = 1234h to bypass memory test (warm boot)
           = 4321h [PS/2 except Mod 25,30] to preserve memory
           = 5678h [Conv] system suspended
           = 9ABCh [Conv] manufacturing test mode
           = ABCDh [Conv] POST loop mode
           =   64h Burn-in mode
 74h   BYTE    Fixed disk last operation status, except ESDI drives:
           00h no error
           01h invalid function request
           02h address mark not found
           03h write protect error
           04h sector not found
           05h reset failed
           06h diskette removed
           07h drive parameter activity failed
           08h DMA overrun
           09h DMA data boundary error
           0Ah bad sector flag detected
           0Bh bad track detected
           0Ch requested diskette media type not found
           (PS/2 or extended BIOS only)
           unsupported track
           0Dh invalid number of sectors for Format
           0Eh control data address mark detected
           0Fh DMA arbitration level out of range
           10h uncorrectable ECC or CRC error
           11h ECC corrected data error
           20h general controller failed
           40h seek failed
           80h time out
           AAh drive not ready
           BBh undefined error
           CCh write fault on selected drive
           E0h status error/error register is zero
           FFh sense failed
 74h   BYTE    [WD1002-27X SuperBIOS] total drives, first controller only
 75h   BYTE    Fixed disk: number of fixed disk drives
       [WD1002-27X SuperBIOS] total fixed drives, both controllers
 76h   BYTE    Fixed disk: control byte    {IBM document only for XT}
       XT: hard disk controller's I/O address (Western Digital)
       [WD1002-27X SuperBIOS] used in track recalculation
 77h   BYTE    Fixed disk: I/O port offset {IBM document only for XT}
       [WD1002-27X SuperBIOS] used in track recalculation
 78h  3 BYTEs  Parallel devices 1-3 time-out counters
 7Bh   BYTE    parallel device 4 time-out counter [non-PS and PS Mod 25,30]
       bit 7-6 reserved
       bit 5 set if Virtual DMA Spec supported [PS] (see INT 4B)
       bit 4 reserved
       bit 3 set if INT 4Bh intercepted
       bit 2 reserved
       bit 1 set if Generic SCSI CBIOS services available on INT 4Bh
       bit 0 reserved
 7Ch  4 BYTEs  Serial devices 1-4 time-out counters
 80h   WORD    Keyboard buffer start as offset from segment 40h (normally 1Eh)
 82h   WORD    Keyboard buffer end+1 as offset from segment 40h (normally 3Eh)
       [XT BIOS dated 11/08/82 ends here]
 84h   BYTE    Video EGA/MCGA/VGA rows on screen minus one
 85h   WORD    Video EGA/MCGA/VGA character height in scan-lines
 87h   BYTE    Video EGA/VGA control: [MCGA: =00h]
           bit 7:  =1 if not to clear RAM (see INT 10h, AH=00h)
           bits 6-5: RAM on adapter = (this field + 1) * 64K
           bit 4:  reserved
           bit 3:  =0 if EGA/VGA video system active, =1 if inactive
           bit 2:  =1 if to wait for display enable (what means this?)
           bit 1:  =0 for color or ECD monitor, =1 for mono monitor
           bit 0:  =0 alphanumeric cursor emulation enabled, =1 not.
               When enabled, text mode cursor size (INT 10,AH=01h)
               settings looking like CGA ones are translated to
               equivalent EGA/VGA ones.
 88h   BYTE    Video EGA/VGA switches: [MCGA: reserved]
           bits 7-4: power-on state of feature connector bits 3-0
           bits 3-0: configuration switches 4-1 (=0 on, =1 off)
             Values as read:
           0h Pri MDA,     Sec EGA+old color display 40 x 25
           1h Pri MDA,     Sec EGA+old color display 80 x 25
           2h Pri MDA,     Sec EGA+ECD normal mode (CGA emul)
           3h Pri MDA,     Sec EGA+ECD enhanced mode
           4h Pri CGA 40 x 25, Sec EGA mono display
           5h Pri CGA 80 x 25, Sec EGA mono display
           6h Pri EGA+old color display 40 x 25,  Sec MDA
           7h Pri EGA+old color display 80 x 25,  Sec MDA
           8h Pri EGA+ECD normal mode (CGA emul), Sec MDA
           9h Pri EGA+ECD enhanced mode,          Sec MDA
           Ah Pri EGA mono display,           Sec CGA 40 x 25
           Bh Pri EGA mono display,           Sec CGA 80 x 25
           When bit4 of 40h:89h is 0, VGA emulates 350-line EGA if
           this byte is x3h or x9h, otherwise emulates 200-line CGA in
           400-line double scan. VGA resets this byte to x9h after the
           mode set.
           See also note for next byte.
 89h   BYTE    {Video MCGA/VGA mode-set option control:}
           bits 7 and 4:
           0 0  350-line mode requested
           0 1  400-line mode at next mode set
           1 0  200-line mode requested
           1 1  reserved
           Apparently VGA BIOS mode set disregards bit 7 and uses
           byte 40h:88h to determine 200/350 selection when bit 4
           is zero. Presumably bit 7 is a convenience for other
           purposes. Bit 7 is reset to zero after the mode set.
           bit 6:  =1 if display switching enabled, =0 if disabled
           bit 5:  reserved
           bit 4:  [VGA]  =1 if to use 400-line mode at next mode set
                  =0 if to emulate EGA at next mode set
                     This bit set to 1 after the mode set.
               [MCGA] =1 use 400-line mode at next mode set
                  =0 emulate CGA, digital monitor, 200 lines,
                     8 x 8 text font at next mode set
                     Bit unchanged by mode set.
           bit 3:  =0 if default palette loading enabled at mode set
           bit 2:  =1 if mono display, =0 if color display
           bit 1:  =1 if gray scale summing enabled, =0 if disabled
           bit 0:  [VGA] =1 if VGA active, =0 if not
               [MCGA] reserved, zero

       Note: the Tseng ET4000 BIOS v3.00 uses bits 6-4 of 88h and
           bits 6-5 of 89h to specify graphics-mode refresh
           rates as follows
               88h/6       640x480:  1 for 72Hz,0 for 60Hz
               88h/5+89h/6 800x600:  00  60Hz
                             01  56Hz
                             11  72Hz
               88h/4+89h/5 1024x768: 00  interlaced
                             01  60Hz
                             10  72Hz???
                             11  70Hz
 8Ah   BYTE    {Video [MCGA/VGA]: index into Display Combination Code table}
 8Bh 11 BYTEs  reserved [PC, PCjr, PC/XT 11/8/82, and Convertible]
 8Bh   BYTE    Diskette media control [not XT]:
           bits 7-6: Last data rate set by controller:
                 00=500kbps, 01=300kbps, 10=250kbps, 11=1Mbps
           bits 5-4: Last diskette drive step rate selected
                 00=0Ch, 01=0Dh, 10=0Eh, 11=0Ah
           bits 3-2: {Data rate at start of operation}
           bits 1-0: reserved
 8Ch   BYTE    Fixed disk controller status [not XT]
 8Dh   BYTE    Fixed disk controller Error Status [not XT]
 8Eh   BYTE    Fixed disk Interrupt Control [not XT]
       cleared to 00h at start of disk operation, set to FFh by IRQ14
       handler when hard disk controller completes command
 8Fh   BYTE    {Diskette controller information [not XT]:}
           bit 7:  reserved
           bit 6:  =1 drive 1 determined
           bit 5:  =1 drive 1 is multi-rate, valid if drive determined
           bit 4:  =1 drive 1 supports 80 tracks, always valid
           bit 3:  reserved
           bit 2:  =1 drive 0 determined
           bit 1:  =1 drive 0 is multi-rate, valid if drive determined
           bit 0:  =1 drive 0 supports 80 tracks, always valid
 90h   BYTE    Diskette drive 0 media state
 91h   BYTE    Diskette drive 1 media state
           bits 7-6: Data rate
               00=500kbps, 01=300kbps, 10=250kbps, 11=1Mbps
           bit    5: =1 if double stepping reqd (e.g. 360kB in 1.2MB)
           bit    4: =1 if media established
           bit    3: =1 if drive capable of supporting 4MB media
           bits 2-0: on exit from BIOS, contain:
               000 trying 360kB in 360kB
               001 trying 360kB in 1.2MB
               010 trying 1.2MB in 1.2MB
               011 360kB in 360kB established
               100 360kB in 1.2MB established
               101 1.2MB in 1.2MB established
               110 reserved
               111 all other formats/drives
 92h   BYTE    {Diskette drive 0 media state at start of operation}
       officially "Drive 2 media state"
       bits 7-3 as above
       bit 2: =1 if multiple data rate capability determined
       bit 1: =1 if multiple data rate capability
       bit 0: =1 if drive has 80 tracks, =0 if 40 tracks
 92h   BYTE    [Olivetti Quaderno] Hard Disk powerdown countdown in clock
       ticks (HD turned off when counter reaches zero)
 93h   BYTE    {Diskette drive 1 media state at start of operation}
       officially "Drive 3 media state"
       bits 7-3 as above
       bit 2: =1 if multiple data rate capability determined
       bit 1: =1 if multiple data rate capability
       bit 0: =1 if drive has 80 tracks, =0 if 40 tracks
 94h   BYTE    Diskette drive 0 current track number
 95h   BYTE    Diskette drive 1 current track number
 96h   BYTE    Keyboard status byte 1
           bit 7 =1 read-ID in progress
           bit 6 =1 last code read was first of two ID codes
           bit 5 =1 force Num Lock if read-ID and enhanced keyboard
           bit 4 =1 enhanced keyboard installed
           bit 3 =1 Right Alt pressed
           bit 2 =1 Right Ctrl pressed
           bit 1 =1 last code read was E0h
           bit 0 =1 last code read was E1h
 97h   BYTE    Keyboard status byte 2
           bit 7 =1 keyboard transmit error flag
           bit 6 =1 LED update in progress
           bit 5 =1 RESEND received from keyboard
           bit 4 =1 ACK received from keyboard
           bit 3 reserved, must be zero
           bit 2 Caps Lock LED
           bit 1 Num Lock LED
           bit 0 Scroll Lock LED
 98h   DWORD   Timer2: [AT, PS exc Mod 30] ptr to user wait-complete flag
                       (see INT 15, AX=8300h)
 9Ch   DWORD   Timer2: [AT, PS exc Mod 30] user wait count in microseconds
 A0h   BYTE    Timer2: [AT, PS exc Mod 30] Wait active flag:
           bit 7 =1 wait time elapsed
           bits 6-1 reserved
           bit 0 =1 INT 15h, AH=86h has occurred
 A1h   BYTE    bit 5 set if LAN Support Program Interrupt Arbitrator present
       (DEVICE=DXMA0MOD.SYS)
 A2h  6 BYTEs  reserved for network adapters
 A4h   DWORD   [PS/2 Mod 30] Saved Fixed Disk Interrupt Vector
 A8h   DWORD   Video: EGA/MCGA/VGA ptr to Video Save Pointer Table (see below)
 ACh-AFh   reserved
 B0h   BYTE    (Phoenix 386 BIOS 1.10 10a) loop count for hard disk timeout
         and delaying when beeping due to full keyboard buffer
 B0h   DWORD   ptr to 3363 Optical disk driver or BIOS entry point.
           When 3363 BIOS present, the signature "OPTIC ",00h occurs 3
           bytes beyond this entry point.
           When 3363 BIOS and 3363 File System Driver present, the
           signature "FILE SYSTEM DRIVER",00h occurs 3 bytes beyond
           this entry point.
 B0h 16 BYTEs  (1988 Phoenix 386 BIOS 1.10 03) drive parameters for hard disk
       type 48 (see INT 41,INT 46)
 B4h   WORD    reserved
 B5h   BYTE    (Dell 4xxDE)
       bit 2: ??? (related to disk drives)
       bit 5: page tables set to allow Weitek addressing in real mode
       bit 6: Weitek math coprocessor present
 B6h  3 BYTEs  reserved for POST?
 B9h  7 BYTEs  ???
 C0h 16 BYTEs  (1988 Phoenix 386 BIOS 1.10 03) drive parameters for hard disk
       type 49 (see INT 41,INT 46)
 C0h 14 BYTEs  reserved
 CEh   WORD    count of days since last boot
 D0h-EFh   reserved
 D0h   BYTE    [Digiboard MV/4] length of data table
 D1h   BYTE    [Digiboard MV/4] product ID
 D2h   WORD    [Digiboard MV/4] base address found
 D4h   BYTE    [Digiboard MV/4] ports
 D5h   BYTE    [Digiboard MV/4] IRQ
 D6h   WORD    [Digiboard MV/4] keyboards found
 D8h   WORD    [Digiboard MV/4] mice found
 DAh   BYTE    [Digiboard MV/4] current port (used by VGA initialization only)
 DBh   BYTE    [Digiboard MV/4] master 8259 mask (used by VGA init only)
 DCh   BYTE    [Digiboard MV/4] slave 8259 mask (used by VGA init only)
 E0h-EFh   [Phoenix 386 BIOS] drive parameter table for first hard disk
         if configurable "type 47"
 EAh   WORD    [Omti controller] segment of extended BIOS data area???
       drive parameter tables stored in specified segment
 ECh   WORD    (Dell 4xxDE BIOS A11) loop count for delays
 F0h-FFh   reserved for user
100h   BYTE    Print Screen Status byte
10Eh   BYTE    state of BREAK at start of BASICA.COM execution
10Fh   BYTE    flag: 02h if BASICA v2.10 running
116h   DWORD   INT 1Bh at start of BASICA.COM execution
11Ah   DWORD   INT 24h at start of BASICA.COM execution

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson