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


Ignore:
Timestamp:
May 27, 2021, 6:25:17 PM (4 years ago)
Author:
Tomi Tilli
Message:

Added more complex way to limit illegal P-CHS Cylinders. This way more modifications can be easily made later if necessary.
Updated biosdrvs to display unmodified and modified CHS.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm

    r593 r613  
    2222SECTION .text
    2323
     24;--------------------------------------------------------------------
     25; Adjust ATA information for compatibility, debug, etc purposes.
     26; We can also completely ignore the drive if necessary.
     27;
     28; AtaID_FixIllegalValuesFromESSI
     29;   Parameters:
     30;       AH:     INT 13h Error Code from reading ATA information
     31;       CF:     Cleared if successfully read ATA information,
     32;               Set if failed to read ATA information
     33;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     34;   Returns:
     35;       ES:SI:  Ata information with possible corrections made
     36;       AH:     INT 13h Error Code from reading ATA information
     37;       CF      cleared if drive now accepted
     38;   Corrupts registers:
     39;       AL, BX, CX, DX, DI
     40;--------------------------------------------------------------------
     41%ifndef NO_ATAID_CORRECTION
     42%ifndef EXCLUDE_FROM_BIOSDRVS
     43AtaID_PopESSIandFixIllegalValuesFromESSI:
     44    pop     si
     45    pop     es
     46%endif
     47AtaID_FixIllegalValuesFromESSI:
     48    jc      SHORT .Return   ; Nothing to fix since failed to read ATA Info
     49
     50    ; Only correct cylinders since there are no reports that head or sectors could be wrong
     51    MIN_U   WORD [es:si+ATA1.wCylCnt], MAX_VALID_PCHS_CYLINDERS     ; Limit to max allowed value
     52   
     53    ; Note! There are ATA ID words 54-58 that also need to be modified! However,
     54    ; the drive itself should modify them when we do Initialize Device Parameters command at AH=9h.
     55    ; Verification from real drive needed before we fix them manually
     56   
     57    clc                     ; Return success
     58.Return:
     59    ret
     60%endif ; NO_ATAID_CORRECTION
     61
     62
     63%ifndef EXCLUDE_FROM_BIOSDRVS
    2464;--------------------------------------------------------------------
    2565; AtaID_VerifyFromESSI
     
    233273
    234274%endif ; MODULE_ADVANCED_ATA
     275
     276%endif ; EXCLUDE_FROM_BIOSDRVS
Note: See TracChangeset for help on using the changeset viewer.