Changeset 35 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Timestamp:
- Aug 24, 2010, 6:44:44 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH0h_HReset.asm
r32 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 27.9.2007 4 ; Last update : 3.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=0h, Disk Controller Reset. … … 44 44 xor al, al ; Zero AL... 45 45 cmp al, bh ; ...and set CF if error 46 jmp Int13h_ StoreErrorCodeToBDAandPopXRegsAndReturn46 jmp Int13h_PopXRegsAndReturn 47 47 48 48 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH14h_HDiag.asm
r28 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 28.9.2007 4 ; Last update : 1.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=14h, Controller Internal Diagnostic. … … 33 33 jnz SHORT .ReturnError 34 34 xor ah, ah ; Zero AH and CF since success 35 jmp Int13h_ StoreErrorCodeToBDAandPopDSDIandReturn35 jmp Int13h_PopDiDsAndReturn 36 36 .ReturnError: 37 37 mov ah, RET_HD_RESETFAIL 38 38 stc 39 jmp Int13h_ StoreErrorCodeToBDAandPopDSDIandReturn39 jmp Int13h_PopDiDsAndReturn -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH15h_HSize.asm
r3 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 28.9.2007 4 ; Last update : 12.4.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=15h, Read Disk Drive Size. … … 44 44 mov ah, 3 ; Type code = Hard disk 45 45 clc 46 jmp Int13h_ReturnWith outSwappingDrives46 jmp Int13h_ReturnWithValueInDL -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1h_HStatus.asm
r28 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 27.9.2007 4 ; Last update : 2 9.7.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=1h, Read Disk Status. … … 32 32 xor ah, ah ; Zero AH 33 33 cmp ah, [BDA.bHDLastSt] ; Set CF if error code is non-zero 34 xchg ah, [BDA.bHDLastSt] ; Last error to AH, zero to BDA34 mov ah, [BDA.bHDLastSt] ; Last error to AH 35 35 36 36 pop ds -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH2h_HRead.asm
r28 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 27.9.2007 4 ; Last update : 1.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=2h, Read Disk Sectors. … … 63 63 mov ah, RET_HD_INVALID ; Invalid value passed 64 64 stc ; Set CF since error 65 jmp Int13h_ StoreErrorCodeToBDAandPopDSDIandReturn65 jmp Int13h_PopDiDsAndReturn -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH8h_HParams.asm
r32 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 27.9.2007 4 ; Last update : 3.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=8h, Read Disk Drive Parameters. … … 38 38 call AH8h_GetDriveParameters 39 39 pop bx 40 jmp Int13h_ReturnWith outSwappingDrives40 jmp Int13h_ReturnWithValueInDL 41 41 42 42 ALIGN JUMP_ALIGN … … 44 44 call Int13h_CallPreviousInt13hHandler 45 45 call RamVars_GetCountOfKnownDrivesToDL 46 jmp Int13h_ReturnWith outSwappingDrives46 jmp Int13h_ReturnWithValueInDL 47 47 48 48 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r28 r35 82 82 and BYTE [di+DPT.bReset], ~FLG_RESET_nSETBLOCK 83 83 84 ; Force PIO mode 085 ;call AH9h_ForcePioMode086 87 84 .ReturnNotSuccessfull: 88 85 pop cx … … 152 149 .Return: 153 150 ret 154 155 156 ;--------------------------------------------------------------------157 ; AH9h_ForcePioMode0158 ; Parameters:159 ; DL: Drive number160 ; DS:DI: Ptr to DPT161 ; Returns:162 ; AH: BIOS Error code163 ; CF: Cleared if succesfull164 ; Set if any error165 ; Corrupts registers:166 ; AX, BX167 ;--------------------------------------------------------------------168 ;ALIGN JUMP_ALIGN169 ;AH9h_ForcePioMode0:170 ; mov bh, 08h ; Parameter to Sector Count Register (PIO Flow Control Transfer Mode 0)171 ; mov ax, 2303h ; Feature: Set transfer mode based on value in Sector Count register172 ; int 13h173 ; jc SHORT .FailedToForcePIO0174 ; ; Debug output here175 ; ret176 ;.FailedToForcePIO0:177 ; ; Debug output here178 ; ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
r33 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 9.12.2007 4 ; Last update : 2 3.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h function AH=Dh, Reset Hard Disk (Alternate reset). … … 26 26 AHDh_HandlerForResetHardDisk: 27 27 call AHDh_ResetDrive 28 jmp Int13h_ StoreErrorCodeToBDAandPopDSDIandReturn28 jmp Int13h_PopDiDsAndReturn 29 29 30 30 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HError.asm
r34 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 30.11.2007 4 ; Last update : 2 3.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Error checking functions for BIOS Hard disk functions. … … 23 23 ALIGN JUMP_ALIGN 24 24 HError_ProcessTimeoutAfterPollingBSYandSomeOtherStatusBit: 25 push ds26 push dx27 28 25 call HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA 29 26 call GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 30 jc SHORT StoreErrorCodeFromAHtoBDA27 jc SHORT .ReturnErrorCodeInAH 31 28 mov ah, RET_HD_TIMEOUT ; Force timeout since no actual error... 32 29 stc ; ...but wanted bit was never set 33 jmp SHORT StoreErrorCodeFromAHtoBDA 30 .ReturnErrorCodeInAH: 31 ret 34 32 35 33 36 34 ALIGN JUMP_ALIGN 37 35 HError_ProcessErrorsAfterPollingBSY: 38 push ds39 push dx40 41 36 call HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA 42 call GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 43 StoreErrorCodeFromAHtoBDA: 44 mov [BDA.bHDLastSt], ah ; Store BIOS error code to BDA 45 46 pop dx 47 pop ds 48 ret 37 jmp SHORT GetBiosErrorCodeToAHfromStatusAndErrorRegistersInAX 49 38 50 39 … … 56 45 ; AL: IDE Status Register contents 57 46 ; AH: IDE Error Register contents 58 ; DS: BDA segment59 47 ; Corrupts registers: 60 ; DX48 ; Nothing 61 49 ;-------------------------------------------------------------------- 62 50 ALIGN JUMP_ALIGN 63 51 HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA: 52 push ds 53 push dx 54 64 55 mov dx, [RAMVARS.wIdeBase] ; Load IDE base port address 65 56 inc dx ; Increment to Error Register … … 68 59 add dx, BYTE REGR_IDE_ST - REGR_IDE_ERROR 69 60 in al, dx ; Read Status Register to AL 70 ; Fall to .StoreStatusAndErrorRegistersFromAXtoBDA71 61 72 ;--------------------------------------------------------------------73 ; .StoreStatusAndErrorRegistersFromAXtoBDA74 ; Parameters:75 ; AL: IDE Status Register contents76 ; AH: IDE Error Register contents77 ; Returns:78 ; DS: BDA segment (zero)79 ; Corrupts registers:80 ; DX81 ;--------------------------------------------------------------------82 .StoreStatusAndErrorRegistersFromAXtoBDA:83 62 LOAD_BDA_SEGMENT_TO ds, dx 84 63 mov [HDBDA.wHDStAndErr], ax 64 65 pop dx 66 pop ds 85 67 ret 86 68 … … 148 130 db RET_HD_BADSECTOR ; Bit7=BBK, Bad Block Detected 149 131 db RET_HD_STATUSERR ; When Error Register is zero 150 151 152 ;--------------------------------------------------------------------153 ; HError_StoreBiosErrorCodeFromAHtoBDA154 ; Parameters:155 ; AH: BIOS error code156 ; Returns:157 ; Nothing158 ; Corrupts registers:159 ; DI160 ;--------------------------------------------------------------------161 ALIGN JUMP_ALIGN162 HError_StoreBiosErrorCodeFromAHtoBDA:163 push ds164 mov di, 0 ; Zero DI and preserve FLAGS165 mov ds, di ; Copy BDA segment to DS166 mov [BDA.bHDLastSt], ah167 pop ds168 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Common/HIRQ.asm
r34 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 11.12.2009 4 ; Last update : 2 3.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Interrupt handling related functions. … … 98 98 jmp SHORT AcknowledgeMasterInterruptController 99 99 100 100 101 ALIGN JUMP_ALIGN 101 102 HIRQ_InterruptServiceRoutineForIrqs8to15: … … 132 133 push ds 133 134 push di 134 push dx135 135 136 136 ; Reading Status Register acknowledges IDE interrupt 137 137 call RamVars_GetSegmentToDS 138 138 call HError_GetStatusAndErrorRegistersToAXandStoreThemToBDA 139 140 ; Set Task Flag 141 LOAD_BDA_SEGMENT_TO ds, ax 139 142 mov BYTE [BDA.bHDTaskFlg], 0FFh ; Set task flag 140 143 141 pop dx142 144 pop di 143 145 pop ds
Note:
See TracChangeset
for help on using the changeset viewer.