"Fossies" - the Fresh Open Source Software Archive

Member "dosemu-1.4.0/src/include/bios.h" (4 May 2007, 6185 Bytes) of package /linux/misc/old/dosemu-1.4.0.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "bios.h" see the Fossies "Dox" file reference documentation.

    1 /* 
    2  * (C) Copyright 1992, ..., 2007 the "DOSEMU-Development-Team".
    3  *
    4  * for details see file COPYING.DOSEMU in the DOSEMU distribution
    5  */
    6 
    7 /* miscellaneous BIOS stuff */
    8 
    9 #ifndef BIOS_H
   10 #define BIOS_H
   11 
   12 #include "config.h"
   13 #include "extern.h"
   14 
   15 extern void bios_f000(void);        /* BIOS start at 0xf0000 */
   16 /* these two addresses are needed to avoid overwriting e.g. font
   17  * tables copied from VBIOS */
   18 extern void bios_f000_endpart1(void);
   19 extern void bios_f000_part2(void);
   20 extern void bios_f000_end(void);    /* BIOS end at 0xfffff */
   21 extern void bios_f000_int10ptr(void);
   22 extern void bios_f000_bootdrive(void);
   23 extern void bios_f000_int10_old(void);
   24 extern char bios_in_int10_callback;
   25 
   26 extern char LFN_string[];
   27 
   28 #define INT2F_IDLE_MAGIC    0x1680
   29 
   30 /*
   31  * symbols to access BIOS-data with meaningful names, not just addresses,
   32  * which are only numbers. The names are retranslatios from an old german
   33  * book :-(
   34  */
   35 
   36 #define BIOS_BASE_ADDRESS_COM1          0x400
   37 #define BIOS_BASE_ADDRESS_COM2          0x402
   38 #define BIOS_BASE_ADDRESS_COM3          0x404
   39 #define BIOS_BASE_ADDRESS_COM4          0x406
   40 #define BIOS_ADDRESS_LPT1               0x408
   41 #define BIOS_ADDRESS_LPT2               0x40a
   42 #define BIOS_ADDRESS_LPT3               0x40c
   43 /* 0x40e is reserved */
   44 #define BIOS_CONFIGURATION              0x410
   45 /* 0x412 is reserved */
   46 #define BIOS_MEMORY_SIZE                0x413
   47 /* #define bios_expansion_memory_size      (*(unsigned int   *) 0x415) */
   48 #define BIOS_KEYBOARD_STATE             0x417
   49 #define BIOS_KEYBOARD_FLAGS1            BIOS_KEYBOARD_STATE
   50 #define BIOS_KEYBOARD_FLAGS2            0x418
   51 #define BIOS_KEYBOARD_TOKEN             0x419
   52 /* used for keyboard input with Alt-Number */
   53 #define BIOS_KEYBOARD_BUFFER_HEAD       0x41a
   54 #define BIOS_KEYBOARD_BUFFER_TAIL       0x41c
   55 #define BIOS_KEYBOARD_BUFFER            0x41e
   56 /* #define bios_keyboard_buffer            (*(unsigned int   *) 0x41e) */
   57 #define BIOS_DRIVE_ACTIVE               0x43e
   58 #define BIOS_DRIVE_RUNNING              0x43f
   59 #define BIOS_MOTOR_TIMEOUT              0x440
   60 #define BIOS_DISK_STATUS                0x441
   61 /* #define bios_fdc_result_buffer          (*(unsigned short *) 0x442) */
   62 #define BIOS_VIDEO_MODE                 0x449
   63 #define BIOS_SCREEN_COLUMNS             0x44a
   64 #define BIOS_VIDEO_MEMORY_USED          0x44c
   65 #define BIOS_VIDEO_MEMORY_ADDRESS       0x44e
   66 
   67 #define set_bios_cursor_x_position(screen, val) \
   68                         LOWMEM_WRITE_BYTE(0x450 + 2*(screen), (val))
   69 #define get_bios_cursor_x_position(screen) \
   70                         LOWMEM_READ_BYTE(0x450 + 2*(screen))
   71 
   72 
   73 #define set_bios_cursor_y_position(screen, val) \
   74                         LOWMEM_WRITE_BYTE(0x451 + 2*(screen), (val))
   75 #define get_bios_cursor_y_position(screen) \
   76                         LOWMEM_READ_BYTE(0x451 + 2*(screen))
   77 
   78 
   79 #define BIOS_CURSOR_SHAPE               0x460
   80 #define BIOS_CURSOR_LAST_LINE           0x460
   81 #define BIOS_CURSOR_FIRST_LINE          0x461
   82 #define BIOS_CURRENT_SCREEN_PAGE        0x462
   83 #define BIOS_VIDEO_PORT                 0x463
   84 #define BIOS_VDU_CONTROL                0x465
   85 #define BIOS_VDU_COLOR_REGISTER         0x466
   86 /* 0x467-0x468 is reserved */
   87 #define BIOS_TIMER                      0x46c
   88 #define BIOS_24_HOURS_FLAG              0x470
   89 #define BIOS_KEYBOARD_FLAGS             0x471
   90 #define BIOS_CTRL_ALT_DEL_FLAG          0x472
   91 #define BIOS_HARDDISK_COUNT     0x475
   92 /* 0x474, 0x476, 0x477 is reserved */
   93 #define BIOS_LPT1_TIMEOUT               0x478
   94 #define BIOS_LPT2_TIMEOUT               0x479
   95 #define BIOS_LPT3_TIMEOUT               0x47a
   96 /* 0x47b is reserved */
   97 #define BIOS_COM1_TIMEOUT               0x47c
   98 #define BIOS_COM2_TIMEOUT               0x47d
   99 /* 0x47e is reserved */
  100 /* 0x47f-0x4ff is unknow for me */
  101 #define BIOS_KEYBOARD_BUFFER_START      0x480
  102 #define BIOS_KEYBOARD_BUFFER_END        0x482
  103 
  104 #define BIOS_ROWS_ON_SCREEN_MINUS_1     0x484
  105 #define BIOS_FONT_HEIGHT                0x485
  106 
  107 #define BIOS_VIDEO_INFO_0               0x487
  108 #define BIOS_VIDEO_INFO_1               0x488
  109 #define BIOS_VIDEO_INFO_2               0x489
  110 #define BIOS_VIDEO_COMBO                0x48a
  111 
  112 #define BIOS_KEYBOARD_FLAGS3            0x496
  113 #define BIOS_KEYBOARD_LEDS              0x497
  114 #define BIOS_PRINT_SCREEN_FLAG          0x500
  115 
  116 #define BIOS_VIDEO_SAVEPTR              0x4a8
  117 
  118 
  119 #define BIT(x)      (1<<x)
  120 
  121 /*
  122  * int 11h config single bit tests
  123  */
  124 
  125 #define CONF_FLOP   BIT(0)
  126 #define CONF_MATHCO BIT(1)
  127 #define CONF_MOUSE  BIT(2)
  128 #define CONF_DMA    BIT(8)
  129 #define CONF_GAME   BIT(12)
  130 
  131 /*
  132  * don't use CONF_NSER with num > 4, CONF_NLPT with num > 3, CONF_NFLOP
  133  * with num > 4
  134  */
  135 #define CONF_NSER(c,num)    {c&=~(BIT(9)|BIT(10)|BIT(11)); c|=(num<<9);}
  136 #define CONF_NLPT(c,num)    {c&=~(BIT(14)|BIT(15)); c|=(num<<14);}
  137 #define CONF_NFLOP(c,num)   {c&=~(CONF_FLOP|BIT(6)|BIT(7)); \
  138                    if (num) c|=((num-1)<<6)|CONF_FLOP;}
  139 
  140 EXTERN unsigned int configuration INIT(0);  /* The virtual
  141                          * BIOS-configuration */
  142 
  143 void            bios_setup_init(void);
  144 
  145 void            INT16_dummy_start(void);
  146 void            INT16_dummy_end(void);
  147 #if 0
  148 void            INT09_dummy_start(void);
  149 void            INT09_dummy_end(void);
  150 #endif
  151 void            INT08_dummy_start(void);
  152 void            INT08_dummy_end(void);
  153 void            INT70_dummy_start(void);
  154 void            INT70_dummy_end(void);
  155 void            DPMI_dummy_start(void);
  156 void            DPMI_dummy_end(void);
  157 void            DPMI_dpmi_init(void);
  158 void            DPMI_return_from_dos(void);
  159 void            DPMI_return_from_dosint(void);
  160 void            DPMI_return_from_realmode(void);
  161 void            DPMI_return_from_dos_memory(void);
  162 void            DPMI_raw_mode_switch_rm(void);
  163 void            DPMI_save_restore_rm(void);
  164 
  165 void            MSDOS_srm_start(void);
  166 void            MSDOS_mouse_callback(void);
  167 void            MSDOS_PS2_mouse_callback(void);
  168 void            MSDOS_srm_end(void);
  169 void            MSDOS_rpm_start(void);
  170 void            MSDOS_return_from_rm(void);
  171 void            MSDOS_rpm_end(void);
  172 
  173 /* various declarations for interfacing with the packet driver code in
  174    bios.S */
  175 
  176 void        PKTDRV_driver_name(void);
  177 void        PKTDRV_param(void);
  178 void        PKTDRV_stats(void);
  179 void        PKTDRV_start(void);
  180 
  181 #endif              /* BIOS_H */