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


Ignore:
Timestamp:
Nov 23, 2011, 8:42:19 PM (13 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Reworked the 'skip detecting the slave if there was no master' code to be more complete (includes configurator drives) and to take into account int13h/25h calls. Some of the changes in my last checkin have been rolled back as a result (they are no longer needed). I did take a byte out of RAMVARS, but there was an alignment byte available for the taking. I also added a perl script for padding and adding the checksum byte to a binary image, which can be invoked manually or with 'make checksum'.

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

Legend:

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

    r200 r203  
    2323.DriveDetectLoop:                           ; Loop through IDEVARS
    2424    mov     si, g_szDetect                  ; Setup standard print string
    25 %ifdef MODULE_SERIAL
     25%ifdef MODULE_SERIAL       
    2626    cmp     byte [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT
    2727    jnz     .DriveNotSerial                 ; Special print string for serial drives
     
    2929.DriveNotSerial:
    3030%endif
     31
    3132    call    .DetectDrives_WithIDEVARS       ; Detect Master and Slave
    3233    add     bp, BYTE IDEVARS_size           ; Point to next IDEVARS
    3334    loop    .DriveDetectLoop
     35
     36%ifdef MODULE_SERIAL       
     37;
     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
     41;
     42    cmp     byte [RAMVARS.xlateVars+XLATEVARS.bLastSerial],cl   ; cx = zero after the loop above
     43                                                                ; less instruction bytes than using immediate
     44    jnz     .done                                                 
    3445       
    35 %ifdef MODULE_SERIAL
    36     call    FindDPT_ToDSDIforSerialDevice   ; Did we already find any serial drives?
    37     jc      .done                           ; Yes, do not scan
    3846    mov     al,[cs:ROMVARS.wFlags]          ; Configurator set to always scan?
    3947    or      al,[es:BDA.bKBFlgs1]            ; Or, did the user hold down the ALT key?
    4048    and     al,8                            ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT
    4149    jz      .done                           
     50
    4251    mov     bp, ROMVARS.ideVarsSerialAuto   ; Point to our special IDEVARS sructure, just for serial scans
    4352    mov     si, g_szDetectCOMAuto           ; Special, special print string for serial drives during a scan
     
    7483    pop     si
    7584
    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        
    9085    mov     ax, g_szSlave
    9186    mov     bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV
     
    106101;       ES:     Zero (BDA segment)
    107102;   Returns:
    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"
     103;       None
    111104;   Corrupts registers:
    112105;       AX, BX, CX, DX, SI, DI
     
    144137    ;call   ReadAtapiInfoFromDrive      ; Assume CD-ROM
    145138    ;jnc    SHORT _CreateBiosTablesForCDROM
    146     jmp     short DetectDrives_DriveNotFound
     139   
     140    ;jmp    short DetectDrives_DriveNotFound
     141;;; fall-through instead of previous jmp instruction
     142;--------------------------------------------------------------------
     143; DetectDrives_DriveNotFound
     144;   Parameters:
     145;       Nothing
     146;   Returns:
     147;       CF:     Set (from BootMenuPrint_NullTerminatedStringFromCSSIandSetCF)
     148;   Corrupts registers:
     149;       AX, SI
     150;--------------------------------------------------------------------
     151DetectDrives_DriveNotFound:     
     152    mov     si, g_szNotFound
     153    jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF     
    147154
    148155
     
    166173    jmp     short DetectPrint_DriveNameFromBootnfoInESBX
    167174
    168 ;--------------------------------------------------------------------
    169 ; DetectDrives_DriveNotFound
    170 ;   Parameters:
    171 ;       Nothing
    172 ;   Returns:
    173 ;       CF:     Set (from BootMenuPrint_NullTerminatedStringFromCSSIandSetCF)
    174 ;   Corrupts registers:
    175 ;       AX, SI
    176 ;--------------------------------------------------------------------
    177 DetectDrives_DriveNotFound:     
    178     mov     si, g_szNotFound
    179     jmp     BootMenuPrint_NullTerminatedStringFromCSSIandSetCF     
    180175
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

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