home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1997 May / Pcwk0597.iso / sybase / starbuck / h.z / BIOS.H < prev    next >
C/C++ Source or Header  |  1996-07-24  |  4KB  |  127 lines

  1. /*
  2.  *  bios.h    BIOS functions
  3.  *
  4.  *  Copyright by WATCOM International Corp. 1988-1996.  All rights reserved.
  5.  */
  6. #ifndef _BIOS_H_INCLUDED
  7. #define _BIOS_H_INCLUDED
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11.  
  12. #ifndef _COMDEF_H_INCLUDED
  13.  #include <_comdef.h>
  14. #endif
  15.  
  16. #if defined(_M_IX86)
  17.   #pragma pack(__push,1);
  18. #else
  19.   #pragma pack(__push,8);
  20. #endif
  21.  
  22. struct    _ibm_diskinfo_t {    /* disk parameters */
  23.     unsigned drive;     /* drive number    */
  24.     unsigned head;        /* head number       */
  25.     unsigned track;     /* track number    */
  26.     unsigned sector;    /* sector number   */
  27.     unsigned nsectors;    /* number of sectors to read/write/compare  */
  28.     void _WCFAR *buffer;    /* buffer to read to,write from, or compare */
  29. };
  30. #define _diskinfo_t    _ibm_diskinfo
  31.  
  32. #if !defined(NO_EXT_KEYS) /* extensions enabled */
  33. #define diskinfo_t    _ibm_diskinfo_t
  34. #endif
  35.  
  36. /* constants for BIOS disk access functions */
  37. #define _DISK_RESET    0
  38. #define _DISK_STATUS    1
  39. #define _DISK_READ    2
  40. #define _DISK_WRITE    3
  41. #define _DISK_VERIFY    4
  42. #define _DISK_FORMAT    5
  43.  
  44. /* constants for BIOS serial communications (RS-232) support */
  45.  
  46. /* serial port services */
  47.  
  48. #define _COM_INIT    0    /* init serial port */
  49. #define _COM_SEND    1    /* send character */
  50. #define _COM_RECEIVE    2    /* receive character */
  51. #define _COM_STATUS    3    /* get serial port status */
  52.  
  53. /* serial port initializers.  One and only one constant from each of the
  54.  * following four groups - character size, stop bit, parity, and baud rate -
  55.  * must be specified in the initialization byte.
  56.  */
  57.  
  58. /* character size initializers */
  59.  
  60. #define _COM_CHR7    2    /* 7 bits characters */
  61. #define _COM_CHR8    3    /* 8 bits characters */
  62.  
  63. /* stop bit values - on or off */
  64.  
  65. #define _COM_STOP1    0    /* 1 stop bit */
  66. #define _COM_STOP2    4    /* 2 stop bits */
  67.  
  68. /*  parity initializers */
  69.  
  70. #define _COM_NOPARITY    0    /* no parity */
  71. #define _COM_ODDPARITY    8    /* odd parity */
  72. #define _COM_SPACEPARITY 16    /* space parity */
  73. #define _COM_EVENPARITY 24    /* even parity */
  74.  
  75. /*  baud rate initializers */
  76.  
  77. #define _COM_110    0    /* 110 baud */
  78. #define _COM_150    32    /* 150 baud */
  79. #define _COM_300    64    /* 300 baud */
  80. #define _COM_600    96    /* 600 baud */
  81. #define _COM_1200    128    /* 1200 baud */
  82. #define _COM_2400    160    /* 2400 baud */
  83. #define _COM_4800    192    /* 4800 baud */
  84. #define _COM_9600    224    /* 9600 baud */
  85.  
  86. /* keyboard services */
  87.  
  88. #define _KEYBRD_READ        0    /* read next character from keyboard */
  89. #define _KEYBRD_READY        1    /* check for keystroke */
  90. #define _KEYBRD_SHIFTSTATUS 2    /* get current shift key status */
  91.  
  92. /* services for enhanced keyboards */
  93.  
  94. #define _NKEYBRD_READ        0x10    /* read next character from keyboard */
  95. #define _NKEYBRD_READY        0x11    /* check for keystroke */
  96. #define _NKEYBRD_SHIFTSTATUS    0x12    /* get current shift key status */
  97.  
  98. /* printer services */
  99.  
  100. #define _PRINTER_WRITE    0    /* write character to printer */
  101. #define _PRINTER_INIT    1    /* initialize printer */
  102. #define _PRINTER_STATUS 2    /* get printer status */
  103.  
  104. /* time-of-day services */
  105.  
  106. #define _TIME_GETCLOCK    0    /* get current clock count */
  107. #define _TIME_SETCLOCK    1    /* set current clock count */
  108.  
  109.  
  110. _WCRTLINK extern unsigned short _bios_disk(unsigned __cmd,
  111.                        struct diskinfo_t *__diskinfo);
  112. _WCRTLINK extern unsigned short _bios_equiplist(void);
  113. _WCRTLINK extern unsigned short _bios_keybrd(unsigned __cmd);
  114. _WCRTLINK extern unsigned short _bios_memsize(void);
  115. _WCRTLINK extern unsigned short _bios_printer(unsigned __cmd,unsigned __port,
  116.                           unsigned __data);
  117. _WCRTLINK extern unsigned short _bios_serialcom(unsigned __cmd,unsigned __port,
  118.                         unsigned __data);
  119. _WCRTLINK extern unsigned short _bios_timeofday(unsigned __cmd,long *__timeval);
  120.  
  121.  
  122. #pragma pack(__pop);
  123. #ifdef __cplusplus
  124. };
  125. #endif
  126. #endif
  127.