Changeset 480 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
- Timestamp:
- Oct 27, 2012, 11:26:11 AM (13 years ago)
- google:author:
- aitotat@gmail.com
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r473 r480 38 38 ; AL: IDE command that was used to start the transfer 39 39 ; (all PIO read and write commands including Identify Device) 40 ; ES:SI: Ptr to normalizeddata buffer40 ; ES:SI: Ptr to data buffer 41 41 ; DS:DI: Ptr to DPT (in RAMVARS segment) 42 42 ; SS:BP: Ptr to IDEPACK … … 62 62 ; Parameters: 63 63 ; AH: Number of sectors to transfer (1...128) 64 ; ES:SI: Normalized ptr to buffer to receive data64 ; ES:SI: Ptr to buffer to receive data 65 65 ; DS:DI: Ptr to DPT (in RAMVARS segment) 66 66 ; SS:BP: Ptr to PIOVARS … … 139 139 ; AH: Number of sectors to transfer (1...128) 140 140 ; DS:DI: Ptr to DPT (in RAMVARS segment) 141 ; ES:SI: Normalized ptr to buffer containing data141 ; ES:SI: Ptr to buffer containing data 142 142 ; SS:BP: Ptr to PIOVARS 143 143 ; Returns: … … 198 198 ; BX: Offset to transfer function lookup table 199 199 ; DS:DI: Ptr to DPT (in RAMVARS segment) 200 ; ES:SI: Ptr to data buffer 200 201 ; SS:BP: Ptr to PIOVARS 201 202 ; Returns: … … 217 218 xchg ax, bx ; Lookup table offset to AX 218 219 mov bl, [di+DPT_ATA.bDevice] 220 %ifdef MODULE_8BIT_IDE 221 mov dl, bl 222 %endif 219 223 add bx, ax 220 224 mov ax, [cs:bx] ; Load offset to transfer function 221 225 mov [bp+PIOVARS.fnXfer], ax 222 ret 223 226 227 ; Normalize pointer for PIO-transfers and convert to physical address for DMA transfers 228 %ifdef MODULE_8BIT_IDE 229 cmp dl, DEVICE_8BIT_XTCF_DMA 230 jb SHORT IdeTransfer_NormalizePointerInESSI 231 232 ; Convert ES:SI to physical address 233 xor dx, dx 234 mov ax, es 235 %rep 4 236 shl ax, 1 237 rcl dx, 1 238 %endrep 239 add si, ax 240 adc dl, dh 241 mov es, dx 242 ret 243 %endif ; MODULE_8BIT_IDE 244 ; Fall to IdeTransfer_NormalizePointerInESSI if no MODULE_8BIT_IDE 245 246 247 ;-------------------------------------------------------------------- 248 ; IdeTransfer_NormalizePointerInESSI 249 ; Parameters: 250 ; ES:SI: Ptr to be normalized 251 ; Returns: 252 ; ES:SI: Normalized pointer (SI = 0...15) 253 ; Corrupts registers: 254 ; AX, DX 255 ;-------------------------------------------------------------------- 256 IdeTransfer_NormalizePointerInESSI: 257 NORMALIZE_FAR_POINTER es, si, ax, dx 258 ret 224 259 225 260 … … 227 262 ALIGN WORD_ALIGN 228 263 g_rgfnPioRead: 229 %ifdef USE_AT230 264 dw IdePioBlock_ReadFrom16bitDataPort ; 0, DEVICE_16BIT_ATA 231 265 dw IdePioBlock_ReadFrom32bitDataPort ; 1, DEVICE_32BIT_ATA 232 %else 233 dd 0 234 %endif 235 %ifdef MODULE_8BIT_IDE 236 dw IdePioBlock_ReadFromXtideRev1 ; 2, DEVICE_8BIT_XTIDE_REV1 237 %ifndef USE_AT 238 g_rgfnPioWrite: 239 %endif 240 dw IdePioBlock_ReadFromXtideRev2 ; 3, DEVICE_8BIT_XTIDE_REV2 241 dw IdePioBlock_ReadFrom8bitDataPort ; 4, DEVICE_8BIT_XTCF_PIO8 242 %endif 243 244 %ifdef USE_AT 266 %ifdef MODULE_8BIT_IDE 267 dw IdePioBlock_ReadFrom8bitDataPort ; 2, DEVICE_8BIT_ATA 268 dw IdePioBlock_ReadFromXtideRev1 ; 3, DEVICE_8BIT_XTIDE_REV1 269 dw IdePioBlock_ReadFromXtideRev2 ; 4, DEVICE_8BIT_XTIDE_REV2 270 dw IdePioBlock_ReadFrom8bitDataPort ; 5, DEVICE_8BIT_XTCF_PIO8 271 dw IdeDmaBlock_ReadFromXTCF ; 6, DEVICE_8BIT_XTCF_DMA 272 %endif 273 274 245 275 g_rgfnPioWrite: 246 276 dw IdePioBlock_WriteTo16bitDataPort ; 0, DEVICE_16BIT_ATA 247 277 dw IdePioBlock_WriteTo32bitDataPort ; 1, DEVICE_32BIT_ATA 248 %endif 249 %ifdef MODULE_8BIT_IDE 250 dw IdePioBlock_WriteToXtideRev1 ; 2, DEVICE_8BIT_XTIDE_REV1 251 dw IdePioBlock_WriteToXtideRev2 ; 3, DEVICE_8BIT_XTIDE_REV2 252 dw IdePioBlock_WriteTo8bitDataPort ; 4, DEVICE_8BIT_XTCF_PIO8 253 %endif 278 %ifdef MODULE_8BIT_IDE 279 dw IdePioBlock_WriteTo8bitDataPort ; 2, DEVICE_8BIT_ATA 280 dw IdePioBlock_WriteToXtideRev1 ; 3, DEVICE_8BIT_XTIDE_REV1 281 dw IdePioBlock_WriteToXtideRev2 ; 4, DEVICE_8BIT_XTIDE_REV2 282 dw IdePioBlock_WriteTo8bitDataPort ; 5, DEVICE_8BIT_XTCF_PIO8 283 dw IdeDmaBlock_WriteToXTCF ; 6, DEVICE_8BIT_XTCF_DMA 284 %endif
Note:
See TracChangeset
for help on using the changeset viewer.