Changeset 424 in xtideuniversalbios for trunk/BIOS_Drive_Information_Tool/Src/Main.asm


Ignore:
Timestamp:
May 16, 2012, 4:23:10 PM (12 years ago)
Author:
aitotat
google:author:
aitotat
Message:

Changes to BIOS Drive Information Tool:

  • Up to date with recent CHS translation changes.
  • Block mode and PIO capabilities are now displayed.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BIOS_Drive_Information_Tool/Src/Main.asm

    r416 r424  
    2828%include "EBIOS.inc"            ; From XTIDE Universal BIOS
    2929FLG_DRVNHEAD_DRV    EQU (1<<4)  ; Required by CustomDPT.inc
     30%include "Romvars.inc"          ; From XTIDE Universal BIOS
    3031%include "CustomDPT.inc"        ; From XTIDE Universal BIOS
    3132
     
    4142; Include library and other sources
    4243%include "AssemblyLibrary.asm"
    43 %include "LbaAssist.asm"        ; From XTIDE Universal BIOS
     44%include "AtaGeometry.asm"      ; From XTIDE Universal BIOS
    4445%include "Strings.asm"
     46%include "AtaInfo.asm"
    4547%include "Bios.asm"
    4648%include "Print.asm"
     
    5557    call    Print_SetCharacterOutputToSTDOUT
    5658
     59    ; Display program name and version
    5760    mov     si, g_szProgramName
    5861    call    Print_NullTerminatedStringFromSI
     
    6568
    6669
    67 
     70;--------------------------------------------------------------------
     71; ReadAndDisplayAllHardDrives
     72;   Parameters:
     73;       Nothing
     74;   Returns:
     75;       Nothing
     76;   Corrupts registers:
     77;       All, except segments
     78;--------------------------------------------------------------------
    6879ReadAndDisplayAllHardDrives:
    6980    call    Bios_GetNumberOfHardDrivesToDX
     
    7384    jmp     SHORT .DisplayFirstDrive
    7485
    75 ALIGN JUMP_ALIGN
    7686.DisplayNextDriveFromDL:
    7787    mov     si, g_szPressAnyKey
     
    8090
    8191.DisplayFirstDrive:
     92    ; Display drive number
    8293    mov     si, g_szHeaderDrive
    8394    call    Print_DriveNumberFromDLusingFormatStringInSI
    8495
     96    ; Display ATA information read from drive
    8597    mov     si, g_szAtaInfoHeader
    8698    call    Print_NullTerminatedStringFromSI
    87     call    DisplayAtaInformationForDriveDL
    88 
     99    call    AtaInfo_DisplayAtaInformationForDriveDL
     100
     101    ; Display INT 13h AH=08h and AH=15h information
    89102    mov     si, g_szOldInfoHeader
    90103    call    Print_NullTerminatedStringFromSI
    91104    call    DisplayOldInt13hInformationForDriveDL
    92105
     106    ; Display EBIOS information
    93107    mov     si, g_szNewInfoHeader
    94108    call    Print_NullTerminatedStringFromSI
     
    101115
    102116
    103 ALIGN JUMP_ALIGN
    104 DisplayAtaInformationForDriveDL:
    105     push    cx
    106     push    dx
    107 
    108     call    Bios_ReadAtaInfoFromDriveDLtoBX
    109     call    Print_ErrorMessageFromAHifError
    110     jc      SHORT .SkipAtaInfoSinceError
    111 
    112     call    Print_NameFromAtaInfoInBX
    113 
    114     mov     cx, [bx+ATA1.wCylCnt]
    115     mov     dx, [bx+ATA1.wHeadCnt]
    116     mov     ax, [bx+ATA1.wSPT]
    117     call    Print_CHSfromCXDXAX
    118 
    119     test    WORD [bx+ATA1.wFields], A1_wFields_54to58
    120     jz      SHORT .SkipChsSectors
    121     mov     si, g_szChsSectors
    122     call    Print_NullTerminatedStringFromSI
    123     mov     si, bx
    124     mov     ax, [si+ATA1.dwCurSCnt]
    125     mov     dx, [si+ATA1.dwCurSCnt+2]
    126     xor     bx, bx
    127     call    Print_TotalSectorsFromBXDXAX
    128     mov     bx, si
    129 .SkipChsSectors:
    130 
    131     test    WORD [bx+ATA1.wCaps], A1_wCaps_LBA
    132     jz      SHORT .SkipLBA28
    133     mov     si, g_szLBA28
    134     call    Print_NullTerminatedStringFromSI
    135     mov     si, bx
    136     mov     ax, [si+ATA1.dwLBACnt]
    137     mov     dx, [si+ATA1.dwLBACnt+2]
    138     xor     bx, bx
    139     call    Print_TotalSectorsFromBXDXAX
    140     mov     bx, si
    141 .SkipLBA28:
    142 
    143     test    WORD [bx+ATA6.wSetSup83], A6_wSetSup83_LBA48
    144     jz      SHORT .SkipLBA48
    145     mov     si, g_szLBA48
    146     call    Print_NullTerminatedStringFromSI
    147     mov     si, bx
    148     mov     ax, [bx+ATA6.qwLBACnt]
    149     mov     dx, [bx+ATA6.qwLBACnt+2]
    150     mov     bx, [bx+ATA6.qwLBACnt+4]
    151     call    Print_TotalSectorsFromBXDXAX
    152     mov     bx, si
    153 .SkipLBA48:
    154 
    155     ; Print L-CHS generated by XTIDE Universal BIOS
    156     mov     ax, g_szXTUBversion
    157     mov     si, g_szXTUB
    158     call    Print_VersionStringFromAXusingFormatStringInSI
    159     call    DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX
    160 
    161 .SkipAtaInfoSinceError:
    162     pop     dx
    163     pop     cx
    164     ret
    165 
    166 
    167 ALIGN JUMP_ALIGN
    168 DisplayXTUBcompatibilityInfoUsingAtaInfoFromDSBX:
    169     test    WORD [bx+ATA1.wCaps], A1_wCaps_LBA
    170     jz      SHORT .LbaNotSupported
    171     test    WORD [bx+ATA6.wSetSup83], A6_wSetSup83_LBA48
    172     jz      SHORT .LoadLba28SectorCount
    173 
    174     ; Load LBA48 Sector Count
    175     mov     ax, [bx+ATA6.qwLBACnt]
    176     mov     dx, [bx+ATA6.qwLBACnt+2]
    177     mov     bx, [bx+ATA6.qwLBACnt+4]
    178     jmp     SHORT .ConvertLbaToLCHS
    179 .LoadLba28SectorCount:
    180     mov     ax, [bx+ATA1.dwLBACnt]
    181     mov     dx, [bx+ATA1.dwLBACnt+2]
    182     xor     bx, bx
    183 
    184 .ConvertLbaToLCHS:
    185     call    LbaAssist_ConvertSectorCountFromBXDXAXtoLbaAssistedCHSinDXAXBLBH
    186     LIMIT_LBA_CYLINDERS_IN_DXAX_TO_LCHS_CYLINDERS
    187     xchg    cx, ax
    188     eMOVZX  dx, bl
    189     eMOVZX  ax, bh
    190     call    Print_CHSfromCXDXAX
    191 .LbaNotSupported:
    192     ret
    193 
    194 
    195 ALIGN JUMP_ALIGN
     117;--------------------------------------------------------------------
     118; DisplayOldInt13hInformationForDriveDL
     119;   Parameters:
     120;       DL:     Drive Number
     121;   Returns:
     122;       Nothing
     123;   Corrupts registers:
     124;       All, except CX and DX
     125;--------------------------------------------------------------------
    196126DisplayOldInt13hInformationForDriveDL:
    197127    push    cx
    198128    push    dx
    199129
     130    ; Print L-CHS from AH=08h
    200131    call    Bios_ReadOldInt13hParametersFromDriveDL
    201132    call    Print_ErrorMessageFromAHifError
     
    203134    call    Print_CHSfromCXDXAX
    204135
     136    ; Print total sector count from AH=15h
    205137    mov     si, g_szSectors
    206138    call    Print_NullTerminatedStringFromSI
     
    210142    call    Print_ErrorMessageFromAHifError
    211143    jc      SHORT .SkipOldInt13hSinceError
     144
    212145    xchg    ax, dx
    213146    mov     dx, cx
     
    220153
    221154
    222 ALIGN JUMP_ALIGN
     155;--------------------------------------------------------------------
     156; DisplayNewInt13hInformationFromDriveDL
     157;   Parameters:
     158;       DL:     Drive Number
     159;   Returns:
     160;       Nothing
     161;   Corrupts registers:
     162;       All, except CX and DX
     163;--------------------------------------------------------------------
    223164DisplayNewInt13hInformationFromDriveDL:
    224165    push    cx
    225166    push    dx
    226167
     168    ; Display EBIOS version
    227169    call    Bios_ReadEbiosVersionFromDriveDL
    228170    call    Print_ErrorMessageFromAHifError
     
    230172    call    Print_EbiosVersionFromBXandExtensionsFromCX
    231173
     174    ; Display drive info from AH=48h
    232175    call    Bios_ReadEbiosInfoFromDriveDLtoDSSI
    233176    call    Print_ErrorMessageFromAHifError
    234177    jc      SHORT .SkipNewInt13hSinceError
    235178
     179    ; Display CHS
    236180    test    WORD [si+EDRIVE_INFO.wFlags], FLG_CHS_INFORMATION_IS_VALID
    237181    jz      SHORT .SkipEbiosCHS
     
    242186.SkipEbiosCHS:
    243187
     188    ; Display total sector count
    244189    push    si
    245190    mov     si, g_szSectors
     
    251196    call    Print_TotalSectorsFromBXDXAX
    252197
     198    ; Display sector size
    253199    mov     ax, [si+EDRIVE_INFO.wSectorSize]
    254200    mov     si, g_szNewSectorSize
    255     call    Print_SectorSizeFromAXusingFormatStringInSI
     201    call    Print_FormatStringFromSIwithParameterInAX
    256202
    257203.SkipNewInt13hSinceError:
Note: See TracChangeset for help on using the changeset viewer.