Changeset 35 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Aug 24, 2010, 6:44:44 PM (14 years ago)
- google:author:
- aitotat
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h.asm
r32 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 21.9.2007 4 ; Last update : 1.8.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Int 13h BIOS functions (Floppy and Hard disk). … … 95 95 ; Special return processing required if target function 96 96 ; returns something in DL 97 mov di, Int13h_ReturnFromAnotherBiosWith outSwappingDrives97 mov di, Int13h_ReturnFromAnotherBiosWithValueInDL 98 98 call DriveXlate_DoesFunctionReturnSomethingInDL 99 99 jc SHORT .PushIretAddress 100 add di, BYTE Int13h_ReturnFromAnotherBios - Int13h_ReturnFromAnotherBiosWith outSwappingDrives100 add di, BYTE Int13h_ReturnFromAnotherBios - Int13h_ReturnFromAnotherBiosWithValueInDL 101 101 .PushIretAddress: 102 102 pushf ; Push FLAGS to simulate INT … … 133 133 134 134 ;-------------------------------------------------------------------- 135 ; Return handlers from another INT 13h BIOS. 136 ; 137 ; Int13h_ReturnFromAnotherBiosWithoutSwappingDrives 135 ; Int13h_ReturnFromAnotherBiosWithValueInDL 138 136 ; Int13h_ReturnFromAnotherBios 139 137 ; Parameters: … … 147 145 ;-------------------------------------------------------------------- 148 146 ALIGN JUMP_ALIGN 149 Int13h_ReturnFromAnotherBiosWith outSwappingDrives:147 Int13h_ReturnFromAnotherBiosWithValueInDL: 150 148 push ds 151 149 push di 152 150 pushf ; Store return flags 153 151 call RamVars_GetSegmentToDS 154 dec BYTE [RAMVARS.xlateVars+XLATEVARS.bRecurCnt]152 call DriveXlate_WhenLeavingInt13hWithReturnValueInDL 155 153 jmp SHORT Int13h_Leave 154 156 155 ALIGN JUMP_ALIGN 157 156 Int13h_ReturnFromAnotherBios: … … 167 166 ; Returns from any BIOS function implemented by this BIOS. 168 167 ; 169 ; Int13h_ReturnWithoutSwappingDrives 170 ; Int13h_StoreErrorCodeToBDAandPopDSDIandReturn 171 ; Int13h_StoreErrorCodeToBDAandPopXRegsAndReturn 168 ; Int13h_ReturnWithValueInDL 172 169 ; Int13h_PopXRegsAndReturn 173 170 ; Int13h_PopDiDsAndReturn … … 181 178 ;-------------------------------------------------------------------- 182 179 ALIGN JUMP_ALIGN 183 Int13h_ReturnWith outSwappingDrives:180 Int13h_ReturnWithValueInDL: 184 181 pushf 185 dec BYTE [RAMVARS.xlateVars+XLATEVARS.bRecurCnt] ; Preserves CF 186 call HError_StoreBiosErrorCodeFromAHtoBDA 187 jmp SHORT Int13h_Leave 188 189 ALIGN JUMP_ALIGN 190 Int13h_StoreErrorCodeToBDAandPopDSDIandReturn: 191 call HError_StoreBiosErrorCodeFromAHtoBDA 192 jmp SHORT Int13h_PopDiDsAndReturn 193 194 ALIGN JUMP_ALIGN 195 Int13h_StoreErrorCodeToBDAandPopXRegsAndReturn: 196 call HError_StoreBiosErrorCodeFromAHtoBDA 182 call DriveXlate_WhenLeavingInt13hWithReturnValueInDL 183 jmp SHORT Int13h_LeaveAfterStoringErrorCodeToBDA 184 197 185 ALIGN JUMP_ALIGN 198 186 Int13h_PopXRegsAndReturn: … … 202 190 pop cx 203 191 pop dx 192 ; Fall to Int13h_PopDiDsAndReturn 193 204 194 ALIGN JUMP_ALIGN 205 195 Int13h_PopDiDsAndReturn: 206 196 pushf 207 197 call DriveXlate_WhenLeavingInt13h 198 ; Fall to Int13h_LeaveAfterStoringErrorCodeToBDA 199 200 Int13h_LeaveAfterStoringErrorCodeToBDA: 201 LOAD_BDA_SEGMENT_TO ds, di 202 mov [BDA.bHDStatus], ah 203 ; Fall to Int13h_Leave 204 208 205 Int13h_Leave: 209 206 popf -
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 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DriveXlate.asm
r3 r35 2 2 ; Project name : IDE BIOS 3 3 ; Created date : 15.3.2010 4 ; Last update : 2 .4.20104 ; Last update : 24.8.2010 5 5 ; Author : Tomi Tilli 6 6 ; Description : Functions for swapping drive letters. … … 28 28 ret 29 29 30 31 ;-------------------------------------------------------------------- 32 ; DriveXlate_WhenLeavingInt13hWithReturnValueInDL 33 ; Parameters: 34 ; DS: RAMVARS segment 35 ; Returns: 36 ; Nothing 37 ; Corrupts registers: 38 ; DI 39 ;-------------------------------------------------------------------- 40 ALIGN JUMP_ALIGN 41 DriveXlate_WhenLeavingInt13hWithReturnValueInDL: 42 dec BYTE [RAMVARS.xlateVars+XLATEVARS.bRecurCnt] 43 ret 30 44 31 45 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r33 r35 38 38 at ROMVARS.bRomSize, db CNT_ROM_BLOCKS ; ROM size in 512B blocks 39 39 at ROMVARS.rgbJump, jmp Initialize_FromMainBiosRomSearch 40 at ROMVARS.rgbDate, db "08/2 3/10" ; Build data (mm/dd/yy)40 at ROMVARS.rgbDate, db "08/24/10" ; Build data (mm/dd/yy) 41 41 at ROMVARS.rgbSign, db "XTIDE110" ; Signature for flash program 42 42 at ROMVARS.szTitle … … 49 49 db " (XT)=-",STOP 50 50 %endif 51 at ROMVARS.szVersion, db "v1.1. 3 (08/23/10)",STOP51 at ROMVARS.szVersion, db "v1.1.4 (08/24/10)",STOP 52 52 53 53 ;---------------------------;
Note:
See TracChangeset
for help on using the changeset viewer.