source: xtideuniversalbios/tags/XTIDE_Universal_BIOS_v1.1.1/Inc/BiosData.inc@ 625

Last change on this file since 625 was 3, checked in by Tomi Tilli, 14 years ago
File size: 6.6 KB
Line 
1; File name : BiosData.inc
2; Project name : IDE BIOS
3; Created date : 28.7.2007
4; Last update : 23.3.2010
5; Author : Tomi Tilli
6; Description : Equates for BIOS Data Area.
7%ifndef BIOSDATA_INC
8%define BIOSDATA_INC
9
10;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11; BIOS DATA AREA VARIABLES ;
12;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
14; BIOS Data Area (related to floppy drives and hard disks)
15struc BDA
16 resb 400h ; 40:0h, Start of BDA
17 .wCOM1 resb 2 ; 0:400h, Serial I/O Address, Port 1
18 .wCOM2 resb 2 ; 0:402h, Serial I/O Address, Port 2
19 .wCOM3 resb 2 ; 0:404h, Serial I/O Address, Port 3
20 .wCOM4 resb 2 ; 0:406h, Serial I/O Address, Port 4
21 .wLPT1 resb 2 ; 0:408h, Parallel I/O Address, Port 1
22 .wLPT2 resb 2 ; 0:40Ah, Parallel I/O Address, Port 2
23 .wLPT3 resb 2 ; 0:40Ch, Parallel I/O Address, Port 3
24 .wLPT4: ; 0:40Eh, Parallel I/O Address, Port 4 (PC/XT)
25 .wSegEBDA resb 2 ; 0:40Eh, Extended BIOS Data Area segment (AT+)
26
27 .wEquipment resb 2 ; 0:410h, Equipment Word
28 .bTest resb 1 ; 0:412h, Manufacturing test
29 .wBaseMem resb 2 ; 0:413h, Base Memory Size in kB
30 .wAdptrMem: ; 0:415h, Adapter Memory Size (PC/XT)
31 .wError resb 2 ; 0:415h, Error Codes (AT+)
32 .bKBFlgs1 resb 1 ; 0:417h, Keyboard, Shift Flags, Set 1
33 .bKBFlgs2 resb 1 ; 0:418h, Keyboard, Shift Flags, Set 2
34 .bKBNumpad resb 1 ; 0:419h, Keyboard, ALT+Numpad work area
35 .wKBHead resb 2 ; 0:41Ah, Keyboard, Head of buffer pointer
36 .wKBTail resb 2 ; 0:41Ch, Keyboard, Tail of buffer pointer
37 .rgwKBBuff resb 32 ; 0:41Eh, Keyboard, 16-word buffer
38
39 .bFDRecal resb 1 ; 0:43Eh, Diskette, Recalibrate status
40 .bFDMotor resb 1 ; 0:43Fh, Diskette, Motor status
41
42 .bFDMotTime resb 1 ; 0:440h, Diskette, Motor timeout counter
43 .bFDRetST resb 1 ; 0:441h, Diskette, Controller status return code
44 .rgbFDStatus resb 7 ; 0:442h, Diskette, Diskette and Disk Controller status bytes
45 .bVidMode resb 1 ; 0:449h, Video, Mode
46 .wVidColumns resb 2 ; 0:44Ah, Video, Number of columns
47 .wVidBpP resb 2 ; 0:44Ch, Video, Total number of bytes per page
48 .wVidPageOff resb 2 ; 0:44Eh, Video, Current page offset
49
50 .rgwVidCurPos resb 16 ; 0:450h, Video, Cursor position, pages 0...7
51
52 .wVidCurShape resb 2 ; 0:460h, Video, Cursor shape
53 .bVidPageIdx resb 1 ; 0:462h, Video, Active display page
54 .wVidPort resb 2 ; 0:463h, Video, I/O Port number base
55 .bVidModeReg resb 1 ; 0:465h, Video, Internal mode register
56 .bVidPalette resb 1 ; 0:466h, Video, Color palette
57 .wCasTimeCnt: ; 0:467h, Cassette, Time count at data edge (PC)
58 .wGenOff resb 2 ; 0:467h, General use offset (XT+)
59 .wCasCRC: ; 0:469h, Cassette, CRC register (PC)
60 .wGenSeg resb 2 ; 0:469h, General use segment (XT+)
61 .bCasLast: ; 0:46Bh, Cassette, Last value read
62 .bLastIRQ resb 1 ; 0:46Bh, Last interrupt that occurred (XT+)
63 .dwTimerTicks resb 4 ; 0:46Ch, Timer ticks count
64
65 .bTimer24h resb 1 ; 0:470h, Timer ticks rollover flag
66 .bKBCtrlBrk resb 1 ; 0:471h, Keyboard, Ctrl+Break flag
67 .wBoot resb 2 ; 0:472h, Warm boot flag
68 .bHDLastSt resb 1 ; 0:474h, Hard Disk, Status of Last Operation (XT+)
69 .bHDCount resb 1 ; 0:475h, Hard Disk, Number of HDs Attached (XT+)
70 .bHDCtrl resb 1 ; 0:476h, Hard Disk, Control Byte (temp, XT+)
71 .bHDPortOff resb 1 ; 0:477h, Hard Disk, Port Offset (XT)
72 .bLPT1Timeout resb 1 ; 0:478h, Parallel Printer 1, Timeout (XT+)
73 .bLPT2Timeout resb 1 ; 0:479h, Parallel Printer 2, Timeout (XT+)
74 .bLPT3Timeout resb 1 ; 0:47Ah, Parallel Printer 3, Timeout (XT+)
75 .bLPT4Timeout resb 1 ; 0:47Bh, Parallel Printer 4, Timeout (XT+)
76 .bCOM1Timeout resb 1 ; 0:47Ch, Serial 1, Timeout (XT+)
77 .bCOM2Timeout resb 1 ; 0:47Dh, Serial 2, Timeout (XT+)
78 .bCOM3Timeout resb 1 ; 0:47Eh, Serial 3, Timeout (XT+)
79 .bCOM4Timeout resb 1 ; 0:47Fh, Serial 4, Timeout (XT+)
80
81 .wKBPtrStart resb 2 ; 0:480h, Keyboard, Pointer to start of buffer (XT+)
82 .wKBPtrEnd resb 2 ; 0:482h, Keyboard, Pointer to end of buffer (XT+)
83 .bVidRows resb 1 ; 0:484h, Video, Number of rows (EGA+)
84 .wVidPpC resb 2 ; 0:485h, Video, Pixels per character (EGA+)
85 .bVidOptns resb 1 ; 0:487h, Video, Options (EGA+)
86 .bVidSwitches resb 1 ; 0:488h, Video, Switches (EGA+)
87 .bVidSave1 resb 1 ; 0:489h, Video, Save area 1 (VGA+)
88 .bVidSave2 resb 1 ; 0:48Ah, Video, Save area 2 (VGA+)
89 .bFDCfgData resb 1 ; 0:48Bh, Diskette, Configuration data (AT+)
90 .bHDStatus resb 1 ; 0:48Ch, Hard Disk, Status Register (AT+)
91 .bHDError resb 1 ; 0:48Dh, Hard Disk, Error Register (AT+)
92 .bHDTaskFlg resb 1 ; 0:48Eh, Hard Disk, Task Complete Flag (AT+)
93 .bFDCtrlInfo resb 1 ; 0:48Fh, Diskette, Controller information (AT+)
94
95 .bFDMedia0 resb 1 ; 0:490h, Diskette 0, Media state (AT+)
96 .bFDMedia1 resb 1 ; 0:491h, Diskette 1, Media state (AT+)
97 .bFDOpStart0 resb 1 ; 0:492h, Diskette 0, Operational starting state (AT+)
98 .bFDOpStart1 resb 1 ; 0:493h, Diskette 1, Operational starting state (AT+)
99 .bFDCurCyl0 resb 1 ; 0:494h, Diskette 0, Current cylinder (AT+)
100 .bFDCurCyl1 resb 1 ; 0:495h, Diskette 1, Current cylinder (AT+)
101 .bKBFlgs3 resb 1 ; 0:496h, Keyboard, Status flags 3 (AT+)
102 .bKBFlgs4 resb 1 ; 0:497h, Keyboard, Status flags 4 (AT+)
103 .dwWaitPtr resb 4 ; 0:498h, User's wait flag pointer (AT+)
104 .dwWaitCnt resb 4 ; 0:49Ch, User's wait count (AT+)
105
106 .bWaitFlg resb 1 ; 0:4A0h, Wait flag (AT+)
107 .rgbLAN resb 7 ; 0:4A1h, Local Area Network (AT+)
108 .dwVidPtr resb 4 ; 0:4A8h, Video, Parameter Control Block Pointer (EGA+)
109 resb 22h ; Reserved from 0:4ACh...0:4CDh
110
111 .dwDays resb 4 ; 0:4CEh, Clock, Days since 1980 (some BIOSes, AT+)
112 resb 2Eh ; Reserved from 0:4D2h...0:4FFh
113
114 .bPrntScrn resb 1 ; 0:500, Print screen status
115endstruc
116
117; BDA struct with only Hard Disk related locations
118struc HDBDA
119 resb 474h
120 .bHDLastSt resb 1 ; 0:474h, Status of Last Operation (XT+)
121 .bHDCount resb 1 ; 0:475h, Number of HDs Attached (XT+)
122 .bHDCtrl resb 1 ; 0:476h, Control Byte (temp, XT+)
123 .bHDPortOff resb 1 ; 0:477h, Port Offset (XT)
124 resb 15h
125 .bHDStatus: ; 0:48Ch, Status Register (AT+)
126 .bHDError: ; 0:48Dh, Error Register (AT+)
127 .wHDStAndErr resb 2
128 .bHDTaskFlg resb 1 ; 0:48Eh, Task Complete Flag (AT+)
129endstruc
130
131
132;--------------------------------------------------------------------
133; Load BDA (Bios Data Area) segment to wanted segment register.
134;
135; LOAD_BDA_SEGMENT_TO
136; Parameters:
137; %1: Destination Segment Register
138; %2: Temporary WORD Register
139; Returns:
140; %1: BDA segment (zero)
141; Corrupts registers:
142; %2
143;--------------------------------------------------------------------
144%macro LOAD_BDA_SEGMENT_TO 2
145 xor %2, %2
146 mov %1, %2
147%endmacro
148
149
150%endif ; BIOSDATA_INC
Note: See TracBrowser for help on using the repository browser.