Changeset 148 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common
- Timestamp:
- Mar 19, 2011, 8:09:41 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HCapacity.asm
r117 r148 13 13 ; DL: Drive number 14 14 ; DS: RAMVARS segment 15 ; DS:DI: Ptr to DPT (HCapacity_GetSectorCountFromOurAH08h) 15 16 ; Returns: 16 17 ; DX:AX: Total sector count … … 21 22 ALIGN JUMP_ALIGN 22 23 HCapacity_GetSectorCountFromForeignAH08h: 23 mov ah, 08h ; Get Drive Parameters24 mov ah, GET_DRIVE_PARAMETERS 24 25 call Int13h_CallPreviousInt13hHandler 25 jmp SHORT HCapacity_ConvertAH08hReturnValuesToSectorCount26 jmp SHORT ConvertAH08hReturnValuesToSectorCount 26 27 27 28 ALIGN JUMP_ALIGN 28 29 HCapacity_GetSectorCountFromOurAH08h: 29 push di30 30 call AH8h_GetDriveParameters 31 pop di 32 ; Fall to HCapacity_ConvertAH08hReturnValuesToSectorCount 31 ; Fall to ConvertAH08hReturnValuesToSectorCount 33 32 34 ALIGN JUMP_ALIGN 35 HCapacity_ConvertAH08hReturnValuesToSectorCount: 33 ConvertAH08hReturnValuesToSectorCount: 36 34 call HAddress_ExtractLCHSFromBiosParams 37 35 xor ax, ax ; Zero AX -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HDrvSel.asm
r88 r148 4 4 ; Section containing code 5 5 SECTION .text 6 7 ;-------------------------------------------------------------------- 8 ; Selects Master or Slave drive and disables interrupts. Interrupts should 9 ; be disabled for commands that do not transfer data. 10 ; This function returns after drive is ready to accept commands. 11 ; 12 ; HDrvSel_SelectDriveAndDisableIRQ 13 ; Parameters: 14 ; DS:DI: Ptr to DPT 15 ; Returns: 16 ; AH: BIOS Error code 17 ; CF: 0 if drive selected successfully 18 ; 1 if any error 19 ; Corrupts registers: 20 ; AL 21 ;-------------------------------------------------------------------- 22 ALIGN JUMP_ALIGN 23 HDrvSel_SelectDriveAndDisableIRQ: 24 push bx 25 mov al, [di+DPT.bDrvCtrl] ; Load Device Control Byte 26 or al, FLG_IDE_CTRL_nIEN ; Disable interrupts 27 call HDrvSel_SelectDriveAndSetControlByte 28 pop bx 29 ret 30 6 31 7 32 ;-------------------------------------------------------------------- … … 81 106 out dx, al ; Output Device Control byte 82 107 ret 83 84 85 ;--------------------------------------------------------------------86 ; Selects Master or Slave drive and disables interrupts. Interrupts should87 ; be disabled for commands that do not transfer data.88 ; This function returns after drive is ready to accept commands.89 ;90 ; HDrvSel_SelectDriveAndDisableIRQ91 ; Parameters:92 ; DS:DI: Ptr to DPT93 ; Returns:94 ; AH: BIOS Error code95 ; CF: 0 if drive selected successfully96 ; 1 if any error97 ; Corrupts registers:98 ; AL99 ;--------------------------------------------------------------------100 ALIGN JUMP_ALIGN101 HDrvSel_SelectDriveAndDisableIRQ:102 push bx103 mov al, [di+DPT.bDrvCtrl] ; Load Device Control Byte104 or al, FLG_IDE_CTRL_nIEN ; Disable interrupts105 call HDrvSel_SelectDriveAndSetControlByte106 pop bx107 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HError.asm
r86 r148 1 ; Project name : IDEBIOS1 ; Project name : XTIDE Universal BIOS 2 2 ; Description : Error checking functions for BIOS Hard disk functions. 3 3 … … 6 6 7 7 ;-------------------------------------------------------------------- 8 ; HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit 9 ; HError_ProcessErrorsAfterPollingBSY 8 ; HError_GetErrorCodeToAHforTimeoutWhenPolling 10 9 ; Parameters: 11 10 ; DS: RAMVARS segment … … 18 17 ;-------------------------------------------------------------------- 19 18 ALIGN JUMP_ALIGN 20 HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit: 21 call HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA 22 call GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 19 HError_GetErrorCodeToAHforTimeoutWhenPolling: 20 call HError_GetErrorCodeToAHafterPolling 23 21 jc SHORT .ReturnErrorCodeInAH 24 22 mov ah, RET_HD_TIMEOUT ; Force timeout since no actual error... … … 28 26 29 27 28 ;-------------------------------------------------------------------- 29 ; HError_GetErrorCodeToAHafterPolling 30 ; Parameters: 31 ; DS: RAMVARS segment 32 ; Returns: 33 ; AH: BIOS error code 34 ; CF: Set if error 35 ; Cleared if no error 36 ; Corrupts registers: 37 ; AL 38 ;-------------------------------------------------------------------- 30 39 ALIGN JUMP_ALIGN 31 HError_ ProcessErrorsAfterPollingBSY:40 HError_GetErrorCodeToAHafterPolling: 32 41 %ifndef USE_186 33 42 call HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA … … 131 140 db RET_HD_BADSECTOR ; Bit7=BBK, Bad Block Detected 132 141 db RET_HD_STATUSERR ; When Error Register is zero 142 143 144 ;-------------------------------------------------------------------- 145 ; HError_SetErrorCodeToBdaAndToIntpackInSSBPfromAH 146 ; HError_SetErrorCodeToIntpackInSSBPfromAH 147 ; Parameters: 148 ; AH: BIOS error code (00h = no error) 149 ; SS:BP: Ptr to INTPACK 150 ; Returns: 151 ; SS:BP: Ptr to INTPACK with error condition set 152 ; Corrupts registers: 153 ; DS, DI 154 ;-------------------------------------------------------------------- 155 ALIGN JUMP_ALIGN 156 HError_SetErrorCodeToBdaAndToIntpackInSSBPfromAH: 157 ; Store error code to BDA 158 LOAD_BDA_SEGMENT_TO ds, di 159 mov [BDA.bHDLastSt], ah 160 161 ; Store error code to INTPACK 162 HError_SetErrorCodeToIntpackInSSBPfromAH: 163 mov [bp+INTPACK.ah], ah 164 test ah, ah 165 jnz SHORT .SetCFtoIntpack 166 and BYTE [bp+INTPACK.flags], ~FLG_FLAGS_CF 167 ret 168 .SetCFtoIntpack: 169 or BYTE [bp+INTPACK.flags], FLG_FLAGS_CF 170 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HIRQ.asm
r116 r148 8 8 ; HIRQ_WaitForIRQ 9 9 ; Parameters: 10 ; DS: RAMVARS segment10 ; DS:BX: Ptr to DPT 11 11 ; Returns: 12 12 ; CF: Set if wait done by operating system … … 36 36 37 37 LOAD_BDA_SEGMENT_TO ds, ax, ! ; Zero AX 38 mov ah, OS_HOOK_DEVICE_BUSY ; Hard disk busy (AX=9000h) 38 39 cli ; Disable interrupts 39 40 cmp al, [BDA.bHDTaskFlg] ; Task flag already set? 40 41 jc SHORT .ReturnFromWaitNotify ; If so, skip OS notification 41 42 mov ah, 90h ; Hard disk busy (AX=9000h) 43 int INTV_SYSTEM_SERVICES ; OS hook, device busy 42 int BIOS_SYSTEM_INTERRUPT_15h ; OS hook, device busy 44 43 jnc SHORT .ReturnFromWaitNotify ; CF cleared, BIOS handles waiting 45 44 … … 106 105 107 106 ; Issue Int 15h, function AX=9100h (Interrupt ready) 108 mov ax, 9100h; Interrupt ready, device 0 (HD)109 int INTV_SYSTEM_SERVICES107 mov ax, OS_HOOK_DEVICE_POST<<8 ; Interrupt ready, device 0 (HD) 108 int BIOS_SYSTEM_INTERRUPT_15h 110 109 111 110 pop ax ; Restore AX -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HStatus.asm
r140 r148 21 21 ALIGN JUMP_ALIGN 22 22 HStatus_WaitIrqOrRdy: 23 call HIRQ_WaitForIRQ 23 call HIRQ_WaitForIRQ ; For OS hook (we still need error processing) 24 24 jnc SHORT .PollRdySinceNoWaitingOnOsHook 25 jmp HError_ ProcessErrorsAfterPollingBSY25 jmp HError_GetErrorCodeToAHafterPolling 26 26 27 27 ALIGN JUMP_ALIGN … … 48 48 call HIRQ_WaitForIRQ 49 49 jnc SHORT .PollDrqSinceNoWaitingOnOsHook 50 jmp HError_ ProcessErrorsAfterPollingBSY50 jmp HError_GetErrorCodeToAHafterPolling 51 51 52 52 ALIGN JUMP_ALIGN … … 185 185 .UpdateTimeout: 186 186 call HTimer_SetCFifTimeout 187 jnc SHORT .PollLoop ; Loop if time left (sets CF on timeout)188 jmp HError_ ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit187 jnc SHORT .PollLoop ; Loop if time left 188 jmp HError_GetErrorCodeToAHforTimeoutWhenPolling 189 189 190 190 ;-------------------------------------------------------------------- … … 218 218 ALIGN JUMP_ALIGN 219 219 GetErrorCodeFromPollingToAH: 220 jmp HError_ ProcessErrorsAfterPollingBSY220 jmp HError_GetErrorCodeToAHafterPolling -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HTimer.asm
r143 r148 45 45 ; RTC resolution is 977 microsecs. 46 46 ; 47 ; HTimer_ MicrosecondsFromAX47 ; HTimer_DelayMicrosecondsFromAX 48 48 ; Parameters: 49 49 ; AX: Number of microsecs to wait … … 53 53 ; AX 54 54 ;-------------------------------------------------------------------- 55 HTimer_ MicrosecondsFromAX:55 HTimer_DelayMicrosecondsFromAX: 56 56 %ifndef USE_AT 57 57 mov ax, 1 … … 62 62 63 63 xor cx, cx 64 xchg dx, ax 64 xchg dx, ax ; Microsecs now in CX:DX 65 65 mov ah, EVENT_WAIT 66 66 int BIOS_SYSTEM_INTERRUPT_15h 67 sti 67 sti ; XT BIOSes return with interrupt disabled 68 68 69 69 pop cx 70 70 pop dx 71 mov ax, 1 ; Prepare to wait 1 timer tick72 jc SHORT HTimer_ TimerTicksFromAX ; Event Wait was unsupported or busy71 mov ax, 1 ; Prepare to wait 1 timer tick 72 jc SHORT HTimer_DelayTimerTicksFromAX ; Event Wait was unsupported or busy 73 73 ret 74 74 %endif … … 79 79 ; will occur at 54.9 ms intervals. 80 80 ; 81 ; HTimer_ TimerTicksFromAX81 ; HTimer_DelayTimerTicksFromAX 82 82 ; Parameters: 83 83 ; AX: Number of timer ticks to wait … … 87 87 ; AX 88 88 ;-------------------------------------------------------------------- 89 HTimer_ TimerTicksFromAX:89 HTimer_DelayTimerTicksFromAX: 90 90 sti ; Make sure that interrupts are enabled 91 91 call ReadTimeFromBdaToCX
Note:
See TracChangeset
for help on using the changeset viewer.