Changeset 550 in xtideuniversalbios
- Timestamp:
- Apr 27, 2013, 5:30:50 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r542 r550 40 40 .bPchsHeads resb 1 ; (1...16) 41 41 .bPchsSectorsPerTrack resb 1 ; (1...63) 42 %ifdef MODULE_COMPATIBLE_TABLES OR MODULE_EBIOS 43 .wPchsCylinders resb 2 44 %endif 42 45 43 ; LBA and remaining P-CHS variables46 ; Total LBA sector count 44 47 %ifdef MODULE_EBIOS 45 .wPchsCylinders resb 246 48 .twLbaSectors resb 6 ; 48-bit sector count for LBA addressing 47 49 %endif … … 64 66 65 67 ; Bit definitions for DPT.bFlagsHigh 66 FLGH_DPT_ BLOCK_MODE_SUPPORTEDEQU (1<<1) ; Bit 1, Use block transfer commands (must be bit 1!)68 FLGH_DPT_USE_BLOCK_MODE_COMMANDS EQU (1<<1) ; Bit 1, Use block transfer commands (must be bit 1!) 67 69 %ifdef MODULE_SERIAL 68 70 FLGH_DPT_SERIAL_DEVICE EQU (1<<2) ; Bit 2, Serial Port Device -
trunk/XTIDE_Universal_BIOS/Inc/ModuleDependency.inc
r541 r550 50 50 %endif 51 51 52 %ifdef MODULE_COMPATIBLE_TABLES 53 %include "CompatibleDPT.inc" 54 %endif 55 52 56 %ifdef MODULE_EBIOS 53 57 %include "EBIOS.inc" ; Equates for EBIOS functions 54 %ifdef CREATE_COMPATIBLE_DPT55 %include "CompatibleDPT.inc"56 %endif57 58 %endif 58 59 -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH24h_HSetBlocks.asm
r545 r550 68 68 ; must know what the actual block size is. 69 69 cmp BYTE [di+DPT_ATA.bDevice], DEVICE_8BIT_XTCF_DMA 70 je SHORT ProcessXTCFsubcommandFromAL.AH1Eh_LoadInvalidCommandToAHandSetCF70 je SHORT .DisableBlockMode 71 71 .NoNeedToLimitBlockSize: 72 72 %endif ; MODULE_8BIT_IDE_ADVANCED … … 74 74 push bx 75 75 76 push ax 76 push ax ; Store block size for later use 77 77 xchg dx, ax ; DL = Block size (Sector Count Register) 78 78 mov al, COMMAND_SET_MULTIPLE_MODE 79 79 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_DRDY, FLG_STATUS_DRDY) 80 80 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 81 pop bx82 jnc SHORT .StoreBlockSize83 81 84 ; Drive disabled block mode since we tried unsupported block size. 85 ; We must adjust DPT accordingly. 86 mov bl, 1 ; Block size 1 will always work (=Block mode disabled) 87 .StoreBlockSize: ; Store new block size to DPT and return 82 ; Disable block mode if failure or if called with block size of 1 sector. 83 ; Some drives allow block mode commands for 1 sector blocks and some do not. 84 pop bx ; Pop block size to BL 85 jc SHORT .DisableBlockMode 86 mov bh, bl ; BL and BH both have block size we tried to set 87 dec bh 88 jz SHORT .DisableBlockMode 89 90 ; Enable block mode and store block size 91 or BYTE [di+DPT.bFlagsHigh], FLGH_DPT_USE_BLOCK_MODE_COMMANDS 92 jmp SHORT .StoreBlockSizeFromBLandReturn 93 94 .DisableBlockMode: 95 and BYTE [di+DPT.bFlagsHigh], ~FLGH_DPT_USE_BLOCK_MODE_COMMANDS 96 mov bl, 1 97 stc 98 .StoreBlockSizeFromBLandReturn: 88 99 mov [di+DPT_ATA.bBlockSize], bl 89 90 100 pop bx 91 101 ret -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r545 r550 163 163 ; Initialize block mode transfers 164 164 pop ax ; Restore .wFlags saved in SetWriteCache 165 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED 166 jz SHORT .BlockModeNotSupportedOrDisabled 167 test al, FLG_DRVPARAMS_BLOCKMODE 168 jz SHORT .BlockModeNotSupportedOrDisabled 165 test al, FLG_DRVPARAMS_BLOCKMODE ; Tested here so block mode can be enabled with AH=24h 166 jz SHORT .BlockModeDisabled 169 167 170 168 ; Try block sizes until we find largest possible supported by drive … … 177 175 jnc SHORT .TryNextBlockSize 178 176 STORE_ERROR_FLAG_TO_DPT FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE 179 .BlockMode NotSupportedOrDisabled:177 .BlockModeDisabled: 180 178 .SupportedBlockSizeFound: 181 179 … … 286 284 %endif ; MODULE_8BIT_IDE_ADVANCED 287 285 286 288 287 %ifdef MODULE_8BIT_IDE 289 288 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH41h_CheckIfExtensionsPresent.asm
r541 r550 44 44 mov WORD [bp+IDEPACK.intpack+INTPACK.bx], 0AA55h 45 45 46 %ifdef CREATE_COMPATIBLE_DPT46 %ifdef MODULE_COMPATIBLE_TABLES 47 47 call AH41h_GetSupportBitsToCX 48 48 mov [bp+IDEPACK.intpack+INTPACK.cx], cx 49 49 %else 50 50 mov WORD [bp+IDEPACK.intpack+INTPACK.cx], ENHANCED_DRIVE_ACCESS_SUPPORT 51 %endif 51 %endif ; MODULE_COMPATIBLE_TABLES 52 52 53 53 and BYTE [bp+IDEPACK.intpack+INTPACK.flags], ~FLG_FLAGS_CF ; Return with CF cleared … … 57 57 58 58 59 %ifdef CREATE_COMPATIBLE_DPT59 %ifdef MODULE_COMPATIBLE_TABLES 60 60 ;-------------------------------------------------------------------- 61 61 ; AH41h_GetSupportBitsToCX … … 87 87 ret 88 88 89 %endif ; CREATE_COMPATIBLE_DPT89 %endif ; MODULE_COMPATIBLE_TABLES -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/EBIOS/AH48h_GetExtendedDriveParameters.asm
r545 r550 81 81 82 82 ; Create DPTE (hardware information for device drivers) 83 %ifdef CREATE_COMPATIBLE_DPT83 %ifdef MODULE_COMPATIBLE_TABLES 84 84 call AH41h_GetSupportBitsToCX 85 85 test cl, ENHANCED_DISK_DRIVE_SUPPORT … … 87 87 call CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI 88 88 .DoNotCreateDPTE: 89 %endif 89 %endif ; MODULE_COMPATIBLE_TABLES 90 90 91 91 ; Point DS:DI to Extended Drive Information Table to fill … … 107 107 ; Store DPTE for standard controllers only, 108 108 ; FFFF:FFFF for non standard controllers 109 %ifdef CREATE_COMPATIBLE_DPT109 %ifdef MODULE_COMPATIBLE_TABLES 110 110 mov [di+EDRIVE_INFO.fpDPTE], bx 111 111 mov [di+EDRIVE_INFO.fpDPTE+2], es … … 117 117 mov [di+EDRIVE_INFO.fpDPTE], bx 118 118 mov [di+EDRIVE_INFO.fpDPTE+2], bx 119 %endif 119 %endif ; MODULE_COMPATIBLE_TABLES 120 120 121 121 ; Fill Extended Drive Information Table in DS:DI from DPT in ES:SI -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/Tools/Prepare.asm
r547 r550 81 81 ; Block mode or single sector 82 82 mov bl, [di+DPT.bFlagsHigh] 83 and bx, BYTE FLGH_DPT_ BLOCK_MODE_SUPPORTED; Bit 183 and bx, BYTE FLGH_DPT_USE_BLOCK_MODE_COMMANDS ; Bit 1 84 84 ret 85 85 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r542 r550 151 151 .NoUserDefinedLBA: 152 152 153 ; * Disable Block Mode transfers *154 test dl, FLG_DRVPARAMS_BLOCKMODE155 jnz SHORT .NoNeedToDisableBlockMode156 mov BYTE [si+ATA1.bBlckSize], 1 ; sectors157 .NoNeedToDisableBlockMode:158 159 153 ; * Load P-CHS to L-CHS translate mode to DX * 160 154 and dx, BYTE MASK_DRVPARAMS_TRANSLATEMODE -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Initialize.asm
r542 r550 83 83 84 84 85 %ifdef CREATE_COMPATIBLE_DPT85 %ifdef MODULE_COMPATIBLE_TABLES 86 86 ;-------------------------------------------------------------------- 87 87 ; .StoreDptPointersToIntVectors … … 118 118 .CompatibleDPTsCreated: 119 119 ; Fall to .ResetDetectedDrives 120 %endif ; CREATE_COMPATIBLE_DPT120 %endif ; MODULE_COMPATIBLE_TABLES 121 121 122 122 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r545 r550 199 199 %include "DetectDrives.asm" ; For detecting IDE drives 200 200 %include "DetectPrint.asm" ; For printing drive detection strings 201 %ifdef MODULE_COMPATIBLE_TABLES 202 %include "CompatibleDPT.asm" 203 %endif 201 204 202 205 ; Hotkey Bar … … 281 284 %include "AH48h_GetExtendedDriveParameters.asm" 282 285 %include "AH41h_CheckIfExtensionsPresent.asm" 283 %ifdef CREATE_COMPATIBLE_DPT 284 %include "CompatibleDPT.asm" 285 %endif 286 %endif 286 %endif -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
r526 r550 81 81 .PushBlockMode: 82 82 mov ax, 1 83 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_ BLOCK_MODE_SUPPORTED83 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_USE_BLOCK_MODE_COMMANDS 84 84 jz SHORT .PushBlockSizeFromAX 85 85 mov al, [di+DPT_ATA.bBlockSize] -
trunk/XTIDE_Universal_BIOS/Src/Menus/DriveXlate.asm
r547 r550 96 96 test dl, ah ; Hard disk? 97 97 jnz SHORT .SwapDrive ; If so, jump to swap 98 98 99 mov al, [RAMVARS.xlateVars+XLATEVARS.bFDSwap] 99 100 cbw … … 106 107 jne SHORT .RestoreAXandReturn 107 108 mov al, ah 109 108 110 ALIGN JUMP_ALIGN 109 111 .SwapToXXhInAL: 110 112 mov dl, al 113 114 %ifdef MODULE_COMPATIBLE_TABLES 115 cmp al, 81h 116 jne SHORT .RestoreAXandReturn 117 118 ; Since swapping drive 80h <=> 81h, we need to swap 119 ; DPT pointers in interrupt vectors 41h and 46h. 120 push ds 121 LOAD_BDA_SEGMENT_TO ds, ax 122 mov ax, [HD0_DPT_POINTER_41h*4] 123 xchg [HD1_DPT_POINTER_46h*4], ax 124 mov [HD0_DPT_POINTER_41h*4], ax 125 mov ax, [HD0_DPT_POINTER_41h*4+2] 126 xchg [HD1_DPT_POINTER_46h*4+2], ax 127 mov [HD0_DPT_POINTER_41h*4+2], ax 128 pop ds 129 %endif ; MODULE_COMPATIBLE_TABLES 130 111 131 ALIGN JUMP_ALIGN 112 132 .RestoreAXandReturn: -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CompatibleDPT.asm
r543 r550 63 63 ; Nothing 64 64 ;-------------------------------------------------------------------- 65 %ifdef MODULE_EBIOS 65 66 GetTemporaryBufferForDPTEtoESDI: 66 67 call GetBufferForDrive80hToESDI 67 68 add di, BYTE TRANSLATED_DPT_size * 2 68 69 ret 70 %endif 69 71 70 72 GetBufferForDrive80hToESDI: … … 73 75 mov di, [cs:ROMVARS.bStealSize] ; No harm to read WORD 74 76 eSHL_IM di, 10 ; DI = RAMVARS size in bytes 77 %ifdef MODULE_EBIOS 75 78 sub di, BYTE (TRANSLATED_DPT_size * 2) + DPTE_size 79 %else 80 sub di, BYTE TRANSLATED_DPT_size * 2 81 %endif 76 82 ret 77 83 … … 174 180 175 181 182 %ifdef MODULE_EBIOS 176 183 ;-------------------------------------------------------------------- 177 184 ; CompatibleDPT_CreateDeviceParameterTableExtensionToESBXfromDPTinDSSI … … 248 255 lea bx, [di-DPTE_size] 249 256 ret 257 %endif ; MODULE_EBIOS 250 258 251 259 -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/CreateDPT.asm
r549 r550 128 128 or [di+DPT.bFlagsLow], cl ; Shift count and addressing mode 129 129 mov [di+DPT.wPchsHeadsAndSectors], bx 130 131 %ifdef MODULE_EBIOS 130 %ifdef MODULE_COMPATIBLE_TABLES OR MODULE_EBIOS 132 131 ; Store P-Cylinders here for Compatible DPTs when FLGL_DPT_LBA is not set 133 132 ; or when drive has over 15,482,880 sectors 134 133 mov [di+DPT.wPchsCylinders], ax 134 %endif 135 136 %ifdef MODULE_EBIOS 135 137 test cl, FLGL_DPT_LBA 136 138 jz SHORT .NoLbaSoNoEBIOS … … 188 190 .NoLbaSoNoEBIOS: 189 191 %endif ; MODULE_EBIOS 190 ; Fall to .StoreBlockMode191 192 ;--------------------------------------------------------------------193 ; .StoreBlockMode194 ; Parameters:195 ; DS:DI: Ptr to Disk Parameter Table196 ; ES:SI: Ptr to 512-byte ATA information read from the drive197 ; CS:BP: Ptr to IDEVARS for the controller198 ; Returns:199 ; Nothing200 ; Corrupts registers:201 ; Nothing202 ;--------------------------------------------------------------------203 .StoreBlockMode:204 cmp BYTE [es:si+ATA1.bBlckSize], 1 ; Max block size in sectors205 jbe SHORT .BlockModeTransfersNotSupported206 or BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED207 .BlockModeTransfersNotSupported:208 192 ; Fall to .StoreDeviceSpecificParameters 209 193 -
trunk/XTIDE_Universal_BIOS/makefile
r545 r550 19 19 # MODULE_8BIT_IDE_ADVANCED Support for memory mapped and DMA based cards like JRIDE and XTCF # 20 20 # MODULE_ADVANCED_ATA Native support for some VLB IDE controllers # 21 # MODULE_COMPATIBLE_TABLES Support for ill behaving software that tries to access DPT directly # 21 22 # MODULE_BOOT_MENU Boot Menu for selection of drive to boot from # 22 23 # MODULE_EBIOS Enhanced functions for accessing drives over 8.4 GB # … … 32 33 # RELOCATE_INT13H_STACK ** Relocates INT 13h stack to beginning of stolen conventional memory # 33 34 # RESERVE_DIAGNOSTIC_CYLINDER Reserve one L-CHS cylinder for compatibility with old BIOSes # 34 # CREATE_COMPATIBLE_DPT Presents compatible DPTs for ill behaving applications #35 35 # DANGEROUS_DETECTION Scans Advanced Controllers from dangerous ports like mirrored PIC # 36 36 # USE_186 Use instructions supported by 80188/80186 and V20/V30 and later # … … 100 100 # Assembler preprocessor defines. # 101 101 ################################################################# 102 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_ SERIAL MODULE_SERIAL_FLOPPY MODULE_EBIOSMODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER103 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED CREATE_COMPATIBLE_DPT102 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_8BIT_IDE MODULE_EBIOS MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_FEATURE_SETS RESERVE_DIAGNOSTIC_CYLINDER 103 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_8BIT_IDE_ADVANCED MODULE_COMPATIBLE_TABLES 104 104 105 105 DEFINES_XT = $(DEFINES_COMMON) ELIMINATE_CGA_SNOW MODULE_8BIT_IDE_ADVANCED 106 106 DEFINES_XTPLUS = $(DEFINES_COMMON) $(DEFINES_XT) USE_186 107 DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ADVANCED_ATA CREATE_COMPATIBLE_DPT107 DEFINES_AT = $(DEFINES_COMMON) USE_AT USE_286 MODULE_IRQ MODULE_ADVANCED_ATA MODULE_COMPATIBLE_TABLES 108 108 109 109 DEFINES_XT_LARGE = $(DEFINES_XT) $(DEFINES_COMMON_LARGE) … … 112 112 113 113 DEFINES_XT_TINY = MODULE_STRINGS_COMPRESSED MODULE_8BIT_IDE 114 DEFINES_386_8K = $(DEFINES_AT) USE_386 CREATE_COMPATIBLE_DPT115 116 DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_FEATURE_SETS 114 DEFINES_386_8K = $(DEFINES_AT) USE_386 115 116 DEFINES_ALL_FEATURES = MODULE_8BIT_IDE MODULE_8BIT_IDE_ADVANCED MODULE_ADVANCED_ATA MODULE_EBIOS MODULE_BOOT_MENU MODULE_HOTKEYS MODULE_IRQ MODULE_SERIAL MODULE_SERIAL_FLOPPY MODULE_STRINGS_COMPRESSED MODULE_FEATURE_SETS MODULE_COMPATIBLE_TABLES 117 117 DEFINES_ALL_FEATURES += ELIMINATE_CGA_SNOW RELOCATE_INT13H_STACK RESERVE_DIAGNOSTIC_CYLINDER 118 118
Note:
See TracChangeset
for help on using the changeset viewer.