Changeset 601 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Device/IDE


Ignore:
Timestamp:
Feb 14, 2019, 7:38:08 PM (6 years ago)
Author:
Krister Nordvall
Message:

Changes:

  • Building the BIOS now works again.
  • Added a new IDE device type/transfer mode for use only with XT-IDE rev 2+ (or Chuck(G)-modded rev 1) cards installed in any of the following machines: Olivetti M24, AT&T PC6300, Xerox 6060 and Logabax Persona 1600. This new transfer mode is slightly faster than the regular XT-IDE rev 1 device type and requires that the card is configured for High Speed mode (or, in case of the card being a rev 1 card, has the Chuck(G) mod done). The new device type is called "XTIDE rev 2 (Olivetti M24)" in XTIDECFG.
  • Made some minor improvements to the library code that handles 'Drive Not Ready' errors in XTIDECFG.
  • Optimizations.
Location:
trunk/XTIDE_Universal_BIOS/Src/Device/IDE
Files:
4 edited

Legend:

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

    r558 r601  
    5959
    6060%ifdef MODULE_8BIT_IDE_ADVANCED
    61     je      SHORT .ReverseA0andA3fromRegisterIndexInDX
     61    cmp     al, DEVICE_8BIT_XTIDE_REV2_OLIVETTI
     62    jbe     SHORT .ReverseA0andA3fromRegisterIndexInDX
    6263
    6364    eSHL_IM dx, 1   ; ADP50L and XT-CF
     
    99100IdeIO_OutputALtoIdeControlBlockRegisterInDL:
    100101    xor     dh, dh  ; IDE Register index now in DX
    101 
    102102    mov     bl, [di+DPT_ATA.bDevice]
    103103    cmp     bl, DEVICE_8BIT_XTIDE_REV2
     
    105105
    106106%ifdef MODULE_8BIT_IDE_ADVANCED
    107     je      SHORT .ReverseA0andA3fromRegisterIndexInDX
     107    cmp     bl, DEVICE_8BIT_XTIDE_REV2_OLIVETTI
     108    jbe     SHORT .ReverseA0andA3fromRegisterIndexInDX
    108109
    109110    ; At this point remaining controllers (JRIDE, XTCF and ADP50L) all have a control
     
    154155IdeIO_OutputALtoIdeRegisterInDL:
    155156    xor     dh, dh  ; IDE Register index now in DX
    156 
    157157    mov     bl, [di+DPT_ATA.bDevice]
    158158    cmp     bl, DEVICE_8BIT_XTIDE_REV2
     
    160160
    161161%ifdef MODULE_8BIT_IDE_ADVANCED
    162     je      SHORT .ReverseA0andA3fromRegisterIndexInDX
     162    cmp     bl, DEVICE_8BIT_XTIDE_REV2_OLIVETTI
     163    jbe     SHORT .ReverseA0andA3fromRegisterIndexInDX
    163164
    164165    cmp     bl, DEVICE_8BIT_JRIDE_ISA
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm

    r589 r601  
    5555
    5656;--------------------------------------------------------------------
     57; IdePioBlock_ReadFromXtideRev2_Olivetti
     58;   Parameters:
     59;       CX:     Block size in 512 byte sectors
     60;       DX:     IDE Data port address
     61;       ES:DI:  Normalized ptr to buffer to receive data
     62;   Returns:
     63;       Nothing
     64;   Corrupts registers:
     65;       AX, CX
     66;--------------------------------------------------------------------
     67ALIGN JUMP_ALIGN
     68IdePioBlock_ReadFromXtideRev2_Olivetti:
     69    UNROLL_SECTORS_IN_CX_TO_OWORDS
     70ALIGN JUMP_ALIGN
     71.InswLoop:
     72    %rep 8  ; WORDs
     73        XTIDE_MOD_OLIVETTI_INSW
     74    %endrep
     75    loop    .InswLoop
     76    ret
     77
     78
     79;--------------------------------------------------------------------
    5780; 8-bit PIO from a single data port.
    5881;
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm

    r589 r601  
    328328ALIGN WORD_ALIGN
    329329g_rgfnPioRead:
    330         dw      IdePioBlock_ReadFrom16bitDataPort   ; 0, DEVICE_16BIT_ATA
     330        dw      IdePioBlock_ReadFrom16bitDataPort       ; 0, DEVICE_16BIT_ATA
    331331%ifdef MODULE_ADVANCED_ATA
    332         dw      IdePioBlock_ReadFrom32bitDataPort   ; 1, DEVICE_32BIT_ATA
     332        dw      IdePioBlock_ReadFrom32bitDataPort       ; 1, DEVICE_32BIT_ATA
    333333%elifdef MODULE_8BIT_IDE
    334334        dw      NULL
    335335%endif ; MODULE_ADVANCED_ATA
    336336%ifdef MODULE_8BIT_IDE
    337         dw      IdePioBlock_ReadFrom8bitDataPort    ; 2, DEVICE_8BIT_ATA
    338         dw      IdePioBlock_ReadFromXtideRev1       ; 3, DEVICE_8BIT_XTIDE_REV1
    339         dw      IdePioBlock_ReadFrom16bitDataPort   ; 4, DEVICE_8BIT_XTIDE_REV2
     337        dw      IdePioBlock_ReadFrom8bitDataPort        ; 2, DEVICE_8BIT_ATA
     338        dw      IdePioBlock_ReadFromXtideRev1           ; 3, DEVICE_8BIT_XTIDE_REV1
     339        dw      IdePioBlock_ReadFrom16bitDataPort       ; 4, DEVICE_8BIT_XTIDE_REV2
     340        dw      IdePioBlock_ReadFromXtideRev2_Olivetti  ; 5, DEVICE_8BIT_XTIDE_REV2_OLIVETTI
    340341%ifdef MODULE_8BIT_IDE_ADVANCED
    341         dw      IdePioBlock_ReadFrom8bitDataPort    ; 5, DEVICE_8BIT_XTCF_PIO8
    342         dw      IdePioBlock_ReadFrom16bitDataPort   ; 6, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
    343         dw      IdePioBlock_ReadFrom16bitDataPort   ; 7, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
    344         dw      IdeDmaBlock_ReadFromXTCF            ; 8, DEVICE_8BIT_XTCF_DMA
     342        dw      IdePioBlock_ReadFrom8bitDataPort        ; 6, DEVICE_8BIT_XTCF_PIO8
     343        dw      IdePioBlock_ReadFrom16bitDataPort       ; 7, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
     344        dw      IdePioBlock_ReadFrom16bitDataPort       ; 8, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
     345        dw      IdeDmaBlock_ReadFromXTCF                ; 9, DEVICE_8BIT_XTCF_DMA
    345346%endif ; MODULE_8BIT_IDE_ADVANCED
    346347%endif ; MODULE_8BIT_IDE
     
    348349
    349350g_rgfnPioWrite:
    350         dw      IdePioBlock_WriteTo16bitDataPort    ; 0, DEVICE_16BIT_ATA
     351        dw      IdePioBlock_WriteTo16bitDataPort        ; 0, DEVICE_16BIT_ATA
    351352%ifdef MODULE_ADVANCED_ATA
    352         dw      IdePioBlock_WriteTo32bitDataPort    ; 1, DEVICE_32BIT_ATA
     353        dw      IdePioBlock_WriteTo32bitDataPort        ; 1, DEVICE_32BIT_ATA
    353354%elifdef MODULE_8BIT_IDE
    354355        dw      NULL
    355356%endif ; MODULE_ADVANCED_ATA
    356357%ifdef MODULE_8BIT_IDE
    357         dw      IdePioBlock_WriteTo8bitDataPort     ; 2, DEVICE_8BIT_ATA
    358         dw      IdePioBlock_WriteToXtideRev1        ; 3, DEVICE_8BIT_XTIDE_REV1
    359         dw      IdePioBlock_WriteToXtideRev2        ; 4, DEVICE_8BIT_XTIDE_REV2
     358        dw      IdePioBlock_WriteTo8bitDataPort         ; 2, DEVICE_8BIT_ATA
     359        dw      IdePioBlock_WriteToXtideRev1            ; 3, DEVICE_8BIT_XTIDE_REV1
     360        dw      IdePioBlock_WriteToXtideRev2            ; 4, DEVICE_8BIT_XTIDE_REV2
     361        dw      IdePioBlock_WriteToXtideRev2            ; 5, DEVICE_8BIT_XTIDE_REV2_OLIVETTI
    360362%ifdef MODULE_8BIT_IDE_ADVANCED
    361         dw      IdePioBlock_WriteTo8bitDataPort     ; 5, DEVICE_8BIT_XTCF_PIO8
    362         dw      IdePioBlock_WriteTo16bitDataPort    ; 6, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
    363         dw      IdePioBlock_WriteTo16bitDataPort    ; 7, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
    364         dw      IdeDmaBlock_WriteToXTCF             ; 8, DEVICE_8BIT_XTCF_DMA
     363        dw      IdePioBlock_WriteTo8bitDataPort         ; 6, DEVICE_8BIT_XTCF_PIO8
     364        dw      IdePioBlock_WriteTo16bitDataPort        ; 7, DEVICE_8BIT_XTCF_PIO8_WITH_BIU_OFFLOAD
     365        dw      IdePioBlock_WriteTo16bitDataPort        ; 8, DEVICE_8BIT_XTCF_PIO16_WITH_BIU_OFFLOAD
     366        dw      IdeDmaBlock_WriteToXTCF                 ; 9, DEVICE_8BIT_XTCF_DMA
    365367%endif ; MODULE_8BIT_IDE_ADVANCED
    366368%endif ; MODULE_8BIT_IDE
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm

    r592 r601  
    100100    jc      SHORT ReturnWithMemoryIOtransferErrorInAH
    101101
    102     mov     cx, [bp+MEMPIOVARS.wSectorsInBlock] ; Clears CH
    103     cmp     [bp+MEMPIOVARS.bSectorsLeft], cl
     102    mov     dx, [bp+MEMPIOVARS.wSectorsInBlock] ; Clears DH
     103    cmp     [bp+MEMPIOVARS.bSectorsLeft], dl
    104104    jbe     SHORT .ReadLastBlockFromDrive
    105105
     
    119119    ; transferred, there will be a wait for next block but DRQ is never
    120120    ; set since all is transferred! Then we get timeout error.
    121     mov     cx, [bp+MEMPIOVARS.wSectorsInBlock]
    122     sub     [bp+MEMPIOVARS.bSectorsLeft], cl
    123     add     [bp+MEMPIOVARS.bSectorsDone], cl
    124     cmp     [bp+MEMPIOVARS.bSectorsLeft], cl
     121    mov     dx, [bp+MEMPIOVARS.wSectorsInBlock]
     122    sub     [bp+MEMPIOVARS.bSectorsLeft], dl
     123    add     [bp+MEMPIOVARS.bSectorsDone], dl
     124    cmp     [bp+MEMPIOVARS.bSectorsLeft], dl
    125125    ja      SHORT .ReadNextBlockFromDrive
    126126
    127127ALIGN JUMP_ALIGN
    128128.ReadLastBlockFromDrive:
    129     mov     cl, [bp+MEMPIOVARS.bSectorsLeft]
    130     push    cx
     129    mov     dl, [bp+MEMPIOVARS.bSectorsLeft]
     130    push    dx
    131131    call    ReadSingleBlockFromSectorAccessWindowInDSSItoESDI
    132132
     
    181181    jc      SHORT ReturnWithMemoryIOtransferErrorInAH
    182182
    183     mov     cx, [bp+MEMPIOVARS.wSectorsInBlock]
    184     cmp     [bp+MEMPIOVARS.bSectorsLeft], cl
     183    mov     dx, [bp+MEMPIOVARS.wSectorsInBlock]
     184    cmp     [bp+MEMPIOVARS.bSectorsLeft], dl
    185185    jbe     SHORT .WriteLastBlockToDrive
    186186
     
    192192
    193193    ; Increment number of successfully written WORDs
    194     mov     cx, [bp+MEMPIOVARS.wSectorsInBlock]
    195     sub     [bp+MEMPIOVARS.bSectorsLeft], cl
    196     add     [bp+MEMPIOVARS.bSectorsDone], cl
    197     cmp     [bp+MEMPIOVARS.bSectorsLeft], cl
     194    mov     dx, [bp+MEMPIOVARS.wSectorsInBlock]
     195    sub     [bp+MEMPIOVARS.bSectorsLeft], dl
     196    add     [bp+MEMPIOVARS.bSectorsDone], dl
     197    cmp     [bp+MEMPIOVARS.bSectorsLeft], dl
    198198    ja      SHORT .WriteNextBlockToDrive
    199199
    200200ALIGN JUMP_ALIGN
    201201.WriteLastBlockToDrive:
    202     mov     cl, [bp+MEMPIOVARS.bSectorsLeft]
    203     push    cx
     202    mov     dl, [bp+MEMPIOVARS.bSectorsLeft]
     203    push    dx
    204204    ePUSH_T bx, CheckErrorsAfterTransferringLastMemoryMappedBlock
    205205    ; Fall to WriteSingleBlockFromDSSIToSectorAccessWindowInESDI
     
    208208; WriteSingleBlockFromDSSIToSectorAccessWindowInESDI
    209209;   Parameters:
    210 ;       CX:     Number of sectors in block
     210;       DX:     Number of sectors in block
    211211;       DS:SI:  Normalized ptr to source buffer
    212212;       ES:DI:  Ptr to Sector Access Window
     
    220220WriteSingleBlockFromDSSIToSectorAccessWindowInESDI:
    221221    mov     bx, di
    222     mov     dx, cx
    223222    xor     cx, cx
    224223ALIGN JUMP_ALIGN
     
    235234; ReadSingleBlockFromSectorAccessWindowInDSSItoESDI
    236235;   Parameters:
    237 ;       CX      Number of sectors in full block or sectors in last partial block
    238 ;       ES:DI:  Normalized ptr to buffer to receive data (destination)
    239 ;       DS:SI:  Ptr to Sector Access Window (source)
     236;       DX:     Number of sectors in block
     237;       ES:DI:  Normalized ptr to destination buffer
     238;       DS:SI:  Ptr to Sector Access Window
    240239;   Returns:
    241240;       CX, DX: Zero
     
    247246ReadSingleBlockFromSectorAccessWindowInDSSItoESDI:
    248247    mov     bx, si
    249     mov     dx, cx
    250248    xor     cx, cx
    251249ALIGN JUMP_ALIGN
Note: See TracChangeset for help on using the changeset viewer.