Changeset 601 in xtideuniversalbios for trunk/Assembly_Library/Src/Serial/SerialServerScan.asm


Ignore:
Timestamp:
Feb 14, 2019, 7:38:08 PM (5 years ago)
Author:
krille_n_
Message:

Changes:

  • Building the BIOS now works again.
  • Added a new IDE device type/transfer mode for use only with XT-IDE rev 2+ (or Chuck(G)-modded rev 1) cards installed in any of the following machines: Olivetti M24, AT&T PC6300, Xerox 6060 and Logabax Persona 1600. This new transfer mode is slightly faster than the regular XT-IDE rev 1 device type and requires that the card is configured for High Speed mode (or, in case of the card being a rev 1 card, has the Chuck(G) mod done). The new device type is called "XTIDE rev 2 (Olivetti M24)" in XTIDECFG.
  • Made some minor improvements to the library code that handles 'Drive Not Ready' errors in XTIDECFG.
  • Optimizations.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Assembly_Library/Src/Serial/SerialServerScan.asm

    r589 r601  
    11; Project name  :   Assembly Library
    22; Description   :   Serial Server Support, Scan for Server
     3
    34;
    45; This functionality is broken out from SerialServer as it may only be needed during
     
    4344;--------------------------------------------------------------------
    4445SerialServerScan_ScanForServer:
    45         mov     cx, 1           ; one sector, not scanning (default)
     46    mov     cx, 1           ; one sector, not scanning (default)
    4647
    47         test    dx, dx
    48         jnz     SHORT SerialServerScan_CheckForServer_PortAndBaudInDX
     48    test    dx, dx
     49    jnz     SHORT SerialServerScan_CheckForServer_PortAndBaudInDX
    4950
    50         mov     di, .scanPortAddresses-1
    51         mov     ch, 1           ;  tell server that we are scanning
     51    mov     di, .scanPortAddresses-1
     52    mov     ch, 1           ;  tell server that we are scanning
    5253
    5354.nextPort:
    54         inc     di              ; load next port address
    55         mov     dh, 40h         ; Clear DH and make sure CF is set if error
    56         mov     dl, [cs:di]
    57         eSHL_IM dx, 2           ; shift from one byte to two
    58         jz      SHORT .error
     55    inc     di              ; load next port address
     56    mov     dh, 40h         ; Clear DH and make sure CF is set if error
     57    mov     dl, [cs:di]
     58    eSHL_IM dx, 2           ; shift from one byte to two
     59    jz      SHORT .error
    5960
    6061;
    6162; Test for COM port presence, write to and read from registers
    6263;
    63         push    dx
    64         add     dl, Serial_UART_lineControl
    65         mov     al, 9Ah
    66         out     dx, al
    67         in      al, dx
    68         pop     dx
    69         cmp     al, 9Ah
    70         jne     SHORT .nextPort
     64    push    dx
     65    add     dl, Serial_UART_lineControl
     66    mov     al, 9Ah
     67    out     dx, al
     68    in      al, dx
     69    pop     dx
     70    cmp     al, 9Ah
     71    jne     SHORT .nextPort
    7172
    72         mov     al, 0Ch
    73         out     dx, al
    74         in      al, dx
    75         cmp     al, 0Ch
    76         jne     SHORT .nextPort
     73    mov     al, 0Ch
     74    out     dx, al
     75    in      al, dx
     76    cmp     al, 0Ch
     77    jne     SHORT .nextPort
    7778
    7879;
     
    8889; Note: hardware baud multipliers (2x, 4x, 8x) will impact the final baud rate and are not known at this level
    8990;
    90         mov     dh, 30h * 2     ; multiply by 2 since we are about to divide by 2
    91         mov     dl, [cs:di]     ; restore single byte port address for scan
     91    mov     dh, 30h * 2     ; multiply by 2 since we are about to divide by 2
     92    mov     dl, [cs:di]     ; restore single byte port address for scan
    9293
    9394.nextBaud:
    94         shr     dh, 1
    95         jz      SHORT .nextPort
    96         cmp     dh, 6           ; skip from 6 to 4, to move from the top of the 9600 baud range
    97         jne     SHORT .testBaud ; to the bottom of the 115200 baud range
    98         mov     dh, 4
     95    shr     dh, 1
     96    jz      SHORT .nextPort
     97    cmp     dh, 6           ; skip from 6 to 4, to move from the top of the 9600 baud range
     98    jne     SHORT .testBaud ; to the bottom of the 115200 baud range
     99    mov     dh, 4
    99100
    100101.testBaud:
    101         call    SerialServerScan_CheckForServer_PortAndBaudInDX
    102         jc      SHORT .nextBaud
     102    call    SerialServerScan_CheckForServer_PortAndBaudInDX
     103    jc      SHORT .nextBaud
    103104
    104105.error:
    105         ret
     106    ret
    106107
    107 .scanPortAddresses: db  SERIAL_COM7_IOADDRESS >> 2
    108                     db  SERIAL_COM6_IOADDRESS >> 2
    109                     db  SERIAL_COM5_IOADDRESS >> 2
    110                     db  SERIAL_COM4_IOADDRESS >> 2
    111                     db  SERIAL_COM3_IOADDRESS >> 2
    112                     db  SERIAL_COM2_IOADDRESS >> 2
    113                     db  SERIAL_COM1_IOADDRESS >> 2
    114                     db  0
     108.scanPortAddresses:
     109    db  SERIAL_COM7_IOADDRESS >> 2
     110    db  SERIAL_COM6_IOADDRESS >> 2
     111    db  SERIAL_COM5_IOADDRESS >> 2
     112    db  SERIAL_COM4_IOADDRESS >> 2
     113    db  SERIAL_COM3_IOADDRESS >> 2
     114    db  SERIAL_COM2_IOADDRESS >> 2
     115    db  SERIAL_COM1_IOADDRESS >> 2
     116    db  0
    115117
    116118
     
    133135;--------------------------------------------------------------------
    134136SerialServerScan_CheckForServer_PortAndBaudInDX:
    135         push    bp              ; setup fake SerialServer_Command
    136         push    dx              ; send port baud and rate, returned in inquire packet
    137                                 ; (and possibly returned in the drive identification string)
    138         push    cx              ; send number of sectors, and if it is on a scan or not
    139         mov     bl, SerialServer_Command_Inquire        ; protocol command onto stack with bh
    140         push    bx
     137    push    bp              ; setup fake SerialServer_Command
     138    push    dx              ; send port baud and rate, returned in inquire packet
     139                            ; (and possibly returned in the drive identification string)
     140    push    cx              ; send number of sectors, and if it is on a scan or not
     141    mov     bl, SerialServer_Command_Inquire        ; protocol command onto stack with bh
     142    push    bx
    141143
    142         mov     bp, sp
    143         call    SerialServer_SendReceive
     144    mov     bp, sp
     145    call    SerialServer_SendReceive
    144146
    145         pop     bx
    146         pop     cx
    147         pop     dx
    148         pop     bp
     147    pop     bx
     148    pop     cx
     149    pop     dx
     150    pop     bp
    149151
    150         ret
     152    ret
    151153
Note: See TracChangeset for help on using the changeset viewer.