Changeset 592 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src/Initialization/AtaID.asm
- Timestamp:
- Jun 25, 2018, 10:29:27 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.