Changeset 474 in xtideuniversalbios


Ignore:
Timestamp:
Oct 11, 2012, 5:30:15 PM (11 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Drive detection now displays autodetected XT-CF port and skips slave drives for XT-CF.
  • AH=1Eh no longer tries to disable 8-bit mode for memory mapped and DMA transfer modes.
  • Preparations to implement DMA.
Location:
trunk/XTIDE_Universal_BIOS
Files:
1 added
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc

    r473 r474  
    128128    .bSerialBaud            resb    1   ; Serial connection baud rate divisor
    129129endstruc
     130
     131; On performance critical situations we compare DPT_ATA.bDevice without checking FLGH_DPT_SERIAL_DEVICE
     132; first! DPT_ATA.bDevice uses small values so there will be no problems.
     133%if DPT_SERIAL.bSerialPort <> DPT_ATA.bDevice
     134    %error "DPT_ATA.bDevice and DPT_SERIAL.bSerialPort must be in same offsets!"
     135%endif
    130136%endif
    131137
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeCommand.asm

    r473 r474  
    179179%ifdef MODULE_8BIT_IDE
    180180    cmp     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
    181     je      SHORT 0 ; IdeDma_StartTransferWithCommandInAL
     181    je      SHORT .StartDmaTransfer
    182182    ja      SHORT JrIdeTransfer_StartWithCommandInAL    ; DEVICE_8BIT_XTCF_MEMMAP or DEVICE_8BIT_JRIDE_ISA
    183 %endif
    184183    jmp     IdeTransfer_StartWithCommandInAL
     184.StartDmaTransfer:
     185    jmp     IdeDmaTransfer_StartWithCommandInAL
     186%else
     187    jmp     IdeTransfer_StartWithCommandInAL
     188%endif
    185189
    186190.WaitUntilNonTransferCommandCompletes:
  • trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm

    r473 r474  
    3939;       AL:     IDE command that was used to start the transfer
    4040;               (all PIO read and write commands including Identify Device)
    41 ;       ES:SI:  Ptr to normalized data buffer (SI 0...15)
     41;       ES:SI:  Ptr to normalized data buffer
    4242;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    4343;       SS:BP:  Ptr to IDEPACK
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH1Eh_XTCF.asm

    r473 r474  
    111111    ; Set DMA Mode
    112112    mov     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
    113     jmp     AH23h_Disable8bitPioMode
     113    mov     al, [di+DPT_ATA.bBlockSize]
     114    jmp     AH24h_SetBlockSize  ; AH=24h limits block size if necessary
    114115
    115116.SetMemoryMappedMode:
    116117    mov     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_MEMMAP
    117     jmp     AH23h_Disable8bitPioMode
     118    jmp     SHORT .Enable8bitPioMode
    118119
    119120.Set8bitPioMode:
    120121    mov     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_PIO8
     122.Enable8bitPioMode:
    121123    jmp     AH23h_Enable8bitPioMode
    122124
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH23h_HFeatures.asm

    r473 r474  
    7979;--------------------------------------------------------------------
    8080; AH23h_Enable8bitPioMode
    81 ; AH23h_Disable8bitPioMode
    8281;   Parameters:
    8382;       DS:DI:  Ptr to DPT (in RAMVARS segment)
     
    9291    mov     si, FEATURE_ENABLE_8BIT_PIO_TRANSFER_MODE
    9392    jmp     SHORT AH23h_SetControllerFeatures
    94 AH23h_Disable8bitPioMode:
    95     mov     si, FEATURE_DISABLE_8BIT_PIO_TRANSFER_MODE
    96     jmp     SHORT AH23h_SetControllerFeatures
    9793%endif ; MODULE_8BIT_IDE
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm

    r445 r474  
    8282;   Parameters:
    8383;       AL:     Number of sectors to transfer
     84;       DS:DI:  Ptr to DPT (in RAMVARS segment)
    8485;       SS:BP:  Ptr to IDEPACK
    8586;   Parameters on INTPACK:
     
    9394ALIGN JUMP_ALIGN
    9495Prepare_BufferToESSIforOldInt13hTransfer:
    95     ; Normalize buffer pointer
     96    cmp     BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA
     97    jne     SHORT .NormalizeForSmallestPossibleOffset
     98
     99    ; Normalize segment for physical 64k pages
     100    xor     bx, bx
     101    mov     si, [bp+IDEPACK.intpack+INTPACK.es] ; Load segment
     102%rep 4
     103    shl     si, 1
     104    rcl     bx, 1
     105%endrep
     106    add     si, [bp+IDEPACK.intpack+INTPACK.bx]
     107    adc     bx, BYTE 0
     108    mov     es, bx                              ; ES:SI now has physical address
     109    jmp     SHORT Prepare_ByValidatingSectorsInALforOldInt13h
     110
     111    ; Normalize segment for 16b pages
     112.NormalizeForSmallestPossibleOffset:
    96113    mov     bx, [bp+IDEPACK.intpack+INTPACK.bx] ; Load offset
    97114    mov     si, bx
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectDrives.asm

    r473 r474  
    153153;--------------------------------------------------------------------
    154154StartDetectionWithDriveSelectByteInBHandStringInCX:
    155     call    DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
    156 %ifdef MODULE_HOTKEYS
    157     call    HotkeyBar_UpdateDuringDriveDetection
    158 %endif
    159     ; Fall to .AutodetectXTCFport or .ReadAtaInfoFromHardDisk
    160 
    161 
     155    ; Autodetect port for XT-CF
    162156%ifdef MODULE_8BIT_IDE
    163 ;--------------------------------------------------------------------
    164 ; .AutodetectXTCFport
    165 ;   Parameters:
    166 ;       BH:     Drive Select byte for Drive and Head Register
    167 ;       CS:BP:  Ptr to IDEVARS for the drive
    168 ;       DS:     RAMVARS segment
    169 ;       ES:     Zero (BDA segment)
    170 ;   Returns:
    171 ;       DX:     Autodetected port (for devices that support autodetection)
    172 ;   Corrupts registers:
    173 ;       AX
    174 ;--------------------------------------------------------------------
    175 .AutodetectXTCFport:
    176     ; Detect port for XTCF
    177157    call    DetectDrives_DoesIdevarsInCSBPbelongToXTCF
    178158    jne     SHORT .SkipXTCFportDetection
     159
     160    ; XT-CF do not support slave drives so skip detection
     161    test    bh, FLG_DRVNHEAD_DRV
     162    jnz     SHORT NoSlaveDriveAvailable
    179163
    180164    ; XT-CF do not support slave drives so we can safely update port
     
    183167    call    BootVars_GetNextXTCFportToDetectToDX
    184168    cmp     dx, XTCF_BASE_PORT_4
    185     ja      SHORT DetectDrives_DriveNotFound    ; XT-CF not found from any port
     169    ja      SHORT .SkipXTCFportDetection        ; XT-CF not found from any port
    186170
    187171    call    AH1Eh_DetectXTCFwithBasePortInDX
    188172    jc      SHORT .DetectNextPort               ; XT-CF not found from this port
     173
     174    ; We now have autodetected port in DX
     175    push    dx
     176    xchg    ax, dx                              ; Port to print in AX
     177    call    DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
     178    jmp     SHORT .DriveDetectionStringPrintedOnScreen
     179
     180    ; Print detect string for devices that do not support autodetection     
    189181.SkipXTCFportDetection:
     182    push    dx
     183%endif ; MODULE_8BIT_IDE
     184
     185    call    DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP
     186.DriveDetectionStringPrintedOnScreen:
     187%ifdef MODULE_HOTKEYS
     188    call    HotkeyBar_UpdateDuringDriveDetection
     189%endif
     190%ifdef MODULE_8BIT_IDE
     191    pop     dx
     192%endif
    190193    ; Fall to .ReadAtaInfoFromHardDisk
    191 %endif ; MODULE_8BIT_IDE
    192194
    193195
     
    284286    cmp     al, DEVICE_8BIT_XTCF_MEMMAP
    285287.DeviceIsXTCF:
     288NoSlaveDriveAvailable:
    286289    ret
    287290%endif ; MODULE_8BIT_IDE
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm

    r473 r474  
    7575;       CS:CX:  Ptr to "Master" or "Slave" string
    7676;       CS:BP:  Ptr to IDEVARS
    77 ;       SI:     Ptr to template string
    78 ;   Returns:
    79 ;       Nothing
    80 ;   Corrupts registers:
    81 ;       AX, SI, DI, CX, DX
     77;   Returns:
     78;       Nothing
     79;   Corrupts registers:
     80;       AX, CX, DX, SI, DI
    8281;--------------------------------------------------------------------
    8382DetectPrint_StartDetectWithMasterOrSlaveStringInCXandIdeVarsInCSBP:
    8483    mov     ax, [cs:bp+IDEVARS.wBasePort]   ; for IDE: AX=port address, DH=.bDevice
     84    ; Fall to DetectPrint_StartDetectWithAutodetectedBasePortInAX
     85
     86;--------------------------------------------------------------------
     87; DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP
     88;   Parameters:
     89;       AX:     Base Port Address
     90;       CS:CX:  Ptr to "Master" or "Slave" string
     91;       CS:BP:  Ptr to IDEVARS
     92;   Returns:
     93;       Nothing
     94;   Corrupts registers:
     95;       AX, CX, DX, SI, DI
     96;--------------------------------------------------------------------   
     97DetectPrint_StartDetectWithAutodetectedBasePortInAXandIdeVarsInCSBP:
    8598    mov     dx, [cs:bp+IDEVARS.bDevice-1]   ; for Serial: AL=port address>>2, AH=baud rate
    8699                                            ;             DL=COM number character, DH=.bDevice
    87 
    88100    push    bp                              ; setup stack for call to
    89101    mov     bp, sp                          ; BootMenuPrint_FormatCSSIfromParamsInSSBP
  • trunk/XTIDE_Universal_BIOS/Src/Main.asm

    r473 r474  
    229229%ifdef MODULE_8BIT_IDE
    230230    %include "JrIdeTransfer.asm"    ; Must be included after IdeCommand.asm
     231    %include "IdeDmaTransfer.asm"
    231232%endif
    232233    %include "IdeTransfer.asm"
Note: See TracChangeset for help on using the changeset viewer.