Ignore:
Timestamp:
Jun 30, 2018, 8:27:04 AM (6 years ago)
Author:
Tomi Tilli
Message:

Flashing now works again.
Hack to get Windows 95 to work properly (MODULE_WIN95_CMOS_HACK included for 386 builds by default).
Edited makefile to produce large 386 build.
Fixed recovery time for QDI Vision VLB-IDE controllers.
No more warnings with Nasm 2.13.xx and later.
File dialog now properly restores default drive when file selection is cancelled.

Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm

    r592 r593  
    3333;               Cleared if no controller
    3434;   Corrupts registers:
    35 ;       BX
     35;       BX, CX
    3636;--------------------------------------------------------------------
    3737AdvAtaInit_DetectControllerForIdeBaseInBX:
     38    ; Detect if system has PCI bus. If it does, we can skip VLB detection. This is
     39    ; good thing since detecting Vision QD6850 is dangerous since Intel PIIX4 south bridge
     40    ; mirrors Interrupt Controller registers from Axh to Bxh. This can lead to faulty
     41    ; detection of QD6850 that will eventually crash the system when ports are written.
     42
     43    ; We should save the 32-bit registers but we don't since system BIOS has stored
     44    ; them already and we don't use the 32-bit registers ourselves anywhere at the moment.
     45    push    bx
     46    push    di
     47    xor     edi, edi        ; Some BIOSes require this to be set to zero
     48    mov     ax, PCI_INSTALLATION_CHECK
     49    int     BIOS_TIME_PCI_PNP_1Ah
     50    pop     di
     51    pop     bx
     52    test    ah, ah
     53    jz      SHORT .ThisSystemHasPCIbus
     54
     55    ; Detect VLB controllers
    3856    call    Vision_DetectAndReturnIDinAXandPortInDXifControllerPresent
    3957    jnz     SHORT .NoVisionControllerFound
     
    5169
    5270.NoAdvancedControllerForPortBX:
     71.ThisSystemHasPCIbus:
    5372    xor     ax, ax      ; Clear ID in AX and CF
    5473    ret
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm

    r592 r593  
    4141    in      al, QD65XX_BASE_PORT + QD65XX_CONFIG_REGISTER_in
    4242
    43 %ifdef DANGEROUS_DETECTION
    44     ; Checking alternative base port is currently commented away
    45     ; since Intel PIIX4 south bridge mirrors Interrupt Controller registers
    46     ; from Axh to Bxh.
    4743    call    IsConfigRegisterWithIDinAL
    4844    je      SHORT VisionControllerDetected.Return
     
    5147    mov     dl, QD65XX_ALTERNATIVE_BASE_PORT
    5248    in      al, QD65XX_ALTERNATIVE_BASE_PORT + QD65XX_CONFIG_REGISTER_in
    53 %endif ; DANGEROUS_DETECTION
    5449    ; Fall to IsConfigRegisterWithIDinAL
    5550
     
    198193
    199194    ; Calculate Recovery Time value for QD65xx IDE Timing Register
    200     call    AtaID_GetRecoveryTimeToAXfromPioModeInBXandCycleTimeInCX
     195    xchg    ax, cx
     196    eMOVZX  cx, BYTE [cs:bx+.rgbToSubtractFromCycleTimeBasedOnPIOmode]
     197    sub     ax, cx
    201198    mov     bx, bp                      ; Active Time value now in BL
    202199    mov     bp, QD65xx_MAX_RECOVERY_TIME_CLOCKS | (QD65xx_MIN_RECOVERY_TIME_CLOCKS << 8)
     
    209206    ret                                 ; Return with CF cleared
    210207
     208.rgbToSubtractFromCycleTimeBasedOnPIOmode:
     209    ; For PIO 0 to 2 this method (t0 - (t1+t8+t9)) seems to give closest (little less) values to the fixed preset
     210    ; values used by QDI6580 DOS driver v3.7
     211    db      (PIO_0_MIN_ADDRESS_VALID_NS + PIO_0_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_0_DIORW_TO_ADDR_VALID_HOLD)
     212    db      (PIO_1_MIN_ADDRESS_VALID_NS + PIO_1_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_1_DIORW_TO_ADDR_VALID_HOLD)
     213    db      (PIO_2_MIN_ADDRESS_VALID_NS + PIO_2_MAX_ADDR_VALID_TO_IOCS16_RELEASED + PIO_2_DIORW_TO_ADDR_VALID_HOLD)
     214    db      102     ; QDI6580 DOS driver v3.7 uses fixed values for PIO 3...
     215    db      61      ; ...and PIO 4. No idea where these values come from.
     216    db      (PIO_5_MIN_CYCLE_TIME_NS / 2) ; PIO 5 and 6 were not available when QD6850 was released. Use values...
     217    db      (PIO_6_MIN_CYCLE_TIME_NS / 2) ; ...that resembles those used for PIO 4
     218
    211219
    212220;--------------------------------------------------------------------
     
    226234
    227235    ; Get VLB Cycle Time in nanosecs
    228     mov     cl, VLB_33MHZ_CYCLE_TIME    ; Assume 33 MHz or slower VLB bus
     236    mov     cl, VLB_33MHZ_CYCLE_TIME    ; Assume 33 MHz or slower VLB bus (30 ns)
    229237    test    BYTE [di+DPT_ADVANCED_ATA.wControllerID], FLG_QDCONFIG_ID3
    230     eCMOVZ  cl, VLB_40MHZ_CYCLE_TIME
     238    eCMOVZ  cl, VLB_40MHZ_CYCLE_TIME    ; (25 ns)
    231239
    232240    ; Convert value in AX to VLB ticks
Note: See TracChangeset for help on using the changeset viewer.