- Timestamp:
- May 27, 2021, 6:25:17 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BIOS_Drive_Information_Tool/Src/AtaInfo.asm
r612 r613 36 36 37 37 ; Read ATA Information from the drive 38 call Bios_ReadAtaInfoFromDriveDLtoBX 38 call Bios_ReadAtaInfoFromDriveDLtoBX ; Unaltered ATA information 39 39 call Print_ErrorMessageFromAHifError ; AH=25h is not available on many BIOSes 40 40 jc SHORT .SkipAtaInfoSinceError … … 44 44 45 45 ; Print Drive P-CHS parameters 46 call DisplayPCHSusingAtaInfoFromDSBX 46 call DisplayPCHSusingAtaInfoFromDSBX ; Unaltered 47 48 ; Fix and display values (ATA Info will stay fixed) 49 xor ah, ah ; Successfully read ATA ID 50 push ds 51 pop es 52 mov si, bx 53 call AtaID_FixIllegalValuesFromESSI ; Modify ATA information if necessary 54 mov si, g_szWillBeModified 55 call Print_NullTerminatedStringFromSI 56 call DisplayPCHSusingAtaInfoFromDSBX ; Display fixed values 47 57 48 58 ; Print Drive CHS sector count -
trunk/BIOS_Drive_Information_Tool/Src/Bios.asm
r589 r613 118 118 ; Set = BIOS error code stored in AH 119 119 ; Corrupts registers: 120 ; ES120 ; CX, ES 121 121 ;-------------------------------------------------------------------- 122 122 Bios_ReadAtaInfoFromDriveDLtoBX: … … 124 124 push ds 125 125 pop es 126 mov cx, XUB_INT13h_SIGNATURE ; Signature to read unaltered ATA ID 126 127 mov ah, GET_DRIVE_INFORMATION 127 128 int BIOS_DISK_INTERRUPT_13h -
trunk/BIOS_Drive_Information_Tool/Src/Main.asm
r590 r613 25 25 %include "Version.inc" ; From XTIDE Universal BIOS 26 26 %include "ATA_ID.inc" ; From XTIDE Universal BIOS 27 %include "Ramvars.inc" ; From XTIDE Universal BIOS (needed by Int13h.inc) 27 28 %include "Int13h.inc" ; From XTIDE Universal BIOS 28 29 %include "EBIOS.inc" ; From XTIDE Universal BIOS … … 42 43 ; Include library and other sources 43 44 %include "AssemblyLibrary.asm" 45 %include "AtaID.asm" ; From XTIDE Universal BIOS 44 46 %include "AtaGeometry.asm" ; From XTIDE Universal BIOS 45 47 %include "Strings.asm" -
trunk/BIOS_Drive_Information_Tool/Src/Strings.asm
r612 r613 37 37 g_szLBA: db "LBA ",NULL 38 38 g_szFormatCHS: db " Cylinders : %5u, Heads: %3u, Sectors: %2u",NULL 39 g_szWillBeModified: db "Will be modified to:",CR,LF,NULL 39 40 g_szChsSectors: db " CHS sectors: ",NULL 40 41 g_szLBA28: db " LBA28 sectors: ",NULL -
trunk/BIOS_Drive_Information_Tool/makefile
r592 r613 45 45 LIBS += ../Assembly_Library/Src/Util/ 46 46 LIBS += ../XTIDE_Universal_BIOS/Inc/ 47 LIBS += ../XTIDE_Universal_BIOS/Src/Initialization/ 47 48 LIBS += ../XTIDE_Universal_BIOS/Src/VariablesAndDPTs/ 48 49 HEADERS += $(LIBS) -
trunk/XTIDE_Universal_BIOS/Inc/Int13h.inc
r539 r613 20 20 %ifndef INT13H_INC 21 21 %define INT13H_INC 22 23 ; Signature for XTIDE Universal BIOS specific functions 24 XUB_INT13h_SIGNATURE EQU RAMVARS_RAM_SIGNATURE 22 25 23 26 ; Hard Disk function (INT 13h) return status codes in AH -
trunk/XTIDE_Universal_BIOS/Src/Device/Device.asm
r568 r613 88 88 ; Parameters: 89 89 ; BH: Drive Select byte for Drive and Head Select Register 90 ; CX: XUB_INT13h_SIGNATURE to ignore illegal ATA-ID values, otherwise 91 ; correct them (only used if NOT build with NO_ATAID_CORRECTION) 90 92 ; DX: Autodetected port (for devices that support autodetection) 91 93 ; DS: Segment to RAMVARS … … 98 100 ; AL, BX, CX, DX, SI, DI, ES 99 101 ;-------------------------------------------------------------------- 102 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH: 103 %ifndef NO_ATAID_CORRECTION 104 cmp cx, XUB_INT13h_SIGNATURE 105 je SHORT .DoNotFixAtaInformation 106 push es 107 push si 108 ePUSH_T cx, AtaID_PopESSIandFixIllegalValuesFromESSI ; Here we modify ATA information if necessary 109 .DoNotFixAtaInformation: 110 %endif 111 100 112 %ifdef MODULE_SERIAL ; IDE + Serial 101 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH:102 113 cmp BYTE [cs:bp+IDEVARS.bDevice], DEVICE_SERIAL_PORT 103 114 %ifdef USE_386 … … 112 123 113 124 %else ; IDE 114 Device_IdentifyToBufferInESSIwithDriveSelectByteInBH EQUIdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH125 jmp IdeCommand_IdentifyDeviceToBufferInESSIwithDriveSelectByteInBH 115 126 %endif 116 127 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH25h_HDrvID.asm
r526 r613 26 26 ; AH25h_HandlerForGetDriveInformation 27 27 ; Parameters: 28 ; ES:Same as in INTPACK28 ; CX, ES: Same as in INTPACK 29 29 ; DL: Translated Drive number 30 30 ; DS:DI: Ptr to DPT (in RAMVARS segment) 31 31 ; SS:BP: Ptr to IDEPACK 32 32 ; Parameters on INTPACK: 33 ; CX: XUB_INT13h_SIGNATURE to ignore illegal ATA-ID values, otherwise 34 ; correct them (only used if NOT build with NO_ATAID_CORRECTION) 33 35 ; ES:BX: Ptr to buffer to receive 512-byte drive information 34 36 ; Returns with INTPACK: -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r593 r613 22 22 SECTION .text 23 23 24 ;-------------------------------------------------------------------- 25 ; Adjust ATA information for compatibility, debug, etc purposes. 26 ; We can also completely ignore the drive if necessary. 27 ; 28 ; AtaID_FixIllegalValuesFromESSI 29 ; Parameters: 30 ; AH: INT 13h Error Code from reading ATA information 31 ; CF: Cleared if successfully read ATA information, 32 ; Set if failed to read ATA information 33 ; ES:SI: Ptr to 512-byte ATA information read from the drive 34 ; Returns: 35 ; ES:SI: Ata information with possible corrections made 36 ; AH: INT 13h Error Code from reading ATA information 37 ; CF cleared if drive now accepted 38 ; Corrupts registers: 39 ; AL, BX, CX, DX, DI 40 ;-------------------------------------------------------------------- 41 %ifndef NO_ATAID_CORRECTION 42 %ifndef EXCLUDE_FROM_BIOSDRVS 43 AtaID_PopESSIandFixIllegalValuesFromESSI: 44 pop si 45 pop es 46 %endif 47 AtaID_FixIllegalValuesFromESSI: 48 jc SHORT .Return ; Nothing to fix since failed to read ATA Info 49 50 ; Only correct cylinders since there are no reports that head or sectors could be wrong 51 MIN_U WORD [es:si+ATA1.wCylCnt], MAX_VALID_PCHS_CYLINDERS ; Limit to max allowed value 52 53 ; Note! There are ATA ID words 54-58 that also need to be modified! However, 54 ; the drive itself should modify them when we do Initialize Device Parameters command at AH=9h. 55 ; Verification from real drive needed before we fix them manually 56 57 clc ; Return success 58 .Return: 59 ret 60 %endif ; NO_ATAID_CORRECTION 61 62 63 %ifndef EXCLUDE_FROM_BIOSDRVS 24 64 ;-------------------------------------------------------------------- 25 65 ; AtaID_VerifyFromESSI … … 233 273 234 274 %endif ; MODULE_ADVANCED_ATA 275 276 %endif ; EXCLUDE_FROM_BIOSDRVS -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/AtaGeometry.asm
r612 r613 239 239 mov bl, [es:si+ATA1.wHeadCnt] ; Heads (1...16) 240 240 mov bh, [es:si+ATA1.wSPT] ; Sectors per Track (1...63) 241 %ifndef EXCLUDE_FROM_BIOSDRVS ; We want the true value in BIOSDRVS242 ; Some CF cards (for example Sandisk Ultra 16/32 GB) violates243 ; the ATA specification by reporting more than 16383 cylinders.244 MIN_U ax, MAX_PCHS_CYLINDERS ; Limit the count to avoid problems.245 %endif246 241 ret 247 242 -
trunk/XTIDE_Universal_BIOS/makefile
r606 r613 37 37 # RELOCATE_INT13H_STACK ** Relocates INT 13h stack to beginning of stolen conventional memory # 38 38 # NO_ATAID_VALIDATION *** Excludes code that tries to ensure proper communication with drives # 39 # NO_ATAID_CORRECTION Excludes code that corrects illegal CHS values from some CF cards # 39 40 # USE_186 Use instructions supported by 80188/80186 and V20/V30 and later # 40 41 # USE_286 Use instructions supported by 286 and later (defines USE_UNDOC_INTEL)# … … 117 118 DEFINES_AT_LARGE = $(DEFINES_AT) $(DEFINES_COMMON_LARGE) 118 119 119 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION CLD_NEEDED120 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE NO_ATAID_VALIDATION NO_ATAID_CORRECTION CLD_NEEDED 120 121 DEFINES_386 = $(DEFINES_AT) USE_386 MODULE_ADVANCED_ATA MODULE_WIN9X_CMOS_HACK 121 122 DEFINES_386_LARGE = $(DEFINES_386) $(DEFINES_COMMON_LARGE)
Note:
See TracChangeset
for help on using the changeset viewer.