Changeset 424 in xtideuniversalbios for trunk/BIOS_Drive_Information_Tool/Src/Main.asm
- Timestamp:
- May 16, 2012, 4:23:10 PM (13 years ago)
- google:author:
- aitotat
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BIOS_Drive_Information_Tool/Src/Main.asm
r416 r424 28 28 %include "EBIOS.inc" ; From XTIDE Universal BIOS 29 29 FLG_DRVNHEAD_DRV EQU (1<<4) ; Required by CustomDPT.inc 30 %include "Romvars.inc" ; From XTIDE Universal BIOS 30 31 %include "CustomDPT.inc" ; From XTIDE Universal BIOS 31 32 … … 41 42 ; Include library and other sources 42 43 %include "AssemblyLibrary.asm" 43 %include " LbaAssist.asm" ; From XTIDE Universal BIOS44 %include "AtaGeometry.asm" ; From XTIDE Universal BIOS 44 45 %include "Strings.asm" 46 %include "AtaInfo.asm" 45 47 %include "Bios.asm" 46 48 %include "Print.asm" … … 55 57 call Print_SetCharacterOutputToSTDOUT 56 58 59 ; Display program name and version 57 60 mov si, g_szProgramName 58 61 call Print_NullTerminatedStringFromSI … … 65 68 66 69 67 70 ;-------------------------------------------------------------------- 71 ; ReadAndDisplayAllHardDrives 72 ; Parameters: 73 ; Nothing 74 ; Returns: 75 ; Nothing 76 ; Corrupts registers: 77 ; All, except segments 78 ;-------------------------------------------------------------------- 68 79 ReadAndDisplayAllHardDrives: 69 80 call Bios_GetNumberOfHardDrivesToDX … … 73 84 jmp SHORT .DisplayFirstDrive 74 85 75 ALIGN JUMP_ALIGN76 86 .DisplayNextDriveFromDL: 77 87 mov si, g_szPressAnyKey … … 80 90 81 91 .DisplayFirstDrive: 92 ; Display drive number 82 93 mov si, g_szHeaderDrive 83 94 call Print_DriveNumberFromDLusingFormatStringInSI 84 95 96 ; Display ATA information read from drive 85 97 mov si, g_szAtaInfoHeader 86 98 call Print_NullTerminatedStringFromSI 87 call DisplayAtaInformationForDriveDL 88 99 call AtaInfo_DisplayAtaInformationForDriveDL 100 101 ; Display INT 13h AH=08h and AH=15h information 89 102 mov si, g_szOldInfoHeader 90 103 call Print_NullTerminatedStringFromSI 91 104 call DisplayOldInt13hInformationForDriveDL 92 105 106 ; Display EBIOS information 93 107 mov si, g_szNewInfoHeader 94 108 call Print_NullTerminatedStringFromSI … … 101 115 102 116 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 ;-------------------------------------------------------------------- 196 126 DisplayOldInt13hInformationForDriveDL: 197 127 push cx 198 128 push dx 199 129 130 ; Print L-CHS from AH=08h 200 131 call Bios_ReadOldInt13hParametersFromDriveDL 201 132 call Print_ErrorMessageFromAHifError … … 203 134 call Print_CHSfromCXDXAX 204 135 136 ; Print total sector count from AH=15h 205 137 mov si, g_szSectors 206 138 call Print_NullTerminatedStringFromSI … … 210 142 call Print_ErrorMessageFromAHifError 211 143 jc SHORT .SkipOldInt13hSinceError 144 212 145 xchg ax, dx 213 146 mov dx, cx … … 220 153 221 154 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 ;-------------------------------------------------------------------- 223 164 DisplayNewInt13hInformationFromDriveDL: 224 165 push cx 225 166 push dx 226 167 168 ; Display EBIOS version 227 169 call Bios_ReadEbiosVersionFromDriveDL 228 170 call Print_ErrorMessageFromAHifError … … 230 172 call Print_EbiosVersionFromBXandExtensionsFromCX 231 173 174 ; Display drive info from AH=48h 232 175 call Bios_ReadEbiosInfoFromDriveDLtoDSSI 233 176 call Print_ErrorMessageFromAHifError 234 177 jc SHORT .SkipNewInt13hSinceError 235 178 179 ; Display CHS 236 180 test WORD [si+EDRIVE_INFO.wFlags], FLG_CHS_INFORMATION_IS_VALID 237 181 jz SHORT .SkipEbiosCHS … … 242 186 .SkipEbiosCHS: 243 187 188 ; Display total sector count 244 189 push si 245 190 mov si, g_szSectors … … 251 196 call Print_TotalSectorsFromBXDXAX 252 197 198 ; Display sector size 253 199 mov ax, [si+EDRIVE_INFO.wSectorSize] 254 200 mov si, g_szNewSectorSize 255 call Print_ SectorSizeFromAXusingFormatStringInSI201 call Print_FormatStringFromSIwithParameterInAX 256 202 257 203 .SkipNewInt13hSinceError:
Note:
See TracChangeset
for help on using the changeset viewer.