Changeset 233 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
- Timestamp:
- Feb 4, 2012, 6:21:22 PM (13 years ago)
- google:author:
- gregli@hotmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm
r203 r233 22 22 23 23 .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 25 38 %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) 30 40 %endif 31 32 call .DetectDrives_WithIDEVARS ; Detect Master and Slave 33 add bp, BYTE IDEVARS_size ; Point to next IDEVARS 41 34 42 loop .DriveDetectLoop 35 43 36 44 %ifdef MODULE_SERIAL 37 45 ; 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) 41 47 ; 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 46 53 mov al,[cs:ROMVARS.wFlags] ; Configurator set to always scan? 47 54 or al,[es:BDA.bKBFlgs1] ; Or, did the user hold down the ALT key? 48 55 and al,8 ; 8 = alt key depressed, same as FLG_ROMVARS_SERIAL_ALWAYSDETECT 49 jz .done 56 jnz .DriveDetectLoop 57 %endif 50 58 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: 55 60 ret 56 %endif57 61 58 62 %if FLG_ROMVARS_SERIAL_SCANDETECT != 8 … … 60 64 %endif 61 65 62 ;--------------------------------------------------------------------63 ; Detects IDE hard disks by using information from IDEVARS.64 ;65 ; DetectDrives_WithIDEVARS66 ; Parameters:67 ; CS:BP: Ptr to IDEVARS68 ; DS: RAMVARS segment69 ; ES: Zero (BDA segment)70 ; SI: Ptr to template string71 ; Returns:72 ; Nothing73 ; Corrupts registers:74 ; AX, BX, DX, SI, DI75 ;--------------------------------------------------------------------76 .DetectDrives_WithIDEVARS:77 push cx78 79 push si80 mov ax, g_szMaster81 mov bh, MASK_DRVNHEAD_SET ; Select Master drive82 call StartDetectionWithDriveSelectByteInBHandStringInAX ; Detect and create DPT + BOOTNFO83 pop si84 85 mov ax, g_szSlave86 mov bh, MASK_DRVNHEAD_SET | FLG_DRVNHEAD_DRV87 call StartDetectionWithDriveSelectByteInBHandStringInAX88 pop cx89 90 .done:91 ret92 93 66 94 67 ;-------------------------------------------------------------------- 95 68 ; StartDetectionWithDriveSelectByteInBHandStringInAX 96 69 ; Parameters: 97 ; AX: Offset to "Master" or "Slave" string98 70 ; BH: Drive Select byte for Drive and Head Register 71 ; CX: Offset to "Master" or "Slave" string 99 72 ; CS:BP: Ptr to IDEVARS for the drive 100 73 ; DS: RAMVARS segment
Note:
See TracChangeset
for help on using the changeset viewer.