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.

181 lines
4.8 KiB

  1. /***
  2. *bios.h - declarations for bios interface functions and supporting definitions
  3. *
  4. * Copyright (c) 1987-1988, 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 NO_EXT_KEYS /* extensions enabled */
  12. #define _CDECL cdecl
  13. #else /* extensions not enabled */
  14. #define _CDECL
  15. #endif /* NO_EXT_KEYS */
  16. /* manifest constants for BIOS serial communications (RS-232) support */
  17. /* serial port services */
  18. #define _COM_INIT 0 /* init serial port */
  19. #define _COM_SEND 1 /* send character */
  20. #define _COM_RECEIVE 2 /* receive character */
  21. #define _COM_STATUS 3 /* get serial port status */
  22. /* serial port initializers. One and only one constant from each of the
  23. * following four groups - character size, stop bit, parity, and baud rate -
  24. * must be specified in the initialization byte.
  25. */
  26. /* character size initializers */
  27. #define _COM_CHR7 2 /* 7 bits characters */
  28. #define _COM_CHR8 3 /* 8 bits characters */
  29. /* stop bit values - on or off */
  30. #define _COM_STOP1 0 /* 1 stop bit */
  31. #define _COM_STOP2 4 /* 2 stop bits */
  32. /* parity initializers */
  33. #define _COM_NOPARITY 0 /* no parity */
  34. #define _COM_ODDPARITY 8 /* odd parity */
  35. #define _COM_EVENPARITY 24 /* even parity */
  36. /* baud rate initializers */
  37. #define _COM_110 0 /* 110 baud */
  38. #define _COM_150 32 /* 150 baud */
  39. #define _COM_300 64 /* 300 baud */
  40. #define _COM_600 96 /* 600 baud */
  41. #define _COM_1200 128 /* 1200 baud */
  42. #define _COM_2400 160 /* 2400 baud */
  43. #define _COM_4800 192 /* 4800 baud */
  44. #define _COM_9600 224 /* 9600 baud */
  45. /* manifest constants for BIOS disk support */
  46. /* disk services */
  47. #define _DISK_RESET 0 /* reset disk controller */
  48. #define _DISK_STATUS 1 /* get disk status */
  49. #define _DISK_READ 2 /* read disk sectors */
  50. #define _DISK_WRITE 3 /* write disk sectors */
  51. #define _DISK_VERIFY 4 /* verify disk sectors */
  52. #define _DISK_FORMAT 5 /* format disk track */
  53. /* struct used to send/receive information to/from the BIOS disk services */
  54. #ifndef NO_EXT_KEYS /* extensions must be enabled */
  55. #ifndef _DISKINFO_T_DEFINED
  56. struct diskinfo_t {
  57. unsigned drive;
  58. unsigned head;
  59. unsigned track;
  60. unsigned sector;
  61. unsigned nsectors;
  62. void far *buffer;
  63. };
  64. #define _DISKINFO_T_DEFINED
  65. #endif
  66. #endif /* NO_EXT_KEYS */
  67. /* manifest constants for BIOS keyboard support */
  68. /* keyboard services */
  69. #define _KEYBRD_READ 0 /* read next character from keyboard */
  70. #define _KEYBRD_READY 1 /* check for keystroke */
  71. #define _KEYBRD_SHIFTSTATUS 2 /* get current shift key status */
  72. /* manifest constants for BIOS printer support */
  73. /* printer services */
  74. #define _PRINTER_WRITE 0 /* write character to printer */
  75. #define _PRINTER_INIT 1 /* intialize printer */
  76. #define _PRINTER_STATUS 2 /* get printer status */
  77. /* manifest constants for BIOS time of day support */
  78. /* time of day services */
  79. #define _TIME_GETCLOCK 0 /* get current clock count */
  80. #define _TIME_SETCLOCK 1 /* set current clock count */
  81. #ifndef _REGS_DEFINED
  82. /* word registers */
  83. struct WORDREGS {
  84. unsigned int ax;
  85. unsigned int bx;
  86. unsigned int cx;
  87. unsigned int dx;
  88. unsigned int si;
  89. unsigned int di;
  90. unsigned int cflag;
  91. };
  92. /* byte registers */
  93. struct BYTEREGS {
  94. unsigned char al, ah;
  95. unsigned char bl, bh;
  96. unsigned char cl, ch;
  97. unsigned char dl, dh;
  98. };
  99. /* general purpose registers union -
  100. * overlays the corresponding word and byte registers.
  101. */
  102. union REGS {
  103. struct WORDREGS x;
  104. struct BYTEREGS h;
  105. };
  106. /* segment registers */
  107. struct SREGS {
  108. unsigned int es;
  109. unsigned int cs;
  110. unsigned int ss;
  111. unsigned int ds;
  112. };
  113. #define _REGS_DEFINED
  114. #endif /* _REGS_DEFINED */
  115. /* function prototypes */
  116. unsigned _CDECL _bios_equiplist(void);
  117. unsigned _CDECL _bios_keybrd(unsigned);
  118. unsigned _CDECL _bios_memsize(void);
  119. unsigned _CDECL _bios_printer(unsigned, unsigned, unsigned);
  120. unsigned _CDECL _bios_serialcom(unsigned, unsigned, unsigned);
  121. unsigned _CDECL _bios_timeofday(unsigned, long *);
  122. int _CDECL int86(int, union REGS *, union REGS *);
  123. int _CDECL int86x(int, union REGS *, union REGS *, struct SREGS *);
  124. #ifndef NO_EXT_KEYS /* extensions must be enabled */
  125. unsigned _CDECL _bios_disk(unsigned, struct diskinfo_t *);
  126. #endif /* NO_EXT_KEYS */