home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c045 / 2.ddi / INCLUDE / BIOS.H$ / BIOS.bin
Encoding:
Text File  |  1992-01-01  |  5.7 KB  |  252 lines

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