home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c034 / 4.ddi / INCLUDE / BIOS.H$ / BIOS.bin
Encoding:
Text File  |  1989-09-27  |  4.4 KB  |  176 lines

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