Changeset 200 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
Nov 22, 2011, 8:38:36 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Added logic to skip scanning COM ports if a COM port was already found during the normal detection process, to avoid finding the same serial drive twice and preseting the OS with two drives which in reality point to the same physical file on the server. Also added logic to skip scanning for the slave serial drive if the master was not found. And various small optimizations.

Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
2 edited

Legend:

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

    r199 r200  
    2020    call    RamVars_GetIdeControllerCountToCX
    2121    mov     bp, ROMVARS.ideVars0            ; CS:BP now points to first IDEVARS
    22 .DriveDetectLoop:
    23     mov     si, g_szDetect
     22
     23.DriveDetectLoop:                           ; Loop through IDEVARS
     24    mov     si, g_szDetect                  ; Setup standard print string
    2425%ifdef MODULE_SERIAL
    2526    cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
    26     jnz     .DriveNotSerial
     27    jnz     .DriveNotSerial                 ; Special print string for serial drives
    2728    mov     si, g_szDetectCOM
    2829.DriveNotSerial:
     
    3132    add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
    3233    loop    .DriveDetectLoop
     34       
    3335%ifdef MODULE_SERIAL
    34     mov     al,[cs:ROMVARS.wFlags]
    35     or      al,[es:BDA.bKBFlgs1]
    36     and     al,8        ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
    37     jz      .done
    38     mov     bp, ROMVARS.ideVarsSerialAuto
    39     mov     si, g_szDetectCOMAuto
     36    call    FindDPT_ToDSDIforSerialDevice   ; Did we already find any serial drives?
     37    jc      .done                           ; Yes, do not scan
     38    mov     al,[cs:ROMVARS.wFlags]          ; Configurator set to always scan?
     39    or      al,[es:BDA.bKBFlgs1]            ; Or, did the user hold down the ALT key?
     40    and     al,8                            ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
     41    jz      .done                           
     42    mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS sructure, just for serial scans
     43    mov     si, g_szDetectCOMAuto           ; Special, special print string for serial drives during a scan
    4044;;; fall-through                   
    4145%else
     
    4448
    4549%if FLG_ROMVARS_SERIAL_SCANDETECT != 8
    46 %error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_ALWAYSDETECT is the same bit as the ALT key code in the BDA.  Changes in the code will be needed if these values are no longer the same."
     50%error "DetectDrives is currently coded to assume that FLG_ROMVARS_SERIAL_SCANDETECT is the same bit as the ALT key code in the BDA.  Changes in the code will be needed if these values are no longer the same."
    4751%endif
    4852
     
    7074    pop     si
    7175
     76%ifdef MODULE_SERIAL
     77;
     78; This block of code checks to see if we found a master during a serial drives scan.  If no master
     79; was found, there is no point in scanning for a slave as the server will not return a slave without a master,
     80; as there is very little point given the drives are emulated.  Performing the slave scan will take
     81; time to rescan all the COM port and baud rate combinations.
     82;
     83    jnc     .masterFound
     84    pop     cx
     85    jcxz    .done       ; note that CX will only be zero after the .DriveDetectLoop, indicating a serial scan
     86    push    cx
     87.masterFound:
     88%endif
     89       
    7290    mov     ax, g_szSlave
    7391    mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
    7492    call    StartDetectionWithDriveSelectByteInBHandStringInAX
    7593    pop     cx
     94       
    7695.done: 
    7796    ret
     
    87106;       ES:     Zero (BDA segment)
    88107;   Returns:
    89 ;       Nothing
     108;       CF:     Set on failure, Clear on success
     109;               Note that this is set in the last thing both cases
     110;               do: printing the drive name, or printing "Not Found"
    90111;   Corrupts registers:
    91112;       AX, BX, CX, DX, SI, DI
     
    150171;       Nothing
    151172;   Returns:
    152 ;       Nothing
     173;       CF:     Set (from BootMenuPrint_NullTerminatedStringFromCSSIandSetCF)
    153174;   Corrupts registers:
    154175;       AX, SI
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r199 r200  
    8888    pop     bx
    8989    pop     di
     90    clc                         ; return success up through DetectDrives
    9091    ret
    9192
Note: See TracChangeset for help on using the changeset viewer.