Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

244 lines
5.7 KiB

  1. /***
  2. *bios.h - declarations for bios interface functions and supporting definitions
  3. *
  4. * Copyright (c) 1987-1992, 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. #ifndef _INC_BIOS
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. #if (_MSC_VER <= 600)
  16. #define __cdecl _cdecl
  17. #define __far _far
  18. #endif
  19. #ifndef _MT
  20. /* manifest constants for BIOS serial communications (RS-232) support */
  21. /* serial port services */
  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. /* serial port initializers. One and only one constant from each of the
  27. * following four groups - character size, stop bit, parity, and baud rate -
  28. * must be specified in the initialization byte.
  29. */
  30. /* character size initializers */
  31. #define _COM_CHR7 2 /* 7 bits characters */
  32. #define _COM_CHR8 3 /* 8 bits characters */
  33. /* stop bit values - on or off */
  34. #define _COM_STOP1 0 /* 1 stop bit */
  35. #define _COM_STOP2 4 /* 2 stop bits */
  36. /* parity initializers */
  37. #define _COM_NOPARITY 0 /* no parity */
  38. #define _COM_ODDPARITY 8 /* odd parity */
  39. #define _COM_EVENPARITY 24 /* even parity */
  40. /* baud rate initializers */
  41. #define _COM_110 0 /* 110 baud */
  42. #define _COM_150 32 /* 150 baud */
  43. #define _COM_300 64 /* 300 baud */
  44. #define _COM_600 96 /* 600 baud */
  45. #define _COM_1200 128 /* 1200 baud */
  46. #define _COM_2400 160 /* 2400 baud */
  47. #define _COM_4800 192 /* 4800 baud */
  48. #define _COM_9600 224 /* 9600 baud */
  49. /* manifest constants for BIOS disk support */
  50. /* disk services */
  51. #define _DISK_RESET 0 /* reset disk controller */
  52. #define _DISK_STATUS 1 /* get disk status */
  53. #define _DISK_READ 2 /* read disk sectors */
  54. #define _DISK_WRITE 3 /* write disk sectors */
  55. #define _DISK_VERIFY 4 /* verify disk sectors */
  56. #define _DISK_FORMAT 5 /* format disk track */
  57. /* struct used to send/receive information to/from the BIOS disk services */
  58. #ifndef _DISKINFO_T_DEFINED
  59. #pragma pack(2)
  60. struct _diskinfo_t {
  61. unsigned drive;
  62. unsigned head;
  63. unsigned track;
  64. unsigned sector;
  65. unsigned nsectors;
  66. void __far *buffer;
  67. };
  68. #ifndef __STDC__
  69. /* Non-ANSI name for compatibility */
  70. #define diskinfo_t _diskinfo_t
  71. #endif
  72. #pragma pack()
  73. #define _DISKINFO_T_DEFINED
  74. #endif
  75. /* manifest constants for BIOS keyboard support */
  76. /* keyboard services */
  77. #define _KEYBRD_READ 0 /* read next character from keyboard */
  78. #define _KEYBRD_READY 1 /* check for keystroke */
  79. #define _KEYBRD_SHIFTSTATUS 2 /* get current shift key status */
  80. /* services for enhanced keyboards */
  81. #define _NKEYBRD_READ 0x10 /* read next character from keyboard */
  82. #define _NKEYBRD_READY 0x11 /* check for keystroke */
  83. #define _NKEYBRD_SHIFTSTATUS 0x12 /* get current shift key status */
  84. /* manifest constants for BIOS printer support */
  85. /* printer services */
  86. #define _PRINTER_WRITE 0 /* write character to printer */
  87. #define _PRINTER_INIT 1 /* intialize printer */
  88. #define _PRINTER_STATUS 2 /* get printer status */
  89. /* manifest constants for BIOS time of day support */
  90. /* time of day services */
  91. #define _TIME_GETCLOCK 0 /* get current clock count */
  92. #define _TIME_SETCLOCK 1 /* set current clock count */
  93. #ifndef _REGS_DEFINED
  94. /* word registers */
  95. struct _WORDREGS {
  96. unsigned int ax;
  97. unsigned int bx;
  98. unsigned int cx;
  99. unsigned int dx;
  100. unsigned int si;
  101. unsigned int di;
  102. unsigned int cflag;
  103. };
  104. /* byte registers */
  105. struct _BYTEREGS {
  106. unsigned char al, ah;
  107. unsigned char bl, bh;
  108. unsigned char cl, ch;
  109. unsigned char dl, dh;
  110. };
  111. /* general purpose registers union -
  112. * overlays the corresponding word and byte registers.
  113. */
  114. union _REGS {
  115. struct _WORDREGS x;
  116. struct _BYTEREGS h;
  117. };
  118. /* segment registers */
  119. struct _SREGS {
  120. unsigned int es;
  121. unsigned int cs;
  122. unsigned int ss;
  123. unsigned int ds;
  124. };
  125. #ifndef __STDC__
  126. /* Non-ANSI names for compatibility */
  127. struct WORDREGS {
  128. unsigned int ax;
  129. unsigned int bx;
  130. unsigned int cx;
  131. unsigned int dx;
  132. unsigned int si;
  133. unsigned int di;
  134. unsigned int cflag;
  135. };
  136. struct BYTEREGS {
  137. unsigned char al, ah;
  138. unsigned char bl, bh;
  139. unsigned char cl, ch;
  140. unsigned char dl, dh;
  141. };
  142. union REGS {
  143. struct WORDREGS x;
  144. struct BYTEREGS h;
  145. };
  146. struct SREGS {
  147. unsigned int es;
  148. unsigned int cs;
  149. unsigned int ss;
  150. unsigned int ds;
  151. };
  152. #endif
  153. #define _REGS_DEFINED
  154. #endif
  155. /* function prototypes */
  156. #ifndef _WINDOWS
  157. unsigned __cdecl _bios_disk(unsigned, struct _diskinfo_t *);
  158. #endif
  159. unsigned __cdecl _bios_equiplist(void);
  160. #ifndef _WINDOWS
  161. unsigned __cdecl _bios_keybrd(unsigned);
  162. #endif
  163. unsigned __cdecl _bios_memsize(void);
  164. #ifndef _WINDOWS
  165. unsigned __cdecl _bios_printer(unsigned, unsigned, unsigned);
  166. unsigned __cdecl _bios_serialcom(unsigned, unsigned, unsigned);
  167. #endif
  168. unsigned __cdecl _bios_timeofday(unsigned, long *);
  169. int __cdecl _int86(int, union _REGS *, union _REGS *);
  170. int __cdecl _int86x(int, union _REGS *, union _REGS *, struct _SREGS *);
  171. #ifndef __STDC__
  172. /* Non-ANSI names for compatibility */
  173. int __cdecl int86(int, union REGS *, union REGS *);
  174. int __cdecl int86x(int, union REGS *, union REGS *, struct SREGS *);
  175. #endif
  176. #endif
  177. #ifdef __cplusplus
  178. }
  179. #endif
  180. #define _INC_BIOS
  181. #endif