Changeset 521 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Timestamp:
- Mar 10, 2013, 3:46:59 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r520 r521 119 119 jz SHORT .ErrorCodeNotUsed 120 120 mov bl, [di+DPT.bIdevarsOffset] ; replace drive number with Idevars pointer for cmp with dl 121 .ErrorCodeNotUsed: 122 123 mov si, ControllerResetForDPTinDSDI 124 call .CallSIforEveryController ; Reset all drives to power on settings 125 mov si, ControllerInitForMasterOrSingleDPTinDSDI 126 ; Fall to .CallSIforEveryController ; Initialize all controllers (Master and Slave drives) 127 128 .CallSIforEveryController: ; BH will be garbage on exit if this entry point is used, 121 .ErrorCodeNotUsed: ; BH will be garbage on exit if this entry point is used, 129 122 ; but reset of all drives will still happen 130 131 123 mov dl, ROMVARS.ideVars0 ; starting Idevars offset 132 124 … … 139 131 140 132 .loop: 141 push si 142 call FindDPT_ForIdevarsOffsetInDL ; look for the first drive on this controller, if any 143 pop si 144 jc SHORT .notFound 133 call FindDPT_MasterOrSingleForIdevarsOffsetInDL 134 jc SHORT .ControllerNotAvailable 145 135 146 push bx 136 ; Reset controller (both Master and Slave Drive). We ignore error codes 137 ; here since initialization is the one that matters. 147 138 push cx 148 139 push dx 149 call si ; Reset Master AND Slave or initialize Master OR Slave drive 140 push bx 141 %ifdef MODULE_IRQ 142 call Interrupts_UnmaskInterruptControllerForDriveInDSDI 143 %endif 144 call Device_ResetMasterAndSlaveController 145 %ifdef MODULE_ADVANCED_ATA 146 call AdvAtaInit_InitializeControllerForDPTinDSDI 147 %endif 148 pop bx 150 149 pop dx 150 151 ; Initialize Master Drive 152 call AH9h_InitializeDriveForUse ; Initialize Master drive 153 call BackupErrorCodeFromTheRequestedDriveToBH 154 155 ; Initialize Slave Drive 156 call FindDPT_SlaveForIdevarsOffsetInDL 157 jc SHORT .SlaveDriveNotAvailable 158 call AH9h_InitializeDriveForUse 159 ; Here we have a small problem. Since DL now has offset to IDEVARS, it will be the same 160 ; for both Master and Slave Drive. We simply ignore error from slave drive reset since most 161 ; systems do not have slave drives at all and it is unlikely that AH=00h would be called for 162 ; specific drive anyway. AH=Dh is for that. 163 164 .SlaveDriveNotAvailable: 151 165 pop cx 152 pop bx 153 call BackupErrorCodeFromTheRequestedDriveToBH ; save error code if same controller as drive from entry 154 155 .notFound: 166 .ControllerNotAvailable: 156 167 add dl, IDEVARS_size ; move Idevars pointer forward 157 168 loop .loop 158 169 ret 159 160 161 ;--------------------------------------------------------------------162 ; ControllerResetForDPTinDSDI163 ; Parameters:164 ; DS:DI: Ptr to DPT for drive to reset (resets both Master and Slave drive)165 ; SS:BP: Ptr to IDEPACK166 ; Returns:167 ; AH: Int 13h return status168 ; Corrupts registers:169 ; AL, BX, CX, DX170 ;--------------------------------------------------------------------171 ControllerResetForDPTinDSDI:172 %ifdef MODULE_IRQ173 call Interrupts_UnmaskInterruptControllerForDriveInDSDI174 %endif175 %ifdef MODULE_ADVANCED_ATA176 call Device_ResetMasterAndSlaveController177 jmp AdvAtaInit_InitializeControllerForDPTinDSDI178 %else179 jmp Device_ResetMasterAndSlaveController180 %endif181 182 183 ;--------------------------------------------------------------------184 ; ControllerInitForMasterOrSingleDPTinDSDI185 ; Parameters:186 ; DS:DI: Ptr to DPT for Master or Single Drive (initializes both Master and Slave drive)187 ; SS:BP: Ptr to IDEPACK188 ; Returns:189 ; AH: Int 13h return status190 ; Corrupts registers:191 ; AL, BX, CX, DX192 ;--------------------------------------------------------------------193 ControllerInitForMasterOrSingleDPTinDSDI:194 call AH9h_InitializeDriveForUse ; Init Master or Single drive195 push ax ; Store error code196 197 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset] ; Clear AH198 add di, BYTE LARGEST_DPT_SIZE ; Slave drive or next controller199 cmp [di+DPT.bIdevarsOffset], al200 jne SHORT .NoSlaveDrivePresent201 202 call AH9h_InitializeDriveForUse ; Init Slave drive203 .NoSlaveDrivePresent:204 pop bx205 MAX_U ah, bh ; Return error code from either drive206 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r505 r521 73 73 ; CF: 0 if successful, 1 if error 74 74 ; Corrupts registers: 75 ; AL, BX, CX, DX75 ; AL, CX 76 76 ;-------------------------------------------------------------------- 77 77 AH9h_InitializeDriveForUse: … … 93 93 push es 94 94 push si 95 push dx 96 push bx 95 97 96 98 … … 232 234 %endif 233 235 236 pop bx 237 pop dx 234 238 pop si 235 239 pop es
Note:
See TracChangeset
for help on using the changeset viewer.