home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / programming / misc_programming / int15.spc < prev    next >
Text File  |  1990-01-04  |  80KB  |  1,621 lines

  1.                Specification of system service (INT 15h)
  2.                -----------------------------------------
  3.                      
  4. a. System service
  5.  
  6.                *(ah) = 40h Read/Modify profiles
  7.                *(ah) = 41h Wait for External Event
  8.                *(ah) = 42h Request system power off (system suspend)
  9.                *(ah) = 43h Read current system status information
  10.                *(ah) = 44h Modem power on/off
  11.                 (ah) = 4fh keyboard intercept  (null)
  12.                 (ah) = 80h reserved
  13.                 (ah) = 81h reserved
  14.                 (ah) = 82h reserved
  15.                 (ah) = 83h Event Wait
  16.                 (ah) = 84h joystick support
  17.                 (ah) = 85h system request key pressed
  18.                 (ah) = 86h wait
  19.                 (ah) = 87h Block Move
  20.                 (ah) = 88h Extended Memory Size Determined
  21.                 (ah) = 89h Switch Processor to Protected Mode
  22.                 (ah) = 90h device busy
  23.                 (ah) = 91h interrupt complete
  24.                 (ah) = c0h return system configuration parameters
  25.                 (ah) = c1h Return extended BIOS data area segment address
  26.                 (ah) = c2h Pointing device BIOS interface
  27.                 (ah) = c3h Fail_save timer/Watchdog timeout(EISA/PS2 only)
  28.                 (ah) = d8h R/W slot configuration from COMS (EISA only)
  29.  
  30.       NOTE:
  31.            1. Function AH = 40 - 44h is supported by Acer Laptop machine.
  32.            2. Function C3h is fail_save timer on EISA and is watchdog 
  33.               time-out on Acer 1080 model (PS/2).
  34.            3. Function D8h is supported on EISA model only.
  35.            4. To support external event wait function, the feature
  36.               information byte (offset = 05h)of system configuration
  37.               table must set bit 3 = 1. ( refer to system configuration
  38.               table )
  39.            5. The Acer extened function include setup, speed control, 
  40.               shadow RAM control, and return system model ID is supported
  41.               by function C0h. ( refer to function C0h )
  42.  
  43. b. Reference BIOS data area:
  44.  
  45.         40:67   Offset  of shutdown address(user program)
  46.         40:69   Segment of shutdown address(user program)
  47.         40:98   offset of user wait flag
  48.         40:9a   segment of user wait flag
  49.         40:9c   low word of user wait count
  50.         40:9e   high word of user wait count
  51.         40:a0   wait active flag
  52.  
  53. c. I/O port defined:
  54.  
  55.           60         Input/Output Buffer for Keyboard and Auxiliary 
  56.                      Device
  57.  
  58.           64         8042 Command/Status Port (WRITE/READ)
  59.  
  60.           61 (write) Syatem control port
  61.                      bit 7-4  Reserved
  62.                      bit 3 -- Enable Channel check (0)
  63.                      bit 2 -- Enable  Parity check (0)
  64.                      bit 1 -- Speaker data enable (1)
  65.                      bit 0 -- Enable Timer 2 gate to speaker (1)
  66.  
  67.           61 (read)  Syatem control port B
  68.                      bit 7 -- Parity  check error occurs (1)
  69.                      bit 6 -- Channel check error occurs (1)
  70.                      bit 5 -- Timer 2 output
  71.                      bit 3 -- Channel check enabled (0)
  72.                      bit 2 -- Parity  check enabled (0)
  73.                      bit 1 -- Speaker data enabled (1)
  74.                      bit 0 -- Timer 2 gate to speaker
  75.  
  76.           201        Game port
  77.  
  78.  
  79. d. Function:
  80.  
  81. READ/MODIFY PROFILE
  82.                                                   (1100LX Laptop model)
  83.       Description:
  84.          This function is used to read and modify system profile 
  85.          information. It is supported only for Acer 1100LX laptop 
  86.          systems to get or modify the status of modem available on 
  87.          battery used, low battery, power saving, and sleep mode 
  88.          enable or disable. It supports also to get or change the 
  89.          inactive timer of Hard Disk, LCD, and Standby mode if the
  90.          system supports these function.
  91.  
  92.          input:
  93.                 AH = 40h                           
  94.  
  95.                 AL = 00h Read system profile
  96.                    output:
  97.                        CX,BX -- contains system profile information
  98.  
  99.                 AL = 01h Modify system profile
  100.                    input:
  101.                        CX,BX -- contains system profile information
  102.  
  103.                 AL = 02h Read modem profile
  104.                    output:
  105.                        CX,BX -- contains system profile information
  106.  
  107.                 AL = 03h Modify modem profile
  108.                    input:
  109.                        CX,BX -- contains system profile information
  110.  
  111.          output: for all
  112.                 AL -- 00 Operation successfully completed
  113.                       80 Profile execution failed
  114.  
  115.                 CF -- 0 Operation successfully completed
  116.                       1 Profile execution failed
  117.  
  118.       Reference : 
  119.            Index Register in CMOS
  120.  
  121.                  11h     Modem Profile Information
  122.                          Bit    Meaning
  123.                          7 - 6  Reserved
  124.                          5  --  0 = Manual answer
  125.                                 1 = auto answer
  126.                          4 - 2  Parity / Framing
  127.                          1 - 0  Data rate
  128.  
  129.       -- To be continue --
  130.  
  131.                  13h     System Profile Information
  132.                          Bit    Meaning
  133.                          7  --  Modem available on battery
  134.                          6  --  Low battery warning enable
  135.                          5  --  Power saving enable
  136.                          4  --  Sleep mode enable
  137.                          3 - 0  reserved
  138.                  1bh     Hard disk inactive time (in minute)
  139.                  1ch     Screen inactive time (in minute)
  140.                  1dh     System standby time (in minute)
  141.  
  142.                 BH :
  143.                     Bit    Meaning
  144.                      7  --  Modem available on battery
  145.                      6  --  Low battery warning enable
  146.                      5  --  Power saving enable
  147.                      4  --  Standby enable
  148.                      3 - 0  reserved
  149.                 BL : Hard disk inactive time (in minutes, 0 disable power
  150.                      off) 
  151.                 CH : Screen inactive time (in minutes, 0 disable power off)
  152.                 CL : System standby time (in minute, 0 disable power off)
  153.  
  154.  
  155.  
  156. REQUEST SYSTEM POWER_OFF (Sleep Mode)
  157.                                                       (1100LX Laptop model)
  158.  
  159.       Description:
  160.          This routine forces the system into standby mode. 
  161.  
  162.         input:
  163.                 ah = 42h
  164.  
  165.                 AL  = 01h - Force system into standby mode
  166.  
  167.         output:
  168.                 The system in standby mode
  169.  
  170.  
  171. SYSTEM STATUS SERVICES
  172.                                                      (1100LX Laptop model)
  173.     Description:
  174.       1.This routine returns the current system status in the AL register 
  175.         as defined below.
  176.  
  177.         input:
  178.                 ah = 43h
  179.         output:
  180.                 AL - Contains system status as follows:
  181.                 ---------------------------------
  182.                 │ 7 │ 6 │ 5 │ 4 │ 3 │ 2 │ 1 │ 0 │
  183.                 ---------------------------------
  184.                   │   │   │   │   │   │   │   │
  185.                   │   │   │   │   │   │   │   ----> LCD detached
  186.                   │   │   │   │   │   │   ----> Reserved
  187.                   │   │   │   │   │   ----> Reserved
  188.                   │   │   │   │   ----> MODEM power on
  189.                   │   │   │   ----> Power activated by RTC alarm
  190.                   │   │   ----> Sleep mode power lost (RTC time bad)
  191.                   │   ----> Operating on external power
  192.                   ----> Low battery
  193.  
  194.  
  195.  
  196. MODEM POWER SERVICES
  197.                                            ( For 1100LX Laptop model )
  198.     Description:
  199.       1.This procedure turns on or off the MODEM
  200.  
  201.         input:
  202.                 ah = 44h
  203.                 al = 00h  - Power off internal MODEM
  204.                      01h  - Power on internal MODEM
  205.         output:
  206.                 al = 00 - successful
  207.                      80 - not successful
  208.                 CF = 0 - successful
  209.                      1 - not successful
  210.  
  211.  
  212. KEYBOARD INTERCEPT              (NULL)
  213.     Description:
  214.       This function is not supported as yet.
  215.  
  216.         input:
  217.                 (ah) = 4fh
  218.         output:
  219.                 (cy) = 1
  220.                 (ah) = 86h
  221.                 (al) = scan code
  222.  
  223.  
  224. DEVICE OPEN             (NULL)
  225.     Description:
  226.       This function is not supported as yet.
  227.  
  228.         input:
  229.                 (ah) = 80h
  230.                 (bx) = device  ID
  231.                 (cx) = process ID
  232.  
  233.         output:
  234.                 (cy) = 1
  235.                 (ah) = 80h
  236.  
  237.  
  238. DEVICE CLOSE            (NULL)
  239.     Description:
  240.       This function is not supported as yet.
  241.  
  242.         input:
  243.                 (ah) = 81h
  244.                 (bx) = device  ID
  245.                 (cx) = process ID
  246.  
  247.         output:
  248.                 (cy) = 1
  249.                 (ah) = 81h
  250.  
  251.  
  252. PROGRAM TERMINATION             (NULL)
  253.     Description:
  254.       This function is not supported as yet.
  255.  
  256.         input:
  257.                 (ah) = 82h
  258.                 (bx) = device  ID
  259.         output:
  260.                 (cy) = 1
  261.                 (ah) = 82h
  262.  
  263.  
  264.  
  265.  
  266. EVENT WAIT
  267.     Description :
  268.       1.This routine is supported for the user to set a time interval,
  269.         and it will set the given data into BIOS data area respectively
  270.         if this function is not busy. There is a hardware RTC interrupt
  271.         occurs periodically and decounts the time interval. When the time
  272.         interval expires, the hardware RTC interrupt sets flag into the
  273.         byte assigned by the user. In this way, the user can know whether
  274.         the time is up by scanning the flag contiguously, and do something
  275.         he wants to do at that time.
  276.       2.If the user have called this function previosly and the time 
  277.         interval dose not expire yet, he calls this routine once more,
  278.         then this routine will do nothing but set carry flag and return,so
  279.         he will receive 'function busy' message in the return carry flag.
  280.       3.When the user issues "Cancel set interval" function, the busy flag
  281.         is cleared, and the user can perform "Set interval" function and
  282.         don't care whether the previous time interval expires or not.
  283.  
  284.        input:
  285.                 (ah) = 83h
  286.                 (al) = 00h Set interval
  287.                 CX,DX -- Time interval in microseconds
  288.                          (Granularity is 976 microseconds, CX is high word
  289.                          and DX is low word. If CX = 0012h and DX = 3456h,
  290.                          the time interval is Hex 123456 microseconds.)
  291.                 ES:BX -- Pointer to byte that caller wants to set
  292.                          flag at the most significant bit after
  293.                          time interval expires.
  294.        output:
  295.                 CF = 0 -- Operation is successfully completed
  296.                    = 1 -- Function busy, operation is unsuccessful
  297.  
  298.        input:
  299.                 (ah) = 83h
  300.                 (al) = 01h Cancel set interval
  301.        output:
  302.                 CF = 0 -- Operation is successfully completed
  303.                    = 1 -- Function busy, operation is unsuccessful
  304.  
  305.        input:
  306.                 (ah) = 83h
  307.                 (al) > 01h Illegal function
  308.        output:
  309.                 CF = 1
  310.  
  311.  
  312. JOYSTICK SUPPORT
  313.  
  314.                description:
  315.                         This routine supports an interface between
  316.                         joystick and system.
  317.        input:
  318.                 (ah) = 84h
  319.                 (dx) = 0  read current switch settings
  320.        output:
  321.                 (cy) = 1 if invalid call
  322.                 (al) = switch setting (bit 7-4)
  323.  
  324.        input:
  325.                 (ah) = 84h
  326.                 (dx) = 01H read resistive inputs
  327.        output:
  328.                 (cy) = 1 if invalid call
  329.                 (ax) = A(x) value
  330.                 (bx) = B(x) value
  331.                 (cx) = C(x) value
  332.                 (dx) = D(x) value
  333.  
  334.  
  335.                 
  336. SYSTEM REQUEST KEY PRESSED             (NULL)
  337.     Description:
  338.       This function is not supported as yet.
  339.  
  340.         input:
  341.                 (ah) = 85h
  342.         output:
  343.                 (cy) = 1
  344.                 (ah) = 86h
  345.  
  346.  
  347.  
  348. WAIT
  349.     Description:
  350.       This routine will perform "wait" until the given time expires.
  351.  
  352.         input:
  353.                 (ah) = 86h
  354.                 (cx,dx) = number of microseconds to elapse before
  355.                           return  to caller
  356.         output:
  357.                 CF = 0 -- Operation is successfully completed
  358.                    = 1 -- Function busy, operation is unsuccessful
  359.  
  360.  
  361. BLOCK MOVE
  362.     Description:
  363.       1.This function will help you to move a block of memory below 1M
  364.         up to memory above 1M.
  365.       2.The prerequsite to access the memory above 1M is entering
  366.         into protected mode, so the user must prepare a GDT table when
  367.         calling this function.
  368.       3.To return to real mode, the shutdown 9 should be issued after move
  369.         block function is completed.
  370.  
  371.         input:
  372.                 (ah) = 87h
  373.                 (cx) = word count of this block
  374.                 ES:SI -- pointer to GDT (Global Descripter Table)
  375.         output:
  376.                 (ah) = 00h -- Operation successfully completed
  377.                 (ah) = 01h -- RAM parity error
  378.                 (ah) = 02h -- Unexpected exception occur
  379.                 (ah) = 03h -- Gate A20 address line failed
  380.  
  381.         The GDT is defined as follows:
  382.                             ┌─────────┐
  383.                             v         │
  384.            ES:SI ──── ┌─────┴─────┐   │
  385.                       │           │   │
  386.                       │  Dummy    │   │
  387.                       │           │   │
  388.                   +08 ├───────────┤   │
  389.                       │           │   │
  390.                       │   GDT     │   │
  391.                       │ Location  ├───┘
  392.                   +10 ├───────────┤
  393.                       │           │
  394.                       │  Source   │
  395.                       │  Entry    │
  396.                   +18 ├───────────┤
  397.                       │           │
  398.                       │  Target   │
  399.                       │  Entry    │
  400.                   +20 ├───────────┤
  401.                       │           │
  402.                       │  BIOS     │
  403.                       │   CS      │
  404.                   +28 ├───────────┤
  405.                       │           │
  406.                       │   SS      │
  407.                       │           │
  408.                       └───────────┘
  409.  
  410.       -- To be continue --
  411.  
  412.         . Every entry contains 8 bytes.
  413.         . The 1'st entry supported by the user must be initialized to 0.
  414.         . The 2'nd entry, initialized to 0 by the user and modified by
  415.           the BIOS, points to the GDT (Global Descriptor Table).
  416.         . The 3'rd entry, initialized by the user, points to the source
  417.           to be moved.
  418.         . The 4'rd entry, initialized by the user, points to the 
  419.           destination to be moved.
  420.         . The 5'th entry, initialized to 0 by the user and modified by
  421.           the BIOS, points to the protected mode code segment.
  422.         . The 6'th entry, initialized to 0 by the user and modified by
  423.           the BIOS, points to the protected mode stack segment.
  424.  
  425.         Note:
  426.              1. All interrupts (including NMI) are disable when this 
  427.                 routine is moving block.
  428.              2. A20 must be activated (=1) when it enters protected mode,
  429.                 and disactivated when it shutdown.
  430.  
  431.  
  432. EXTENDED MEMORY SIZE DETERMINED
  433.     Description:
  434.       This function will retern the memory size above 1M, as determined by
  435.       the POST.
  436.  
  437.         input:
  438.                 ah = 88h
  439.         output:
  440.                 ax = contiguous 1KB blocks of memory available above 1M
  441.  
  442.  
  443. SWITCH PROCESSOR TO PROTECTED MODE
  444.     Description:
  445.       This function supports the user to switch the processor from real 
  446.       mode into protected mode. Upon completion, the processor is in 
  447.       protected mode and control is transferred to the code segment 
  448.       specified by the user.
  449.  
  450.         input:
  451.                 ah = 89h
  452.                 bh = index of interrupt level 1
  453.                 bl = index of interrupt level 2
  454.                 ES:SI -- pointer to GDT
  455.         output:
  456.                 ah = 00h operation successfully completed
  457.         The GDT is defined as follows:
  458.                             ┌─────────┐
  459.                             v         │
  460.            ES:SI ──── ┌─────┴─────┐   │
  461.                       │           │   │
  462.                       │  Dummy    │   │
  463.                       │           │   │
  464.                   +08 ├───────────┤   │
  465.                       │           │   │
  466.                       │   GDT     │   │
  467.                       │ Location  ├───┘
  468.                   +10 ├───────────┤
  469.                       │           │
  470.                       │   IDT     │
  471.                       │ LOCATION  │
  472.                   +18 ├───────────┤
  473.                       │           │
  474.                       │  user DS  │
  475.                       │           │
  476.                   +20 ├───────────┤
  477.                       │           │
  478.                       │  user ES  │
  479.                       │           │
  480.                   +28 ├───────────┤
  481.                       │           │
  482.                       │  user SS  │
  483.                       │           │
  484.                   +30 ├───────────┤
  485.                       │           │
  486.                       │  user CS  │
  487.                       │           │
  488.                   +38 ├───────────┤
  489.                       │           │
  490.                       │  BIOS CS  │
  491.                       │           │
  492.                       └───────────┘
  493.     -- To be continue --
  494.  
  495.         . Every entry contains 8 bytes.
  496.         . The 1'st entry supported by the user must be initialized to 0.
  497.         . The 2'nd entry, initialized the user, points to the GDT.
  498.         . The 3'rd entry, initialized by the user, points to the user
  499.           defined IDT (Interrupt Descriptor Table).
  500.         . The 4'rd entry, initialized by the user, points to the user DS.
  501.         . The 5'th entry, initialized by the user, points to the user ES.
  502.         . The 6'th entry, initialized by the user, points to the user SS.
  503.         . The 7'th entry, initialized by the user, points to the user CS.
  504.         . The 8'th entry, build by the BIOS, points to the BIOS code
  505.           segment and can be reused by the user.
  506.  
  507.  
  508. DEVICE BUSY
  509.     Description:
  510.       This routine is called to indicate that a device is busy. For the
  511.       device type = diskette,  a return is not made until a diskette  
  512.       interrupt has been  received or 2 seconds have elapsed ( whichever
  513.       is first ). For the device type = keyboard a return will not be made
  514.       until the keyboard buffer is in a not empty condition.
  515.  
  516.         input:
  517.                 (ah) = 90h
  518.                 (al) = type code
  519.                      = 00 - Disk (time-out)
  520.                      = 01 - Diskette (time-out)
  521.                      = 02 - Keyboard (no time-out)
  522.                      = 03 - Pointing device (no time-out)
  523.                      = 80 - Network (no time-out)
  524.                              (ES:BX) = Network control block(NCB)
  525.                      = FD - Wait for motor startup
  526.                      = FE - Printer (time-out)
  527.         output:
  528.                 (cy) = 0
  529.                 (ah) = 90h
  530.  
  531.  
  532.  
  533. INTERRUPT CPMPLETE
  534.     Description:
  535.       This function is not supported as yet.
  536.  
  537.         input:
  538.                 (ah) = 91h
  539.  
  540.         output:
  541.                 (ah) = 91h
  542.                 (cy) = 1
  543.  
  544.  
  545. RETURN SYSTEM CONFIGURATION PARAMETERS
  546.     Description:
  547.       This routine will tell you the information about the model of this
  548.       machine, the BIOS revision level, and some hardware feature.
  549.  
  550.         input:
  551.                 (ah) = c0h
  552.         output:
  553.                 (ah) = 0
  554.                 (es:bx) = pointer to system descriptor vector in ROM
  555.                 (cy) = 0
  556.  
  557.        Output: AH = 0
  558.                ES:BX -- system configuration parameter table
  559.                CF = 0
  560.  
  561.                 System descriptor table:
  562.  
  563.       offset    size    description
  564.      ---------------------------------------------------------------------
  565.         00h     word    length of descriptor in bytes (minimum is 8 bytes)
  566.         02h     byte    model byte   
  567.                            XT             = 0FEh
  568.                            XT             = 0FBh
  569.                            AT             = 0FCh
  570.                            XT 286         = 0FCh
  571.                            PC Convertible = 0F9h
  572.                            PS/2 80        = 0F8h
  573.                            Unknow system  = 0FFh
  574.         03h     byte    Submodel byte 
  575.                            XT             = 00h
  576.                            AT             = 01h
  577.                            XT 286         = 02h
  578.                            PC Convertible = 00h
  579.                            PS/2 80        = 00h
  580.                            Unknow system  = 0FFh
  581.         04h     byte    BIOS revision level (= 00h)
  582.         05h     byte    feature information byte 1 (= 0f6h)
  583.                         bit 7   = 1 Fixed disk BIOS uses DMA channel 3
  584.                         bit 6   = 1 two interrupt controller
  585.                         bit 5   = 1 real-time clock present
  586.                         bit 4   = 1 keyboard escape sequence (INT 15)call 
  587.                                     in keyboard interrrupt(INT 09)
  588.                         bit 3   = 0 wait for external event not support
  589.                         bit 2   = 1 extended BIOS data area is allocated
  590.                         bit 1   = 1 microchannel implemented
  591.                         bit 0   = 0 reserved
  592.  
  593.  
  594.  
  595.        -- to be continued --
  596.  
  597.         06h     byte    feature information byte 2 - reserved = 0
  598.         07h     byte    feature information byte 3 - reserved = 0
  599.         08h     byte    feature information byte 4 - reserved = 0
  600.         09h     byte    feature information byte 5 - reserved = 0
  601.       0Ah     byte    'ACER                      ' ACER mark for extend
  602.                                                      function
  603.         24h     byte    '80X86 ACER BIOS VX.XX' ---> BIOS title
  604.         39h     byte    '.XXXXX.XX' ---------------> Model ID     
  605.         42h     byte    0,'XXX' -------------------> CPU type 
  606.         46h     byte    'XX' ----------------------> Max speed of processor
  607.  
  608.  
  609.  
  610. ACER EXTENSIVE FUNCTION
  611.  
  612.         input:
  613.               AH  = 0C0h
  614.               CX:DX = 'ACER'  ---> Acer mark
  615.                BX = 0  -- get bios message table
  616.                           return ES:BX - pointer of BIOS message table
  617.              
  618.                           BIOS message table:
  619.                           offset    size    description
  620.                          --------------------------------------------
  621.                             00h     byte    BIOS ID
  622.                             03h     byte    Sub ID of BIOS
  623.                             04h     byte    CPU type    ex. i386 = 80386
  624.                             0Ah     byte    Maxinum speed of processor
  625.                             0Ch     byte    Version no. of BIOS    
  626.                             11h     byte    Release date of BIOS
  627.                             19h     byte    Reserved = 0
  628.  
  629.                     1  -- setup
  630.                     2  -- get/set system speed
  631.                           AL = 0 -- get current system speed
  632.                            return : AL = 0 -- low spped
  633.                                        = 1 -- high speed
  634.                           AL = 1 -- set high speed
  635.                           AL = 2 -- set low speed
  636.                           AL = 3 -- toggle speed
  637.                     3  -- enable/disable RAM BIOS
  638.                           AL = 0 -- enable RAM BIOS
  639.                           AL = 1 -- disable RAM BIOS
  640.                     4  -- setup (For ICL issue setup under OS/2)
  641.                     5  -- return Acer model ID
  642.                           return : ES:BX = pointer of Acer Model ID 
  643.  
  644.                           Model ID format :
  645.                               byte 0 - 2 = OEM ID     
  646.                                    3,4   = Model
  647.  
  648.  
  649.  
  650. POINTING DEVICE
  651.      Description:
  652.        This function supports envirnment establishing for pointing device
  653.        (such as "MOUSE"). It can facilitate the system programmer to
  654.        implement a MOUSE driver.
  655.  
  656.        When the device driver is called the following information is on
  657.        the stack (each entry is word length):
  658.  
  659.        entry   description
  660.        -------------------------------------------------------
  661.        1       status(high byte = 0)
  662.                low byte is defined as :
  663.                bit 7   1 = Y data overflow
  664.                bit 6   1 = X data overflow
  665.                bit 5   Y data, 1 = negative
  666.                bit 4   X data, 0 = positive
  667.                bit 3,2 reserved
  668.                bit 1   1 = right button pressed
  669.                bit 0   1 = left  button pressed
  670.        2       X data (high byte = 0)
  671.                low byte bit 7 MSB, bit 0 LSB
  672.        3       Y data (high byte = 0)
  673.                low byte bit 7 MSB, bit 0 LSB
  674.        4       Z data (high byte = 0)
  675.                low byte = 0.
  676.  
  677. Note:
  678.        For all functions of the pointing device, the output is as follows:
  679.                (cy) = 0 -- operation successfully completed
  680.                     = 1 -- unsuccesful operation
  681.                (ah) = status
  682.                        00 - no error
  683.                        01 - invalid function call
  684.                        02 - invalid function input
  685.                        03 - error
  686.                        04 - reserved
  687.                        05 - no far call installed
  688.                        06 - reserved
  689.  
  690.         ENABLE OR DISABLE POINTING DEVICE
  691.         input:
  692.                 (ah) = c2h
  693.                 (al) = 0
  694.                 (bh) = 0        disable the pointing device
  695.                      = 1        enable  the pointing device
  696.                      > 1        Invalid function call
  697.         output: See the note as described above.
  698.  
  699.  
  700.        -- to be continued --
  701.  
  702.         RESET POINTING DEVICE
  703.         input:
  704.                 (ah) = c2h
  705.                 (al) = 1
  706.         output: See the note as described above.
  707.                 bx = device ID if operation is successful
  708.         Note :
  709.               After being reseted, the pointing device situation is
  710.               described as following:
  711.               . It is disabled unless the flag of pointing device
  712.                 interface initialization sets.
  713.               . Sample rate at 100 reports/sec
  714.               . Resolution at 4 counts/milimeter
  715.               . Scaling at 1 to 1
  716.               . Package size remain unchanged
  717.  
  718.         SET SAMPLE RATE
  719.         input:
  720.                 (ah) = c2h
  721.                 (al) = 2
  722.                 (bh) = rate value
  723.                      = 0   - 10 reports/sec
  724.                      = 1   - 20 reports/sec
  725.                      = 2   - 40 reports/sec
  726.                      = 3   - 60 reports/sec
  727.                      = 4   - 80 reports/sec
  728.                      = 5   -100 reports/sec
  729.                      = 6   -200 reports/sec
  730.                      > 6   -Invalid input
  731.  
  732.         output: See the note as described above.
  733.  
  734.         SET RESOLUTION
  735.         input:
  736.                 (ah) = c2h
  737.                 (al) = 3
  738.                 (bh) - resolution value
  739.                      = 0    - 1 count /mm
  740.                      = 1    - 2 counts/mm
  741.                      = 2    - 4 counts/mm
  742.                      = 3    - 8 counts/mm
  743.                      > 3    - Invalid input
  744.         output: See the note as described above.
  745.  
  746.         READ DEVICE TYPE
  747.         input:
  748.                 (ah) = c2h
  749.                 (al) = 4
  750.         output: See the note as described above.
  751.                 If operation is successfully completed then
  752.                 (bh) = device ID
  753.  
  754.        -- to be continued --
  755.  
  756.         INITIALIZATION
  757.         input:
  758.                 (ah) = c2h
  759.                 (al) = 5
  760.                 (bh) - data package size
  761.                      = 1    -  1 byte
  762.                      = 2    -  2 bytes
  763.                      = 3    -  3 bytes
  764.                      = 4    -  4 bytes
  765.                      = 5    -  5 bytes
  766.                      = 6    -  6 bytes
  767.                      = 7    -  7 bytes
  768.                      = 8    -  8 bytes
  769.                      > 8    -  Invalid input
  770.  
  771.         output: See the note as described above.
  772.                 The pointing device state is as follows:
  773.                 . Disabled
  774.                 . Sample rate at 100 reports/sec
  775.                 . Resolution at 4 counts/milimeter
  776.                 . Scaling at 1 to 1
  777.  
  778.         EXTENDED COMMAND
  779.         input:
  780.                 (ah) = c2h
  781.                 (al) = 6
  782.                 (bh) = 0      return status
  783.  
  784.         output: See the note as described above.
  785.  
  786.                 If operation is successfully completed then
  787.                 (bl) - status byte 1
  788.                         bit 7 = 0 - reserved
  789.                         bit 6 = 0 - stream mode
  790.                               = 1 - remote mode
  791.                         bit 5 = 1 - pointer enable
  792.                         bit 4 = 0 - 1:1 scaling
  793.                               = 1 - 2:1 scaling
  794.                         bit 3 = 0 - reserved
  795.                         bit 2 = 1 - left butten pressed
  796.                         bit 1 = 0 - reserved
  797.                         bit 0 = 1 - right butten pressed
  798.                 (cl) - status byte 2
  799.                         00  - 1 count /mm
  800.                         01  - 2 counts/mm
  801.                         02  - 4 counts/mm
  802.                         03  - 8 counts/mm
  803.  
  804.        -- to be continued --
  805.  
  806.                 (dl) - status byte 3
  807.                         0a  - 10 reports/sec
  808.                         14  - 20 reports/sec
  809.                         2b  - 40 reports/sec
  810.                         3c  - 60 reports/sec
  811.                         50  - 80 reports/sec
  812.                         64  -100 reports/sec
  813.                         c8  -200 reports/sec
  814.         input:
  815.                 (ah) = c2h
  816.                 (al) = 6
  817.                 (bh) = 1      set scaling to 1:1
  818.         output: See the note as described above.
  819.  
  820.         input:
  821.                 (ah) = c2h
  822.                 (al) = 6
  823.                 (bh) = 2      set scaling to 2:1
  824.         output: See the note as described above.
  825.  
  826.         input:
  827.                 (ah) = c2h
  828.                 (al) = 6
  829.                 (bh) > 2      Illegal function call
  830.         output: See the note as described above.
  831.  
  832.  
  833.         DEVICE DRIVER FAR CALL
  834.         input:
  835.                 (ah) = c2h
  836.                 (al) = 7
  837.                 (es) = segment pointer
  838.                 (bx) = offset  pointer
  839.         output:
  840.                 none
  841.  
  842.         If BIOS has the device driver and INT 15H is issued to set the
  843.         segment and offset of the device driver far call, the folowing
  844.         information is available on the stack:
  845.                 status - first  word pushed on the stack
  846.                 X data - second word pushed on the stack
  847.                 Y data - third  word pushed on the stack
  848.                 Z data - fourth word pushed on the stack
  849.  
  850.        -- to be continued --
  851.  
  852.     Programming:
  853.         1. Command 8042 to write to auxiliary device (Command byte = 0D4h)
  854.  
  855.         2. Output pointing device command defined as below :
  856.            pointing device command:
  857.                 0f4h   ----> enable  mouse
  858.                 0f5h   ----> disable mouse
  859.                 0ffh   ----> reset   mouse
  860.  
  861.                 0f3h   ----> set sample rate
  862.                       next command:
  863.                       00ah --- 10 reports per second
  864.                       014h --- 20 reports per second
  865.                       028h --- 40 reports per second
  866.                       03ch --- 60 reports per second
  867.                       050h --- 80 reports per second
  868.                       064h --- 100 reports per second
  869.                       0c8h --- 200 reports per second
  870.  
  871.                 0f2h   ----> read ID
  872.  
  873.                 0e9h   ----> return status
  874.                 0e6h   ----> set scaling to 1:1
  875.                 0e7h   ----> set scaling to 2:1
  876.  
  877.                 0e8h   ----> set resolution
  878.                      next command:
  879.                       000h  --- 1 count  per millimeter
  880.                       001h  --- 2 counts per millimeter
  881.                       002h  --- 4 counts per millimeter
  882.                       003h  --- 8 counts per millimeter
  883.  
  884.  
  885.  
  886. WATCHDOG TIME-OUT (PS/2 only)
  887.     Description:
  888.       This routine will enable/disabl watchdog time-out
  889.  
  890.         input:
  891.                 (ah) = c3h
  892.                 (al) = 0 -- disable fail save timer
  893.                 (al) = 1 -- enable fail save timer
  894.                      (bx) -- timer value
  895.         output:
  896.                 (cy) = 0 -- successful
  897.                 (cy) = 1 -- unsuccessful
  898.  
  899. FAIL_SAVE TIMER  (for EISA only)
  900.     Description:
  901.       This routine will enable/disabl fail_save timer
  902.  
  903.         input:
  904.                 (ah) = c3h
  905.                 (al) = 0 -- disable fail save timer
  906.                 (al) = 1 -- enable fail save timer
  907.                      (bx) -- timer value
  908.         output:
  909.                 (cy) = 0 -- successful
  910.                 (cy) = 1 -- unsuccessful
  911.  
  912.       NOTE :
  913.              Watchdog time-out is supported by Acer 1080
  914.              Fail save timer is supported by Acer EISA486
  915.  
  916.  
  917. RESERVED        (NULL)
  918.         input:
  919.                 (ah) = 00h - 03h
  920.                        06h - 20h
  921.                        22h - 4eh
  922.                        50h - 7fh
  923.                        8Ah - 8Fh
  924.                        92h - BFh
  925.                        C4h - D7h
  926.                        D9h - FFh
  927.         output:
  928.                 (cy) = 1
  929.                 (ah) = 86h - Invalid function
  930.  
  931.  
  932. R/W SLOT CONFIGURATION FROM CMOS (EISA only)
  933.  
  934.          There are 4 subfunction for EISA system to support automatic 
  935.     hardware configuration in this function. Both subfunction 02h and 
  936.     03h are called by setup utility to initialize CMOS. One routine 
  937.     clears CMOS and the other stores configuration information into 
  938.     CMOS. Device drivers and the POST routine use other subfunctions 
  939.     to retrieve configuration information from CMOS. One subfunction
  940.     returnss a subset of the configuration information stored in CMOS 
  941.     for one expansion board. The other subfunction returns all the
  942.     configuration information about one expansion board function.
  943.  
  944.          This function is bimodal (real or protected mode) and may be 
  945.     called for execution as 32- or 16-bit code. So this function must be 
  946.     adhere to the following conventions when you implement.
  947.          *  Do not perform any segment register-dependent operations (all
  948.             branch instructions are relative to the instruction pointer)
  949.          *  Do not change the segment registers(including the code segment)
  950.          *  Return to calling routine with the interrupt flag numodified.
  951.          *  Do not use privileged instructions (LMSW, LSL, etc)
  952.          *  Do not write data using a code segment (CS) override
  953.  
  954.  Subfunction 00h : Read slot configuration information
  955.          This subfunction reads a subset of the configuration for one slot
  956.     from CMOS. The subfunction returns a summary that includes all functions
  957.     of expansion board.
  958.  
  959.          input:
  960.                 (ah) = d8h
  961.                 (al) = 00h (If CS and DS specify 16-bit addressing and data
  962.                             size)
  963.                 (al) = 80h (If CS and DS specify 32-bit addressing and data
  964.                             size)
  965.                 (cl) = slot No (including embedded and virtual devices)
  966.  
  967.          output:
  968.                 (ah) = 00h - Successful completion; Carry Flag = 0.
  969.                      = 80h - Invalid slot No; Carry Flag = 1.
  970.                      = 82h - CMOS corrupt; Carry Flag = 1.
  971.                      = 83h - Empty slot; Carry Flag = 1.
  972.                      = 86h - Invalid BIOS routine call; Carry Flag = 1.
  973.                      = 87h - Invalid system configuration; Carry Flag = 1.
  974.                              (Even though this error occurs, the data is
  975.                               returned in AL)
  976.  
  977.                 -- to be continued --
  978.  
  979.                 (al) =
  980.                    bit 0-3 - Duplicate ID No.
  981.                                (This nibble indicates which CFG file is 
  982.                                loaded when duplicate file names are 
  983.                                present.)
  984.  
  985.                                0000 if no duplicate ID.
  986.                                0001 if 1st duplicate ID.
  987.                                ...
  988.                                1111 if 15th duplicate ID.
  989.                     bit 4,5 - Slot type.
  990.                                00 = Expansion slot.
  991.                                01 = Embedded device.
  992.                                10 = Virtual device.
  993.                                11 = Reserved.
  994.                     bit 6   - Product ID.
  995.                                0 = readable
  996.                                1 = not readable
  997.                     bit 7   - Duplicate ID
  998.                                0 = No duplicate ID.
  999.                                1 = Duplicate IDs.
  1000.  
  1001.                  (bh) = Major revision level of setup utility.
  1002.                  (bl) = Minor revision level of setup utility.
  1003.                  (ch) = Checksum (MSB) of configuration file.
  1004.                  (cl) = Checksum (LSB) of configuration file.
  1005.                  (dl) = Combined function information byte
  1006.                     bit 0 - slot has one or more function type definition
  1007.                     bit 1 - slot has one or more memory entries
  1008.                     bit 2 - slot has one or more interrupt (IRQ) entries
  1009.                     bit 3 - slot has one or more DMA entries
  1010.                     bit 4 - slot has one or more port range entries
  1011.                     bit 5 - slot has one or more port initialization entries
  1012.                     bit 6,7 - reserved
  1013.                   (di & si) = Four byte compressed ID
  1014.                               di (lsb) = byte 0
  1015.                               di (msb) = byte 1
  1016.                               si (lsb) = byte 2
  1017.                               si (msb) = byte 3
  1018.  
  1019.                 -- to be continued --
  1020.  
  1021.  Subfunction 01h : Read function configuration information
  1022.          This subfunction reads all the configuration information for one
  1023.     expansion board fuction. This routine transfers the data block that
  1024.     contains the configuration information for the expansion board function
  1025.     from CMOS.
  1026.  
  1027.          input:
  1028.                 (ah) = d8h
  1029.                 (al) = 01h (If CS and DS specify 16-bit addressing and data
  1030.                             size)
  1031.                 (al) = 81h (If CS and DS specify 32-bit addressing and data
  1032.                             size)
  1033.                 (cl) = slot No (including embedded and virtual devices)
  1034.                 (ds) = segment for return data buffer
  1035.                 (si) = offset to return data buffer (16-bit call)
  1036.                 (esi) = offset to return data buffer (32-bit call)
  1037.  
  1038.          output:
  1039.                 (ah) = 00h - Successful completion; Carry Flag = 0.
  1040.                      = 80h - Invalid slot No; Carry Flag = 1.
  1041.                      = 81h - Invalid function number; Carry Flag = 1.
  1042.                      = 82h - CMOS corrupt; Carry Flag = 1.
  1043.                      = 83h - Empty slot; Carry Flag = 1.
  1044.                      = 86h - Invalid BIOS routine call; Carry Flag = 1.
  1045.                      = 87h - Invalid system configuration; Carry Flag = 1.
  1046.                              (Even though this error occurs, the data is
  1047.                               returned in AL)
  1048.  
  1049.  
  1050.                 -- to be continued --
  1051.  
  1052.    Configuration data block structure
  1053.       The 320-byte data block pointed to by DS:SI contains one expansion
  1054.     board function's configuration information. The field sizes of the data
  1055.     block are fixed sizes. The 320-byte data block structure as follow:
  1056.  
  1057. ┌─────────────────────────────────────────────────────────────────────────┐
  1058. │                  Four-byte Compressed ID                 Total bytes = 4│
  1059. │                                                          Offset = 00h   │
  1060. │ Byte 0                                                                  │
  1061. │    bit 7         reserved=0                                             │
  1062. │    bit 6-2       Character 1                                            │
  1063. │    bit 1-0       Character 2                                            │
  1064. │ Byte 1                                                                  │
  1065. │    bit 7-5       Character 2                                            │
  1066. │    bit 4-0       Character 3                                            │
  1067. │ Byte 2                                                                  │
  1068. │    3-digit product No. (00-FF) (binary)                                 │
  1069. │ Byte 3                                                                  │
  1070. │    1-digit product No. (00-FF) (binary)                                 │
  1071. ├─────────────────────────────────────────────────────────────────────────┤
  1072. │                  ID and slot information                 Total bytes = 2│
  1073. │                                                          Offset = 04h   │
  1074. │ Byte 0                                                                  │
  1075. │    bit 7         0 = no duplicate ID is present                         │
  1076. │                  1 = duplicate is present                               │
  1077. │    bit 6         0 = ID is readable                                     │
  1078. │                  1 = ID is not readable                                 │
  1079. │    bit 5,4       slot type                                              │
  1080. │                      00 = Expansion slot                                │
  1081. │                      01 = Embedded device                               │
  1082. │                      10 = Virtual device                                │
  1083. │                      11 = Reserved                                      │
  1084. │    bit 3-0       Numeric identifier for duplicate CFG filenames (IDs)   │
  1085. │                      0000 if no duplicate CFG filenames                 │
  1086. │                      0001 if 1st duplicate CFG file                     │
  1087. │                      ...                                                │
  1088. │                      1111 if 15th duplicate CFG file                    │
  1089. │ Byte 1                                                                  │
  1090. │    bit 7         0 = configuration is complete                          │
  1091. │                  1 = configuration is not complete                      │
  1092. │    bit 6-2       reserved                                               │
  1093. │    bit 1         0 = EISA IOCHKERR supported                            │
  1094. │                  1 = EISA IOCHKERR not supported                        │
  1095. │    bit 0         0 = EISA ENABLE supported (expansion board can be      │
  1096. │                      disable)                                           │
  1097. │                  1 = EISA ENABLE not supported(board can not be disable)│
  1098. └─────────────────────────────────────────────────────────────────────────┘
  1099.  
  1100.                 -- to be continued --
  1101.  
  1102.  
  1103. ┌──────────────────────────────────────────────────────────────────────────┐
  1104. │        CFG file extension revision level                 Total bytes = 2 │
  1105. │                                                          Offset = 06h    │
  1106. │ Byte 0 = Minor revision level (0 if no CFG file extension)               │
  1107. │ Byte 1 = Major revision level (0 if no CFG file extension)               │
  1108. ├──────────────────────────────────────────────────────────────────────────┤
  1109. │        Selections                                        Total bytes = 26│
  1110. │                                                          Offset = 08h    │
  1111. │ Byte 0                                                                   │
  1112. │     bit 7        0 = function is not disabled                            │
  1113. │                  1 = function is disabled                                │
  1114. │     bit 6        CFG extension free-form data                            │
  1115. │     bit 5        port initialization entry follows                       │
  1116. │     bit 4        port range entry follows                                │
  1117. │     bit 3        DMA entry follows                                       │
  1118. │     bit 2        interrupt(IRQ) entry follows                            │
  1119. │     bit 1        memory entry follows                                    │
  1120. │     bit 0        type/subtype ASCII string entry follows                 │
  1121. ├──────────────────────────────────────────────────────────────────────────┤
  1122. │        TYPE and SUBTYPE ASCII string                     Total bytes = 80│
  1123. │                                                          Offset = 23h    │
  1124. │ Byte 0  = 1st character of ASCII string                                  │
  1125. │ Byte 1  = 2nd character of ASCII string                                  │
  1126. │        ...                                                               │
  1127. │ Byte 79 = 80th character of ASCII string                                 │
  1128. │                                                                          │
  1129. └──────────────────────────────────────────────────────────────────────────┘
  1130.  
  1131.                 -- to be continued --
  1132.  
  1133.  
  1134. ┌──────────────────────────────────────────────────────────────────────────┐
  1135. │        Memory configuration                              Total bytes = 63│
  1136. │                                                          Offset = 73h    │
  1137. │ Byte 0 = memory configuration byte                                       │
  1138. │     bit 7        0 = last entry                                          │
  1139. │                  1 = more entries follow                                 │
  1140. │     bit 6        reserved                                                │
  1141. │     bit 5        0 = not shared memory                                   │
  1142. │                  1 = shared memory                                       │
  1143. │     bit 4,3      memory type                                             │
  1144. │                      00 = base or extended                               │
  1145. │                      01 = expanded                                       │
  1146. │                      10 = virtual                                        │
  1147. │                      11 = other                                          │
  1148. │     bit 2        reserved                                                │
  1149. │     bit 1        0 = not cached                                          │
  1150. │                  1 = cached                                              │
  1151. │     bit 0        0 = read only (ROM)                                     │
  1152. │                  1 = R/W (RAM)                                           │
  1153. │ Byte 1 = memory data size                                                │
  1154. │     bit 7-4      reserved                                                │
  1155. │     bit 3,2      decode size                                             │
  1156. │                      00 = 20                                             │
  1157. │                      01 = 24                                             │
  1158. │                      10 = 32                                             │
  1159. │                      11 = reserved                                       │
  1160. │     bit 1,0      data size (access size)                                 │
  1161. │                      00 = BYTE                                           │
  1162. │                      01 = WORD                                           │
  1163. │                      10 = DWORD                                          │
  1164. │                      11 = reserved                                       │
  1165. │ Byte 2 = LSByte memory start address (divided by 100h)                   │
  1166. │ Byte 3 = middle byte memory start address                                │
  1167. │ Byte 4 = MSByte memory start address                                     │
  1168. │ Byte 5 = LSByte memory size (divided by 400h)                            │
  1169. │ Byte 6 = MSByte memory size (0 in this word means 64M)                   │
  1170. └──────────────────────────────────────────────────────────────────────────┘
  1171.  
  1172.                 -- to be continued --
  1173.  
  1174.  
  1175. ┌──────────────────────────────────────────────────────────────────────────┐
  1176. │        Interrupt configuration                           Total bytes = 14│
  1177. │                                                          Offset = B2h    │
  1178. │ Byte 0                                                                   │
  1179. │     bit 7        0 = last entry                                          │
  1180. │                  1 = more entries follow                                 │
  1181. │     bit 6        0 = not shared                                          │
  1182. │                  1 = shared                                              │
  1183. │     bit 5        0 = edge triggered                                      │
  1184. │                  1 = level triggered                                     │
  1185. │     bit 4        reserved (must be 0)                                    │
  1186. │     bit 3-0      interrupt (0-F)                                         │
  1187. │ Byte 1 = reserved                                                        │
  1188. ├──────────────────────────────────────────────────────────────────────────┤
  1189. │        DMA channel description                           Total bytes = 8 │
  1190. │                                                          Offset = C0h    │
  1191. │ Byte 0                                                                   │
  1192. │     bit 7        0 = last entry                                          │
  1193. │                  1 = more entries follow                                 │
  1194. │     bit 6        0 = not shared                                          │
  1195. │                  1 = shared                                              │
  1196. │     bit 5-3      reserved (0)                                            │
  1197. │     bit 2-0      DMA channel No (0-7)                                    │
  1198. │ Byte 1                                                                   │
  1199. │     bit 7,6      reserved (0)                                            │
  1200. │     bit 5,4      DMA timming                                             │
  1201. │                      00 - default timming (ISA compatible)               │
  1202. │                      01 - type A timming                                 │
  1203. │                      10 - type B timming                                 │
  1204. │                      11 - type C timming (BURST)                         │
  1205. │     bit 3,2      transfer size                                           │
  1206. │                      00 - 8-bit (byte) transfer                          │
  1207. │                      01 - 16-bit (word) transfer                         │
  1208. │                      00 - 32-bit (dword) transfer                        │
  1209. │                      11 - reserved                                       │
  1210. │     bit 1,9      reserved (0)                                            │
  1211. ├──────────────────────────────────────────────────────────────────────────┤
  1212. │        Port I/O information                              Total bytes = 60│
  1213. │                                                          Offset = C8h    │
  1214. │ Byte 0                                                                   │
  1215. │     bit 7        0 = last entry                                          │
  1216. │                  1 = more entries follow                                 │
  1217. │     bit 6        0 = not shared                                          │
  1218. │                  1 = shared                                              │
  1219. │     bit 5        reserved (0)                                            │
  1220. │     bit 4-0      No of ports (minus 1)                                   │
  1221. │                      00000 = 1 port                                      │
  1222. │                      00001 = 2 sequential ports                          │
  1223. │                         ...                                              │
  1224. │                      11111 = 32 sequential ports                         │
  1225. │ Byte 1 = LSByte I/O port address                                         │
  1226. │ Byte 2 = MSByte I/O port address                                         │
  1227. └──────────────────────────────────────────────────────────────────────────┘
  1228.  
  1229.                 -- to be continued --
  1230.  
  1231.  
  1232. ┌──────────────────────────────────────────────────────────────────────────┐
  1233. │        Initialization data                               Total bytes = 60│
  1234. │                                                          Offset = 104h   │
  1235. │ Byte 0                                                                   │
  1236. │     bit 7        0 = last entry                                          │
  1237. │                  1 = more entries follow                                 │
  1238. │     bit 6-3      reserved (0)                                            │
  1239. │     bit 2        port value or mask value                                │
  1240. │                      0 - write value to port                             │
  1241. │                      1 - use mask and value                              │
  1242. │     bit 1,0      type of access                                          │
  1243. │                      00 - byte address                                   │
  1244. │                      01 - word address                                   │
  1245. │                      10 - dword address                                  │
  1246. │                      11 - reserved                                       │
  1247. │ Byte 1 = LSByte of port I/O address                                      │
  1248. │ Byte 2 = MSByte of port I/O address                                      │
  1249. │                                                                          │
  1250. │ If byte 0, bit 2 = 0 (no mask) :                                         │
  1251. │     bit 1,0 = port width to write                                        │
  1252. │                  00 - byte 3 = port value                                │
  1253. │                  01 - byte 3 = LSB of port value                         │
  1254. │                       byte 4 = MSB of port value                         │
  1255. │                  10 - byte 3 = LSB of port value                         │
  1256. │                       byte 4 = 2nd byte of port value                    │
  1257. │                       byte 5 = 3rd byte of port value                    │
  1258. │                       byte 6 = MSB of port value                         │
  1259. │                  11 - reserved                                           │
  1260. │                                                                          │
  1261. │ If byte 0, bit 2 = 1 (use mask) :                                        │
  1262. │     bit 1,0 = No of bytes/port value/mask                                │
  1263. │                  00 - byte 3 = port value                                │
  1264. │                       byte 4 = port mask (byte)                          │
  1265. │                  01 - byte 3 = LSB of port value                         │
  1266. │                       byte 4 = MSB of port value                         │
  1267. │                       byte 5 = LSB mask (word)                           │
  1268. │                       byte 6 = MSB mask (word)                           │
  1269. │                  10 - byte 3 = LSB of port value                         │
  1270. │                       byte 4 = 2nd byte of port value                    │
  1271. │                       byte 5 = 3rd byte of port value                    │
  1272. │                       byte 6 = MSB of port value/                        │
  1273. │                       byte 7 = LSB mask (dword)                          │
  1274. │                       byte 8 = 2nd byte of port mask (dword)             │
  1275. │                       byte 9 = 3rd byte of port mask (dword)             │
  1276. │                       byte 10 = MSB mask (dword)                         │
  1277. │                  11 - reserved                                           │
  1278. └──────────────────────────────────────────────────────────────────────────┘
  1279.  
  1280.  
  1281.                 -- to be continued --
  1282.  
  1283.  Subfunction 02h : Clear CMOS
  1284.          This subfunction clears all EISA CMOS, but does not clear the 64
  1285.      bytes ISA CMOS.
  1286.  
  1287.          input:
  1288.                 (ah) = d8h
  1289.                 (al) = 02h (If CS and DS specify 16-bit addressing and data
  1290.                             size)
  1291.                 (al) = 82h (If CS and DS specify 32-bit addressing and data
  1292.                             size)
  1293.                 (bh) = configuration utility major revision level
  1294.                 (bl) = configuration utility minor revision level
  1295.  
  1296.          output:
  1297.                 (ah) = 00h - Successful completion; Carry Flag = 0.
  1298.                      = 84h - Error writing CMOS; Carry Flag = 1.
  1299.                      = 86h - Invalid BIOS routine call; Carry Flag = 1.
  1300.  
  1301.  
  1302.  Subfunction 03h : Write CMOS
  1303.          This subfunction writes configuration information for one slot 
  1304.    into EISA CMOS. This routine must be compute a checksum after each call.
  1305.  
  1306.          input:
  1307.                 (ah) = d8h
  1308.                 (al) = 03h (If CS and DS specify 16-bit addressing and data
  1309.                             size)
  1310.                 (al) = 83h (If CS and DS specify 32-bit addressing and data
  1311.                             size)
  1312.                 (cx) = length of data structure (CX = 0 indicates empty
  1313.                        slot), length includes 2 bytes for configuration 
  1314.                        file checksum
  1315.                 (ds) = segment of data buffer
  1316.                 (si) = offset of data buffer (16-bit call)
  1317.                 (esi) = offset of data buffer (32-bit call)
  1318.  
  1319.          output:
  1320.                 (ah) = 00h - Successful completion; Carry Flag = 0.
  1321.                      = 84h - Error writing CMOS; Carry Flag = 1.
  1322.                      = 85h - CMOS is full, Carry Flag = 1.
  1323.                      = 86h - Invalid BIOS routine call; Carry Flag = 1.
  1324.  
  1325.                 -- to be continued --
  1326.  
  1327.  
  1328.          The structure referenced by DS:SI in this subfunction for a slot
  1329.     with a single function has the following format:
  1330.  
  1331. ┌──────────────────────────────────────────────────────────────────────────┐
  1332. │                  Four-byte Compressed ID                 Total bytes = 4 │
  1333. │                                                                          │
  1334. │ Byte 0                                                                   │
  1335. │    bit 7         reserved                                                │
  1336. │    bit 6-2       Character 1                                             │
  1337. │    bit 1-0       Character 2                                             │
  1338. │ Byte 1                                                                   │
  1339. │    bit 7-5       Character 2                                             │
  1340. │    bit 4-0       Character 3                                             │
  1341. │ Byte 2                                                                   │
  1342. │    3-digit product No (00-FF) (binary)                                   │
  1343. │ Byte 3                                                                   │
  1344. │    1-digit product No (00-FF) (binary)                                   │
  1345. ├──────────────────────────────────────────────────────────────────────────┤
  1346. │                  ID and slot information                 Total bytes = 2 │
  1347. │                                                                          │
  1348. │ Byte 0                                                                   │
  1349. │    bit 7         0 = no duplicate ID is present                          │
  1350. │                  1 = duplicate is present                                │
  1351. │    bit 6         0 = ID is readable                                      │
  1352. │                  1 = ID is not readable                                  │
  1353. │    bit 5,4       slot type                                               │
  1354. │                      00 = Expansion slot                                 │
  1355. │                      01 = Embedded device                                │
  1356. │                      10 = Virtual device                                 │
  1357. │                      11 = Reserved                                       │
  1358. │    bit 3-0       Numeric identifier for duplicate CFG filenames (IDs)    │
  1359. │                      0000 if no duplicate CFG filenames                  │
  1360. │                      0001 if 1st duplicate CFG file                      │
  1361. │                      ...                                                 │
  1362. │                      1111 if 15th duplicate CFG file                     │
  1363. │ Byte 1                                                                   │
  1364. │    bit 7         0 = configuration is complete                           │
  1365. │                  1 = configuration is not complete                       │
  1366. │    bit 6-2       reserved                                                │
  1367. │    bit 1         0 = EISA IOCHKERR supported                             │
  1368. │                  1 = EISA IOCHKERR not supported                         │
  1369. │    bit 0         0 = EISA ENABLE supported (expansion board can be       │
  1370. │                      disable)                                            │
  1371. │                  1 = EISA ENABLE not supported (board can not be disable)│
  1372. ├──────────────────────────────────────────────────────────────────────────┤
  1373. │        CFG file extension revision level                 Total bytes = 2 │
  1374. │                                                          Offset = 06h    │
  1375. │ Byte 0 = Minor revision level (0 if no CFG file extension)               │
  1376. │ Byte 1 = Major revision level (0 if no CFG file extension)               │
  1377. ├──────────────────────────────────────────────────────────────────────────┤
  1378. │        Function length                                   Total bytes = 2 │
  1379. │ Byte 0,1 = length of following function entry                            │
  1380. │        ** Length does not include these two bytes, or the checksum at the│
  1381. │           end of CMOS.                                                   │
  1382. └──────────────────────────────────────────────────────────────────────────┘
  1383.  
  1384.                 -- to be continued --
  1385.  
  1386.  
  1387. ┌──────────────────────────────────────────────────────────────────────────┐
  1388. │        Selections                                   Total bytes = 2 to 27│
  1389. │ Byte 0 = length of following selections filed                            │
  1390. │ Byte 1 = 1st selection                                                   │
  1391. │ Byte 2 = 2nd selection                                                   │
  1392. │    ...                                                                   │
  1393. │ Byte 26 = 26th selection                                                 │
  1394. ├──────────────────────────────────────────────────────────────────────────┤
  1395. │        Function information                              Total bytes = 1 │
  1396. │ Byte 0                                                                   │
  1397. │     bit 7        0 = function is not disabled                            │
  1398. │                  1 = function is disabled                                │
  1399. │     bit 6        CFG extension free-form data                            │
  1400. │     bit 5        port initialization entry follows                       │
  1401. │     bit 4        port range entry follows                                │
  1402. │     bit 3        DMA entry follows                                       │
  1403. │     bit 2        interrupt(IRQ) entry follows                            │
  1404. │     bit 1        memory entry follows                                    │
  1405. │     bit 0        type/subtype ASCII string entry follows                 │
  1406. ├──────────────────────────────────────────────────────────────────────────┤
  1407. │        TYPE and SUBTYPE ASCII string                Total bytes = 2 to 81│
  1408. │                                                          Offset = 23h    │
  1409. │ Byte 0 = length of following ASCII string filed                          │
  1410. │ Byte 1  = 1st character of ASCII string                                  │
  1411. │ Byte 2  = 2nd character of ASCII string                                  │
  1412. │        ...                                                               │
  1413. │ Byte 80 = 80th character of ASCII string                                 │
  1414. │                                                                          │
  1415. └──────────────────────────────────────────────────────────────────────────┘
  1416.  
  1417.                 -- to be continued --
  1418.  
  1419.  
  1420. ┌──────────────────────────────────────────────────────────────────────────┐
  1421. │        Memory configuration                        Total bytes = 7 to 63 │
  1422. │                                                                          │
  1423. │ Byte 0 = memory configuration byte                                       │
  1424. │     bit 7        0 = last entry                                          │
  1425. │                  1 = more entries follow                                 │
  1426. │     bit 6        reserved                                                │
  1427. │     bit 5        0 = not shared memory                                   │
  1428. │                  1 = shared memory                                       │
  1429. │     bit 4,3      memory type                                             │
  1430. │                      00 = base or extended                               │
  1431. │                      01 = expanded                                       │
  1432. │                      10 = virtual                                        │
  1433. │                      11 = other                                          │
  1434. │     bit 2        reserved                                                │
  1435. │     bit 1        0 = not cached                                          │
  1436. │                  1 = cached                                              │
  1437. │     bit 0        0 = read only (ROM)                                     │
  1438. │                  1 = R/W (RAM)                                           │
  1439. │ Byte 1 = memory data size                                                │
  1440. │     bit 7-4      reserved                                                │
  1441. │     bit 3,2      decode size                                             │
  1442. │                      00 = 20                                             │
  1443. │                      01 = 24                                             │
  1444. │                      10 = 32                                             │
  1445. │                      11 = reserved                                       │
  1446. │     bit 1,0      data size (access size)                                 │
  1447. │                      00 = BYTE                                           │
  1448. │                      01 = WORD                                           │
  1449. │                      10 = DWORD                                          │
  1450. │                      11 = reserved                                       │
  1451. │ Byte 2 = LSByte memory start address (divided by 100h)                   │
  1452. │ Byte 3 = middle byte memory start address                                │
  1453. │ Byte 4 = MSByte memory start address                                     │
  1454. │ Byte 5 = LSByte memory size (divided by 400h)                            │
  1455. │ Byte 6 = MSByte memory size (0 in this word means 64M)                   │
  1456. └──────────────────────────────────────────────────────────────────────────┘
  1457.  
  1458.                 -- to be continued --
  1459.  
  1460.  
  1461. ┌──────────────────────────────────────────────────────────────────────────┐
  1462. │        Interrupt configuration                     Total bytes = 2 to 14 │
  1463. │ Byte 0                                                                   │
  1464. │     bit 7        0 = last entry                                          │
  1465. │                  1 = more entries follow                                 │
  1466. │     bit 6        0 = not shared                                          │
  1467. │                  1 = shared                                              │
  1468. │     bit 5        0 = edge triggered                                      │
  1469. │                  1 = level triggered                                     │
  1470. │     bit 4        reserved (must be 0)                                    │
  1471. │     bit 3-0      interrupt (0-F)                                         │
  1472. │ Byte 1 = reserved                                                        │
  1473. ├──────────────────────────────────────────────────────────────────────────┤
  1474. │        DMA channel description                      Total bytes = 2 to 8 │
  1475. │ Byte 0                                                                   │
  1476. │     bit 7        0 = last entry                                          │
  1477. │                  1 = more entries follow                                 │
  1478. │     bit 6        0 = not shared                                          │
  1479. │                  1 = shared                                              │
  1480. │     bit 5-3      reserved (0)                                            │
  1481. │     bit 2-0      DMA channel No (0-7)                                    │
  1482. │ Byte 1                                                                   │
  1483. │     bit 7,6      reserved (0)                                            │
  1484. │     bit 5,4      DMA timming                                             │
  1485. │                      00 - default timming (ISA compatible)               │
  1486. │                      01 - type A timming                                 │
  1487. │                      10 - type B timming                                 │
  1488. │                      11 - type C timming (BURST)                         │
  1489. │     bit 3,2      transfer size                                           │
  1490. │                      00 - 8-bit (byte) transfer                          │
  1491. │                      01 - 16-bit (word) transfer                         │
  1492. │                      00 - 32-bit (dword) transfer                        │
  1493. │                      11 - reserved                                       │
  1494. │     bit 1,9      reserved (0)                                            │
  1495. ├──────────────────────────────────────────────────────────────────────────┤
  1496. │        Port I/O information                        Total bytes = 3 to 60 │
  1497. │ Byte 0                                                                   │
  1498. │     bit 7        0 = last entry                                          │
  1499. │                  1 = more entries follow                                 │
  1500. │     bit 6        0 = not shared                                          │
  1501. │                  1 = shared                                              │
  1502. │     bit 5        reserved (0)                                            │
  1503. │     bit 4-0      No of ports (minus 1)                                   │
  1504. │                      00000 = 1 port                                      │
  1505. │                      00001 = 2 sequential ports                          │
  1506. │                         ...                                              │
  1507. │                      11111 = 32 sequential ports                         │
  1508. │ Byte 1 = LSByte I/O port address                                         │
  1509. │ Byte 2 = MSByte I/O port address                                         │
  1510. └──────────────────────────────────────────────────────────────────────────┘
  1511.  
  1512.                 -- to be continued --
  1513.  
  1514.  
  1515. ┌──────────────────────────────────────────────────────────────────────────┐
  1516. │        Initialization data                         Total bytes = 4 to 60 │
  1517. │                                                                          │
  1518. │ Byte 0                                                                   │
  1519. │     bit 7        0 = last entry                                          │
  1520. │                  1 = more entries follow                                 │
  1521. │     bit 6-3      reserved (0)                                            │
  1522. │     bit 2        port value or mask value                                │
  1523. │                      0 - write value to port                             │
  1524. │                      1 - use mask and value                              │
  1525. │     bit 1,0      type of access                                          │
  1526. │                      00 - byte address                                   │
  1527. │                      01 - word address                                   │
  1528. │                      10 - dword address                                  │
  1529. │                      11 - reserved                                       │
  1530. │ Byte 1 = LSByte of port I/O address                                      │
  1531. │ Byte 2 = MSByte of port I/O address                                      │
  1532. │                                                                          │
  1533. │ If byte 0, bit 2 = 0 (no mask) :                                         │
  1534. │     bit 1,0 = port width to write                                        │
  1535. │                  00 - byte 3 = port value                                │
  1536. │                  01 - byte 3 = LSB of port value                         │
  1537. │                       byte 4 = MSB of port value                         │
  1538. │                  10 - byte 3 = LSB of port value                         │
  1539. │                       byte 4 = 2nd byte of port value                    │
  1540. │                       byte 5 = 3rd byte of port value                    │
  1541. │                       byte 6 = MSB of port value                         │
  1542. │                  11 - reserved                                           │
  1543. │                                                                          │
  1544. │ If byte 0, bit 2 = 1 (use mask) :                                        │
  1545. │     bit 1,0 = No of bytes/port value/mask                                │
  1546. │                  00 - byte 3 = port value                                │
  1547. │                       byte 4 = port mask (byte)                          │
  1548. │                  01 - byte 3 = LSB of port value                         │
  1549. │                       byte 4 = MSB of port value                         │
  1550. │                       byte 5 = LSB mask (word)                           │
  1551. │                       byte 6 = MSB mask (word)                           │
  1552. │                  10 - byte 3 = LSB of port value                         │
  1553. │                       byte 4 = 2nd byte of port value                    │
  1554. │                       byte 5 = 3rd byte of port value                    │
  1555. │                       byte 6 = MSB of port value/                        │
  1556. │                       byte 7 = LSB mask (dword)                          │
  1557. │                       byte 8 = 2nd byte of port mask (dword)             │
  1558. │                       byte 9 = 3rd byte of port mask (dword)             │
  1559. │                       byte 10 = MSB mask (dword)                         │
  1560. │                  11 - reserved                                           │
  1561. └──────────────────────────────────────────────────────────────────────────┘
  1562.  
  1563.                 -- to be continued --
  1564.  
  1565.  
  1566. ┌──────────────────────────────────────────────────────────────────────────┐
  1567. │        Configuration data for 2nd function       Function length         │
  1568. │                  .                                      .                │
  1569. │                  .                                      .                │
  1570. │                  .                                      .                │
  1571. ├──────────────────────────────────────────────────────────────────────────┤
  1572. │        Configuration data for 3rd function       Function length         │
  1573. │                  .                                      .                │
  1574. │                  .                                      .                │
  1575. │                  .                                      .                │
  1576. ├──────────────────────────────────────────────────────────────────────────┤
  1577. │        Configuration data for nth function       Function length for nth │
  1578. │                  .                               function = 00           │
  1579. │                  .                                                       │
  1580. │                  .                                                       │
  1581. ├──────────────────────────────────────────────────────────────────────────┤
  1582. │        Configuration file checksum                       Total bytes = 2 │
  1583. │                                                                          │
  1584. │ Byte 1 = MSByte of Configuration file checksum                           │
  1585. │ Byte 0 = MSByte of Configuration file checksum                           │
  1586. └──────────────────────────────────────────────────────────────────────────┘
  1587.  
  1588.  
  1589.                 -- to be continued --
  1590.  
  1591.          The 8K EISA CMOS data structure as follow:
  1592.  
  1593. ┌──────────────────────────────────────────────────────────────────────────┐
  1594. │                                                                          │
  1595. │ Byte 0           counter for writing routine with each slot              │
  1596. │ Byte 1           checksum byte                                           │
  1597. │ Byte 2-0Fh       reserved                                                │
  1598. │                                                                          │
  1599. │ Byte 10h         data length of slot 0                                   │
  1600. │ Byte 11h,12h     data pointer of slot 0                                  │
  1601. │ Byte 13h         data length of slot 1                                   │
  1602. │ Byte 14h,15h     data pointer of slot 1                                  │
  1603. │        ...                                                               │
  1604. │ Byte 0CDh        data length of slot 63                                  │
  1605. │ Byte 0CEh,0CFh   data pointer of slot 63                                 │
  1606. │                                                                          │
  1607. │ Byte 0D0h-1FFFh  part of saving data                                     │
  1608. │                                                                          │
  1609. │                                                                          │
  1610. │ Note :                                                                   │
  1611. │      1.  Before you write CMOS must be calling subfunction 02h to clear  │
  1612. │          CMOS all. And call writing routine for each slot. Because write │
  1613. │          CMOS subfunction do not exist a parameter of slot No, so we need│
  1614. │          a internal counter for writing routine. So when you exit writing│
  1615. │          routine must be increase Byte 0 for next slot.                  │
  1616. │      2.  Byte 1 is a checksum byte for all 8K CMOS. You must do checksum │
  1617. │          once for every write routine.                                   │
  1618. │      3.  Maybe we must change this definition for compatibility, so make │
  1619. │          your coding independent as possible you can.                    │
  1620. └──────────────────────────────────────────────────────────────────────────┘
  1621.