Changeset 592 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (6 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Initialization
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r589 r592 60 60 ; AX: ID WORD specific for detected controller 61 61 ; Returns: 62 ; AL: Max supported PIO mode 63 ; AH: FLGH_DPT_IORDY if IORDY supported, zero otherwise62 ; AL: Max supported PIO mode (only if ZF set) 63 ; AH: ~FLGH_DPT_IORDY if IORDY not supported, -1 otherwise (only if ZF set) 64 64 ; BX: Min PIO cycle time (only if ZF set) 65 65 ; ZF: Set if PIO limit necessary -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/PDC20x30.asm
r589 r592 127 127 128 128 ; PDC20230C and PDC20630 clears the bit we set at the beginning 129 in al, dx 129 in al, dx ; 1F2h 130 130 dec dx 131 131 dec dx ; Base port … … 139 139 ; AX: ID WORD specific for detected controller 140 140 ; Returns: 141 ; AL: Max supported PIO mode 142 ; AH: FLGH_DPT_IORDY if IORDY supported, zero otherwise141 ; AL: Max supported PIO mode (only if ZF set) 142 ; AH: ~FLGH_DPT_IORDY if IORDY not supported, -1 otherwise (only if ZF set) 143 143 ; BX: Min PIO cycle time (only if ZF set) 144 144 ; ZF: Set if PIO limit necessary … … 148 148 ;-------------------------------------------------------------------- 149 149 PDC20x30_GetMaxPioModeToALandMinPioCycleTimeToBX: 150 cmp ah, ID_PDC20 630151 j e SHORT .Return ; No need to limit anything152 mov ax, 2; Limit PIO to 2 for ID_PDC20230150 cmp ah, ID_PDC20230 151 jne SHORT .Return ; No need to limit anything for ID_PDC20630 152 mov ax, (~FLGH_DPT_IORDY & 0FFh) << 8 | 2 ; Limit PIO to 2 for ID_PDC20230 153 153 mov bx, PIO_2_MIN_CYCLE_TIME_NS 154 stc155 154 .Return: 156 155 ret … … 206 205 ;-------------------------------------------------------------------- 207 206 SetSpeedForDriveInCX: 208 eMOVZX bx, BYTE [di+DPT_ADVANCED_ATA.bPioMode] 209 MIN_U bl, 2 ; Limit to PIO2 210 mov bl, [cs:bx+.rgbPioModeToPDCspeedValue] 207 mov bx, .rgbPioModeToPDCspeedValue 208 mov al, [di+DPT_ADVANCED_ATA.bPioMode] 209 MIN_U al, 2 ; Limit to PIO2 210 cs xlat 211 xchg bx, ax 211 212 212 213 add dx, BYTE SECTOR_NUMBER_REGISTER -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/Vision.asm
r589 r592 131 131 ; AH: QDI Vision Controller ID 132 132 ; Returns: 133 ; AL: Max supported PIO mode 134 ; AH: FLGH_DPT_IORDY if IORDY supported, zero otherwise133 ; AL: Max supported PIO mode (only if ZF set) 134 ; AH: ~FLGH_DPT_IORDY if IORDY not supported, -1 otherwise (only if ZF set) 135 135 ; BX: Min PIO Cycle Time (only if ZF set) 136 136 ; ZF: Set if PIO limit necessary … … 142 142 cmp ah, ID_QD6500 143 143 jne SHORT .NoNeedToLimitForQD6580 144 145 mov ax, 2 ; Limit to PIO 2 because QD6500 does not support IORDY 144 mov ax, (~FLGH_DPT_IORDY & 0FFh) << 8 | 2 ; Limit to PIO 2 because QD6500 does not support IORDY 146 145 mov bx, PIO_2_MIN_CYCLE_TIME_NS 147 146 .NoNeedToLimitForQD6580: -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
r580 r592 104 104 ; DX: User defined P-CHS to L-CHS translate mode 105 105 ; Corrupts registers: 106 ; AX, BX , CX106 ; AX, BX 107 107 ;-------------------------------------------------------------------- 108 108 AtaID_ModifyESSIforUserDefinedLimitsAndReturnTranslateModeInDX: … … 113 113 pop ds 114 114 115 ; Load User Defined CHS or LBA to CX:AX116 mov d x, [bx+DRVPARAMS.wFlags]115 ; Load User Defined CHS or LBA to BX:AX 116 mov dl, [bx+DRVPARAMS.wFlags] ; Only load the flags we actually need 117 117 mov ax, [bx+DRVPARAMS.wCylinders] ; Or .dwMaximumLBA 118 mov cx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2118 mov bx, [bx+DRVPARAMS.wHeadsAndSectors] ; Or .dwMaximumLBA+2 119 119 120 120 push es … … 127 127 ; Apply new CHS and disable LBA (we also want to set CHS addressing) 128 128 mov [si+ATA1.wCylCnt], ax 129 eMOVZX ax, cl129 eMOVZX ax, bl 130 130 mov [si+ATA1.wHeadCnt], ax 131 mov al, ch131 mov al, bh 132 132 mov [si+ATA1.wSPT], ax 133 133 and BYTE [si+ATA1.wCaps+1], ~(A1_wCaps_LBA>>8) … … 140 140 141 141 ; Apply new LBA and disable LBA48 142 cmp cx, [si+ATA1.dwLBACnt+2]142 cmp bx, [si+ATA1.dwLBACnt+2] 143 143 ja SHORT .NoUserDefinedLBA ; Do not set larger than drive 144 144 jb SHORT .StoreNewLBA … … 147 147 .StoreNewLBA: 148 148 mov [si+ATA1.dwLBACnt], ax 149 mov [si+ATA1.dwLBACnt+2], cx149 mov [si+ATA1.dwLBACnt+2], bx 150 150 and BYTE [si+ATA6.wSetSup83+1], ~(A6_wSetSup83_LBA48>>8) 151 151 .NoUserDefinedLBA: … … 173 173 AtaID_GetMaxPioModeToAXandMinCycleTimeToCX: 174 174 ; Get PIO mode and cycle time for PIO 0...2 175 mov bx, [es:si+ATA1.bPioMode] 176 mov ax, bx ; AH = 0, AL = PIO mode 0, 1 or 2 177 eSHL_IM bx, 1 ; Shift for WORD lookup 175 %ifdef USE_386 176 movzx ax, [es:si+ATA1.bPioMode] ; AH = 0, AL = PIO mode 0, 1 or 2 177 %else 178 mov al, [es:si+ATA1.bPioMode] 179 cbw 180 %endif 181 mov bx, ax 182 eSHL_IM bx, 1 ; Shift for WORD lookup 178 183 mov cx, [cs:bx+.rgwPio0to2CycleTimeInNanosecs] 179 184 180 185 ; Check if IORDY is supported 181 186 test BYTE [es:si+ATA2.wCaps+1], A2_wCaps_IORDY >> 8 182 jz SHORT .ReturnPioTimings ; No PIO 3 or higher if no IORDY183 mov ah, FLGH_DPT_IORDY 187 jz SHORT .ReturnPioTimings ; No PIO 3 or higher if no IORDY 188 mov ah, FLGH_DPT_IORDY ; *FIXME* Actually, CF specification v4.1 says that use of IORDY is invalid for PIO modes 5 and 6. 184 189 185 190 ; Check if Advanced PIO modes are supported (3 and above) … … 187 192 jz SHORT .ReturnPioTimings 188 193 189 ; Get Advanced PIO mode 190 ; (Hard Disks supports up to 4 but CF cards can support 5 and 6)191 mov bl, [es:si+ATA2.bPIOSupp]194 ; Get Advanced PIO mode (Hard Disks supports up to 4 but CF cards can support 5 and 6) 195 or bh, [es:si+ATA2.bPIOSupp] 196 jz SHORT .ReturnPioTimings 192 197 .CheckNextFlag: 193 198 inc ax 194 shr b l, 1199 shr bh, 1 195 200 jnz SHORT .CheckNextFlag 196 201 MIN_U al, 6 ; Make sure not above lookup tables -
trunk/XTIDE_Universal_BIOS/Src/Initialization/DetectPrint.asm
r589 r592 150 150 push bp 151 151 mov bp, sp 152 %ifndef CHECK_FOR_UNUSED_ENTRYPOINTS 153 %if DRVDETECTINFO.szDrvName = 0 154 push bx 155 %else 152 156 lea si, [bx+DRVDETECTINFO.szDrvName] 153 157 push si 158 %endif 159 %endif 154 160 mov si, g_szDriveName 155 161 jmp SHORT DetectPrint_FormatCSSIfromParamsInSSBP -
trunk/XTIDE_Universal_BIOS/Src/Initialization/FloppyDrive.asm
r567 r592 190 190 LOAD_BDA_SEGMENT_TO ds, ax 191 191 mov al, [BDA.wEquipment] ; Load Equipment WORD low byte 192 and al, 0C1h ; Leave bits 7..6 and 0 193 eAAM 64 194 add al, ah ; AL = Floppy Drive count 192 195 pop ds 193 194 %ifdef USE_UNDOC_INTEL195 and al, 0C1h196 eAAM 64197 %else198 mov ah, al ; Copy it to AH199 and ax, 0C001h ; Leave bits 15..14 and 0200 eROL_IM ah, 2 ; EW low byte bits 7..6 to 1..0201 %endif ; USE_UNDOC_INTEL202 203 add al, ah ; AL = Floppy Drive count204 196 %endif ; USE_AT 205 197 -
trunk/XTIDE_Universal_BIOS/Src/Initialization/Interrupts.asm
r589 r592 239 239 .ClearBitFrom8259MaskRegister: 240 240 push cx 241 xchg ax, cx ; IRQ index to CL 241 xchg cx, ax ; IRQ index to CL 242 in al, dx ; Read Interrupt Mask Register 242 243 mov ch, ~1 ; Load bit mask to be rotated 243 244 rol ch, cl ; Rotate mask to correct position for clearing 244 in al, dx ; Read Interrupt Mask Register245 245 and al, ch ; Clear wanted bit 246 246 out dx, al ; Write modified Interrupt Mask Register
Note:
See TracChangeset
for help on using the changeset viewer.