2 *bios.h - declarations for bios interface functions and supporting definitions
4 * Copyright (c) 1987-1988, Microsoft Corporation. All rights reserved.
7 * This file declares the constants, structures, and functions
8 * used for accessing and using various BIOS interfaces.
10 *******************************************************************************/
13 #ifndef NO_EXT_KEYS /* extensions enabled */
15 #else /* extensions not enabled */
17 #endif /* NO_EXT_KEYS */
19 /* manifest constants for BIOS serial communications (RS-232) support */
21 /* serial port services */
23 #define _COM_INIT 0 /* init serial port */
24 #define _COM_SEND 1 /* send character */
25 #define _COM_RECEIVE 2 /* receive character */
26 #define _COM_STATUS 3 /* get serial port status */
28 /* serial port initializers. One and only one constant from each of the
29 * following four groups - character size, stop bit, parity, and baud rate -
30 * must be specified in the initialization byte.
33 /* character size initializers */
35 #define _COM_CHR7 2 /* 7 bits characters */
36 #define _COM_CHR8 3 /* 8 bits characters */
38 /* stop bit values - on or off */
40 #define _COM_STOP1 0 /* 1 stop bit */
41 #define _COM_STOP2 4 /* 2 stop bits */
43 /* parity initializers */
45 #define _COM_NOPARITY 0 /* no parity */
46 #define _COM_ODDPARITY 8 /* odd parity */
47 #define _COM_EVENPARITY 24 /* even parity */
49 /* baud rate initializers */
51 #define _COM_110 0 /* 110 baud */
52 #define _COM_150 32 /* 150 baud */
53 #define _COM_300 64 /* 300 baud */
54 #define _COM_600 96 /* 600 baud */
55 #define _COM_1200 128 /* 1200 baud */
56 #define _COM_2400 160 /* 2400 baud */
57 #define _COM_4800 192 /* 4800 baud */
58 #define _COM_9600 224 /* 9600 baud */
61 /* manifest constants for BIOS disk support */
65 #define _DISK_RESET 0 /* reset disk controller */
66 #define _DISK_STATUS 1 /* get disk status */
67 #define _DISK_READ 2 /* read disk sectors */
68 #define _DISK_WRITE 3 /* write disk sectors */
69 #define _DISK_VERIFY 4 /* verify disk sectors */
70 #define _DISK_FORMAT 5 /* format disk track */
72 /* struct used to send/receive information to/from the BIOS disk services */
74 #ifndef NO_EXT_KEYS /* extensions must be enabled */
76 #ifndef _DISKINFO_T_DEFINED
87 #define _DISKINFO_T_DEFINED
91 #endif /* NO_EXT_KEYS */
94 /* manifest constants for BIOS keyboard support */
96 /* keyboard services */
98 #define _KEYBRD_READ 0 /* read next character from keyboard */
99 #define _KEYBRD_READY 1 /* check for keystroke */
100 #define _KEYBRD_SHIFTSTATUS 2 /* get current shift key status */
103 /* manifest constants for BIOS printer support */
105 /* printer services */
107 #define _PRINTER_WRITE 0 /* write character to printer */
108 #define _PRINTER_INIT 1 /* intialize printer */
109 #define _PRINTER_STATUS 2 /* get printer status */
112 /* manifest constants for BIOS time of day support */
114 /* time of day services */
116 #define _TIME_GETCLOCK 0 /* get current clock count */
117 #define _TIME_SETCLOCK 1 /* set current clock count */
120 #ifndef _REGS_DEFINED
137 unsigned char al, ah;
138 unsigned char bl, bh;
139 unsigned char cl, ch;
140 unsigned char dl, dh;
143 /* general purpose registers union -
144 * overlays the corresponding word and byte registers.
152 /* segment registers */
161 #define _REGS_DEFINED
163 #endif /* _REGS_DEFINED */
166 /* function prototypes */
168 unsigned _CDECL _bios_equiplist(void);
169 unsigned _CDECL _bios_keybrd(unsigned);
170 unsigned _CDECL _bios_memsize(void);
171 unsigned _CDECL _bios_printer(unsigned, unsigned, unsigned);
172 unsigned _CDECL _bios_serialcom(unsigned, unsigned, unsigned);
173 unsigned _CDECL _bios_timeofday(unsigned, long *);
174 int _CDECL int86(int, union REGS *, union REGS *);
175 int _CDECL int86x(int, union REGS *, union REGS *, struct SREGS *);
177 #ifndef NO_EXT_KEYS /* extensions must be enabled */
179 unsigned _CDECL _bios_disk(unsigned, struct diskinfo_t *);
181 #endif /* NO_EXT_KEYS */