Changeset 140 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common
- Timestamp:
- Mar 14, 2011, 11:38:26 AM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HStatus.asm
r120 r140 172 172 ALIGN JUMP_ALIGN 173 173 HStatus_PollBsyAndFlg: 174 call InitializeTimeoutWithTicksInCL; Initialize timeout counter175 in al, dx ; Discard contents for first read176 ; (should read Alternate Status Register)174 call HTimer_InitializeTimeoutWithTicksInCL ; Initialize timeout counter 175 in al, dx ; Discard contents for first read 176 ; (should read Alternate Status Register) 177 177 ALIGN JUMP_ALIGN 178 178 .PollLoop: 179 in al, dx ; Load IDE Status Register180 test al, FLG_IDE_ST_BSY ; Controller busy?181 jnz SHORT .UpdateTimeout ; If so, jump to timeout update182 test al, ah ; Test secondary flag183 jnz SHORT GetErrorCodeFromPollingToAH ; If set, break loop179 in al, dx ; Load IDE Status Register 180 test al, FLG_IDE_ST_BSY ; Controller busy? 181 jnz SHORT .UpdateTimeout ; If so, jump to timeout update 182 test al, ah ; Test secondary flag 183 jnz SHORT GetErrorCodeFromPollingToAH ; If set, break loop 184 184 ALIGN JUMP_ALIGN 185 185 .UpdateTimeout: 186 call SetCFifTimeout187 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout)186 call HTimer_SetCFifTimeout 187 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout) 188 188 jmp HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit 189 189 … … 206 206 ALIGN JUMP_ALIGN 207 207 HStatus_PollBsy: 208 call InitializeTimeoutWithTicksInCL; Initialize timeout counter209 in al, dx ; Discard contents for first read210 ; (should read Alternate Status Register)208 call HTimer_InitializeTimeoutWithTicksInCL ; Initialize timeout counter 209 in al, dx ; Discard contents for first read 210 ; (should read Alternate Status Register) 211 211 ALIGN JUMP_ALIGN 212 212 .PollLoop: 213 in al, dx ; Load IDE Status Reg214 test al, FLG_IDE_ST_BSY ; Controller busy?215 jz SHORT GetErrorCodeFromPollingToAH ; If not, jump to check errors216 call SetCFifTimeout; Update timeout counter217 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout)213 in al, dx ; Load IDE Status Reg 214 test al, FLG_IDE_ST_BSY ; Controller busy? 215 jz SHORT GetErrorCodeFromPollingToAH ; If not, jump to check errors 216 call HTimer_SetCFifTimeout ; Update timeout counter 217 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout) 218 218 ALIGN JUMP_ALIGN 219 219 GetErrorCodeFromPollingToAH: 220 220 jmp HError_ProcessErrorsAfterPollingBSY 221 222 223 ;--------------------------------------------------------------------224 ; InitializeTimeoutWithTicksInCL225 ; Parameters:226 ; CL: Timeout value in system timer ticks227 ; DS: Segment to RAMVARS228 ; Returns:229 ; Nothing230 ; Corrupts registers:231 ; CX232 ;--------------------------------------------------------------------233 ALIGN JUMP_ALIGN234 InitializeTimeoutWithTicksInCL:235 push bx236 xchg cx, ax237 238 xor ah, ah ; Timeout ticks now in AX239 mov bx, RAMVARS.wTimeoutCounter240 call TimerTicks_InitializeTimeoutFromAX241 242 xchg ax, cx ; Restore AX243 pop bx244 ret245 246 ;--------------------------------------------------------------------247 ; SetCFifTimeout248 ; Parameters:249 ; DS: Segment to RAMVARS250 ; Returns:251 ; CF: Set if timeout252 ; Cleared if time left253 ; Corrupts registers:254 ; CX255 ;--------------------------------------------------------------------256 ALIGN JUMP_ALIGN257 SetCFifTimeout:258 push bx259 xchg cx, ax260 261 mov bx, RAMVARS.wTimeoutCounter262 call TimerTicks_GetTimeoutTicksLeftToAXfromDSBX263 264 xchg ax, cx ; Restore AX265 pop bx266 ret
Note:
See TracChangeset
for help on using the changeset viewer.