Changeset 473 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Oct 10, 2012, 6:22:23 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
r472 r473 38 38 ;-------------------------------------------------------------------- 39 39 AH1Eh_HandlerForXTCFfeatures: 40 xor ah, ah ; Subcommand now in AX41 40 %ifndef USE_186 42 call AH1Eh_ProcessXTCFsubcommandFromA X41 call AH1Eh_ProcessXTCFsubcommandFromAL 43 42 jmp Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 44 43 %else 45 44 push Int13h_ReturnFromHandlerAfterStoringErrorCodeFromAH 46 ; Fall to AH1Eh_ProcessXTCFsubcommandFromA X45 ; Fall to AH1Eh_ProcessXTCFsubcommandFromAL 47 46 %endif 48 47 49 48 50 49 ;-------------------------------------------------------------------- 51 ; AH1Eh_ProcessXTCFsubcommandFromA X50 ; AH1Eh_ProcessXTCFsubcommandFromAL 52 51 ; Parameters: 53 ; A X: XT-CF subcommand (see XTCF.inc for more info)52 ; AL: XT-CF subcommand (see XTCF.inc for more info) 54 53 ; DS:DI: Ptr to DPT (in RAMVARS segment) 55 54 ; SS:BP: Ptr to IDEPACK … … 58 57 ; CF: 0 if successful, 1 if error 59 58 ; Corrupts registers: 60 ; AL, BX, CX, DX 59 ; AL, BX, CX, DX, SI 61 60 ;-------------------------------------------------------------------- 62 AH1Eh_ProcessXTCFsubcommandFromA X:61 AH1Eh_ProcessXTCFsubcommandFromAL: 63 62 ; IS_THIS_DRIVE_XTCF. We check this for all commands. 64 dec ax ; Subcommand65 mov dx, [di+DPT.wXTCFport]66 test dx, dx ; Never zero for XT-CF, Always zero for other devices67 jz SHORT XTCFnotFound63 call AccessDPT_IsThisDeviceXTCF 64 jne SHORT XTCFnotFound 65 and ax, BYTE 7Fh ; Subcommand now in AX 66 jz SHORT .ReturnWithSuccess ; IS_THIS_DRIVE_XTCF 68 67 69 68 ; READ_XTCF_CONTROL_REGISTER_TO_DH 70 add dl, XTCF_CONTROL_REGISTER ; DX to Control Register 71 dec ax ; Subcommand 69 dec ax ; Subcommand 72 70 jnz SHORT .SkipReadXtcfControlRegisterToDH 71 mov dx, [di+DPT.wBasePort] 72 add dl, XTCF_CONTROL_REGISTER 73 73 in al, dx 74 74 mov [bp+IDEPACK.intpack+INTPACK.dh], al 75 jmp SHORT .ReturnWithSuccess 75 .ReturnWithSuccess: 76 xor ah, ah 77 ret 76 78 .SkipReadXtcfControlRegisterToDH: 77 79 78 80 ; WRITE_DH_TO_XTCF_CONTROL_REGISTER 79 dec ax ; Subcommand81 dec ax ; Subcommand 80 82 jnz SHORT XTCFnotFound ; Invalid subcommand 81 83 mov al, [bp+IDEPACK.intpack+INTPACK.dh] 84 ; Fall to AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL 85 86 87 ;-------------------------------------------------------------------- 88 ; AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL 89 ; Parameters: 90 ; AL: XT-CF Control Register 91 ; DS:DI: Ptr to DPT (in RAMVARS segment) 92 ; SS:BP: Ptr to IDEPACK 93 ; Returns: 94 ; AH: Int 13h return status 95 ; CF: 0 if successful, 1 if error 96 ; Corrupts registers: 97 ; AL, BX, CX, DX, SI 98 ;-------------------------------------------------------------------- 99 AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL: 100 ; Output Control Register 101 mov dx, [di+DPT.wBasePort] 102 add dl, XTCF_CONTROL_REGISTER 82 103 out dx, al 83 .ReturnWithSuccess: 84 xor ah, ah 85 ret 104 105 ; Convert Control Register Contents to device code 106 test al, al 107 jz SHORT .Set8bitPioMode 108 cmp al, XTCF_MEMORY_MAPPED_MODE 109 jae SHORT .SetMemoryMappedMode 110 111 ; Set DMA Mode 112 mov BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA 113 jmp AH23h_Disable8bitPioMode 114 115 .SetMemoryMappedMode: 116 mov BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_MEMMAP 117 jmp AH23h_Disable8bitPioMode 118 119 .Set8bitPioMode: 120 mov BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_PIO8 121 jmp AH23h_Enable8bitPioMode 86 122 87 123 … … 96 132 ; Set if XT-CF not found 97 133 ; Corrupts registers: 98 ; AL , DX134 ; AL 99 135 ;-------------------------------------------------------------------- 100 136 AH1Eh_DetectXTCFwithBasePortInDX: 137 push dx 101 138 add dl, XTCT_CONTROL_REGISTER_INVERTED_in ; set DX to XT-CF config register (inverted) 102 139 in al, dx ; get value … … 104 141 inc dx ; set DX to XT-CF config register (non-inverted) 105 142 in al, dx ; get value 106 not al ; invert it 143 not al ; invert value 144 pop dx 107 145 sub ah, al ; do they match? (clear AH if they do) 108 146 jz SHORT XTCFfound 109 147 110 148 XTCFnotFound: 149 AH1Eh_LoadInvalidCommandToAHandSetCF: 111 150 stc ; set carry flag since XT-CF not found 112 151 mov ah, RET_HD_INVALID -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm
r376 r473 74 74 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) 75 75 jmp Idepack_StoreNonExtParametersAndIssueCommandFromAL 76 77 78 %ifdef MODULE_8BIT_IDE 79 ;-------------------------------------------------------------------- 80 ; AH23h_Enable8bitPioMode 81 ; AH23h_Disable8bitPioMode 82 ; Parameters: 83 ; DS:DI: Ptr to DPT (in RAMVARS segment) 84 ; SS:BP: Ptr to IDEPACK 85 ; Returns: 86 ; AH: Int 13h return status 87 ; CF: 0 if successful, 1 if error 88 ; Corrupts registers: 89 ; AL, BX, CX, DX, SI 90 ;-------------------------------------------------------------------- 91 AH23h_Enable8bitPioMode: 92 mov si, FEATURE_ENABLE_8BIT_PIO_TRANSFER_MODE 93 jmp SHORT AH23h_SetControllerFeatures 94 AH23h_Disable8bitPioMode: 95 mov si, FEATURE_DISABLE_8BIT_PIO_TRANSFER_MODE 96 jmp SHORT AH23h_SetControllerFeatures 97 %endif ; MODULE_8BIT_IDE -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
r376 r473 59 59 ;-------------------------------------------------------------------- 60 60 AH24h_SetBlockSize: 61 ; XT-CF does not support largest block size in DMA mode. 62 %ifdef MODULE_8BIT_IDE 63 call AccessDPT_IsThisDeviceXTCF 64 cmp ah, DEVICE_8BIT_XTCF_DMA 65 jne SHORT .NoNeedToLimitBlockSize 66 cmp al, XTCF_DMA_MODE_MAX_BLOCK_SIZE 67 ja SHORT AH1Eh_LoadInvalidCommandToAHandSetCF 68 .NoNeedToLimitBlockSize: 69 %endif ; MODULE_8BIT_IDE 70 61 71 push bx 62 72 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r445 r473 104 104 jmp .ReturnWithErrorCodeInAH 105 105 .ContinueInitializationSinceDriveSelectedSuccesfully: 106 107 108 ;;; Set XT-CF mode 109 %ifdef MODULE_8BIT_IDE 110 call AccessDPT_IsThisDeviceXTCF 111 jne SHORT .DoNotSetXTCFmode 112 113 call AccessDPT_GetIdevarsToCSBX 114 mov al, [cs:bx+IDEVARS.bXTCFcontrolRegister] 115 call AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL 116 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_SET_XTCF_MODE 117 .DoNotSetXTCFmode: 118 %endif 106 119 107 120 … … 125 138 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS 126 139 .SkipInitializeDeviceParameters: 127 128 129 %ifdef MODULE_8BIT_IDE130 ;;; Enable 8-bit PIO Transfer Mode for Lo-tech XT-CF (CF and Microdrives only)131 call AH9h_Enable8bitPioModeForXTCF132 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_ENABLE_8BIT_PIO_MODE133 %endif134 140 135 141 … … 244 250 ; Nothing 245 251 ;-------------------------------------------------------------------- 246 DoNotEnable8bitMode:247 252 IgnoreInvalidCommandError: 248 253 xor ah, ah ; Clears CF … … 256 261 .NoErrorFlagToSet: 257 262 ret 258 259 260 %ifdef MODULE_8BIT_IDE261 ;--------------------------------------------------------------------262 ; AH9h_Enable8bitPioModeForXTCF263 ; Parameters:264 ; DS:DI: Ptr to DPT265 ; SS:BP: Ptr to IDEPACK266 ; Returns:267 ; AH: Int 13h return status268 ; CF: 0 if successful, 1 if error269 ; Corrupts registers:270 ; AL, BX, CX, DX, SI271 ;--------------------------------------------------------------------272 AH9h_Enable8bitPioModeForXTCF:273 eMOVZX bx, [di+DPT.bIdevarsOffset]274 cmp BYTE [cs:bx+IDEVARS.bDevice], DEVICE_8BIT_XTCF275 jne SHORT DoNotEnable8bitMode276 277 mov si, FEATURE_ENABLE_8BIT_PIO_TRANSFER_MODE278 jmp AH23h_SetControllerFeatures279 %endif ; MODULE_8BIT_IDE -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
r445 r473 70 70 71 71 ; Initialize Master and Slave drives 72 eMOVZX ax, [di+DPT.bIdevarsOffset] ; (AL) pointer to controller we are looking to reset 72 call AccessDPT_GetIdevarsToCSBX 73 xchg ax, bx ; (AL) pointer to controller we are looking to reset 73 74 ; (AH) initialize error code, assume success 74 75
Note:
See TracChangeset
for help on using the changeset viewer.