Changeset 120 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
- Timestamp:
- Feb 28, 2011, 4:41:41 PM (14 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
r116 r120 80 80 out dx, al ; Select Master or Slave drive 81 81 sub dx, BYTE REG_IDE_DRVHD ; Back to IDE Base port 82 call AH25h_GetDriveDetectionTimeoutValue 82 83 ; Wait until ready to accept commands 84 xor bh, bh ; BX now contains bus type 85 mov cl, B_TIMEOUT_DRVINFO ; Load short timeout 86 cmp [RAMVARS.bDrvCnt], bh ; Detecting first drive? 87 eCMOVE cl, B_TIMEOUT_RESET ; If so, load long timeout 83 88 call HStatus_WaitRdy ; Wait until ready to accept commands 84 89 jc SHORT .Return ; Return if error … … 92 97 ; Transfer data 93 98 sub dx, BYTE REGR_IDE_ST ; DX to IDE Data Reg 94 xor bh, bh ; BX now contains bus type95 99 mov cx, 256 ; Transfer 256 words (single sector) 96 100 cld ; INSW to increment DI … … 98 102 call HStatus_WaitRdyDefTime ; Wait until drive ready 99 103 100 ; Return101 104 .Return: 102 105 pop bx … … 104 107 pop di 105 108 ret 106 107 108 ;--------------------------------------------------------------------109 ; Returns timeout value for drive detection.110 ; Long timeout is required for detecting first drive to make sure it is111 ; ready after power-on (ATA specification says up to 31 seconds).112 ; Short timeout is used for additional drives to prevent long boot time113 ; when drive has failed or it is not present.114 ;115 ; AH25h_GetDriveDetectionTimeoutValue116 ; Parameters:117 ; DS: Segment to RAMVARS118 ; Returns:119 ; CL: Timeout value120 ; Corrupts registers:121 ; Nothing122 ;--------------------------------------------------------------------123 ALIGN JUMP_ALIGN124 AH25h_GetDriveDetectionTimeoutValue:125 mov cl, B_TIMEOUT_RESET ; Load long timeout (assume first drive)126 cmp BYTE [RAMVARS.bDrvCnt], 0 ; Detecting first drive?127 je SHORT .Return128 mov cl, B_TIMEOUT_DRVINFO ; Load short timeout129 ALIGN JUMP_ALIGN, ret ; This speed optimization may be unnecessary130 .Return:131 ret
Note:
See TracChangeset
for help on using the changeset viewer.