Changeset 473 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
- Timestamp:
- Oct 10, 2012, 6:22:23 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.