Changeset 567 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm


Ignore:
Timestamp:
May 26, 2014, 1:25:15 PM (10 years ago)
Author:
krille_n_@…
google:author:
krille_n_@hotmail.com
Message:

Changes:

  • Renamed MODULE_FEATURE_SETS to MODULE_POWER_MANAGEMENT.
  • Renamed MODULE_VERY_LATE_INITIALIZATION to MODULE_VERY_LATE_INIT and removed it from the official builds.
  • Removed the code that skips detection of slave drives on XT-CF controllers since slave drives can be used with Lo-tech ISA CompactFlash boards.
  • Added autodetection of the SVC ADP50L controller to XTIDECFG.
  • The autodetection of XT-CF controllers now requires MODULE_8BIT_IDE_ADVANCED in the loaded BIOS.
  • Fixed a bug in XTIDECFG from r502 where the "Base (cmd block) address" menu option would be displayed when a serial device was selected as the IDE controller.
  • XTIDECFG would display the "Enable interrupt" menu option for the XTIDE r1 but not for the XTIDE r2. It's now displayed for both controller types.
  • Disabled the "Internal Write Cache" menu option in the Master/Slave Drive menus for serial device type drives.
  • Optimizations and other fixes.
File:
1 edited

Legend:

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

    r550 r567  
    2727;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    2828;   Returns:
    29 ;       CF:     Set if failed to verify ATA-ID
    30 ;               Cleared if ATA-ID verified successfully
     29;       ZF:     Set if ATA-ID verified successfully
     30;               Cleared if failed to verify ATA-ID
    3131;   Corrupts registers:
    3232;       AX, BX, CX
     
    4141    ; Verify P-CHS cylinders
    4242    mov     bx, ATA1.wCylCnt
    43     mov     cx, MAX_VALID_PCHS_CYLINDERS
    44     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     43    mov     ax, MAX_VALID_PCHS_CYLINDERS
     44    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    4545
    4646    mov     bl, ATA1.wHeadCnt & 0FFh
    47     mov     cx, MAX_VALID_PCHS_HEADS
    48     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     47    mov     ax, MAX_VALID_PCHS_HEADS
     48    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    4949
    5050    mov     bl, ATA1.wSPT & 0FFh
    51     mov     cl, MAX_VALID_PCHS_SECTORS_PER_TRACK
    52     call    .CompareCHorSfromOffsetBXtoMaxValueInCX
     51    mov     al, MAX_VALID_PCHS_SECTORS_PER_TRACK
     52    call    .CompareCHorSfromOffsetBXtoMaxValueInAX
    5353
    5454    ; Check signature byte. It is only found on ATA-5 and later. It should be zero on
     
    6262    ; Check checksum byte since signature was present
    6363    mov     cx, ATA6_size
    64     call    Memory_SumCXbytesFromESSItoAL       ; Returns with ZF set according to result
    65     jnz     SHORT .FailedToVerifyAtaID
    66 
    67     ; ATA-ID is now verified to be valid
    68 .AtaIDverifiedSuccessfully:
    69     clc
    70     ret
    71 
    72 ;--------------------------------------------------------------------
    73 ; .CompareCHorSfromOffsetBXtoMaxValueInCX
    74 ;   Parameters:
     64    jmp     Memory_SumCXbytesFromESSItoAL       ; Returns with ZF set according to result
     65
     66;--------------------------------------------------------------------
     67; .CompareCHorSfromOffsetBXtoMaxValueInAX
     68;   Parameters:
     69;       AX:     Maximum valid C, H or S value
    7570;       BX:     C, H or S offset to ATA-ID
    76 ;       CX:     Maximum valid C, H or S value
    77 ;       ES:SI:  Ptr to 512-byte ATA information read from the drive
    78 ;   Returns:
    79 ;       Exits from AtaID_VerifyFromESSI with CF set if invalid value
    80 ;   Corrupts registers:
    81 ;       AX
    82 ;--------------------------------------------------------------------
    83 .CompareCHorSfromOffsetBXtoMaxValueInCX:
    84     mov     ax, [es:bx+si]
    85     test    ax, ax
    86     jz      SHORT .InvalidPCHorSinOffsetBX
    87     cmp     ax, cx          ; Compare to max valid value
     71;       ES:SI:  Ptr to 512-byte ATA information read from the drive
     72;   Returns:
     73;       Exits from AtaID_VerifyFromESSI with ZF cleared if invalid value
     74;   Corrupts registers:
     75;       CX
     76;--------------------------------------------------------------------
     77.CompareCHorSfromOffsetBXtoMaxValueInAX:
     78    mov     cx, [es:bx+si]
     79    jcxz    .InvalidPCHorSinOffsetBX
     80    cmp     cx, ax          ; Compare to max valid value
    8881    jbe     SHORT .ValidPCHorSinOffsetBX
    8982.InvalidPCHorSinOffsetBX:
    90     add     sp, BYTE 2      ; Clear return address for this function
     83    pop     cx              ; Clear return address for this function
     84    inc     cx              ; Clear ZF to indicate invalid ATA-ID (safe to do since return address in CX will never be FFFFh)
     85.AtaIDverifiedSuccessfully:
    9186.FailedToVerifyAtaID:
    92     stc                     ; Set carry to indicate invalid ATA-ID
    9387.ValidPCHorSinOffsetBX:
    9488    ret
     
    9791;--------------------------------------------------------------------
    9892; 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.
     93; Modifying the ATA ID reduces code and possibilities for bugs since
     94; only little further checks are needed elsewhere.
    10195;
    10296; AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX
Note: See TracChangeset for help on using the changeset viewer.