Changeset 538 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS
- Timestamp:
- Apr 11, 2013, 8:05:27 PM (12 years ago)
- google:author:
- aitotat@gmail.com
- Location:
- trunk/XTIDE_Universal_BIOS/Src/Device
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeTransfer.asm
r526 r538 78 78 mov bx, g_rgfnPioRead 79 79 call InitializePiovarsInSSBPwithSectorCountInAH 80 %ifdef USE_AT 81 jc SHORT ReturnWithTransferErrorInAH 82 %endif 80 83 81 84 ; Wait until drive is ready to transfer … … 154 157 mov bx, g_rgfnPioWrite 155 158 call InitializePiovarsInSSBPwithSectorCountInAH 159 %ifdef USE_AT 160 jc SHORT ReturnWithTransferErrorInAH 161 %endif 156 162 157 163 ; Always poll when writing first block (IRQs are generated for following blocks) … … 201 207 ; SS:BP: Ptr to PIOVARS 202 208 ; Returns: 203 ; Nothing 204 ; Corrupts registers: 205 ; AX, BX, DX 209 ; ES:SI: Normalized pointer 210 ; AH: INT 13h Error Code (only when CF set) 211 ; CF: Set of failed to normalize pointer (segment overflow) 212 ; Cleared if success 213 ; Corrupts registers: 214 ; AL, BX, DX 206 215 ;-------------------------------------------------------------------- 207 216 ALIGN JUMP_ALIGN … … 209 218 ; Store sizes and Data Port 210 219 mov [bp+PIOVARS.bSectorsLeft], ah 220 %ifdef USE_AT 221 xchg dx, ax 222 %endif 211 223 mov ax, [di+DPT.wBasePort] 212 224 mov [bp+PIOVARS.wDataPort], ax … … 280 292 ;------------------------------------ 281 293 %endif ; 26 29/26 294 clc 282 295 ret 283 296 %endif ; MODULE_8BIT_IDE_ADVANCED … … 288 301 ; IdeTransfer_NormalizePointerInESSI 289 302 ; Parameters: 303 ; DH: Number of sectors to transfer (when USE_AT defined) 290 304 ; ES:SI: Ptr to be normalized 291 305 ; Returns: 292 306 ; ES:SI: Normalized pointer (SI = 0...15) 307 ; AH: INT 13h Error Code (only when CF set) 308 ; CF: Set of failed to normalize pointer (segment overflow) 309 ; Cleared if success 293 310 ; Corrupts registers: 294 311 ; AX, DX 295 312 ;-------------------------------------------------------------------- 296 313 IdeTransfer_NormalizePointerInESSI: 314 ; Normalization can cause segment overflow if it is done when not needed 315 ; (I don't know if any software calls with such seg:off address). 316 ; This does not apply to XT systems since nothing will write to main BIOS ROM. 317 ; On AT systems things are quite different, even in protected mode the address 318 ; is passed in seg:offset form and HMA is accessible in real mode. 319 %ifdef USE_AT 320 xor dl, dl 321 shl dx, 1 322 dec dx ; Prevents normalization when bytes + offset will be zero 323 add dx, si 324 jc SHORT .NormalizationRequired 325 ret 326 .NormalizationRequired: 327 %endif ; USE_AT 328 297 329 NORMALIZE_FAR_POINTER es, si, ax, dx 298 ret 330 %ifdef USE_AT ; CF is always clear for XT builds 331 mov ah, 0 ; Clear AH and preserve CF 332 rcl ah, 1 ; RET_HD_INVALID 333 %endif 334 ret 335 299 336 300 337 -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/JrIdeTransfer.asm
r536 r538 53 53 xor ax, ax 54 54 mov [bp+MEMPIOVARS.bSectorsDone], al 55 mov al, [bp+IDEPACK.bSectorCount]56 mov [bp+MEMPIOVARS.bSectorsLeft], al55 mov dh, [bp+IDEPACK.bSectorCount] 56 mov [bp+MEMPIOVARS.bSectorsLeft], dh 57 57 mov al, [di+DPT_ATA.bBlockSize] 58 58 mov [bp+MEMPIOVARS.wSectorsInBlock], ax … … 62 62 ; Normalize pointer 63 63 call IdeTransfer_NormalizePointerInESSI 64 %ifdef USE_AT 65 jc SHORT ReturnWithMemoryIOtransferErrorInAH 66 %endif 64 67 65 68 ; Get far pointer to Sector Access Window -
trunk/XTIDE_Universal_BIOS/Src/Device/Serial/SerialCommand.asm
r526 r538 62 62 .readOrWrite: 63 63 mov [bp+IDEPACK.bFeatures],ah ; store protocol command 64 %ifdef USE_AT 65 mov dh, [bp+IDEPACK.bSectorCount] 66 %endif 64 67 call IdeTransfer_NormalizePointerInESSI 68 %ifdef USE_AT 69 jnc SHORT .PointerNormalizationWasSuccessfull 70 xor cx, cx ; Nothing transferred 71 jmp SerialCommand_ReturnError 72 .PointerNormalizationWasSuccessfull: 73 %endif 65 74 66 75 mov dx, [di+DPT_SERIAL.wSerialPortAndBaud]
Note:
See TracChangeset
for help on using the changeset viewer.