Changeset 588 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Handlers
- Timestamp:
- Jun 3, 2015, 12:30:54 PM (9 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm
r584 r588 65 65 ; IS_THIS_DRIVE_XTCF. We check this for all commands. 66 66 call AccessDPT_IsThisDeviceXTCF 67 j neSHORT .XTCFnotFound67 jc SHORT .XTCFnotFound 68 68 and ax, 0FFh ; Subcommand now in AX (clears AH and CF) 69 69 jz SHORT .XTCFfound ; Sub-function IS_THIS_DRIVE_XTCF (=0) … … 111 111 ; Selected transfer mode is stored in BIOS variable (DPT_ATA.bDevice). 112 112 113 ; Note that when selecting ' DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD' mode,113 ; Note that when selecting 'XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD' mode, 114 114 ; the ATA device (i.e. CompactFlash card) will operate in 8-bit mode, but 115 115 ; data will be transferred from its data register using 16-bit CPU instructions … … 122 122 ; Also note that some machines, noteably the Olivetti M24 (also known as 123 123 ; the AT&T PC6300 and Xerox 6060), have hardware errors in the BIU logic, 124 ; resulting in reversed byte ordering. Therefore, mode DEVICE_8BIT_PIOis124 ; resulting in reversed byte ordering. Therefore, XTCF_8BIT_PIO_MODE is 125 125 ; the default transfer mode for best system compatibility. 126 126 127 128 ; Is requested mode valid? 129 cmp al, 3 ; Valid modes are 0...3 130 ja SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF 131 132 ; Convert mode to XT-CF device type (see RomVars.inc and XTCF.inc for full details) 133 eSHL_IM al, 1 ; Shift requested mode 134 add al, XTCF_DEVICE_OFFSET ; Add the device offset (already shifted) 135 mov [di+DPT_ATA.bDevice], al ; Set the new mode (or device actually) 136 137 cmp al, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD 138 je SHORT AH23h_Disable8bitPioMode 139 140 ; We always need to enable 8-bit mode since 16-bit mode is restored 141 ; when controller is reset (AH=00h or 0Dh) 142 143 cmp al, DEVICE_8BIT_XTCF_DMA 144 jne SHORT AH23h_Enable8bitPioMode 145 146 ; DMA transfers have limited block size 147 mov al, XTCF_DMA_MODE_MAX_BLOCK_SIZE 148 cmp [di+DPT_ATA.bBlockSize], al 149 jbe SHORT AH23h_Enable8bitPioMode ; No need to limit block size 150 call AH24h_SetBlockSize 151 jmp SHORT AH23h_Enable8bitPioMode 152 153 154 %if 0 127 155 ; We always need to enable 8-bit mode since 16-bit mode is restored 128 156 ; when controller is reset (AH=00h or 0Dh) … … 134 162 dec ax ; XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD = 1 135 163 jz SHORT .Set8bitPioModeWithBIUOffload 136 dec ax 164 dec ax ; XTCF_16BIT_PIO_WITH_BIU_OFFLOAD = 2 137 165 jz SHORT .Set16bitPioModeWithBIUOffload 138 166 139 ; XTCF_DMA_MODE = 2 (allow 3 as well for more optimized code)167 ; XTCF_DMA_MODE = 3 140 168 mov BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA 141 169 … … 161 189 mov [di+DPT_ATA.bDevice], al 162 190 ret 191 %endif ; 0 163 192 164 193 … … 168 197 ; DS:DI: Ptr to DPT (in RAMVARS segment) 169 198 ; Returns: 170 ; AX: XT-CF mode (XTCF_8BIT_PIO_MODE, XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD or XTCF_DMA_MODE)199 ; AX: XT-CF mode (XTCF_8BIT_PIO_MODE, XTCF_8BIT_PIO_MODE_WITH_BIU_OFFLOAD, XTCF_16BIT_PIO_WITH_BIU_OFFLOAD or XTCF_DMA_MODE) 171 200 ; CF: Clear 172 201 ; Corrupts registers: … … 174 203 ;-------------------------------------------------------------------- 175 204 AH1Eh_GetCurrentXTCFmodeToAX: 205 mov ax, -XTCF_DEVICE_OFFSET & 0FFh 206 add al, [di+DPT_ATA.bDevice] 207 shr al, 1 208 ret 209 210 %if 0 176 211 mov al, [di+DPT_ATA.bDevice] 177 212 shr al, 1 178 213 cbw 179 sub al, DEVICE_8BIT_XTCF_PIO8 >> 1 180 ret 214 sub al, XTCF_DEVICE_OFFSET >> 1 215 ret 216 %endif ; 0 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
r558 r588 68 68 ; must know what the actual block size is. 69 69 cmp BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA 70 je SHORT .DisableBlockMode70 je SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF 71 71 .NoNeedToLimitBlockSize: 72 72 %endif ; MODULE_8BIT_IDE_ADVANCED -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r567 r588 234 234 235 235 236 %ifdef MODULE_8BIT_IDE 237 ;-------------------------------------------------------------------- 238 ; AH9h_Enable8bitModeForDevice8bitAta 239 ; Parameters: 240 ; DS:DI: Ptr to DPT (in RAMVARS segment) 241 ; SS:BP: Ptr to IDEPACK 242 ; Returns: 243 ; AH: Int 13h return status 244 ; CF: Clear if successful or device is not DEVICE_8BIT_ATA 245 ; Set if failed to set 8-bit mode for DEVICE_8BIT_ATA 246 ; Corrupts registers: 247 ; AL, BX, CX, DX, SI 248 ;-------------------------------------------------------------------- 249 AH9h_Enable8bitModeForDevice8bitAta: 250 cmp BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_ATA 251 %ifdef MODULE_8BIT_IDE_ADVANCED 252 jne SHORT IgnoreInvalidCommandError 253 jmp AH23h_Enable8bitPioMode 254 %else ; ~MODULE_8BIT_IDE_ADVANCED 255 je AH23h_Enable8bitPioMode 256 ; Fall to IgnoreInvalidCommandError 257 %endif ; MODULE_8BIT_IDE_ADVANCED 258 %endif ; MODULE_8BIT_IDE 259 260 261 %ifdef MODULE_8BIT_IDE_ADVANCED 262 ;-------------------------------------------------------------------- 263 ; AH9h_SetModeFromALtoXTCF 264 ; Parameters: 265 ; AL: XT-CF Mode to set 266 ; DS:DI: Ptr to DPT (in RAMVARS segment) 267 ; SS:BP: Ptr to IDEPACK 268 ; Returns: 269 ; AH: Int 13h return status 270 ; CF: Clear if successful or device is not XT-CF 271 ; Set if failed to set mode for XT-CF 272 ; Corrupts registers: 273 ; AL, BX, CX, DX, SI 274 ;-------------------------------------------------------------------- 275 AH9h_SetModeFromALtoXTCF: 276 call AccessDPT_IsThisDeviceXTCF 277 jnc AH1Eh_ChangeXTCFmodeBasedOnModeInAL 278 ; Fall to IgnoreInvalidCommandError 279 %endif ; MODULE_8BIT_IDE_ADVANCED 280 281 236 282 ;-------------------------------------------------------------------- 237 283 ; SetErrorFlagFromALwithErrorCodeInAH … … 259 305 .NoErrorFlagToSet: 260 306 ret 261 262 263 %ifdef MODULE_8BIT_IDE_ADVANCED264 ;--------------------------------------------------------------------265 ; AH9h_SetModeFromALtoXTCF266 ; Parameters:267 ; AL: XT-CF Mode to set268 ; DS:DI: Ptr to DPT (in RAMVARS segment)269 ; SS:BP: Ptr to IDEPACK270 ; Returns:271 ; AH: Int 13h return status272 ; CF: Clear if successful or device is not XT-CF273 ; Set if failed to set mode for XT-CF274 ; Corrupts registers:275 ; AL, BX, CX, DX, SI276 ;--------------------------------------------------------------------277 AH9h_SetModeFromALtoXTCF:278 call AccessDPT_IsThisDeviceXTCF279 jne SHORT IgnoreInvalidCommandError280 jmp AH1Eh_ChangeXTCFmodeBasedOnModeInAL281 %endif ; MODULE_8BIT_IDE_ADVANCED282 283 284 %ifdef MODULE_8BIT_IDE285 ;--------------------------------------------------------------------286 ; AH9h_Enable8bitModeForDevice8bitAta287 ; Parameters:288 ; DS:DI: Ptr to DPT (in RAMVARS segment)289 ; SS:BP: Ptr to IDEPACK290 ; Returns:291 ; AH: Int 13h return status292 ; CF: Clear if successful or device is not DEVICE_8BIT_ATA293 ; Set if failed to set 8-bit mode for DEVICE_8BIT_ATA294 ; Corrupts registers:295 ; AL, BX, CX, DX, SI296 ;--------------------------------------------------------------------297 AH9h_Enable8bitModeForDevice8bitAta:298 cmp BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_ATA299 jne SHORT IgnoreInvalidCommandError300 jmp AH23h_Enable8bitPioMode301 %endif ; MODULE_8BIT_IDE
Note:
See TracChangeset
for help on using the changeset viewer.