Ignore:
Timestamp:
May 1, 2011, 10:42:58 AM (13 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to XTIDE Universal BIOS:

  • XTIDE mod should now be supported (untested).
  • Interrupt Service Routine no longer requires variable from RAMVARS.
  • Some small improvements.
File:
1 edited

Legend:

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

    r150 r152  
    213213
    214214;--------------------------------------------------------------------
    215 ; DualByteRead      Dual port 8-bit XTIDE PIO read transfer
    216 ; WordRead          Normal 16-bit IDE PIO read transfer
    217 ; DWordRead         VLB/PCI 32-bit IDE PIO read transfer
    218 ; SingleByteRead    Single port 8-bit PIO read transfer
     215; DualByteReadForXtide      Dual port 8-bit XTIDE PIO read transfer
     216; SingleByteRead            Single port 8-bit PIO read transfer
     217; WordReadForXTIDEmod       8088/8086 compatible 16-bit IDE PIO read transfer
     218; WordReadForXTplusAndAT    Normal 16-bit IDE PIO read transfer
     219; DWordRead                 VLB/PCI 32-bit IDE PIO read transfer
    219220;   Parameters:
    220221;       CX:     Block size in WORDs
     
    227228;--------------------------------------------------------------------
    228229ALIGN JUMP_ALIGN
    229 DualByteRead:
    230     times 2 shr cx, 1           ; Loop unrolling
    231     mov     bx, 8               ; Bit mask for toggling data low/high reg
     230DualByteReadForXtide:
     231    times 2 shr cx, 1   ; Loop unrolling
     232    mov     bx, 8       ; Bit mask for toggling data low/high reg
    232233ALIGN JUMP_ALIGN
    233234.InswLoop:
    234     eDUAL_BYTE_PORT_INSW
    235     eDUAL_BYTE_PORT_INSW
    236     eDUAL_BYTE_PORT_INSW
    237     eDUAL_BYTE_PORT_INSW
     235    XTIDE_INSW
     236    XTIDE_INSW
     237    XTIDE_INSW
     238    XTIDE_INSW
    238239    loop    .InswLoop
    239240    ret
    240241
    241 ALIGN JUMP_ALIGN
    242 WordRead:
    243     rep
    244     db      6Dh         ; INSW
    245     ret
    246 
    247 ALIGN JUMP_ALIGN
    248 DWordRead:
    249     shr     cx, 1       ; WORD count to DWORD count
    250     rep
    251     db      66h         ; Override operand size to 32-bit
    252     db      6Dh         ; INSW/INSD
    253     ret
    254 
     242;----
    255243ALIGN JUMP_ALIGN
    256244SingleByteRead:
    257245%ifdef USE_186  ; INS instruction available
    258     shl     cx, 1               ; WORD count to BYTE count
     246    shl     cx, 1       ; WORD count to BYTE count
    259247    rep insb
    260248%else           ; If 8088/8086
    261     shr     cx, 1               ; WORD count to DWORD count
     249    shr     cx, 1       ; WORD count to DWORD count
    262250ALIGN JUMP_ALIGN
    263251.InsdLoop:
    264252    in      al, dx
    265     stosb                       ; Store to [ES:DI]
     253    stosb               ; Store to [ES:DI]
    266254    in      al, dx
    267255    stosb
     
    274262    ret
    275263
    276 
    277 ;--------------------------------------------------------------------
    278 ; DualByteWrite     Dual port 8-bit XTIDE PIO write transfer
    279 ; WordWrite         Normal 16-bit IDE PIO write transfer
    280 ; DWordWrite        VLB/PCI 32-bit IDE PIO write transfer
    281 ; SingleByteWrite   Single port 8-bit PIO write transfer
     264;----
     265%ifndef USE_186
     266ALIGN JUMP_ALIGN
     267WordReadForXTIDEmod:
     268    times 2 shr cx, 1   ; WORD count to QWORD count
     269ALIGN JUMP_ALIGN
     270.ReadNextQword:
     271    in      ax, dx      ; Read 1st WORD
     272    stosw               ; Store 1st WORD to [ES:DI]
     273    in      ax, dx
     274    stosw               ; 2nd
     275    in      ax, dx
     276    stosw               ; 3rd
     277    in      ax, dx
     278    stosw               ; 4th
     279    loop    .ReadNextQword
     280    ret
     281%endif
     282
     283;----
     284ALIGN JUMP_ALIGN
     285WordReadForXTplusAndAT:
     286    rep
     287    db      6Dh         ; INSW (we want this in XT build)
     288    ret
     289
     290;----
     291ALIGN JUMP_ALIGN
     292DWordRead:
     293    shr     cx, 1       ; WORD count to DWORD count
     294    rep
     295    db      66h         ; Override operand size to 32-bit
     296    db      6Dh         ; INSW/INSD
     297    ret
     298
     299
     300;--------------------------------------------------------------------
     301; DualByteWriteForXtide     Dual port 8-bit XTIDE PIO write transfer
     302; SingleByteWrite           Single port 8-bit PIO write transfer
     303; WordWriteForXTIDEmod      8088/8086 compatible 16-bit IDE PIO read transfer
     304; WordWrite                 Normal 16-bit IDE PIO write transfer
     305; DWordWrite                VLB/PCI 32-bit IDE PIO write transfer
    282306;   Parameters:
    283307;       CX:     Block size in WORDs
     
    290314;--------------------------------------------------------------------
    291315ALIGN JUMP_ALIGN
    292 DualByteWrite:
     316DualByteWriteForXtide:
    293317    push    ds
    294318    push    bx
    295     times 2 shr cx, 1           ; Loop unrolling
    296     mov     bx, 8               ; Bit mask for toggling data low/high reg
    297     push    es                  ; Copy ES...
    298     pop     ds                  ; ...to DS
     319    times 2 shr cx, 1   ; Loop unrolling
     320    mov     bx, 8       ; Bit mask for toggling data low/high reg
     321    push    es          ; Copy ES...
     322    pop     ds          ; ...to DS
    299323ALIGN JUMP_ALIGN
    300324.OutswLoop:
    301     eDUAL_BYTE_PORT_OUTSW
    302     eDUAL_BYTE_PORT_OUTSW
    303     eDUAL_BYTE_PORT_OUTSW
    304     eDUAL_BYTE_PORT_OUTSW
     325    XTIDE_OUTSW
     326    XTIDE_OUTSW
     327    XTIDE_OUTSW
     328    XTIDE_OUTSW
    305329    loop    .OutswLoop
    306330    pop     bx
     
    308332    ret
    309333
    310 ALIGN JUMP_ALIGN
    311 WordWrite:
    312     eSEG    es          ; Source is ES segment
    313     rep
    314     db      6Fh         ; OUTSW
    315     ret
    316 
    317 ALIGN JUMP_ALIGN
    318 DWordWrite:
    319     shr     cx, 1       ; WORD count to DWORD count
    320     eSEG    es          ; Source is ES segment
    321     rep
    322     db      66h         ; Override operand size to 32-bit
    323     db      6Fh         ; OUTSW/OUTSD
    324     ret
    325 
     334;----
    326335ALIGN JUMP_ALIGN
    327336SingleByteWrite:
    328337%ifdef USE_186  ; OUTS instruction available
    329     shl     cx, 1               ; WORD count to BYTE count
    330     eSEG    es                  ; Source is ES segment
     338    shl     cx, 1       ; WORD count to BYTE count
     339    eSEG    es          ; Source is ES segment
    331340    rep outsb
    332341%else           ; If 8088/8086
    333     shr     cx, 1               ; WORD count to DWORD count
    334     push    ds                  ; Store DS
    335     push    es                  ; Copy ES...
    336     pop     ds                  ; ...to DS
     342    shr     cx, 1       ; WORD count to DWORD count
     343    push    ds          ; Store DS
     344    push    es          ; Copy ES...
     345    pop     ds          ; ...to DS
    337346ALIGN JUMP_ALIGN
    338347.OutsdLoop:
    339     lodsb                       ; Load from [DS:SI] to AL
     348    lodsb               ; Load from [DS:SI] to AL
    340349    out     dx, al
    341350    lodsb
     
    346355    out     dx, al
    347356    loop    .OutsdLoop
    348     pop     ds                  ; Restore DS
    349 %endif
    350     ret
     357    pop     ds          ; Restore DS
     358%endif
     359    ret
     360
     361;---
     362ALIGN JUMP_ALIGN
     363WordWriteForXTIDEmod:
     364    push    ds
     365    times 2 shr cx, 1   ; Loop unrolling
     366    push    es          ; Copy ES...
     367    pop     ds          ; ...to DS
     368ALIGN JUMP_ALIGN
     369.WriteNextQword:
     370    XTIDE_MOD_OUTSW
     371    XTIDE_MOD_OUTSW
     372    XTIDE_MOD_OUTSW
     373    XTIDE_MOD_OUTSW
     374    loop    .WriteNextQword
     375    pop     ds
     376    ret
     377
     378;----
     379ALIGN JUMP_ALIGN
     380WordWrite:
     381    eSEG    es          ; Source is ES segment
     382    rep
     383    db      6Fh         ; OUTSW
     384    ret
     385
     386ALIGN JUMP_ALIGN
     387DWordWrite:
     388    shr     cx, 1       ; WORD count to DWORD count
     389    eSEG    es          ; Source is ES segment
     390    rep
     391    db      66h         ; Override operand size to 32-bit
     392    db      6Fh         ; OUTSW/OUTSD
     393    ret
     394
    351395
    352396
     
    354398ALIGN WORD_ALIGN
    355399g_rgfnPioRead:
    356     dw      DualByteRead        ; DEVICE_8BIT_DUAL_PORT_XTIDE
    357     dw      NULL                ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
    358     dw      SingleByteRead      ; DEVICE_8BIT_SINGLE_PORT
    359     dw      WordRead            ; DEVICE_16BIT_ATA
    360     dw      DWordRead           ; DEVICE_32BIT_ATA
     400    dw      DualByteReadForXtide    ; DEVICE_8BIT_DUAL_PORT_XTIDE
     401%ifdef USE_186
     402    dw      WordReadForXTplusAndAT  ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
     403%else
     404    dw      WordReadForXTIDEmod
     405%endif
     406    dw      SingleByteRead          ; DEVICE_8BIT_SINGLE_PORT
     407    dw      WordReadForXTplusAndAT  ; DEVICE_16BIT_ATA
     408    dw      DWordRead               ; DEVICE_32BIT_ATA
     409
    361410g_rgfnPioWrite:
    362     dw      DualByteWrite       ; DEVICE_8BIT_DUAL_PORT_XTIDE
    363     dw      NULL                ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
    364     dw      SingleByteWrite     ; DEVICE_8BIT_SINGLE_PORT
    365     dw      WordWrite           ; DEVICE_16BIT_ATA
    366     dw      DWordWrite          ; DEVICE_32BIT_ATA
     411    dw      DualByteWriteForXtide   ; DEVICE_8BIT_DUAL_PORT_XTIDE
     412    dw      WordWriteForXTIDEmod    ; DEVICE_XTIDE_WITH_REVERSED_A3_AND_A0
     413    dw      SingleByteWrite         ; DEVICE_8BIT_SINGLE_PORT
     414    dw      WordWrite               ; DEVICE_16BIT_ATA
     415    dw      DWordWrite              ; DEVICE_32BIT_ATA
Note: See TracChangeset for help on using the changeset viewer.