Ignore:
Timestamp:
Mar 26, 2012, 4:20:43 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Added Advanced ATA Module (MODULE_ADVANCED_ATA) with native support for QDI Vision QD6500 and QD6580 VLB IDE Controllers.
  • Hopefully optimized IDE transfer functions for 8088 (replaced some memory accesses from WORD to BYTE).
  • XT build does not fit in 8k at the moment!!!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm

    r294 r363  
    5353
    5454    ; Initialize Master and Slave drives
    55     eMOVZX  ax, [di+DPT.bIdevarsOffset]         ; (AL) pointer to controller we are looking to reset
     55    eMOVZX  ax, BYTE [di+DPT.bIdevarsOffset]    ; (AL) pointer to controller we are looking to reset
    5656                                                ; (AH) initialize error code, assume success
    5757
    58     mov     si, IterateAndResetDrives
     58    mov     si, IterateAndResetDrives           ; Callback function for FindDPT_IterateAllDPTs
    5959    call    FindDPT_IterateAllDPTs
    6060
     
    7373; merged into overall error code for this controller.  Master will be reset
    7474; first.  Note that the iteration will go until the end of the DPT list.
     75;
     76;   Parameters:
     77;       AL:     Offset to IDEVARS for drives to initialize
     78;       AH:     Error status from previous initialization
     79;       DS:DI:  Ptr to DPT to examine
     80;   Returns:
     81;       AH:     Error status from initialization
     82;       CF:     Set to iterate all DPTs
     83;   Corrupts registers:
     84;       AL, BX, DX
    7585;--------------------------------------------------------------------
    7686IterateAndResetDrives:
     
    7888    jne     .done
    7989    push    ax
     90    push    cx
    8091    call    AH9h_InitializeDriveForUse          ; Reset Master and Slave (Master will come first in DPT list)
     92
     93%ifdef MODULE_ADVANCED_ATA
     94    jc      SHORT .SkipControllerInitSinceError
     95    call    InitializeAdvancedIdeControllers    ; Done after drive init so drives are first set to advanced PIO mode, then the controller
     96.SkipControllerInitSinceError:
     97%endif
     98
     99    pop     cx
    81100    pop     ax
    82101    jnc     .done
     
    85104    stc                                         ; From IterateAllDPTs perspective, the DPT is never found (continue iteration)
    86105    ret
     106
     107
     108%ifdef MODULE_ADVANCED_ATA
     109;--------------------------------------------------------------------
     110; Here we initialize the more advanced controllers (VLB and PCI)
     111; to get better performance for systems with 32-bit bus.
     112;
     113; This step is optional since the controllers use slowest possible
     114; settings by default if they are not initialized.
     115;
     116; InitializeAdvancedIdeController
     117;   Parameters:
     118;       DS:DI:  Ptr to DPT
     119;   Returns:
     120;       CF:     Cleared if success or no controller to initialize
     121;               Set if error
     122;   Corrupts registers:
     123;       AX, BX, CX, DX
     124;--------------------------------------------------------------------
     125InitializeAdvancedIdeControllers:
     126    ; We want to initialize the advanced controller only after both
     127    ; Master and Slave drive are initialized to correct PIO mode.
     128    ; We check if next DPT is for the same IDE controller. If it is,
     129    ; we skip the initialization.
     130    mov     al, [di+DPT.bIdevarsOffset]
     131    cmp     al, [di++LARGEST_DPT_SIZE+DPT.bIdevarsOffset]
     132    je      SHORT .SkipInitializationUntilNextDrive ; CF cleared
     133
     134    jmp     AdvAtaInit_InitializeControllerForDPTinDSDI
     135.SkipInitializationUntilNextDrive:
     136    clc
     137    ret
     138
     139%endif  ; MODULE_ADVANCED_ATA
Note: See TracChangeset for help on using the changeset viewer.