Ignore:
Timestamp:
Feb 4, 2012, 6:21:22 PM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Serial Port: split single byte port and baud into two bytes, taking advantage of the two bytes in DPT_SERIAL, which supports more serial baud rates and in particular fixed a bug where a 4x client machine couldn't talk to a 115.2K server machine. This is a wide change, touching lots of files, but most are shallow changes. DetectPrint.asm took the most significant changes, now it calculates the baud rate to display instead of using characters provided by the Configurator. The Configurator now has a new menu flag, FLG_MENUITEM_CHOICESTRINGS, for specifying that values are not linear and they should be lookedup rather than indexed. Finally, another important bug fixed here is that in some error cases, the serial port code could get into an infinite loop waiting ont the hardware; now it has a timeout.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r203 r233  
    2222
    2323.DriveDetectLoop:                           ; Loop through IDEVARS
    24     mov     si, g_szDetect                  ; Setup standard print string
     24    push    cx
     25
     26    mov     cx, g_szDetectMaster
     27    mov     bh, MASK_DRVNHEAD_SET                               ; Select Master drive
     28    call    StartDetectionWithDriveSelectByteInBHandStringInAX  ; Detect and create DPT + BOOTNFO
     29
     30    mov     cx, g_szDetectSlave
     31    mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV 
     32    call    StartDetectionWithDriveSelectByteInBHandStringInAX
     33       
     34    pop     cx
     35
     36    add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
     37
    2538%ifdef MODULE_SERIAL       
    26     cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
    27     jnz     .DriveNotSerial                 ; Special print string for serial drives
    28     mov     si, g_szDetectCOM
    29 .DriveNotSerial:
     39    jcxz    .done                           ; Set to zero on .ideVarsSerialAuto iteration (if any)
    3040%endif
    31 
    32     call    .DetectDrives_WithIDEVARS       ; Detect Master and Slave
    33     add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
     41       
    3442    loop    .DriveDetectLoop
    3543
    3644%ifdef MODULE_SERIAL       
    3745;
    38 ; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we have a connection)
    39 ; Note that XLATEVARS.bLastSerial is zero'd in RamVars_Initialize, called in Initialize_AutoDetectDrives;
    40 ; bLastSerial it set in the detection code of SerialCommand.asm
     46; if serial drive detected, do not scan (avoids duplicate drives and isn't needed - we already have a connection)
    4147;
    42     cmp     byte [RAMVARS.xlateVars+XLATEVARS.bLastSerial],cl   ; cx = zero after the loop above
    43                                                                 ; less instruction bytes than using immediate
    44     jnz     .done                                                 
    45        
     48    call    FindDPT_ToDSDIforSerialDevice
     49    jc      .done
     50
     51    mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS sructure, just for serial scans     
     52               
    4653    mov     al,[cs:ROMVARS.wFlags]          ; Configurator set to always scan?
    4754    or      al,[es:BDA.bKBFlgs1]            ; Or, did the user hold down the ALT key?
    4855    and     al,8                            ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
    49     jz      .done                           
     56    jnz     .DriveDetectLoop                           
     57%endif
    5058
    51     mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS sructure, just for serial scans
    52     mov     si, g_szDetectCOMAuto           ; Special, special print string for serial drives during a scan
    53 ;;; fall-through                   
    54 %else
     59.done:
    5560    ret
    56 %endif
    5761
    5862%if FLG_ROMVARS_SERIAL_SCANDETECT != 8
     
    6064%endif
    6165
    62 ;--------------------------------------------------------------------
    63 ; Detects IDE hard disks by using information from IDEVARS.
    64 ;
    65 ; DetectDrives_WithIDEVARS
    66 ;   Parameters:
    67 ;       CS:BP:      Ptr to IDEVARS
    68 ;       DS:         RAMVARS segment
    69 ;       ES:         Zero (BDA segment)
    70 ;       SI:         Ptr to template string
    71 ;   Returns:
    72 ;       Nothing
    73 ;   Corrupts registers:
    74 ;       AX, BX, DX, SI, DI
    75 ;--------------------------------------------------------------------
    76 .DetectDrives_WithIDEVARS:
    77     push    cx
    78 
    79     push    si     
    80     mov     ax, g_szMaster
    81     mov     bh, MASK_DRVNHEAD_SET                               ; Select Master drive
    82     call    StartDetectionWithDriveSelectByteInBHandStringInAX  ; Detect and create DPT + BOOTNFO
    83     pop     si
    84 
    85     mov     ax, g_szSlave
    86     mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
    87     call    StartDetectionWithDriveSelectByteInBHandStringInAX
    88     pop     cx
    89        
    90 .done: 
    91     ret
    92 
    9366       
    9467;--------------------------------------------------------------------
    9568; StartDetectionWithDriveSelectByteInBHandStringInAX
    9669;   Parameters:
    97 ;       AX:     Offset to "Master" or "Slave" string
    9870;       BH:     Drive Select byte for Drive and Head Register
     71;       CX:     Offset to "Master" or "Slave" string
    9972;       CS:BP:  Ptr to IDEVARS for the drive
    10073;       DS:     RAMVARS segment
Note: See TracChangeset for help on using the changeset viewer.