Changeset 424 in xtideuniversalbios for trunk


Ignore:
Timestamp:
May 16, 2012, 4:23:10 PM (13 years ago)
Author:
Tomi Tilli
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.
Location:
trunk/BIOS_Drive_Information_Tool
Files:
2 added
4 edited

Legend:

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

    r376 r424  
    3131;       AX, BX, CX
    3232;--------------------------------------------------------------------
    33 ALIGN JUMP_ALIGN
    3433Bios_GetNumberOfHardDrivesToDX:
    3534    mov     dl, 80h     ; First hard drive
     
    5453;       Nothing
    5554;--------------------------------------------------------------------
    56 ALIGN JUMP_ALIGN
    5755Bios_ReadOldInt13hParametersFromDriveDL:
    5856    mov     ah, GET_DRIVE_PARAMETERS
     
    102100;       Nothing
    103101;--------------------------------------------------------------------
    104 ALIGN JUMP_ALIGN
    105102Bios_ReadOldInt13hCapacityFromDriveDL:
    106103    mov     ah, GET_DISK_TYPE
     
    123120;       ES
    124121;--------------------------------------------------------------------
    125 ALIGN JUMP_ALIGN
    126122Bios_ReadAtaInfoFromDriveDLtoBX:
    127123    mov     bx, g_rgbAtaInfo
     
    146142;       Nothing
    147143;--------------------------------------------------------------------
    148 ALIGN JUMP_ALIGN
    149144Bios_ReadEbiosVersionFromDriveDL:
    150145    mov     ah, CHECK_EXTENSIONS_PRESENT
     
    175170;       Nothing
    176171;--------------------------------------------------------------------
    177 ALIGN JUMP_ALIGN
    178172Bios_ReadEbiosInfoFromDriveDLtoDSSI:
    179173    mov     si, g_edriveInfo
  • 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:
  • trunk/BIOS_Drive_Information_Tool/Src/Print.asm

    r376 r424  
    3030;       AX, BX, DI
    3131;--------------------------------------------------------------------
    32 ALIGN JUMP_ALIGN
    3332Print_SetCharacterOutputToSTDOUT:
    3433    mov     bl, ATTRIBUTES_NOT_USED
     
    5049;       AX, DX
    5150;--------------------------------------------------------------------
    52 ALIGN JUMP_ALIGN
    5351DosCharOut:
    5452    xchg    dx, ax
     
    6866;       AX, BP, SI, DI (CF remains unchanged)
    6967;--------------------------------------------------------------------
    70 ALIGN JUMP_ALIGN
    7168Print_ErrorMessageFromAHifError:
    7269    jnc     SHORT .NoErrors
    7370    eMOVZX  ax, ah
    7471    mov     si, g_szBiosError
    75     call    Print_BiosFunctionNumberFromAXusingFormatStringInSI
     72    call    Print_FormatStringFromSIwithParameterInAX
    7673    stc     ; Keep the CF set
    7774ALIGN JUMP_ALIGN
     
    8279;---------------------------------------------------------------------
    8380; Print_DriveNumberFromDLusingFormatStringInSI
    84 ; Print_VersionStringFromAXusingFormatStringInSI
    85 ; Print_BiosFunctionNumberFromAXusingFormatStringInSI
    86 ; Print_SectorSizeFromAXusingFormatStringInSI
    8781;   Parameters:
    8882;       DL:     Drive Number
    89 ;       AX:     Function number
     83;       SI:     Offset to format string
    9084;   Returns:
    9185;       Nothing
     
    9387;       AX, BP, DI
    9488;--------------------------------------------------------------------
    95 ALIGN JUMP_ALIGN
    9689Print_DriveNumberFromDLusingFormatStringInSI:
    9790    eMOVZX  ax, dl
    98 Print_VersionStringFromAXusingFormatStringInSI:
    99 Print_BiosFunctionNumberFromAXusingFormatStringInSI:
    100 Print_SectorSizeFromAXusingFormatStringInSI:
    101     mov     bp, sp
    102     push    ax
    103     jmp     SHORT JumpToFormatNullTerminatedStringFromSI
     91    ; Fall to Print_FormatStringFromSIwithParameterInAX
     92
     93
     94;---------------------------------------------------------------------
     95; Print_FormatStringFromSIwithParameterInAX
     96; Print_FormatStringFromSIwithParametersInAXDX
     97; Print_FormatStringFromSIwithParametersInAXDXCX
     98;   Parameters:
     99;       AX:     Format parameter 1
     100;       DX:     Format parameter 2
     101;       CX:     Format parameter 3
     102;       SI:     Offset to format string
     103;   Returns:
     104;       Nothing
     105;   Corrupts registers:
     106;       AX, BP, DI
     107;--------------------------------------------------------------------
     108Print_FormatStringFromSIwithParameterInAX:
     109    mov     bp, sp
     110    push    ax
     111    jmp     JumpToFormatNullTerminatedStringFromSI
     112
     113Print_FormatStringFromSIwithParametersInAXDX:
     114    mov     bp, sp
     115    push    ax
     116    push    dx
     117    jmp     JumpToFormatNullTerminatedStringFromSI
     118
     119Print_FormatStringFromSIwithParametersInAXDXCX:
     120    mov     bp, sp
     121    push    ax
     122    push    dx
     123    push    cx
     124    jmp     SHORT JumpToFormatNullTerminatedStringFromSI
     125
     126
     127;---------------------------------------------------------------------
     128; Print_ModeFromDLandCHSfromAXBLBH
     129;   Parameters:
     130;       AX:     Number of L-CHS cylinders (1...1024)
     131;       BL:     Number of L-CHS heads (1...255)
     132;       BH:     Number of L-CHS sectors per track (1...63)
     133;       DL:     CHS Translate Mode
     134;   Returns:
     135;       Nothing
     136;   Corrupts registers:
     137;       AX, BP, SI, DI
     138;--------------------------------------------------------------------
     139Print_ModeFromDLandCHSfromAXLBH:
     140    mov     bp, sp
     141
     142    xor     dh, dh
     143    mov     si, dx
     144    shl     si, 1       ; Shift for WORD lookup
     145    push    WORD [si+.rgszXlateModeToString]
     146
     147    ePUSH_T si, g_szFormatCHS
     148    push    ax          ; Cylinders
     149    eMOVZX  ax, bl
     150    push    ax          ; Heads
     151    mov     al, bh
     152    push    ax          ; Sectors per track
     153
     154    mov     si, g_szXlateAndCHS
     155    jmp     SHORT JumpToFormatNullTerminatedStringFromSI
     156
     157.rgszXlateModeToString:
     158    dw      g_szNormal
     159    dw      g_szLarge
     160    dw      g_szLBA
    104161
    105162
     
    115172;       AX, BP, DI
    116173;--------------------------------------------------------------------
    117 ALIGN JUMP_ALIGN
    118174Print_CHSfromCXDXAX:
    119175    push    si
     
    139195;       AX, CX, BP, SI, DI
    140196;--------------------------------------------------------------------
    141 ALIGN JUMP_ALIGN
    142197Print_NameFromAtaInfoInBX:
    143198    cld
     
    171226;       AX, BX, BP, DI
    172227;--------------------------------------------------------------------
    173 ALIGN JUMP_ALIGN
    174228Print_TotalSectorsFromBXDXAX:
    175229    ePUSH_T di, 0
     
    200254;       AX, BP, SI, DI
    201255;--------------------------------------------------------------------
    202 ALIGN JUMP_ALIGN
    203256Print_EbiosVersionFromBXandExtensionsFromCX:
    204257    mov     bp, sp
     
    219272;       AX, DI
    220273;--------------------------------------------------------------------
    221 ALIGN JUMP_ALIGN
    222274JumpToFormatNullTerminatedStringFromSI:
    223275    CALL_DISPLAY_LIBRARY    FormatNullTerminatedStringFromCSSI
     
    234286;       AX, DI
    235287;--------------------------------------------------------------------
    236 ALIGN JUMP_ALIGN
    237288Print_NullTerminatedStringFromSI:
    238289    CALL_DISPLAY_LIBRARY    PrintNullTerminatedStringFromCSSI
  • trunk/BIOS_Drive_Information_Tool/Src/Strings.asm

    r376 r424  
    2121SECTION .data
    2222
    23 g_szProgramName:    db  "BIOS Drive Information Tool v1.0.1",CR,LF
     23g_szProgramName:    db  "BIOS Drive Information Tool v1.0.2",CR,LF
    2424                    db  "(C) 2012 by XTIDE Universal BIOS Team",CR,LF
    2525                    db  "Released under GNU GPL v2",CR,LF
     
    3232g_szAtaInfoHeader:  db  "ATA-information from AH=25h...",CR,LF,NULL
    3333g_szFormatDrvName:  db  " Name: %s",CR,LF,NULL
     34g_szXlateAndCHS:    db  " Mode: %s, %s",NULL
     35g_szNormal:         db  "NORMAL",NULL
     36g_szLarge:          db  "LARGE ",NULL
     37g_szLBA:            db  "LBA   ",NULL
    3438g_szFormatCHS:      db  " Cylinders    : %5-u, Heads: %3-u, Sectors: %2-u",CR,LF,NULL
    3539g_szChsSectors:     db  " CHS   sectors: ",NULL
    3640g_szLBA28:          db  " LBA28 sectors: ",NULL
    3741g_szLBA48:          db  " LBA48 sectors: ",NULL
    38 
     42g_szBlockMode:      db  " Block set    : %u, Max block: %u sectors",CR,LF,NULL
     43g_szPIO:            db  " Max PIO mode : %u, Min cycle time without IORDY %u, with IORDY %d ns",CR,LF,NULL
    3944g_szXTUB:           db  "XTIDE Universal BIOS %s generates following L-CHS...",CR,LF,NULL
    4045g_szXTUBversion:    db  ROM_VERSION_STRING  ; This one is NULL terminated
Note: See TracChangeset for help on using the changeset viewer.