Ignore:
Timestamp:
Oct 27, 2012, 11:26:11 AM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • XT-CF DMA transfers should now work.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r473 r480  
    3838;       AL:     IDE command that was used to start the transfer
    3939;               (all PIO read and write commands including Identify Device)
    40 ;       ES:SI:  Ptr to normalized data buffer
     40;       ES:SI:  Ptr to data buffer
    4141;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    4242;       SS:BP:  Ptr to IDEPACK
     
    6262;   Parameters:
    6363;       AH:     Number of sectors to transfer (1...128)
    64 ;       ES:SI:  Normalized ptr to buffer to receive data
     64;       ES:SI:  Ptr to buffer to receive data
    6565;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    6666;       SS:BP:  Ptr to PIOVARS
     
    139139;       AH:     Number of sectors to transfer (1...128)
    140140;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    141 ;       ES:SI:  Normalized ptr to buffer containing data
     141;       ES:SI:  Ptr to buffer containing data
    142142;       SS:BP:  Ptr to PIOVARS
    143143;   Returns:
     
    198198;       BX:     Offset to transfer function lookup table
    199199;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     200;       ES:SI:  Ptr to data buffer
    200201;       SS:BP:  Ptr to PIOVARS
    201202;   Returns:
     
    217218    xchg    ax, bx                              ; Lookup table offset to AX
    218219    mov     bl, [di+DPT_ATA.bDevice]
     220%ifdef MODULE_8BIT_IDE
     221    mov     dl, bl
     222%endif
    219223    add     bx, ax
    220224    mov     ax, [cs:bx]                         ; Load offset to transfer function
    221225    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;--------------------------------------------------------------------
     256IdeTransfer_NormalizePointerInESSI:
     257    NORMALIZE_FAR_POINTER   es, si, ax, dx
     258    ret
    224259
    225260
     
    227262ALIGN WORD_ALIGN
    228263g_rgfnPioRead:
    229 %ifdef USE_AT
    230264        dw      IdePioBlock_ReadFrom16bitDataPort   ; 0, DEVICE_16BIT_ATA
    231265        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
    245275g_rgfnPioWrite:
    246276        dw      IdePioBlock_WriteTo16bitDataPort    ; 0, DEVICE_16BIT_ATA
    247277        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.