Changeset 542 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization


Ignore:
Timestamp:
Apr 15, 2013, 4:03:33 PM (12 years ago)
Author:
aitotat@…
google:author:
aitotat@gmail.com
Message:

Changes to XTIDE Universal BIOS:

  • Fixed a bug that allowed EBIOS functions for user defined CHS.
  • Simplified user defined CHS and LBA setup a little.
Location:
trunk/XTIDE_Universal_BIOS/Src/Initialization
Files:
3 edited

Legend:

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

    r534 r542  
    4141    in      al, QD65XX_BASE_PORT + QD65XX_CONFIG_REGISTER_in
    4242
    43 %if 0
     43%ifdef DANGEROUS_DETECTION
    4444    ; Checking alternative base port is currently commented away
    4545    ; since Intel PIIX4 south bridge mirrors Interrupt Controller registers
     
    5151    or      dl, QD65XX_ALTERNATIVE_BASE_PORT
    5252    in      al, QD65XX_ALTERNATIVE_BASE_PORT + QD65XX_CONFIG_REGISTER_in
    53 %endif ; 0
     53%endif ; DANGEROUS_DETECTION
    5454    ; Fall to IsConfigRegisterWithIDinAL
    5555
     
    6565;       Nothing
    6666;--------------------------------------------------------------------
    67 ;IsConfigRegisterWithIDinAL:
     67IsConfigRegisterWithIDinAL:
    6868    mov     ah, al
    6969    and     al, MASK_QDCONFIG_CONTROLLER_ID
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r526 r542  
    9595
    9696
     97;--------------------------------------------------------------------
     98; Writes user defined limits from ROMVARS to ATA ID read from the drive.
     99; Modifying the ATA ID reduces code and possibilites for bugs since
     100; only little furher checks are needed elsewhere.
     101;
     102; AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX
     103;   Parameters:
     104;       DS:DI:  Ptr to incomplete Disk Parameter Table
     105;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     106;       CS:BP:  Ptr to IDEVARS for the controller
     107;   Returns:
     108;       DX:     User defined P-CHS to L-CHS translate mode
     109;   Corrupts registers:
     110;       AX, BX, CX
     111;--------------------------------------------------------------------
     112AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX:
     113    call    AccessDPT_GetPointerToDRVPARAMStoCSBX
     114    push    ds
     115    push    es
     116    pop     ds      ; DS:SI now points to ATA information
     117
     118    ; Load User Defined CHS or LBA to CX:AX
     119    mov     dx, [cs:bx+DRVPARAMS.wFlags]
     120    mov     ax, [cs:bx+DRVPARAMS.wCylinders]        ; Or .dwMaximumLBA
     121    mov     cx, [cs:bx+DRVPARAMS.wHeadsAndSectors]  ; Or .dwMaximumLBA+2
     122
     123    ; * User defined CHS *
     124    test    dl, FLG_DRVPARAMS_USERCHS
     125    jz      SHORT .NoUserDefinedCHS
     126
     127    ; Apply new CHS and disable LBA (we also want to set CHS addressing)
     128    mov     [si+ATA1.wCylCnt], ax
     129    eMOVZX  ax, cl
     130    mov     [si+ATA1.wHeadCnt], ax
     131    mov     al, ch
     132    mov     [si+ATA1.wSPT], ax
     133    and     BYTE [si+ATA1.wCaps+1], ~(A1_wCaps_LBA>>8)
     134    and     BYTE [si+ATA6.wSetSup83+1], ~(A6_wSetSup83_LBA48>>8)
     135.NoUserDefinedCHS:
     136
     137    ; * User defined LBA *
     138    test    dl, FLG_DRVPARAMS_USERLBA
     139    jz      SHORT .NoUserDefinedLBA
     140
     141    ; Apply new LBA and disable LBA48
     142    cmp     cx, [si+ATA1.dwLBACnt+2]
     143    ja      SHORT .NoUserDefinedLBA     ; Do not set larger than drive
     144    jb      SHORT .StoreNewLBA
     145    cmp     ax, [si+ATA1.dwLBACnt]
     146    ja      SHORT .NoUserDefinedLBA     ; Allow same size to disable LBA48
     147.StoreNewLBA:
     148    mov     [si+ATA1.dwLBACnt], ax
     149    mov     [si+ATA1.dwLBACnt+2], cx
     150    and     BYTE [si+ATA6.wSetSup83+1], ~(A6_wSetSup83_LBA48>>8)
     151.NoUserDefinedLBA:
     152
     153    ; * Disable Block Mode transfers *
     154    test    dl, FLG_DRVPARAMS_BLOCKMODE
     155    jnz     SHORT .NoNeedToDisableBlockMode
     156    mov     BYTE [si+ATA1.bBlckSize], 1 ; sectors
     157.NoNeedToDisableBlockMode:
     158
     159    ; * Load P-CHS to L-CHS translate mode to DX *
     160    and     dx, BYTE MASK_DRVPARAMS_TRANSLATEMODE
     161    eSHR_IM dx, TRANSLATEMODE_FIELD_POSITION
     162
     163    pop     ds
     164    ret
     165
     166
    97167%ifdef MODULE_ADVANCED_ATA
    98168;--------------------------------------------------------------------
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm

    r541 r542  
    9595;--------------------------------------------------------------------
    9696.StoreDptPointersToIntVectors:
     97%ifndef USE_AT
     98    test    BYTE [cs:ROMVARS.wFlags], FLG_ROMVARS_FULLMODE
     99    jz      SHORT .CompatibleDPTsCreated    ; Only Full operating mode has extra RAM to spare
     100%endif
     101
    97102    mov     dl, 80h
    98103    call    FindDPT_ForDriveNumberInDL  ; DPT to DS:DI
Note: See TracChangeset for help on using the changeset viewer.