home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / ddkx86v1.zip / DDKX86 / H / VDMBIOS.H < prev    next >
Text File  |  1995-04-14  |  24KB  |  647 lines

  1. /*DDK*************************************************************************/
  2. /*                                                                           */
  3. /* COPYRIGHT (C) Microsoft Corporation, 1989                                 */
  4. /* COPYRIGHT    Copyright (C) 1995 IBM Corporation                           */
  5. /*                                                                           */
  6. /*    The following IBM OS/2 WARP source code is provided to you solely for  */
  7. /*    the purpose of assisting you in your development of OS/2 WARP device   */
  8. /*    drivers. You may use this code in accordance with the IBM License      */
  9. /*    Agreement provided in the IBM Device Driver Source Kit for OS/2. This  */
  10. /*    Copyright statement may not be removed.                                */
  11. /*                                                                           */
  12. /*****************************************************************************/
  13. /***    VDMBIOS.H
  14.  *
  15.  *      SCCSID = @(#)vdmbios.h    6.6 92/03/04
  16.  *
  17.  *      MVDM ROM BIOS Data Definitions
  18.  *
  19.  *      For include file hierarchy, see MVDM.H
  20.  *
  21.  *
  22.  *      MODIFICATION HISTORY
  23.  *          09/20/88  JTP    Created.
  24.  *          12/04/88  JTP    Converted to structure.
  25.  *  @235    03/18/91 GAG        Allow disk seek but do verify sector instead
  26.  */
  27.  
  28. /***ET+ Low memory/ROM and EBIOS defines - used by VBIOS */
  29.  
  30. //c-begin
  31. #define ROMDATA_START   (IVT_START+IVT_LEN)
  32. #define ROMDATA_LEN     0x101   // sizeof(ROMDATA)-IVT_LEN
  33.  
  34. #define ROMBIOS_START   0xF0000
  35. #define ROMBIOS_LEN     0x10000
  36. #define ROMBIOS_PAGES   PAGESFROMBYTES(ROMBIOS_LEN)
  37.  
  38. #define PS2BIOS_START   0xE0000
  39. #define PS2BIOS_LEN     0x20000
  40. #define PS2BIOS_PAGES   PAGESFROMBYTES(PS2BIOS_LEN)
  41.  
  42. #define EXTROM_START    0xC0000 // where and how far to
  43. #define EXTROM_LEN      0x40000 // search for external adapter ROMs
  44. #define EXTROM_PAGES    PAGESFROMBYTES(EXTROM_LEN)
  45.  
  46. #define EBIOSDATA_START 0x9FC00
  47. #define EBIOSDATA_LEN   0x00400
  48. #define EBIOSDATA_PAGES PAGESFROMBYTES(EBIOSDATA_LEN)
  49.  
  50. #if     ROMDATA_START   != IVT_START+IVT_LEN
  51. #error  ROMDATA_START not equal to IVT_START+IVT_LEN
  52. #endif
  53.  
  54. #if     defined(IVT_START) && defined(DCA_START)
  55.  
  56. #if     DCA_START       != ROMDATA_START+ROMDATA_LEN
  57. #error  DCA_START not equal to ROMDATA_START+ROMDATA_LEN
  58. #endif
  59.  
  60. #define LOWMEM_START    IVT_START
  61. #define LOWMEM_LEN      (IVT_LEN+ROMDATA_LEN+DCA_LEN)
  62. #define LOWMEM_COPYLEN  (IVT_LEN+ROMDATA_LEN)
  63. #define LOWMEM_PAGES    PAGESFROMBYTES(LOWMEM_LEN)
  64.  
  65. #endif
  66. //c-end
  67. /*end*/
  68.  
  69.  
  70. /***    BIOS Interrupt Vectors
  71.  */
  72.  
  73. #define BIOSINT_PARITYCHECK     0x02
  74. #define BIOSINT_PRINTSCREEN     0x05
  75. #define BIOSINT_TIMERINTERRUPT  0x08
  76. #define BIOSINT_KEYINTERRUPT    0x09
  77. #define BIOSINT_COM2INTERRUPT   0x0B
  78. #define BIOSINT_COM1INTERRUPT   0x0C
  79. #define BIOSINT_LPT2INTERRUPT   0x0D
  80. #define BIOSINT_FLOPPYINTERRUPT 0x0E
  81. #define BIOSINT_LPT1INTERRUPT   0x0F
  82. #define BIOSINT_VIDEO           0x10
  83. #define BIOSINT_EQUIPMENTCHECK  0x11
  84. #define BIOSINT_MEMORYCHECK     0x12
  85. #define BIOSINT_DISKIO          0x13
  86. #define BIOSINT_COMIO           0x14
  87. #define BIOSINT_OSHOOK          0x15
  88. #define BIOSINT_KEYBOARD        0x16
  89. #define BIOSINT_PRINTERIO       0x17
  90. #define BIOSINT_ROMBASIC        0x18
  91. #define BIOSINT_REBOOT          0x19
  92. #define BIOSINT_TIMEOFDAY       0x1A
  93. #define BIOSINT_KEYBREAK        0x1B
  94. #define BIOSINT_CLOCKTICK       0x1C
  95. #define BIOSINT_VIDEOPARMS      0x1D
  96. #define BIOSINT_DISKPARMS       0x1E
  97. #define BIOSINT_VIDEOGRAPH      0x1F
  98. #define BIOSINT_OLDDISKIO       0x40
  99. #define BIOSINT_HDISK1PARMS     0x41
  100. #define BIOSINT_OLDVIDEO        0x42
  101. #define BIOSINT_EXTVIDEOGRAPH   0x43
  102. #define BIOSINT_HDISK2PARMS     0x46
  103.  
  104.  
  105. /***    Int 10h Equates (AH values)
  106.  */
  107.  
  108. #define INT10_SETMODE           0x00
  109. #define INT10_SETCURSORTYPE     0x01
  110. #define INT10_SETCURSORPOS      0x02
  111. #define INT10_QUERYCURSORPOS    0x03
  112. #define INT10_QUERYLPEN         0x04
  113. #define INT10_SETACTIVEPAGE     0x05
  114. #define INT10_SCROLLUP          0x06
  115. #define INT10_SCROLLDOWN        0x07
  116. #define INT10_READCHARATTR      0x08
  117. #define INT10_WRITECHARATTR     0x09
  118. #define INT10_WRITECHAR         0x0A
  119. #define INT10_SETPALETTE        0x0B
  120. #define INT10_WRITEPIXEL        0x0C
  121. #define INT10_READPIXEL         0x0D
  122. #define INT10_WRITETTY          0x0E
  123. #define INT10_QUERYMODE         0x0F
  124. #define INT10_EGASETPALETTE     0x10
  125. #define INT10_EGASELECTFONT     0x11
  126. #define INT10_EGASELECTMISC     0x12
  127. #define INT10_EGAWRITESTRING    0x13
  128. #define INT10_VGADISPLAYCODES   0x1A
  129. #define INT10_VGAQUERYSTATE     0x1B
  130. #define INT10_VGASAVERESTORE    0x1C
  131.  
  132.  
  133. /***    Int 13h Equates (AH values)
  134.  */
  135.  
  136. #define INT13_DISKRESET         0x00
  137. #define INT13_DISKSTATUS        0x01
  138. #define INT13_READSECTORS       0x02
  139. #define INT13_WRITESECTORS      0x03
  140. #define INT13_VERIFYSECTORS     0x04
  141. #define INT13_FORMATTRACK       0x05
  142. #define INT13_QUERYDRVPARMS     0x08
  143. #define INT13_DISKSEEK          0x0C            //@235
  144. #define INT13_QUERYDASDTYPE     0x15
  145. #define INT13_QUERYCHANGE       0x16
  146. #define INT13_SETDISKTYPE       0x17
  147. #define INT13_SETMEDIATYPE      0x18
  148.  
  149.  
  150. /***    Int 13h Status Equates (return in AH)
  151.  */
  152.  
  153. #define INT13STATUS_SUCCESS     0x00    //successful completion
  154. #define INT13STATUS_BADCMD      0x01    //bad command
  155. #define INT13STATUS_BADADDRMARK 0x02    //address mark not found
  156. #define INT13STATUS_WRTPROTECT  0x03    //write on write-protected disk
  157. #define INT13STATUS_RECNOTFOUND 0x04    //sector not found
  158. #define INT13STATUS_BADRESET    0x05    //reset failed (HD)
  159. #define INT13STATUS_MEDIACHANGE 0x06    //media changed
  160. #define INT13STATUS_INITFAIL    0x07    //parm. act. failed (HD)
  161. #define INT13STATUS_BADDMA      0x08    //DMA overrun
  162. #define INT13STATUS_DMABOUNDARY 0x09    //DMA across 64K boundary
  163. #define INT13STATUS_BADSECTOR   0x0a    //bad sector detected (HD)
  164. #define INT13STATUS_BADTRACK    0x0b    //bad track detected (HD)
  165. #define INT13STATUS_BADMEDIATYPE 0x0c   //unsupported track (HD)
  166. #define INT13STATUS_BADFMTSECNUM 0x0d   //bad # of sectors on format (HD)
  167. #define INT13STATUS_ADDRMARKDET 0x0e    //ctrl data addr mark detected (HD
  168. #define INT13STATUS_DMAARBERR   0x0f    //DMA arbitration error (HD)
  169. #define INT13STATUS_BADCRCECC   0x10    //bad CRC/ECC
  170. #define INT13STATUS_DATACORRECT 0x11    //data ECC corrected
  171. #define INT13STATUS_BADCNTLR    0x20    //controller failure
  172. #define INT13STATUS_BADSEEK     0x40    //seek failed
  173. #define INT13STATUS_TIMEOUT     0x80    //time out
  174. #define INT13STATUS_DRVNOTREADY 0xaa    //drive not ready (HD)
  175. #define INT13STATUS_UNDEFERR    0xbb    //undefined error (HD)
  176. #define INT13STATUS_WRITEFAULT  0xcc    //write fault (HD)
  177. #define INT13STATUS_STATUSERROR 0xe0    //status register error (HD)
  178. #define INT13STATUS_SENSEFAIL   0xff    //sense operation failed (HD)
  179.  
  180.  
  181. /***    Int 15h Equates (AH values)
  182.  */
  183.  
  184. #define INT15AH_KEYINTERCEPT    0x4f
  185. #define INT15AH_KEYSYSREQ       0x85
  186. #define INT15AH_DEVBUSY         0x90
  187. #define INT15AH_INTCOMPLETE     0x91
  188.  
  189.  
  190. /***    Int 15h Equates (AL values)
  191.  */
  192.  
  193. #define INT15AL_DISKETTE        0x01
  194. #define INT15AL_KEYBOARD        0x02
  195.  
  196.  
  197. /***    Int 16h Equates (AH values)
  198.  */
  199. #define INT16_READCHAR          0x00
  200. #define INT16_PEEKCHAR          0x01
  201. #define INT16_QUERYSHIFT        0x02
  202. #define INT16_SETDELAYS         0x03
  203. #define INT16_WRITECHAR         0x05
  204. #define INT16_READEXTCHAR       0x10
  205. #define INT16_PEEKEXTCHAR       0x11
  206. #define INT16_QUERYEXTSHIFT     0x12
  207. #define INT16_READ122CHAR       0x20
  208. #define INT16_PEEK122CHAR       0x21
  209. #define INT16_QUERY122SHIFT     0x22
  210.  
  211.  
  212. /***    Diskette Parameter Table (pointed by vector BIOSINT_DISKPARMS (1Eh))
  213.  */
  214.  
  215. typedef struct fdparmtable_s {
  216.     BYTE    fdp_bSpecify1;              // step-rate, head-unload
  217.     BYTE    fdp_bSpecify2;              // head-load, DMA mode
  218.     BYTE    fdp_bMotorOff;              // motor-off delay
  219.     BYTE    fdp_bSectorSize;            // bytes/sec (0=128,1=256,2=512,3=1024)
  220.     BYTE    fdp_nLastSector;            // (or think of it as # sectors/track)
  221.     BYTE    fdp_lenGapRW;               //
  222.     BYTE    fdp_lenData;                //
  223.     BYTE    fdp_lenGapFormat;           //
  224.     BYTE    fdp_bFormatData;            // format initialization byte
  225.     BYTE    fdp_bSettle;                // head settle time
  226.     BYTE    fdp_bMotorOn;               // motor start-up time
  227. } FDPARMTABLE;
  228. typedef FDPARMTABLE *PFDPARMTABLE;      // pointer to diskette parameter table
  229.  
  230.  
  231. /***    Fixed Disk Parameter Table
  232.  */
  233.  
  234. typedef struct hdparmtable_s {
  235.     WORD    hdp_wMaxCylinders;          // maximum number of cylinders
  236.     BYTE    hdp_bMaxHeads;              // maximum number of heads
  237.     WORD    hdp_wReserve1;              // reserved (not used)
  238.     WORD    hdp_wWritePrecompCyl;       // starting write precompensation cyl.
  239.     BYTE    hdp_bMaxECCDataBurstLen;    // maximum ECC data burst length
  240.     BYTE    hdp_bControl;               // control byte
  241.     BYTE    hdp_abReserve2[3];          // reserved (not used)
  242.     WORD    hdp_wLandingZone;           // landing zone for head parking
  243.     BYTE    hdp_bSectorsPerTrack;       // number of sectors per track
  244.     BYTE    hdp_bReserve3;              // reserved for future use
  245. } HDPARMTABLE;
  246. typedef HDPARMTABLE *PHDPARMTABLE;      // pointer to hard disk parameter table
  247.  
  248.  
  249. /***    Hard disk parameter - control byte bit mask
  250.  */
  251.  
  252. #define HDPCTRL_DISABLERETRY    0xc0    // disable retries
  253. #define HDPCTRL_EXCEED8HEADS    0x08    // more than 8 heads
  254.  
  255.  
  256. /***    Model byte equates (located at F000:FFFE in actual ROM)
  257.  */
  258. #define ROMMODEL_PC1    0x0FF           // PC-1, Expansion, Old PC2 (PC)
  259. #define ROMMODEL_PC2    0x0FE           // PC-2, Newer              (XT)
  260. #define ROMMODEL_JR     0x0FD           // HALO                     (JR)
  261. #define ROMMODEL_AT     0x0FC           // Salmon (PC-3)            (AT)
  262.  
  263.  
  264. /***    ROM format
  265.  */
  266. #define ROMHDR_SIGNATURE        0xAA55
  267. #define ROMHDR_INCR             2048
  268. #define BLOCKSIZE               512
  269. #define BLOCKSPERPAGE           (PAGESIZE / BLOCKSIZE)
  270.  
  271. //c-begin
  272. #define PAGESFROMBLOCKS(nbl)    ((nbl+BLOCKSPERPAGE-1) / BLOCKSPERPAGE)
  273. #define BLOCKSFROMBYTES(nb)     ((nb+BLOCKSIZE-1) / BLOCKSIZE)
  274. //c-end
  275.  
  276. typedef struct romhdr_s {
  277.     WORD romhdr_wSignature;     // should be ROMHDR_SIGNATURE
  278.     BYTE romhdr_bnBlocks;       // # of ROM blocks
  279.     BYTE romhdr_abFiller[ROMHDR_INCR-3];
  280. } ROMHDR;
  281.  
  282. typedef ROMHDR *PROMHDR;
  283.  
  284.  
  285. /***    ROM BIOS Data Area
  286.  */
  287. typedef struct romdata_s {
  288.  
  289. VPVOID  rb_avpIVT[IVT_LEN/4];   // interrupt vector table
  290.  
  291.  
  292. /***    Start of ROM BIOS Data Areas (0400h)
  293.  */
  294. WORD    rb_awCOM[4];            // RS232_BASE   (addresses of serial cards)
  295. WORD    rb_awLPT[4];            // PRINTER_BASE (addresses of printer cards)
  296. WORD    rb_fsEquip;             // EQUIP_FLAG   (installed hardware)
  297.  
  298. #define BIOSEQUIP_FLOPPY        0x00001     // machine has a floppy
  299. #define BIOSEQUIP_X87           0x00002     // X87=1 if coprocessor installed
  300. #define BIOSEQUIP_VIDEOMASK     0x00030     // video configuration bits
  301. #define BIOSEQUIP_COLOR40VIDEO  0x00010     //
  302. #define BIOSEQUIP_COLOR80VIDEO  0x00020     //
  303. #define BIOSEQUIP_MONOVIDEO     0x00030     //
  304. #define BIOSEQUIP_FLOPPYMASK    0x000C0     // # floppies-1 (if IPLDISK=1)
  305. #define BIOSEQUIP_COMMASK       0x00E00     // # COM ports
  306. #define BIOSEQUIP_PRINTERMASK   0x0C000     // # LPT ports
  307.  
  308. BBOOL   rb_bfMfgTest;           // MFG_TST      (initialization flag)
  309. WORD    rb_wMemSize;            // MEMORY_SIZE  (memory size in Kbytes)
  310. BBOOL   rb_bfMfgError[2];       // MFG_ERR_FLAG (scratchpad for manufacturing)
  311.  
  312.  
  313. /***    Start of keyboard data area (0417h)
  314.  */
  315. BYTE    rb_fbKFlag;             // KB_FLAG      (keyboard shift states)
  316.  
  317. #define BIOSKFLAG_RIGHTSHIFT    0x01
  318. #define BIOSKFLAG_LEFTSHIFT     0x02
  319. #define BIOSKFLAG_SHIFTMASK     0x03
  320. #define BIOSKFLAG_CTRL          0x04
  321. #define BIOSKFLAG_ALT           0x08
  322. #define BIOSKFLAG_SCROLLLOCK    0x10
  323. #define BIOSKFLAG_NUMLOCK       0x20
  324. #define BIOSKFLAG_CAPSLOCK      0x40
  325. #define BIOSKFLAG_INSERT        0x80
  326.  
  327. BYTE    rb_fbKFlag1;            // KB_FLAG_1    (second byte of keyboard status)
  328.  
  329. #define BIOSKFLAG1_LEFTCTRL     0x01        // left CTRL down
  330. #define BIOSKFLAG1_LEFTALT      0x02        // left ALT down
  331. #define BIOSKFLAG1_SYSSHIFT     0x04        // SysReq pressed and held
  332. #define BIOSKFLAG1_HOLDSTATE    0x08        // Ctrl-NumLock has been pressed
  333. #define BIOSKFLAG1_SCROLLDOWN   0x10
  334. #define BIOSKFLAG1_NUMDOWN      0x20
  335. #define BIOSKFLAG1_CAPSDOWN     0x40
  336. #define BIOSKFLAG1_INSDOWN      0x80
  337.  
  338. BYTE    rb_bKAlt;               // ALT_INPUT    (storage for Alt-keypad entry)
  339. WORD    rb_npKHead;             // BUFFER_HEAD  (advanced at task-time)
  340. WORD    rb_npKTail;             // BUFFER_TAIL  (advanced at interrupt-time)
  341. WORD    rb_abKBuf[16];          // KB_BUFFER
  342.  
  343.  
  344. /***    Start of floppy data area (043Eh)
  345.  */
  346. BYTE    rb_fbFSeekStatus;       // SEEK_STATUS
  347.  
  348. #define BIOSSEEK_DRV0NORECAL    0x01
  349. #define BIOSSEEK_DRV1NORECAL    0x02
  350. #define BIOSSEEK_DRV2NORECAL    0x04
  351. #define BIOSSEEK_DRV3NORECAL    0x08
  352. #define BIOSSEEK_DRVINTERRUPT   0x80
  353.  
  354. BYTE    rb_fbFMotorStatus;      // MOTOR_STATUS
  355.  
  356. #define BIOSMOTOR_DRV0RUNNING   0x01
  357. #define BIOSMOTOR_DRV1RUNNING   0x02
  358. #define BIOSMOTOR_DRV2RUNNING   0x04
  359. #define BIOSMOTOR_DRV3RUNNING   0x08
  360. #define BIOSMOTOR_DRVSELECT     0x30
  361. #define BIOSMOTOR_WRTOPERATION  0x80
  362.  
  363. BYTE    rb_bFMotorCount;        // MOTOR_COUNT
  364. BYTE    rb_bFStatus;            // DISKETTE_STATUS
  365. BYTE    rb_abFCtlStatus[7];     // NEC_STATUS (also CMD_BLOCK and HD_ERROR)
  366.  
  367.  
  368. /***    Start of video data area (0449h)
  369.  */
  370. BYTE    rb_bVMode;              // CRT_MODE
  371.  
  372. #define BIOSVMODE_BW40           0x00
  373. #define BIOSVMODE_CO40           0x01
  374. #define BIOSVMODE_BW80           0x02
  375. #define BIOSVMODE_CO80           0x03
  376. #define BIOSVMODE_CO320X200X4    0x04
  377. #define BIOSVMODE_BW320X200X4    0x05
  378. #define BIOSVMODE_CO640X200X2    0x06
  379. #define BIOSVMODE_MONO80         0x07
  380. #define BIOSVMODE_PCJR1          0x08
  381. #define BIOSVMODE_PCJR2          0x09
  382. #define BIOSVMODE_PCJR3          0x0A
  383. #define BIOSVMODE_COLRFONT       0x0B
  384. #define BIOSVMODE_MONOFONT       0x0C
  385. #define BIOSVMODE_CO320X200X16   0x0D
  386. #define BIOSVMODE_CO640X200X16   0x0E
  387. #define BIOSVMODE_MONO640X350X4  0x0F
  388. #define BIOSVMODE_CO640X350X16   0x10
  389. #define BIOSVMODE_CO640X480X2    0x11
  390. #define BIOSVMODE_CO640X480X16   0x12
  391. #define BIOSVMODE_CO320X200X256  0x13
  392.  
  393. WORD    rb_nVCols;              // CRT_COLS
  394. WORD    rb_wVLen;               // CRT_LEN
  395. WORD    rb_wVStart;             // CRT_START
  396. WORD    rb_awVCursorPos[8];     // CURSOR_POSN
  397. WORD    rb_wVCursorMode;        // CURSOR_MODE
  398. BYTE    rb_bVPage;              // ACTIVE_PAGE
  399. WORD    rb_wVPort;              // ADDR_6845
  400. BYTE    rb_bVModeByte;          // CRT_MODE_SET
  401. BYTE    rb_bVPalByte;           // CRT_PALETTE
  402.  
  403.  
  404. /***    Start of POST data area (0467h)
  405.  */
  406. VPVOID  rb_vpRomInit;           // IO_ROM_INIT and IO_ROM_SEG
  407. BBOOL   rb_fInterrupt;          // INTR_FLAG
  408.  
  409.  
  410. /***    Start of timer data area (046Ch)
  411.  */
  412. ULONG   rb_ulTickCount;         // TIMER_LOW and TIMER_HIGH
  413. BYTE    rb_bTickOverflow;       // TIMER_OFL
  414.  
  415.  
  416. /***    Start of system data area (0471h)
  417.  */
  418. BBOOL   rb_fBreak;              // BIOS_BREAK
  419.  
  420. #define BIOSBREAK_SET           0x80
  421.  
  422. SBOOL   rb_fReset;              // RESET_FLAG
  423.  
  424. #define BIOSRESET_WARMBOOT      0x1234
  425.  
  426.  
  427. /***    Start of hard disk data area (0474h)
  428.  */
  429. BYTE    rb_bDStatus;            // DISK_STATUS1 (fixed disk status byte)
  430. BYTE    rb_nDTotal;             // HF_NUM       (count of fixed disk drives)
  431. BYTE    rb_bDControl;           // CONTROL_BYTE (control byte drive options)
  432. BYTE    rb_bDPortOffset;        // PORT_OFF     (port offset)
  433.  
  434.  
  435. /***    Start of COM and LPT time-out data area (0478h)
  436.  */
  437. BYTE    rb_abLPTtimeout[4];     // PRINT_TIM_OUT
  438. BYTE    rb_abCOMtimeout[4];     // RS232_TIM_OUT
  439.  
  440.  
  441. /***    Start of additional keyboard data area (0480h)
  442.  */
  443. WORD    rb_npKBufStart;         // BUFFER_START
  444. WORD    rb_npKBufEnd;           // BUFFER_END
  445.  
  446.  
  447. /***    Start of EGA/VGA data area (0484h)
  448.  */
  449. BYTE    rb_nVRows;              // ROWS         (# rows-1)
  450. WORD    rb_nVCharHeight;        // POINTS       (height of char in pixels)
  451. BYTE    rb_bVInfo;              // INFO
  452.  
  453. #define BIOSVINFO_NOEMULATE     0x01    // (controls cursor emulation)
  454. #define BIOSVINFO_EGAMONO       0x02    //
  455. #define BIOSVINFO_WAITRETRC     0x04    //
  456. #define BIOSVINFO_EGAINACTIVE   0x08    //
  457. #define BIOSVINFO_MEMMASK       0x60    // (00=64k, 01=128k, 10=192k, 11=256k)
  458. #define BIOSVINFO_DONTCLEAR     0x80    // (don't clear screen on resets)
  459.  
  460. BYTE    rb_bVSwitches;          // INFO_3
  461.  
  462. #define BIOSVSW_SW1OFF          0x01
  463. #define BIOSVSW_SW2OFF          0x02
  464. #define BIOSVSW_SW3OFF          0x04
  465. #define BIOSVSW_SW4OFF          0x08
  466. #define BIOSVSW_FEATUREBITS     0xF0
  467.  
  468. BYTE    rb_bVFlags;             // Flags (for VGA and MCGA)
  469.  
  470. #define BIOSVFLAGS_VGAACTIVE    0x01
  471. #define BIOSVFLAGS_GRAYSCALES   0x02
  472. #define BIOSVFLAGS_VGAMONO      0x04
  473. #define BIOSVFLAGS_NODEFPALETTE 0x08
  474. #define BIOSVFLAGS_DSPSWITCHING 0x40
  475.  
  476. #define BIOSVFLAGS_350LINES     0x00
  477. #define BIOSVFLAGS_400LINES     0x10
  478. #define BIOSVFLAGS_200LINES     0x80
  479. #define BIOSVFLAGS_RESRVDLINES  0x90
  480.  
  481.  
  482. /***    Reserved area (048Ah)
  483.  */
  484. BYTE    rb_bReserved1[1];       // reserved
  485.  
  486.  
  487. /***    Start of additional diskette data area (048Bh)
  488.  */
  489. BYTE    rb_bFLastRate;          // LASTRATE
  490.  
  491.  
  492. /***    Start of additional hard disk data area (048Ch)
  493.  */
  494. BYTE    rb_bDStatusReg;         // HF_STATUS
  495. BYTE    rb_bDErrorReg;          // HF_ERROR
  496. BBOOL   rb_fDInterrupt;         // HF_INT_FLAG
  497. BBOOL   rb_fDCombo;             // HF_CNTRL     (combo hard disk/diskette card)
  498.  
  499.  
  500. /***    Start of additional diskette data area (0490h)
  501.  */
  502. BYTE    rb_bF0State;            // DSK_STATE    (drive 0 media state)
  503. BYTE    rb_bF1State;            //              (drive 1 media state)
  504. BYTE    rb_bF0StartState;       //              (drive 0 operation start state)
  505. BYTE    rb_bF1StartState;       //              (drive 1 operation start state)
  506. BYTE    rb_bF0Cyl;              // DSK_TRK      (drive 0 current cylinder)
  507. BYTE    rb_bF1Cyl;              //              (drive 1 current cylinder)
  508.  
  509.  
  510. /***    Start of additional keyboard data area (0496h)
  511.  */
  512. BYTE    rb_fbKFlag3;            // KB_FLAG_3
  513.  
  514. #define BIOSKFLAG3_E1PREFIX     0x01    // supported
  515. #define BIOSKFLAG3_SECPREFIX    0x02    // supported
  516. #define BIOSKFLAG3_RIGHTCTRL    0x04    // right CTRL down
  517. #define BIOSKFLAG3_RIGHTALT     0x08    // right ALT down
  518. #define BIOSKFLAG3_KBX          0x10    // supported
  519. #define BIOSKFLAG3_SETNUMLOCK   0x20    // supported
  520. #define BIOSKFLAG3_LASTID       0x40    // supported
  521. #define BIOSKFLAG3_READINGID    0x80    // supported (we never SET it though!)
  522.  
  523. BYTE    rb_fbKFlag2;            // KB_FLAG_2
  524.  
  525. #define BIOSKFLAG2_LEDS         0x07    // supported
  526. #define BIOSKFLAG2_ACK          0x10    // supported
  527. #define BIOSKFLAG2_RESEND       0x20    // supported
  528. #define BIOSKFLAG2_LEDUPDATE    0x40    // always clear
  529. #define BIOSKFLAG2_XMITERROR    0x80    // always clear
  530.  
  531.  
  532. /***    Start of real-time CMOS clock data area (0498h)
  533.  */
  534. VPVOID  rb_vpWaitFlag;          // USER_FLAG and USER_FLAG_SEG
  535. ULONG   rb_ulWaitFlag;          // RTC_LOW and RTC_HIGH
  536. BBOOL   rb_fWaitActive;         // RTC_WAIT_FLAG
  537.  
  538. BYTE    rb_bReserved2[7];        // this should "ORG" us to 04A8h
  539.  
  540.  
  541. /***    Start of additional EGA/VGA data area (04A8h)
  542.  */
  543. VPVOID  rb_vpVideoPtrTable;
  544.  
  545. /***    Format of VideoPtrTable:
  546.  *
  547.  *       VPVOID[0]      Parameter Table Pointer
  548.  *                      Initialized to BIOS Video Parameter Table.
  549.  *                      This value MUST exist.  For a VGA, the table is:
  550.  *
  551.  *                      BYTE    Value for CRT_COLS
  552.  *                      BYTE    Value for ROWS
  553.  *                      BYTE    Value for POINTS
  554.  *                      WORD    Value for CRT_LEN
  555.  *                      BYTE*4  Values for SEQ registers 1-4
  556.  *                      BYTE    Value for Miscellaneous Output register
  557.  *                      BYTE*25 Values for CRT registers 0-18h
  558.  *                      BYTE*20 Values for ATC registers 0-13h
  559.  *                      BYTE*9  Values for GDC registers 0-8
  560.  *
  561.  *       VPVOID[1]      Parameter Save Area Pointer
  562.  *                      Initialized to 0000:0000, this value is optional.
  563.  *                      When non-zero, this pointer will be used as pointer
  564.  *                      to a RAM area where certain dynamic values are to
  565.  *                      be saved. When in EGA operation this RAM area will
  566.  *                      hold the 16 EGA palette register values plus
  567.  *                      the overscan value in bytes 00h-10h respectively.
  568.  *                      At least 256 bytes must be allocated for this area.
  569.  *
  570.  *       VPVOID[2]      Alpha Character Set Override Pointer
  571.  *                      Initialized to 0000:0000, this value is optional.
  572.  *                      When non-zero, this pointer is used as a pointer
  573.  *                      to a tables described as follows:
  574.  *
  575.  *                      BYTE    Bytes/character
  576.  *
  577.  *                      BYTE    Block to load, should be zero for normal
  578.  *                              operation
  579.  *
  580.  *                      WORD    Count to store, should be 256 for normal
  581.  *                              operation
  582.  *
  583.  *                      WORD    Character offset, should be zero for normal
  584.  *                              operation
  585.  *
  586.  *                      VPVOID  Pointer to a font table
  587.  *
  588.  *                      BYTE    Displayable rows
  589.  *                              if 'FF' the maximum calculated value will be
  590.  *                              used, else this value will be used
  591.  *
  592.  *                      BYTE    Consecutive bytes of mode values for which
  593.  *                              this font description is to be used.
  594.  *                              The end of this stream is indicated by a
  595.  *                              byte code of 'FF'
  596.  *
  597.  *       VPVOID[3]      Graphics Character Set Override Pointer
  598.  *                      Initialized to 0000:0000, this value is optional.
  599.  *                      When non-zero, this pointer is used as a pointer
  600.  *                      to a tables described as follows:
  601.  *
  602.  *                      BYTE    Displayable rows
  603.  *
  604.  *                      WORD    Bytes per character
  605.  *
  606.  *                      VPVOID  Pointer to a font table
  607.  *
  608.  *                      BYTE    Consecutive bytes of mode values for which
  609.  *                              this font description is to be used.
  610.  *                              The end of this stream is indicated by a
  611.  *                              byte code of 'FF'
  612.  *
  613.  *       VPVOID[4]      Address of Secondary Video Pointer Table (VGA ONLY):
  614.  *
  615.  *                      WORD    Length of this table, in bytes
  616.  *                      VPVOID  Pointer to Display Combination Code Table
  617.  *                      VPVOID  Pointer to second Alpha Character Set Override
  618.  *                      VPVOID  Pointer to User Palette Profile Table
  619.  *                      VPVOID  Reserved
  620.  *                      VPVOID  Reserved
  621.  *                      VPVOID  Reserved
  622.  *
  623.  *       VPVOID[5]      Reserved and set to 0000:0000.
  624.  *
  625.  *       VPVOID[6]      Reserved and set to 0000:0000.
  626.  */
  627.  
  628. BYTE    rb_bReserved3[0x54];    // this should "ORG" us to 0500h
  629.  
  630. /***    Extra data area (0500h)
  631.  */
  632. BYTE    rb_bPrtScrStatus;       // STATUS_BYTE
  633. } ROMDATA;
  634.  
  635. typedef ROMDATA *PROMDATA;
  636.  
  637.  
  638. //c-begin
  639. typedef PROMDATA PVDMBASE;
  640. #define VDMBase (*(PVDMBASE)0)
  641. //c-end
  642.  
  643. //masm-begin
  644. //VDMBase   equ <ds:[0]>
  645. //.errnz  (size romdata_s NE 0501h)
  646. //masm-end
  647.