Changeset 399 in xtideuniversalbios
- Timestamp:
- Apr 19, 2012, 10:39:44 PM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r397 r399 4 4 5 5 ; 6 ; XTIDE Universal BIOS and Associated Tools 6 ; XTIDE Universal BIOS and Associated Tools 7 7 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 8 8 ; … … 11 11 ; the Free Software Foundation; either version 2 of the License, or 12 12 ; (at your option) any later version. 13 ; 13 ; 14 14 ; This program is distributed in the hope that it will be useful, 15 15 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ; GNU General Public License for more details. 17 ; GNU General Public License for more details. 18 18 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 19 ; … … 26 26 ; General Disk Parameter Table related 27 27 .wFlags: 28 .bFlagsLow 29 .bFlagsHigh 30 .bIdevarsOffset 28 .bFlagsLow resb 1 29 .bFlagsHigh resb 1 30 .bIdevarsOffset resb 1 ; Offset to IDEVARS for this drive 31 31 32 32 ; IDE Drive related 33 33 ; .bLbaHeads and .twLbaSectors are used for LBA addressing only. 34 .bLbaHeads: 35 .twLbaSectors 34 .bLbaHeads: resb 1 ; Number of LBA assisted heads (1...255) 35 .twLbaSectors resb 2 ; 48-bit sector count for LBA addressing 36 36 37 37 ; .wPchsCylinders and .bPchsSectors are used for CHS addressing only. 38 .wPchsCylinders 38 .wPchsCylinders resb 2 ; Number of P-CHS Cylinders (1...16383) 39 39 .wPchsHeadsAndSectors: 40 .bPchsHeads 41 .bPchsSectors 40 .bPchsHeads resb 1 ; Number of P-CHS heads (1...16) 41 .bPchsSectors resb 1 ; Number of P-CHS Sectors per Track (1...63) 42 42 endstruc 43 43 44 ; Bit definitions for DPT.bFlagsLow45 MASKL_DPT_CHS_SHIFT_COUNT EQU (7<<0) ; Bits 0...3, P-CHS to L-CHS bit shift count (0...4)46 FLGL_DPT_SLAVEEQU FLG_DRVNHEAD_DRV ; (1<<4), Drive is slave drive47 MASKL_DPT_ADDRESSING_MODEEQU (3<<5) ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA)48 FLGL_DPT_ENABLE_IRQEQU (1<<7)44 ; Bit definitions for DPT.bFlagsLow 45 MASKL_DPT_CHS_SHIFT_COUNT EQU (7<<0) ; Bits 0...2, P-CHS to L-CHS bit shift count (0...4) 46 FLGL_DPT_SLAVE EQU FLG_DRVNHEAD_DRV ; (1<<4), Drive is slave drive 47 MASKL_DPT_ADDRESSING_MODE EQU (3<<5) ; Bits 5..6, Addressing Mode (bit 6 == FLG_DRVNHEAD_LBA) 48 FLGL_DPT_ENABLE_IRQ EQU (1<<7) 49 49 50 ; Bit definitions for DPT.bFlagsHigh 51 FLGH_DPT_REVERSED_A0_AND_A3 EQU (1<<0) ; XTIDE mod, Address lines 0 and 3 reversed 52 FLGH_DPT_BLOCK_MODE_SUPPORTED EQU (1<<1) ; Use block transfer commands (must be bit 1!) 53 %ifdef MODULE_SERIAL 54 FLGH_DPT_SERIAL_DEVICE EQU (1<<2) ; Serial Port Device 55 %endif 56 FLGH_DPT_INTERRUPT_IN_SERVICE EQU (1<<3) ; Set when waiting for IRQ 50 ; Bit definitions for DPT.bFlagsHigh 51 FLGH_DPT_REVERSED_A0_AND_A3 EQU (1<<0) ; XTIDE mod, Address lines 0 and 3 reversed 52 FLGH_DPT_BLOCK_MODE_SUPPORTED EQU (1<<1) ; Use block transfer commands (must be bit 1!) 53 FLGH_DPT_SERIAL_DEVICE EQU (1<<2) ; Serial Port Device 54 FLGH_DPT_INTERRUPT_IN_SERVICE EQU (1<<3) ; Set when waiting for IRQ 55 FLGH_DPT_POWER_MANAGEMENT_SUPPORTED EQU (1<<5) 57 56 58 ; IDE device only 59 %ifdef MODULE_ADVANCED_ATA 60 FLGH_DPT_IORDY EQU (1<<7) ; Controller and Drive supports IORDY 61 %endif 57 ; IDE device only 58 FLGH_DPT_IORDY EQU (1<<7) ; Controller and Drive supports IORDY 62 59 63 ; Serial device only64 FLGH_DPT_SERIAL_FLOPPY EQU (1<<4)65 FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK EQU 0e0h66 FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION EQU 560 ; Serial device only 61 FLGH_DPT_SERIAL_FLOPPY EQU (1<<4) 62 FLGH_DPT_SERIAL_FLOPPY_TYPE_MASK EQU 0e0h 63 FLGH_DPT_SERIAL_FLOPPY_TYPE_FIELD_POSITION EQU 5 67 64 68 ; Addressing modes for DPT.wFlags69 ADDRESSING_MODE_FIELD_POSITIONEQU 570 ADDRESSING_MODE_LCHSEQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes)71 ADDRESSING_MODE_PCHSEQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes)72 ADDRESSING_MODE_LBA28EQU 2 ; 28-bit LBA Addressing Mode73 ADDRESSING_MODE_LBA48EQU 3 ; 48-bit LBA Addressing Mode65 ; Addressing modes for DPT.wFlags 66 ADDRESSING_MODE_FIELD_POSITION EQU 5 67 ADDRESSING_MODE_LCHS EQU 0 ; L-CHS Addressing Mode (NORMAL in many other BIOSes) 68 ADDRESSING_MODE_PCHS EQU 1 ; P-CHS Addressing Mode (LARGE in many other BIOSes) 69 ADDRESSING_MODE_LBA28 EQU 2 ; 28-bit LBA Addressing Mode 70 ADDRESSING_MODE_LBA48 EQU 3 ; 48-bit LBA Addressing Mode 74 71 75 72 76 73 ; DPT for ATA devices 77 74 struc DPT_ATA ; 10 + 2 bytes = 12 bytes 78 .dpt 79 .bBlockSize 80 .bInitError 75 .dpt resb DPT_size 76 .bBlockSize resb 1 ; Current block size in sectors (do not set to zero!) 77 .bInitError resb 1 81 78 endstruc 82 79 83 ; Flags for DPT_ATA.bInitError84 FLG_INITERROR_FAILED_TO_SELECT_DRIVE EQU (1<<0)85 FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS EQU (1<<1)86 FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE EQU (1<<2)87 FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE EQU (1<<3)88 FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE EQU (1<<4)89 FLG_INITERROR_FAILED_TO_SET_PIO_MODE EQU (1<<5)90 80 81 ; Flags for DPT_ATA.bInitError 82 FLG_INITERROR_FAILED_TO_SELECT_DRIVE EQU (1<<0) 83 FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS EQU (1<<1) 84 FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE EQU (1<<2) 85 FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE EQU (1<<3) 86 FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE EQU (1<<4) 87 FLG_INITERROR_FAILED_TO_SET_PIO_MODE EQU (1<<5) 88 FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER EQU (1<<6) 91 89 92 90 ; Additional variables needed to initialize and reset Advanced IDE Controllers. … … 107 105 %ifdef MODULE_SERIAL 108 106 struc DPT_SERIAL 109 .dpt 107 .dpt resb DPT_size 110 108 .wSerialPortAndBaud: 111 .bSerialPort 112 .bSerialBaud 109 .bSerialPort resb 1 ; Serial connection I/O port address, divided by 4 110 .bSerialBaud resb 1 ; Serial connection baud rate divisor 113 111 endstruc 114 112 %endif … … 117 115 ; This is the common size for all DPTs. All DPTs must be equal size. 118 116 %ifdef MODULE_ADVANCED_ATA 119 LARGEST_DPT_SIZEEQU DPT_ADVANCED_ATA_size117 LARGEST_DPT_SIZE EQU DPT_ADVANCED_ATA_size 120 118 %else 121 LARGEST_DPT_SIZEEQU DPT_ATA_size119 LARGEST_DPT_SIZE EQU DPT_ATA_size 122 120 %endif 123 121 124 122 125 ; Number of Sectors per Track is fixed to 63 for LBA assist calculation.126 ; 1024 cylinders, 256 heads, 63 sectors = 8.4 GB limit (but DOS does not support more than 255 heads)127 MAX_LCHS_CYLINDERSEQU 1024128 LBA_ASSIST_SPTEQU 63123 ; Number of Sectors per Track is fixed to 63 for LBA assist calculation. 124 ; 1024 cylinders, 256 heads, 63 sectors = 8.4 GB limit (but DOS does not support more than 255 heads) 125 MAX_LCHS_CYLINDERS EQU 1024 126 LBA_ASSIST_SPT EQU 63 129 127 130 128 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
r376 r399 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 ; GNU General Public License for more details. 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 19 19 20 20 ; Section containing code … … 34 34 IdeDPT_Finalize: 35 35 36 %ifdef MODULE_FEATURE_SETS 37 ;-------------------------------------------------------------------- 38 ; .DetectPowerManagementSupport 39 ; Parameters: 40 ; DS:DI: Ptr to Disk Parameter Table 41 ; ES:SI: Ptr to 512-byte ATA information read from the drive 42 ; Returns: 43 ; Nothing 44 ; Corrupts registers: 45 ; Nothing 46 ;-------------------------------------------------------------------- 47 .DetectPowerManagementSupport: 48 test BYTE [es:si+ATA6.wSetSup82], A6_wSetSup82_POWERMAN 49 jz .NoPowerManagementSupport 50 or BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED 51 .NoPowerManagementSupport: 52 %endif ; MODULE_FEATURE_SETS 53 36 54 ;-------------------------------------------------------------------- 37 55 ; .StoreBlockMode 38 56 ; Parameters: 39 57 ; DS:DI: Ptr to Disk Parameter Table 40 ; ES:SI: Ptr to 512-byte ATA information read from the drive41 ; CS:BP: Ptr to IDEVARS for the controller42 58 ; Returns: 43 59 ; Nothing 44 60 ; Corrupts registers: 45 ; AX61 ; Nothing 46 62 ;-------------------------------------------------------------------- 47 63 .StoreBlockMode: … … 78 94 mov [di+DPT_ADVANCED_ATA.wMinPioCycleTime], cx 79 95 mov [di+DPT_ADVANCED_ATA.bPioMode], al 80 or [di+DPT.bFlagsHigh], ah 96 or [di+DPT.bFlagsHigh], ah 81 97 82 98 ;-------------------------------------------------------------------- -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r376 r399 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing code … … 44 44 45 45 ;-------------------------------------------------------------------- 46 ; Initialize ddrive to be ready for use.46 ; Initialize drive to be ready for use. 47 47 ; 48 48 ; AH9h_InitializeDriveForUse … … 57 57 ;-------------------------------------------------------------------- 58 58 AH9h_InitializeDriveForUse: 59 xor ax, ax 60 61 ; Clear Initialization Error flags from DPT 62 mov [di+DPT_ATA.bInitError], al 63 64 %ifdef MODULE_SERIAL 65 ; No need to do this for serial devices 66 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE ; Clears CF 67 jz SHORT .ContinueInitialization 68 ret ; With AH and CF cleared 69 .ContinueInitialization: 70 %endif 71 59 72 push es 60 73 push si 61 74 62 %ifdef MODULE_SERIAL 63 ; no need to do this for serial devices 64 xor ah, ah 65 test byte [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE ; Clears CF 66 jnz .ReturnWithErrorCodeInAH 67 68 %else 69 ; Clear Initialization Error flags from DPT 70 mov BYTE [di+DPT_ATA.bInitError], 0 71 %endif 72 75 ;;; SelectDrive 73 76 ; Try to select drive and wait until ready 74 77 call AccessDPT_GetDriveSelectByteToAL 75 78 mov [bp+IDEPACK.bDrvAndHead], al 76 79 call Device_SelectDrive 80 77 81 mov al, FLG_INITERROR_FAILED_TO_SELECT_DRIVE 78 call SetErrorFlagFromALwithErrorCodeInAH 79 jc SHORT .ReturnWithErrorCodeInAH 80 82 call .SetErrorFlagFromALwithErrorCodeInAH 83 jc .ReturnWithErrorCodeInAH 84 85 ;;; InitializeDeviceParameters 81 86 ; Initialize CHS parameters if LBA is not used 82 call InitializeDeviceParameters 83 mov al, FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS 84 call SetErrorFlagFromALwithErrorCodeInAH 85 86 ; Enable or Disable Write Cache 87 call SetWriteCache 88 mov al, FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE 89 call SetErrorFlagFromALwithErrorCodeInAH 90 91 ; Recalibrate drive by seeking to cylinder 0 92 .RecalibrateDrive: 93 call AH11h_RecalibrateDrive 94 mov al, FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE 95 call SetErrorFlagFromALwithErrorCodeInAH 96 97 ; Initialize block mode transfers 98 .InitializeBlockMode: 99 call InitializeBlockMode 100 mov al, FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE 101 call SetErrorFlagFromALwithErrorCodeInAH 102 103 %ifdef MODULE_ADVANCED_ATA 104 ; Initialize fastest supported PIO mode 105 .InitializePioMode: 106 call InitializePioMode 107 mov al, FLG_INITERROR_FAILED_TO_SET_PIO_MODE 108 call SetErrorFlagFromALwithErrorCodeInAH 109 %endif 110 111 ; There might have been several errors so just return 112 ; one error code for them all 113 cmp BYTE [di+DPT_ATA.bInitError], 0 114 je SHORT .ReturnWithErrorCodeInAH 115 mov ah, RET_HD_RESETFAIL 116 stc 117 118 .ReturnWithErrorCodeInAH: 119 pop si 120 pop es 121 ret 122 123 124 ;-------------------------------------------------------------------- 125 ; InitializeDeviceParameters 126 ; Parameters: 127 ; DS:DI: Ptr to DPT (in RAMVARS segment) 128 ; SS:BP: Ptr to IDEPACK 129 ; Returns: 130 ; AH: BIOS Error code 131 ; CF: Cleared if successful 132 ; Set if any error 133 ; Corrupts registers: 134 ; AL, BX, CX, DX 135 ;-------------------------------------------------------------------- 136 InitializeDeviceParameters: 137 ; No need to initialize CHS parameters if LBA mode enabled 138 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA ; Clear CF 139 jnz SHORT ReturnSuccessSinceInitializationNotNeeded 87 test BYTE [di+DPT.bFlagsLow], FLG_DRVNHEAD_LBA 88 jnz SHORT .SkipInitializeDeviceParameters ; No need to initialize CHS parameters if LBA mode enabled 140 89 141 90 ; Initialize Logical Sectors per Track and Max Head number … … 145 94 mov al, COMMAND_INITIALIZE_DEVICE_PARAMETERS 146 95 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) 147 jmp Idepack_StoreNonExtParametersAndIssueCommandFromAL 148 149 150 ;-------------------------------------------------------------------- 151 ; SetWriteCache 152 ; Parameters: 153 ; DS:DI: Ptr to DPT (in RAMVARS segment) 154 ; Returns: 155 ; AH: BIOS Error code 156 ; CF: Cleared if successful 157 ; Set if any error 158 ; Corrupts registers: 159 ; AL, BX, CX, DX, SI 160 ;-------------------------------------------------------------------- 161 SetWriteCache: 96 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 97 98 mov al, FLG_INITERROR_FAILED_TO_INITIALIZE_CHS_PARAMETERS 99 call .SetErrorFlagFromALwithErrorCodeInAH 100 .SkipInitializeDeviceParameters: 101 102 ;;; SetWriteCache 103 ; Enable or Disable Write Cache 162 104 call AccessDPT_GetPointerToDRVPARAMStoCSBX 163 105 mov bl, [cs:bx+DRVPARAMS.wFlags] 106 push bx ; Save .wFlags for later use in InitializeBlockMode 164 107 and bx, BYTE MASK_DRVPARAMS_WRITECACHE 165 jz SHORT ReturnSuccessSinceInitializationNotNeeded; DEFAULT_WRITE_CACHE108 jz SHORT .SkipSetWriteCache ; DEFAULT_WRITE_CACHE 166 109 mov si, [cs:bx+.rgbWriteCacheCommands] 167 jmp AH23h_SetControllerFeatures 168 169 .rgbWriteCacheCommands: 170 db 0 ; DEFAULT_WRITE_CACHE 171 db FEATURE_DISABLE_WRITE_CACHE ; DISABLE_WRITE_CACHE 172 db FEATURE_ENABLE_WRITE_CACHE ; ENABLE_WRITE_CACHE 173 174 175 %ifdef MODULE_ADVANCED_ATA 176 ;-------------------------------------------------------------------- 177 ; InitializePioMode 178 ; Parameters: 179 ; DS:DI: Ptr to DPT (in RAMVARS segment) 180 ; Returns: 181 ; AH: BIOS Error code 182 ; CF: Cleared if successful 183 ; Set if any error 184 ; Corrupts registers: 185 ; AL, BX, CX, DX 186 ;-------------------------------------------------------------------- 187 InitializePioMode: 188 mov dl, PIO_DEFAULT_MODE_DISABLE_IORDY 189 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_IORDY 190 jz SHORT .IordyNotSupported 191 192 ; Advanced PIO mode 3 and above 193 mov dl, [di+DPT_ADVANCED_ATA.bPioMode] 194 or dl, PIO_FLOW_CONTROL_MODE_xxx 195 196 .IordyNotSupported: 197 mov si, FEATURE_SET_TRANSFER_MODE 198 jmp AH23h_SetControllerFeatures 199 %endif 200 201 202 ;-------------------------------------------------------------------- 203 ; InitializeBlockMode 204 ; Parameters: 205 ; DS:DI: Ptr to DPT (in RAMVARS segment) 206 ; Returns: 207 ; AH: BIOS Error code 208 ; CF: Cleared if successful 209 ; Set if any error 210 ; Corrupts registers: 211 ; AL, BX, CX, DX 212 ;-------------------------------------------------------------------- 213 InitializeBlockMode: 214 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED ; Clear CF 110 call AH23h_SetControllerFeatures 111 112 mov al, FLG_INITERROR_FAILED_TO_SET_WRITE_CACHE 113 call .SetErrorFlagFromALwithErrorCodeInAH 114 .SkipSetWriteCache: 115 116 ;;; RecalibrateDrive 117 ; Recalibrate drive by seeking to cylinder 0 118 call AH11h_RecalibrateDrive 119 120 mov al, FLG_INITERROR_FAILED_TO_RECALIBRATE_DRIVE 121 call .SetErrorFlagFromALwithErrorCodeInAH 122 123 ;;; InitializeBlockMode 124 ; Initialize block mode transfers 125 pop ax ; Restore .wFlags saved in SetWriteCache 126 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_BLOCK_MODE_SUPPORTED 215 127 jz SHORT .BlockModeNotSupportedOrDisabled 216 call AccessDPT_GetPointerToDRVPARAMStoCSBX 217 test BYTE [cs:bx+DRVPARAMS.wFlags], FLG_DRVPARAMS_BLOCKMODE 128 test al, FLG_DRVPARAMS_BLOCKMODE 218 129 jz SHORT .BlockModeNotSupportedOrDisabled 219 130 … … 222 133 .TryNextBlockSize: 223 134 mov al, bl 224 call AH24h_SetBlockSize 135 call AH24h_SetBlockSize ; Stores block size to DPT 225 136 jnc SHORT .SupportedBlockSizeFound 226 shr bl, 1 ; Try next size 227 jmp SHORT .TryNextBlockSize 137 shr bl, 1 138 jnc SHORT .TryNextBlockSize 139 140 mov al, FLG_INITERROR_FAILED_TO_SET_BLOCK_MODE 141 call .SetErrorFlagFromALwithErrorCodeInAH 142 .BlockModeNotSupportedOrDisabled: 228 143 .SupportedBlockSizeFound: 229 mov [di+DPT_ATA.bBlockSize], bl 230 .BlockModeNotSupportedOrDisabled: 231 ReturnSuccessSinceInitializationNotNeeded: 144 145 %ifdef MODULE_ADVANCED_ATA 146 ;;; InitializePioMode 147 ; Initialize fastest supported PIO mode 148 mov dl, PIO_DEFAULT_MODE_DISABLE_IORDY 149 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_IORDY 150 jz SHORT .IordyNotSupported 151 152 ; Advanced PIO mode 3 and above 153 mov dl, [di+DPT_ADVANCED_ATA.bPioMode] 154 or dl, PIO_FLOW_CONTROL_MODE_xxx 155 156 .IordyNotSupported: 157 mov si, FEATURE_SET_TRANSFER_MODE 158 call AH23h_SetControllerFeatures 159 160 mov al, FLG_INITERROR_FAILED_TO_SET_PIO_MODE 161 call .SetErrorFlagFromALwithErrorCodeInAH 162 %endif ; MODULE_ADVANCED_ATA 163 164 %ifdef MODULE_FEATURE_SETS 165 ;;; InitStandbyTimer 166 ; Initialize the standby timer (if supported) 167 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_POWER_MANAGEMENT_SUPPORTED 168 jz .NoPowerManagementSupport 169 170 mov al, COMMAND_IDLE 171 mov dl, [cs:ROMVARS.bIdleTimeout] 172 mov bx, TIMEOUT_AND_STATUS_TO_WAIT(TIMEOUT_BSY, FLG_STATUS_BSY) 173 call Idepack_StoreNonExtParametersAndIssueCommandFromAL 174 175 mov al, FLG_INITERROR_FAILED_TO_INITIALIZE_STANDBY_TIMER 176 call .SetErrorFlagFromALwithErrorCodeInAH 177 .NoPowerManagementSupport: 178 %endif ; MODULE_FEATURE_SETS 179 180 ; There might have been several errors so just return one error code for them all 181 mov ah, [di+DPT_ATA.bInitError] 182 test ah, ah ; Clears CF 183 jz SHORT .ReturnWithErrorCodeInAH 184 mov ah, RET_HD_RESETFAIL 185 stc 186 187 .ReturnWithErrorCodeInAH: 188 pop si 189 pop es 232 190 ret 233 191 234 192 235 193 ;-------------------------------------------------------------------- 236 ; SetErrorFlagFromALwithErrorCodeInAH194 ; .SetErrorFlagFromALwithErrorCodeInAH 237 195 ; Parameters: 238 196 ; AH: BIOS Error Code … … 245 203 ; Nothing 246 204 ;-------------------------------------------------------------------- 247 SetErrorFlagFromALwithErrorCodeInAH: 205 .IgnoreInvalidCommandError: 206 xor ah, ah ; Clears CF 207 208 .SetErrorFlagFromALwithErrorCodeInAH: 248 209 jnc SHORT .NoErrorFlagToSet 249 210 cmp ah, RET_HD_INVALID … … 252 213 or [di+DPT_ATA.bInitError], al 253 214 stc 254 ret255 .IgnoreInvalidCommandError:256 xor ah, ah257 215 .NoErrorFlagToSet: 258 216 ret 217 218 219 .rgbWriteCacheCommands: 220 db 0 ; DEFAULT_WRITE_CACHE 221 db FEATURE_DISABLE_WRITE_CACHE ; DISABLE_WRITE_CACHE 222 db FEATURE_ENABLE_WRITE_CACHE ; ENABLE_WRITE_CACHE 223 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r392 r399 4 4 5 5 ; 6 ; XTIDE Universal BIOS and Associated Tools 6 ; XTIDE Universal BIOS and Associated Tools 7 7 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 8 8 ; … … 11 11 ; the Free Software Foundation; either version 2 of the License, or 12 12 ; (at your option) any later version. 13 ; 13 ; 14 14 ; This program is distributed in the hope that it will be useful, 15 15 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 ; GNU General Public License for more details. 17 ; GNU General Public License for more details. 18 18 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 ; 19 ; 20 20 21 21 ; Section containing code … … 75 75 ;-------------------------------------------------------------------- 76 76 AdvAtaInit_InitializeControllerForDPTinDSDI: 77 push bp78 push si79 80 77 ; Call Controller Specific initialization function 81 78 mov ax, [di+DPT_ADVANCED_ATA.wControllerID] … … 83 80 jz SHORT .NoAdvancedController ; Return with CF cleared 84 81 82 push bp 83 push si 84 85 85 ; We only support Vision at the moment so no need to identify ID 86 86 call AdvAtaInit_LoadMasterDPTtoDSSIifSlaveInDSDI 87 87 call Vision_InitializeWithIDinAHandConfigInAL 88 88 89 .NoAdvancedController:90 89 pop si 91 90 pop bp 91 92 .NoAdvancedController: 92 93 ret 93 94 -
trunk/XTIDE_Universal_BIOS/Src/Main.asm
r398 r399 181 181 %include "Interrupts.asm" ; For Interrupt initialization 182 182 %include "RamVars.asm" ; For RAMVARS initialization and access 183 %include "BootVars.asm" ; For initializing variable dused during init and boot183 %include "BootVars.asm" ; For initializing variables used during init and boot 184 184 %include "FloppyDrive.asm" ; Floppy Drive related functions 185 185 %include "CreateDPT.asm" ; For creating DPTs -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrint.asm
r397 r399 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 ; GNU General Public License for more details. 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 19 19 20 20 ; Section containing code … … 145 145 ; 5 3.5" ED on some BIOSes 3 1/2 2.88M 146 146 ; 6 FLOPPY_TYPE_35_ED 3 1/2 2.88M 147 ; >6 Unkn won, handled above147 ; >6 Unknown, handled above 148 148 ; 149 149 ;-------------------------------------------------------------------- … … 159 159 push ax ; "5 1/4" or "3 1/2" 160 160 161 xor bh, bh 161 162 mov al,FloppyTypes.rgbCapacityMultiplier 162 mov bh, 0 163 mul byte [cs:bx+FloppyTypes.rgbCapacity - 1] ; -1 since 0 is handled above and not in the table 163 mul BYTE [cs:bx+FloppyTypes.rgbCapacity - 1] ; -1 since 0 is handled above and not in the table 164 164 165 165 .PushAXAndOutput: … … 202 202 push dx ; Magnitude character 203 203 204 test di, di204 test di, di 205 205 jz SHORT BootMenuPrint_RefreshInformation.FormatRelay 206 206 -
trunk/XTIDE_Universal_BIOS/Src/Menus/BootMenu/BootMenuPrintCfg.asm
r392 r399 2 2 ; Description : Functions for printing drive configuration 3 3 ; information on Boot Menu. 4 ; 4 ; 5 5 ; Included by BootMenuPrint.asm, this routine is to be inserted into 6 6 ; BootMenuPrint_HardDiskRefreshInformation. … … 8 8 9 9 ; 10 ; XTIDE Universal BIOS and Associated Tools 10 ; XTIDE Universal BIOS and Associated Tools 11 11 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 12 12 ; … … 15 15 ; the Free Software Foundation; either version 2 of the License, or 16 16 ; (at your option) any later version. 17 ; 17 ; 18 18 ; This program is distributed in the hope that it will be useful, 19 19 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 20 20 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 21 ; GNU General Public License for more details. 22 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 22 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 23 23 ; 24 24 25 25 ; Section containing code 26 26 SECTION .text … … 131 131 ;-------------------------------------------------------------------- 132 132 .PushResetStatus: 133 xor ax, ax134 %ifdef MODULE_SERIAL135 test BYTE [di+DPT.bFlagsHigh], FLGH_DPT_SERIAL_DEVICE136 jnz SHORT .AlwaysSuccess137 133 mov al, [di+DPT_ATA.bInitError] 138 .AlwaysSuccess:139 %endif140 134 push ax 141 135 -
trunk/XTIDE_Universal_BIOS/Src/Menus/HotkeyBar.asm
r395 r399 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 16 ; GNU General Public License for more details. 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 19 19 20 20 ; Section containing code … … 382 382 383 383 .StoreDriveLetter: 384 adc di, BYTE 0 ; Add 1if Floppy Drive384 adc di, BYTE 1 ; Add CF if Floppy Drive 385 385 xchg ax, cx 386 mov [es:di +1], al; AH = zero to clear function hotkey386 mov [es:di], al ; AH = zero to clear function hotkey 387 387 388 388 .StoreFunctionHotkeyFromAH: -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/DrvDetectInfo.asm
r397 r399 4 4 5 5 ; 6 ; XTIDE Universal BIOS and Associated Tools 6 ; XTIDE Universal BIOS and Associated Tools 7 7 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 8 8 ; … … 11 11 ; the Free Software Foundation; either version 2 of the License, or 12 12 ; (at your option) any later version. 13 ; 13 ; 14 14 ; This program is distributed in the hope that it will be useful, 15 15 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 16 16 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 17 ; GNU General Public License for more details. 18 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 19 19 ; 20 20 21 21 ; Section containing code 22 22 SECTION .text … … 45 45 pop ds 46 46 47 add si, BYTE ATA1.strModel ; DS:SI now points drive name 48 lea di, [bx+DRVDETECTINFO.szDrvName] 47 add si, BYTE ATA1.strModel ; DS:SI now points drive name (Clears CF) 48 lea di, [bx+DRVDETECTINFO.szDrvName] ; ES:DI now points to name destination 49 49 mov cx, MAX_HARD_DISK_NAME_LENGTH / 2 ; Max number of WORDs allowed 50 50 .CopyNextWord: … … 53 53 stosw 54 54 loop .CopyNextWord 55 x or ax, ax ; Zero AX and clear CF55 xchg cx, ax ; Zero AX (CF already cleared from the ADD above) 56 56 stosw ; Terminate with NULL 57 57 58 58 pop si 59 59 pop ds 60 60 61 61 ret 62 62 … … 74 74 ;-------------------------------------------------------------------- 75 75 DriveDetectInfo_ConvertDPTtoBX: 76 mov ax, di 77 sub ax, BYTE RAMVARS_size ; subtract off base of DPTs 76 lea ax, [di-RAMVARS_size] ; subtract off base of DPTs 78 77 mov bl, DPT_DRVDETECTINFO_SIZE_MULTIPLIER ; DRVDETECTINFO are a whole number multiple of DPT size 79 mul bl 78 mul bl 80 79 add ax, BOOTVARS.rgDrvDetectInfo ; add base of DRVDETECTINFO 81 xchg ax, bx82 ret 80 xchg bx, ax 81 ret -
trunk/XTIDE_Universal_BIOS/makefile
r398 r399 24 24 # MODULE_SERIAL_FLOPPY Virtual floppy drives using serial port (requires MODULE_SERIAL) # 25 25 # MODULE_STRINGS_COMPRESSED Use compressed strings to save space # 26 # MODULE_FEATURE_SETS Power Management support # 26 27 # # 27 28 # Not modules but these affect the assembly: # … … 91 92 # Assembler preprocessor defines. # 92 93 ################################################################# 93 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_EBIOS 94 DEFINES_COMMON = MODULE_STRINGS_COMPRESSED MODULE_HOTKEYS MODULE_EBIOS MODULE_FEATURE_SETS 94 95 DEFINES_COMMON_LARGE = MODULE_BOOT_MENU MODULE_JRIDE MODULE_SERIAL MODULE_SERIAL_FLOPPY 95 96 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/BootMenuSettingsMenu.asm
r376 r399 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing initialized data … … 71 71 iend 72 72 73 g_MenuitemBootMenuSerialScanDetect: 73 g_MenuitemBootMenuSerialScanDetect: 74 74 istruc MENUITEM 75 75 at MENUITEM.fnActivate, dw Menuitem_ActivateMultichoiceSelectionForMenuitemInDSSI … … 134 134 iend 135 135 136 %if 0 ; *FIXME* 136 137 g_MenuitemBootMnuStngsSwapBootDriveNumbers: 137 138 istruc MENUITEM … … 149 150 at MENUITEM.itemValue + ITEM_VALUE.wValueBitmask, dw FLG_ROMVARS_DRVXLAT 150 151 iend 152 %endif 151 153 152 154 … … 221 223 or [g_MenuitemBootMnuStngsDefaultBootDrive+MENUITEM.bFlags], al 222 224 or [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al 223 or [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al225 ; or [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al 224 226 ret 225 227 … … 228 230 and [g_MenuitemBootMnuStngsDefaultBootDrive+MENUITEM.bFlags], al 229 231 and [g_MenuitemBootMnuStngsSelectionTimeout+MENUITEM.bFlags], al 230 and [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al231 ret 232 ; and [g_MenuitemBootMnuStngsSwapBootDriveNumbers+MENUITEM.bFlags], al 233 ret 232 234 233 235 -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Menupages/IdeControllerMenu.asm
r376 r399 3 3 4 4 ; 5 ; XTIDE Universal BIOS and Associated Tools 5 ; XTIDE Universal BIOS and Associated Tools 6 6 ; Copyright (C) 2009-2010 by Tomi Tilli, 2011-2012 by XTIDE Universal BIOS Team. 7 7 ; … … 10 10 ; the Free Software Foundation; either version 2 of the License, or 11 11 ; (at your option) any later version. 12 ; 12 ; 13 13 ; This program is distributed in the hope that it will be useful, 14 14 ; but WITHOUT ANY WARRANTY; without even the implied warranty of 15 15 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 ; GNU General Public License for more details. 16 ; GNU General Public License for more details. 17 17 ; Visit http://www.gnu.org/licenses/old-licenses/gpl-2.0.html 18 ; 18 ; 19 19 20 20 ; Section containing initialized data … … 523 523 jb .writeNonSerial 524 524 525 mov ax, DEVICE_ATA_DEFAULT_PORT ; Defaults for 16-bit and better ATA devices526 mov bx, DEVICE_ATA_DEFAULT_PORTCTRL525 mov ax, DEVICE_ATA_PRIMARY_PORT ; Defaults for 16-bit and better ATA devices 526 mov bx, DEVICE_ATA_PRIMARY_PORTCTRL 527 527 528 528 .writeNonSerial: -
trunk/XTIDE_Universal_BIOS_Configurator_v2/Src/Strings.asm
r380 r399 356 356 g_szItemBootDispMode: db "Display Mode",NULL 357 357 g_szItemBootFloppyDrvs: db "Number of Floppy Drives",NULL 358 g_szItemBootSwap: db "Swap boot drive numbers",NULL358 ;g_szItemBootSwap: db "Swap boot drive numbers",NULL 359 359 g_szItemSerialDetect: db "Scan for Serial Drives",NULL 360 360 … … 364 364 g_szDlgBootDispMode: db "Select display mode for Boot Menu.",NULL 365 365 g_szDlgBootFloppyDrvs: db "Select number of Floppy Drives to display on boot menu.",NULL 366 g_szDlgBootSwap: db "Enable drive number translation?",NULL366 ;g_szDlgBootSwap: db "Enable drive number translation?",NULL 367 367 g_szDlgSerialDetect: db "Scan for serial drives?",NULL 368 368 … … 372 372 g_szNfoDispMode: db "Display Mode for Boot Menu.",NULL 373 373 g_szNfoBootFloppyDrvs: db "Number of Floppy Drives to display on boot menu.",NULL 374 g_szNfoBootSwap: db "Drive Number Translation (swap first drive with selected).",NULL374 ;g_szNfoBootSwap: db "Drive Number Translation (swap first drive with selected).",NULL 375 375 g_szNfoSerialDetect: db "Scans all standard COM ports for serial drives." 376 376 db " This can also be invoked by holding down ALT at the end of normal drive detection.",NULL … … 382 382 g_szHelpBootFloppyDrvs: incbin "Bootmenu_FloppyDrives.txt" 383 383 db NULL 384 g_szHelpBootSwap: incbin "Bootmenu_SwapDrives.txt"385 db NULL384 ;g_szHelpBootSwap: incbin "Bootmenu_SwapDrives.txt" 385 ; db NULL 386 386 g_szHelpSerialDetect: incbin "Bootmenu_SerialDetect.txt" 387 387 db NULL
Note:
See TracChangeset
for help on using the changeset viewer.