- Timestamp:
- May 16, 2012, 4:23:10 PM (13 years ago)
- google:author:
- aitotat
- 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 31 31 ; AX, BX, CX 32 32 ;-------------------------------------------------------------------- 33 ALIGN JUMP_ALIGN34 33 Bios_GetNumberOfHardDrivesToDX: 35 34 mov dl, 80h ; First hard drive … … 54 53 ; Nothing 55 54 ;-------------------------------------------------------------------- 56 ALIGN JUMP_ALIGN57 55 Bios_ReadOldInt13hParametersFromDriveDL: 58 56 mov ah, GET_DRIVE_PARAMETERS … … 102 100 ; Nothing 103 101 ;-------------------------------------------------------------------- 104 ALIGN JUMP_ALIGN105 102 Bios_ReadOldInt13hCapacityFromDriveDL: 106 103 mov ah, GET_DISK_TYPE … … 123 120 ; ES 124 121 ;-------------------------------------------------------------------- 125 ALIGN JUMP_ALIGN126 122 Bios_ReadAtaInfoFromDriveDLtoBX: 127 123 mov bx, g_rgbAtaInfo … … 146 142 ; Nothing 147 143 ;-------------------------------------------------------------------- 148 ALIGN JUMP_ALIGN149 144 Bios_ReadEbiosVersionFromDriveDL: 150 145 mov ah, CHECK_EXTENSIONS_PRESENT … … 175 170 ; Nothing 176 171 ;-------------------------------------------------------------------- 177 ALIGN JUMP_ALIGN178 172 Bios_ReadEbiosInfoFromDriveDLtoDSSI: 179 173 mov si, g_edriveInfo -
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: -
trunk/BIOS_Drive_Information_Tool/Src/Print.asm
r376 r424 30 30 ; AX, BX, DI 31 31 ;-------------------------------------------------------------------- 32 ALIGN JUMP_ALIGN33 32 Print_SetCharacterOutputToSTDOUT: 34 33 mov bl, ATTRIBUTES_NOT_USED … … 50 49 ; AX, DX 51 50 ;-------------------------------------------------------------------- 52 ALIGN JUMP_ALIGN53 51 DosCharOut: 54 52 xchg dx, ax … … 68 66 ; AX, BP, SI, DI (CF remains unchanged) 69 67 ;-------------------------------------------------------------------- 70 ALIGN JUMP_ALIGN71 68 Print_ErrorMessageFromAHifError: 72 69 jnc SHORT .NoErrors 73 70 eMOVZX ax, ah 74 71 mov si, g_szBiosError 75 call Print_ BiosFunctionNumberFromAXusingFormatStringInSI72 call Print_FormatStringFromSIwithParameterInAX 76 73 stc ; Keep the CF set 77 74 ALIGN JUMP_ALIGN … … 82 79 ;--------------------------------------------------------------------- 83 80 ; Print_DriveNumberFromDLusingFormatStringInSI 84 ; Print_VersionStringFromAXusingFormatStringInSI85 ; Print_BiosFunctionNumberFromAXusingFormatStringInSI86 ; Print_SectorSizeFromAXusingFormatStringInSI87 81 ; Parameters: 88 82 ; DL: Drive Number 89 ; AX: Function number83 ; SI: Offset to format string 90 84 ; Returns: 91 85 ; Nothing … … 93 87 ; AX, BP, DI 94 88 ;-------------------------------------------------------------------- 95 ALIGN JUMP_ALIGN96 89 Print_DriveNumberFromDLusingFormatStringInSI: 97 90 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 ;-------------------------------------------------------------------- 108 Print_FormatStringFromSIwithParameterInAX: 109 mov bp, sp 110 push ax 111 jmp JumpToFormatNullTerminatedStringFromSI 112 113 Print_FormatStringFromSIwithParametersInAXDX: 114 mov bp, sp 115 push ax 116 push dx 117 jmp JumpToFormatNullTerminatedStringFromSI 118 119 Print_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 ;-------------------------------------------------------------------- 139 Print_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 104 161 105 162 … … 115 172 ; AX, BP, DI 116 173 ;-------------------------------------------------------------------- 117 ALIGN JUMP_ALIGN118 174 Print_CHSfromCXDXAX: 119 175 push si … … 139 195 ; AX, CX, BP, SI, DI 140 196 ;-------------------------------------------------------------------- 141 ALIGN JUMP_ALIGN142 197 Print_NameFromAtaInfoInBX: 143 198 cld … … 171 226 ; AX, BX, BP, DI 172 227 ;-------------------------------------------------------------------- 173 ALIGN JUMP_ALIGN174 228 Print_TotalSectorsFromBXDXAX: 175 229 ePUSH_T di, 0 … … 200 254 ; AX, BP, SI, DI 201 255 ;-------------------------------------------------------------------- 202 ALIGN JUMP_ALIGN203 256 Print_EbiosVersionFromBXandExtensionsFromCX: 204 257 mov bp, sp … … 219 272 ; AX, DI 220 273 ;-------------------------------------------------------------------- 221 ALIGN JUMP_ALIGN222 274 JumpToFormatNullTerminatedStringFromSI: 223 275 CALL_DISPLAY_LIBRARY FormatNullTerminatedStringFromCSSI … … 234 286 ; AX, DI 235 287 ;-------------------------------------------------------------------- 236 ALIGN JUMP_ALIGN237 288 Print_NullTerminatedStringFromSI: 238 289 CALL_DISPLAY_LIBRARY PrintNullTerminatedStringFromCSSI -
trunk/BIOS_Drive_Information_Tool/Src/Strings.asm
r376 r424 21 21 SECTION .data 22 22 23 g_szProgramName: db "BIOS Drive Information Tool v1.0. 1",CR,LF23 g_szProgramName: db "BIOS Drive Information Tool v1.0.2",CR,LF 24 24 db "(C) 2012 by XTIDE Universal BIOS Team",CR,LF 25 25 db "Released under GNU GPL v2",CR,LF … … 32 32 g_szAtaInfoHeader: db "ATA-information from AH=25h...",CR,LF,NULL 33 33 g_szFormatDrvName: db " Name: %s",CR,LF,NULL 34 g_szXlateAndCHS: db " Mode: %s, %s",NULL 35 g_szNormal: db "NORMAL",NULL 36 g_szLarge: db "LARGE ",NULL 37 g_szLBA: db "LBA ",NULL 34 38 g_szFormatCHS: db " Cylinders : %5-u, Heads: %3-u, Sectors: %2-u",CR,LF,NULL 35 39 g_szChsSectors: db " CHS sectors: ",NULL 36 40 g_szLBA28: db " LBA28 sectors: ",NULL 37 41 g_szLBA48: db " LBA48 sectors: ",NULL 38 42 g_szBlockMode: db " Block set : %u, Max block: %u sectors",CR,LF,NULL 43 g_szPIO: db " Max PIO mode : %u, Min cycle time without IORDY %u, with IORDY %d ns",CR,LF,NULL 39 44 g_szXTUB: db "XTIDE Universal BIOS %s generates following L-CHS...",CR,LF,NULL 40 45 g_szXTUBversion: db ROM_VERSION_STRING ; This one is NULL terminated
Note:
See TracChangeset
for help on using the changeset viewer.