Changeset 370 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Mar 29, 2012, 4:40:50 PM (13 years ago)
- google:author:
- krille_n_@hotmail.com
- Location:
- trunk/XTIDE_Universal_BIOS
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Inc/ATA_ID.inc
r364 r370 21 21 PIO_3_MIN_ADDRESS_VALID_NS EQU 30 22 22 PIO_4_MIN_ADDRESS_VALID_NS EQU 25 23 PIO_5_MIN_ADDRESS_VALID_NS EQU 25 ; Could not find info24 PIO_6_MIN_ADDRESS_VALID_NS EQU 25 ; Could not find info23 PIO_5_MIN_ADDRESS_VALID_NS EQU 15 24 PIO_6_MIN_ADDRESS_VALID_NS EQU 10 25 25 26 26 ; PIO Minimum Active Times (t2) … … 30 30 PIO_3_MIN_ACTIVE_TIME_NS EQU 80 31 31 PIO_4_MIN_ACTIVE_TIME_NS EQU 70 32 PIO_5_MIN_ACTIVE_TIME_NS EQU 70 ; Could not find info33 PIO_6_MIN_ACTIVE_TIME_NS EQU 70 ; Could not find info32 PIO_5_MIN_ACTIVE_TIME_NS EQU 65 33 PIO_6_MIN_ACTIVE_TIME_NS EQU 55 34 34 35 35 ; PIO Minimum Recovery Times or Inactive Times (t2i) can be calculated 36 ; from Minimum Cycle Time (t0) - Minimum Active Time (t2) - Address Valid Time (t1). 36 ; from Minimum Cycle Time (t0) - Minimum Active Time (t2) - Address Valid Time (t1). 37 37 ; I'm not sure about this calculation so correct me if I'm wrong! 38 38 ; Recovery time should be calculated at run time since Cycle Time t0 can be … … 54 54 .wBpTrck resw 1 ; 4F, Number of unformatted bytes per track 55 55 .wBpSect resw 1 ; 5F, Number of unformatted bytes per sector 56 .wSPT resw 1 ; 6F, Number of sectors per track 56 .wSPT resw 1 ; 6F, Number of sectors per track 57 57 resw 3 ; 7...9X 58 58 .strSerial resb 20 ; 10...19F, Serial number (20 ASCII characters, 0000h=not specified) … … 136 136 resw 1 ; 4X 137 137 resw 1 ; 5X 138 .wSPT resw 1 ; 6F, Number of logical sectors per track 138 .wSPT resw 1 ; 6F, Number of logical sectors per track 139 139 resw 3 ; 7...9X 140 140 .strSerial resb 20 ; 10...19F, Serial number (20 ASCII characters, 0000h=not specified) … … 166 166 .bBlockSel resb 1 ; 59[0-7]V, Current setting for number of sectors that 167 167 ; can be transferred per interrupt on R/W multiple command 168 .bBlockFlgs resb 1 ; 59[8-15]VR, bit 0 set if Multiple sector setting is valid 168 .bBlockFlgs resb 1 ; 59[8-15]VR, bit 0 set if Multiple sector setting is valid 169 169 .dwLBACnt resd 1 ; 60...61F, Total number of user addressable sectors (LBA mode only) 170 170 .bSDMASupp resb 1 ; 62[0-7]F, Single word DMA transfer modes supported … … 172 172 .bMDMASupp resb 1 ; 63[0-7]F, Multiword DMA transfer modes supported 173 173 .bMDMAAct resb 1 ; 63[8-15]V, Multiword DMA transfer mode active 174 174 175 175 ; Words 64-70 are valid only if bit1 is set in .wFields (ATA2+) 176 176 .bPIOSupp resb 1 ; 64[0-7]F, Advanced PIO Transfer Modes Supported … … 220 220 resw 1 ; 4X 221 221 resw 1 ; 5X 222 resw 1 ; 6X, Obsolete (Number of logical sectors per track) 222 resw 1 ; 6X, Obsolete (Number of logical sectors per track) 223 223 resw 2 ; 7...8V, Reserved for assignment by the CompactFlash Association 224 224 resw 1 ; 9X -
trunk/XTIDE_Universal_BIOS/Inc/CustomDPT.inc
r365 r370 91 91 struc DPT_SERIAL 92 92 .dpt resb DPT_size 93 94 93 .wSerialPortAndBaud: 95 94 .bSerialPort resb 1 ; Serial connection I/O port address, divided by 4 … … 126 125 jnz SHORT %%LoadMaxValueToAX 127 126 cmp ax, MAX_LCHS_CYLINDERS 128 jb eSHORT %%NoNeedToModify127 jb SHORT %%NoNeedToModify 129 128 %%LoadMaxValueToAX: 130 129 mov ax, MAX_LCHS_CYLINDERS -
trunk/XTIDE_Universal_BIOS/Inc/IDE_8bit.inc
r363 r370 30 30 ; XTIDE_INSW 31 31 ; Parameters: 32 ; B X: Bit mask for toggling XTIDE data low/high reg32 ; BL: Bit mask for toggling XTIDE data low/high reg 33 33 ; DX: XTIDE Data Low Register address 34 34 ; ES:DI: Ptr to destination buffer … … 41 41 %ifdef USE_186 ; INS instruction available 42 42 insb ; Load low byte from port DX to [ES:DI] 43 xor d x, bx; IDE Data Reg to XTIDE Data High Reg43 xor dl, bl ; IDE Data Reg to XTIDE Data High Reg 44 44 insb ; Load high byte from port DX to [ES:DI] 45 xor d x, bx; Restore to IDE Data Register45 xor dl, bl ; Restore to IDE Data Register 46 46 %else ; If 8088/8086 47 47 in al, dx ; Load low byte from port 48 xor d x, bx; IDE Data Reg to XTIDE Data High Reg48 xor dl, bl ; IDE Data Reg to XTIDE Data High Reg 49 49 stosb ; Store byte to [ES:DI] 50 50 in al, dx ; Load high byte from port 51 xor d x, bx; Restore to IDE Data Register51 xor dl, bl ; Restore to IDE Data Register 52 52 stosb ; Store byte to [ES:DI] 53 53 %endif … … 60 60 ; XTIDE_OUTSW 61 61 ; Parameters: 62 ; B X: Bit mask for toggling XTIDE data low/high reg62 ; BL: Bit mask for toggling XTIDE data low/high reg 63 63 ; DX: XTIDE Data Low Register address 64 64 ; DS:SI: Ptr to source buffer … … 71 71 %ifdef USE_186 ; OUTS instruction available 72 72 lodsb ; Load low byte from [DS:SI] to AL 73 xor d x, bx; IDE Data Reg to XTIDE Data High Reg73 xor dl, bl ; IDE Data Reg to XTIDE Data High Reg 74 74 outsb ; Output high byte from [DS:SI] 75 xor d x, bx; XTIDE Data High Reg to Data Low Reg75 xor dl, bl ; XTIDE Data High Reg to Data Low Reg 76 76 out dx, al ; Output low byte from AL 77 77 %else ; If 8088/8086 78 78 lodsw ; Load word from [DS:SI] 79 xor d x, bx; IDE Data Reg to XTIDE Data High Reg79 xor dl, bl ; IDE Data Reg to XTIDE Data High Reg 80 80 xchg al, ah ; => AL=high byte, AH=low byte 81 81 out dx, al ; Output high byte 82 xor d x, bx; XTIDE Data High Reg to Data Low Reg82 xor dl, bl ; XTIDE Data High Reg to Data Low Reg 83 83 mov al, ah ; Copy low byte to AL 84 84 out dx, al ; Output low byte -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r365 r370 102 102 ; Return number of successfully read sectors 103 103 ReturnWithTransferErrorInAH: 104 %ifdef USE_386 105 movzx cx, [bp+PIOVARS.bSectorsDone] 106 %else 104 107 mov cl, [bp+PIOVARS.bSectorsDone] 105 108 mov ch, 0 ; Preserve CF 109 %endif 106 110 ret 107 111 … … 180 184 ; Store sizes 181 185 mov [bp+PIOVARS.bSectorsLeft], ah 182 eMOVZX ax, BYTE[di+DPT_ATA.bBlockSize]186 eMOVZX ax, [di+DPT_ATA.bBlockSize] 183 187 mov [bp+PIOVARS.wSectorsInBlock], ax 184 188 mov [bp+PIOVARS.bSectorsDone], ah ; Zero … … 218 222 ReadBlockFromXtideRev1: 219 223 UNROLL_SECTORS_IN_CX_TO_QWORDS 220 mov b x, 8 ; Bit mask for toggling data low/high reg224 mov bl, 8 ; Bit mask for toggling data low/high reg 221 225 ALIGN JUMP_ALIGN 222 226 .InswLoop: … … 287 291 push bx 288 292 UNROLL_SECTORS_IN_CX_TO_QWORDS 289 mov b x, 8 ; Bit mask for toggling data low/high reg293 mov bl, 8 ; Bit mask for toggling data low/high reg 290 294 push es ; Copy ES... 291 295 pop ds ; ...to DS -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AH9h_HInit.asm
r365 r370 227 227 ; Set if error flag was set 228 228 ; Corrupts registers: 229 ; BX, ES229 ; Nothing 230 230 ;-------------------------------------------------------------------- 231 231 SetErrorFlagFromALwithErrorCodeInAH: -
trunk/XTIDE_Universal_BIOS/Src/Handlers/Int13h/AHDh_HReset.asm
r369 r370 52 52 53 53 ; Initialize Master and Slave drives 54 eMOVZX ax, BYTE [di+DPT.bIdevarsOffset]; (AL) pointer to controller we are looking to reset54 eMOVZX ax, [di+DPT.bIdevarsOffset] ; (AL) pointer to controller we are looking to reset 55 55 ; (AH) initialize error code, assume success 56 56 … … 85 85 IterateAndResetDrives: 86 86 cmp al, [di+DPT.bIdevarsOffset] ; The right controller? 87 jne .done 87 jne .Done 88 push cx 88 89 push ax 89 push cx90 90 call AH9h_InitializeDriveForUse ; Reset Master and Slave (Master will come first in DPT list) 91 91 92 92 %ifdef MODULE_ADVANCED_ATA 93 93 jc SHORT .SkipControllerInitSinceError 94 call InitializeAdvancedIdeControllers ; Done after drive init so drives are first set to advanced PIO mode, then the controller 94 ; Here we initialize the more advanced controllers (VLB and PCI) to get better performance for systems with 32-bit bus. 95 ; This step is optional since the controllers use slowest possible settings by default if they are not initialized. 96 97 pop ax 98 push ax 99 cmp al, [di+LARGEST_DPT_SIZE+DPT.bIdevarsOffset] ; We check if next DPT is for the same IDE controller. 100 je SHORT .SkipInitializationUntilNextDrive ; If it is, we skip the initialization. 101 call AdvAtaInit_InitializeControllerForDPTinDSDI ; Done after drive init so drives are first set to advanced PIO mode, then the controller 102 .SkipInitializationUntilNextDrive: 95 103 .SkipControllerInitSinceError: 96 %endif 104 %endif ; MODULE_ADVANCED_ATA 97 105 106 pop ax 98 107 pop cx 99 pop ax 100 jnc .done 108 jnc .Done 101 109 or ah, (RET_HD_RESETFAIL << 1) | 1 ; OR in Reset Failed error code and CF, will SHR into position later 102 . done:110 .Done: 103 111 stc ; From IterateAllDPTs perspective, the DPT is never found (continue iteration) 104 112 ret 105 113 106 107 %ifdef MODULE_ADVANCED_ATA108 ;--------------------------------------------------------------------109 ; Here we initialize the more advanced controllers (VLB and PCI)110 ; to get better performance for systems with 32-bit bus.111 ;112 ; This step is optional since the controllers use slowest possible113 ; settings by default if they are not initialized.114 ;115 ; InitializeAdvancedIdeController116 ; Parameters:117 ; DS:DI: Ptr to DPT118 ; Returns:119 ; CF: Cleared if success or no controller to initialize120 ; Set if error121 ; Corrupts registers:122 ; AX, BX, CX, DX123 ;--------------------------------------------------------------------124 InitializeAdvancedIdeControllers:125 ; We want to initialize the advanced controller only after both126 ; Master and Slave drive are initialized to correct PIO mode.127 ; We check if next DPT is for the same IDE controller. If it is,128 ; we skip the initialization.129 mov al, [di+DPT.bIdevarsOffset]130 cmp al, [di++LARGEST_DPT_SIZE+DPT.bIdevarsOffset]131 je SHORT .SkipInitializationUntilNextDrive ; CF cleared132 133 jmp AdvAtaInit_InitializeControllerForDPTinDSDI134 .SkipInitializationUntilNextDrive:135 clc136 ret137 138 %endif ; MODULE_ADVANCED_ATA -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvAtaInit.asm
r364 r370 114 114 ;-------------------------------------------------------------------- 115 115 AdvAtaInit_SelectSlowestCommonPioTimingsToBXandCXfromDSSIandDSDI: 116 eMOVZX bx, BYTE[di+DPT_ADVANCED_ATA.bPioMode]116 eMOVZX bx, [di+DPT_ADVANCED_ATA.bPioMode] 117 117 mov cx, [di+DPT_ADVANCED_ATA.wMinPioCycleTime] 118 118 test si, si -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r364 r370 89 89 ; Get PIO mode and cycle time for PIO 0...2 90 90 mov bx, [es:si+ATA1.bPioMode] 91 mov ax, bx ; AH = 0, AL = PIO mode 0, 1 or 2 91 92 shl bx, 1 ; Shift for WORD lookup 92 93 mov cx, [cs:bx+.rgwPio0to2CycleTimeInNanosecs] 93 shr bx, 194 xchg ax, bx ; AH = 0, AL = PIO mode 0, 1 or 295 94 96 95 ; Check if IORDY is supported … … 105 104 ; Get Advanced PIO mode 106 105 ; (Hard Disks supports up to 4 but CF cards can support 5 and 6) 107 mov b x, [es:si+ATA2.bPIOSupp]106 mov bl, [es:si+ATA2.bPIOSupp] 108 107 .CheckNextFlag: 109 108 inc ax 110 shr b x, 1109 shr bl, 1 111 110 jnz SHORT .CheckNextFlag 112 111 MIN_U al, 6 ; Make sure not above lookup tables -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Vision.asm
r364 r370 45 45 IsConfigRegisterWithIDinAL: 46 46 mov ah, al 47 and a h, MASK_QDCONFIG_CONTROLLER_ID48 cmp a h, ID_QD6500 << 447 and al, MASK_QDCONFIG_CONTROLLER_ID 48 cmp al, ID_QD6500 << 4 49 49 je SHORT VisionControllerDetected 50 cmp a h, ID_QD6580 << 450 cmp al, ID_QD6580 << 4 51 51 je SHORT VisionControllerDetected 52 cmp a h, ID_QD6580_ALTERNATE << 452 cmp al, ID_QD6580_ALTERNATE << 4 53 53 VisionControllerDetected: 54 xchg ah, al 54 55 ret 55 56 … … 175 176 mov bp, QD6500_MAX_ACTIVE_TIME_CLOCKS | (QD6500_MIN_ACTIVE_TIME_CLOCKS << 8) 176 177 177 ; We need the PIO Cycle Time in CX to calculate Active and Recovery Times. 178 ; We need the PIO Cycle Time in CX to calculate Active and Recovery Times. 178 179 .CalculateTimingsForQD65xx: 179 180 call AdvAtaInit_SelectSlowestCommonPioTimingsToBXandCXfromDSSIandDSDI -
trunk/XTIDE_Universal_BIOS/makefile
r369 r370 196 196 197 197 xt_unused: xt 198 $(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS199 perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm200 198 @$(AS) "$(SRC_ASM)" $(ASFLAGS) $(DEFS_XT) -o"$(TARGET)_xt_unused.asm" -E -DCHECK_FOR_UNUSED_ENTRYPOINTS 199 @perl ..\tools\unused.pl $(TARGET)_xt.lst $(TARGET)_xt_unused.asm 200
Note:
See TracChangeset
for help on using the changeset viewer.