Ignore:
Timestamp:
Oct 10, 2012, 6:22:23 PM (11 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Large changes to prepare full XT-CF support (DMA not yet implemented and memory mapped transfers are not working).
File:
1 edited

Legend:

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

    r445 r473  
    5656;   Parameters:
    5757;       BH:     Drive Select byte for Drive and Head Select Register
     58;       DX:     Autodetected port for XT-CF
    5859;       DS:     Segment to RAMVARS
    5960;       ES:SI:  Ptr to buffer to receive 512-byte IDE Information
     
    7071    eMOVZX  ax, bh
    7172    mov     [di+DPT.wFlags], ax
    72     mov     [di+DPT.bIdevarsOffset], bp
     73    call    CreateDPT_StoreIdevarsOffsetAndBasePortFromCSBPtoDPTinDSDI
     74    call    IdeDPT_StoreDeviceTypeToDPTinDSDIfromIdevarsInCSBP
    7375    mov     BYTE [di+DPT_ATA.bBlockSize], 1 ; Block = 1 sector
    74     call    IdeDPT_StoreDeviceTypeFromIdevarsInCSBPtoDPTinDSDI
    7576
    7677    ; Wait until drive motors have reached full speed
    77     cmp     bp, BYTE ROMVARS.ideVars0       ; First controller?
     78    cmp     bp, BYTE ROMVARS.ideVars0   ; First controller?
    7879    jne     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    79     test    bh, FLG_DRVNHEAD_DRV            ; Wait already done for Master
     80    test    bh, FLG_DRVNHEAD_DRV        ; Wait already done for Master
    8081    jnz     SHORT .SkipLongWaitSinceDriveIsNotPrimaryMaster
    8182    call    AHDh_WaitUntilDriveMotorHasReachedFullSpeed
     
    8788
    8889%ifdef MODULE_8BIT_IDE
    89     ; Enable 8-bit PIO mode for Lo-tech XT-CF
     90    ; We set XT-CF to 8-bit PIO mode for Identify Device command.
     91    ; Correct XT-CF mode is later set on AH=09h (after all drives are detected).
     92    call    AccessDPT_IsThisDeviceXTCF
     93    jne     SHORT .SkipXTCFmodeChange
     94
     95    xor     al, al                      ; XTCF_8BIT_PIO_MODE
    9096    push    si
    91     call    AH9h_Enable8bitPioModeForXTCF
     97    call    AH1Eh_ChangeXTCFmodeBasedOnControlRegisterInAL
    9298    pop     si
    9399    jc      SHORT .FailedToSet8bitMode
    94 %endif
     100.SkipXTCFmodeChange:
     101%endif ; MODULE_8BIT_IDE
    95102
    96103    ; Prepare to output Identify Device command
     
    170177    cmp     bl, FLG_STATUS_DRQ              ; Data transfer started?
    171178    jne     SHORT .WaitUntilNonTransferCommandCompletes
    172 %ifdef MODULE_JRIDE
    173     cmp     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_JRIDE_ISA
    174     je      SHORT JrIdeTransfer_StartWithCommandInAL
     179%ifdef MODULE_8BIT_IDE
     180    cmp     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
     181    je      SHORT 0 ; IdeDma_StartTransferWithCommandInAL
     182    ja      SHORT JrIdeTransfer_StartWithCommandInAL    ; DEVICE_8BIT_XTCF_MEMMAP or DEVICE_8BIT_JRIDE_ISA
    175183%endif
    176184    jmp     IdeTransfer_StartWithCommandInAL
     
    205213    ; We use different timeout value when detecting drives.
    206214    ; This prevents unnecessary long delays when drive is not present.
    207     mov     bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY)
     215    mov     cx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY)
    208216    cmp     WORD [RAMVARS.wDrvDetectSignature], RAMVARS_DRV_DETECT_SIGNATURE
    209     eCMOVE  bh, TIMEOUT_SELECT_DRIVE_DURING_DRIVE_DETECTION
     217    eCMOVE  ch, TIMEOUT_SELECT_DRIVE_DURING_DRIVE_DETECTION
    210218
    211219    ; Select Master or Slave Drive
    212220    mov     al, [bp+IDEPACK.bDrvAndHead]
    213221    OUTPUT_AL_TO_IDE_REGISTER   DRIVE_AND_HEAD_SELECT_REGISTER
     222    mov     bx, cx
    214223    call    IdeWait_PollStatusFlagInBLwithTimeoutInBH
    215224
     
    248257
    249258    mov     al, ch
    250     JUMP_TO_OUTPUT_AL_TO_IDE_REGISTER   LBA_HIGH_REGISTER
     259    OUTPUT_AL_TO_IDE_REGISTER   LBA_HIGH_REGISTER
     260    ret
Note: See TracChangeset for help on using the changeset viewer.