|
|
1.1 root 1: /***
2: *bios.h - declarations for bios interface functions and supporting definitions
3: *
4: * Copyright (c) 1987, Microsoft Corporation. All rights reserved.
5: *
6: *Purpose:
7: * This file declares the constants, structures, and functions
8: * used for accessing and using various BIOS interfaces.
9: *
10: *******************************************************************************/
11:
12: #ifndef NO_EXT_KEYS /* extensions enabled */
13: #define _CDECL cdecl
14: #else /* extensions not enabled */
15: #define _CDECL
16: #endif /* NO_EXT_KEYS */
17:
18: /* manifest constants for BIOS serial communications (RS-232) support */
19:
20: /* serial port services */
21:
22: #define _COM_INIT 0 /* init serial port */
23: #define _COM_SEND 1 /* send character */
24: #define _COM_RECEIVE 2 /* receive character */
25: #define _COM_STATUS 3 /* get serial port status */
26:
27: /* serial port initializers. One and only one constant from each of the
28: * following four groups - character size, stop bit, parity, and baud rate -
29: * must be specified in the initialization byte.
30: */
31:
32: /* character size initializers */
33:
34: #define _COM_CHR7 2 /* 7 bits characters */
35: #define _COM_CHR8 3 /* 8 bits characters */
36:
37: /* stop bit values - on or off */
38:
39: #define _COM_STOP1 0 /* 1 stop bit */
40: #define _COM_STOP2 4 /* 2 stop bits */
41:
42: /* parity initializers */
43:
44: #define _COM_NOPARITY 0 /* no parity */
45: #define _COM_ODDPARITY 8 /* odd parity */
46: #define _COM_EVENPARITY 24 /* even parity */
47:
48: /* baud rate initializers */
49:
50: #define _COM_110 0 /* 110 baud */
51: #define _COM_150 32 /* 150 baud */
52: #define _COM_300 64 /* 300 baud */
53: #define _COM_600 96 /* 600 baud */
54: #define _COM_1200 128 /* 1200 baud */
55: #define _COM_2400 160 /* 2400 baud */
56: #define _COM_4800 192 /* 4800 baud */
57: #define _COM_9600 224 /* 9600 baud */
58:
59:
60: /* manifest constants for BIOS disk support */
61:
62: /* disk services */
63:
64: #define _DISK_RESET 0 /* reset disk controller */
65: #define _DISK_STATUS 1 /* get disk status */
66: #define _DISK_READ 2 /* read disk sectors */
67: #define _DISK_WRITE 3 /* write disk sectors */
68: #define _DISK_VERIFY 4 /* verify disk sectors */
69: #define _DISK_FORMAT 3 /* format disk track */
70:
71: /* struct used to send/receive information to/from the BIOS disk services */
72:
73: #ifndef NO_EXT_KEYS /* extensions must be enabled */
74:
75: #ifndef DISKINFO_T_DEFINED
76:
77: struct diskinfo_t {
78: unsigned drive;
79: unsigned head;
80: unsigned track;
81: unsigned sector;
82: unsigned nsectors;
83: void far *buffer;
84: };
85:
86: #define DISKINFO_T_DEFINED
87:
88: #endif
89:
90: #endif /* NO_EXT_KEYS */
91:
92:
93: /* manifest constants for BIOS keyboard support */
94:
95: /* keyboard services */
96:
97: #define _KEYBRD_READ 0 /* read next character from keyboard */
98: #define _KEYBRD_READY 1 /* check for keystroke */
99: #define _KEYBRD_SHIFTSTATUS 2 /* get current shift key status */
100:
101:
102: /* manifest constants for BIOS printer support */
103:
104: /* printer services */
105:
106: #define _PRINTER_WRITE 0 /* write character to printer */
107: #define _PRINTER_INIT 1 /* intialize printer */
108: #define _PRINTER_STATUS 2 /* get printer status */
109:
110:
111: /* manifest constants for BIOS time of day support */
112:
113: /* time of day services */
114:
115: #define _TIME_GETCLOCK 0 /* get current clock count */
116: #define _TIME_SETCLOCK 1 /* set current clock count */
117:
118:
119: #ifndef _REGS_DEFINED
120:
121: /* word registers */
122:
123: struct WORDREGS {
124: unsigned int ax;
125: unsigned int bx;
126: unsigned int cx;
127: unsigned int dx;
128: unsigned int si;
129: unsigned int di;
130: unsigned int cflag;
131: };
132:
133: /* byte registers */
134:
135: struct BYTEREGS {
136: unsigned char al, ah;
137: unsigned char bl, bh;
138: unsigned char cl, ch;
139: unsigned char dl, dh;
140: };
141:
142: /* general purpose registers union -
143: * overlays the corresponding word and byte registers.
144: */
145:
146: union REGS {
147: struct WORDREGS x;
148: struct BYTEREGS h;
149: };
150:
151: /* segment registers */
152:
153: struct SREGS {
154: unsigned int es;
155: unsigned int cs;
156: unsigned int ss;
157: unsigned int ds;
158: };
159:
160: #define _REGS_DEFINED
161:
162: #endif /* _REGS_DEFINED */
163:
164:
165: /* function prototypes */
166:
167: unsigned _CDECL _bios_equiplist(void);
168: unsigned _CDECL _bios_keybrd(unsigned);
169: unsigned _CDECL _bios_memsize(void);
170: unsigned _CDECL _bios_printer(unsigned, unsigned, unsigned);
171: unsigned _CDECL _bios_serialcom(unsigned, unsigned, unsigned);
172: unsigned _CDECL _bios_timeofday(unsigned, long *);
173: int _CDECL int86(int, union REGS *, union REGS *);
174: int _CDECL int86x(int, union REGS *, union REGS *, struct SREGS *);
175:
176: #ifndef NO_EXT_KEYS /* extensions must be enabled */
177:
178: unsigned _CDECL _bios_disk(unsigned, struct diskinfo_t *);
179:
180: #endif /* NO_EXT_KEYS */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.