Changeset 623 in xtideuniversalbios for trunk/XTIDE_Universal_BIOS/Src
- Timestamp:
- Jun 15, 2022, 2:48:59 PM (2 years ago)
- Location:
- trunk/XTIDE_Universal_BIOS/Src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdeDPT.asm
r622 r623 133 133 mov [di+DPT_ADVANCED_ATA.wMinPioCycleTime], bx 134 134 135 ; We have detected 32-bit controller so change Device Type since 136 ; it might have been set to 16-bit on IDEVARS 137 ; 138 ; Change to 32-bit on 386 builds only. We leave AT builds unchanged for faster troubleshooting 139 ; and for uncommon systems, like IBM 486SLC2 processors that can have VLB motherboard even though 140 ; the IBM 486SLC2 is externally 16-bit CPU 135 ; We have detected 32-bit controller so change Device Type 136 ; since it might have been set to 16-bit on IDEVARS 141 137 .ChangeTo32bitDevice: 142 %ifdef USE_386 138 ; *FIXME* We might need to add code to detect the IBM 486SLC2 CPU (and possibly other 139 ; 386+ class CPUs with a 16-bit external bus?) to avoid changing to DEVICE_32BIT_ATA. 143 140 mov BYTE [di+DPT_ATA.bDevice], DEVICE_32BIT_ATA 144 %endif145 141 .NoAdvancedControllerDetected: 146 142 %endif ; MODULE_ADVANCED_ATA -
trunk/XTIDE_Universal_BIOS/Src/Device/IDE/IdePioBlock.asm
r601 r623 43 43 ALIGN JUMP_ALIGN 44 44 IdePioBlock_ReadFromXtideRev1: 45 UNROLL_SECTORS_IN_CX_TO_OWORDS 45 %ifdef EXTRA_LOOP_UNROLLING_LARGE 46 UNROLL_SECTORS_IN_CX_TO_32WORDS 47 %elifdef EXTRA_LOOP_UNROLLING_SMALL 48 UNROLL_SECTORS_IN_CX_TO_16WORDS 49 %else 50 UNROLL_SECTORS_IN_CX_TO_OWORDS 51 %endif 46 52 mov bl, 8 ; Bit mask for toggling data low/high reg 47 53 ALIGN JUMP_ALIGN 48 .InswLoop: 49 %rep 8 ; WORDs 54 .NextIteration: 55 %ifdef EXTRA_LOOP_UNROLLING_LARGE 56 %rep 32 ; WORDs 50 57 XTIDE_INSW 51 58 %endrep 52 loop .InswLoop 59 dec cx 60 %ifdef USE_386 61 jnz .NextIteration 62 %else 63 jz SHORT .BlockTransferred 64 jmp .NextIteration 65 66 ALIGN JUMP_ALIGN 67 .BlockTransferred: 68 %endif 69 %elifdef EXTRA_LOOP_UNROLLING_SMALL 70 %rep 16 ; WORDs 71 XTIDE_INSW 72 %endrep 73 %ifdef USE_186 74 loop .NextIteration 75 %else 76 dec cx 77 jz SHORT .BlockTransferred 78 jmp .NextIteration 79 80 ALIGN JUMP_ALIGN 81 .BlockTransferred: 82 %endif 83 %else 84 %rep 8 ; WORDs 85 XTIDE_INSW 86 %endrep 87 loop .NextIteration 88 %endif 53 89 ret 54 90 … … 67 103 ALIGN JUMP_ALIGN 68 104 IdePioBlock_ReadFromXtideRev2_Olivetti: 69 UNROLL_SECTORS_IN_CX_TO_OWORDS 70 ALIGN JUMP_ALIGN 71 .InswLoop: 72 %rep 8 ; WORDs 105 %ifdef EXTRA_LOOP_UNROLLING_LARGE 106 UNROLL_SECTORS_IN_CX_TO_32WORDS 107 %elifdef EXTRA_LOOP_UNROLLING_SMALL 108 UNROLL_SECTORS_IN_CX_TO_16WORDS 109 %else 110 UNROLL_SECTORS_IN_CX_TO_OWORDS 111 %endif 112 ALIGN JUMP_ALIGN 113 .NextIteration: 114 %ifdef EXTRA_LOOP_UNROLLING_LARGE 115 %rep 32 ; WORDs 73 116 XTIDE_MOD_OLIVETTI_INSW 74 117 %endrep 75 loop .InswLoop 118 dec cx 119 %ifdef USE_386 120 jnz .NextIteration 121 %else 122 jz SHORT .BlockTransferred 123 jmp .NextIteration 124 125 ALIGN JUMP_ALIGN 126 .BlockTransferred: 127 %endif 128 %elifdef EXTRA_LOOP_UNROLLING_SMALL 129 %rep 16 ; WORDs 130 XTIDE_MOD_OLIVETTI_INSW 131 %endrep 132 loop .NextIteration 133 %else 134 %rep 8 ; WORDs 135 XTIDE_MOD_OLIVETTI_INSW 136 %endrep 137 loop .NextIteration 138 %endif 76 139 ret 77 140 … … 96 159 rep insb 97 160 ret 161 98 162 %else ; 808x 99 UNROLL_SECTORS_IN_CX_TO_OWORDS 100 ALIGN JUMP_ALIGN 101 .ReadNextOword: 163 %ifdef EXTRA_LOOP_UNROLLING_LARGE 164 UNROLL_SECTORS_IN_CX_TO_32WORDS 165 %elifdef EXTRA_LOOP_UNROLLING_SMALL 166 UNROLL_SECTORS_IN_CX_TO_16WORDS 167 %else 168 UNROLL_SECTORS_IN_CX_TO_OWORDS 169 %endif 170 ALIGN JUMP_ALIGN 171 .NextIteration: 172 %ifdef EXTRA_LOOP_UNROLLING_LARGE 173 %rep 64 ; BYTEs 174 in al, dx ; Read BYTE 175 stosb ; Store BYTE to [ES:DI] 176 %endrep 177 dec cx 178 jz SHORT .BlockTransferred 179 jmp .NextIteration 180 181 ALIGN JUMP_ALIGN 182 .BlockTransferred: 183 %elifdef EXTRA_LOOP_UNROLLING_SMALL 184 %rep 32 ; BYTEs 185 in al, dx ; Read BYTE 186 stosb ; Store BYTE to [ES:DI] 187 %endrep 188 loop .NextIteration 189 %else 102 190 %rep 16 ; BYTEs 103 191 in al, dx ; Read BYTE 104 192 stosb ; Store BYTE to [ES:DI] 105 193 %endrep 106 loop .ReadNextOword 194 loop .NextIteration 195 %endif 107 196 ret 108 197 %endif … … 132 221 133 222 %else ; 808x 134 UNROLL_SECTORS_IN_CX_TO_OWORDS 135 ALIGN JUMP_ALIGN 136 .ReadNextOword: 137 %rep 8 ; WORDs 223 %ifdef EXTRA_LOOP_UNROLLING_LARGE 224 UNROLL_SECTORS_IN_CX_TO_32WORDS 225 %elifdef EXTRA_LOOP_UNROLLING_SMALL 226 UNROLL_SECTORS_IN_CX_TO_16WORDS 227 %else 228 UNROLL_SECTORS_IN_CX_TO_OWORDS 229 %endif 230 ALIGN JUMP_ALIGN 231 .NextIteration: 232 %ifdef EXTRA_LOOP_UNROLLING_LARGE 233 %rep 32 ; WORDs 138 234 in ax, dx ; Read WORD 139 235 stosw ; Store WORD to [ES:DI] 140 236 %endrep 141 loop .ReadNextOword 237 %elifdef EXTRA_LOOP_UNROLLING_SMALL 238 %rep 16 ; WORDs 239 in ax, dx ; Read WORD 240 stosw ; Store WORD to [ES:DI] 241 %endrep 242 %else 243 %rep 8 ; WORDs 244 in ax, dx ; Read WORD 245 stosw ; Store WORD to [ES:DI] 246 %endrep 247 %endif 248 loop .NextIteration 142 249 ret 143 250 %endif … … 174 281 ALIGN JUMP_ALIGN 175 282 IdePioBlock_WriteToXtideRev1: 283 %ifdef EXTRA_LOOP_UNROLLING_LARGE 284 UNROLL_SECTORS_IN_CX_TO_16WORDS 285 %elifdef EXTRA_LOOP_UNROLLING_SMALL 286 UNROLL_SECTORS_IN_CX_TO_OWORDS 287 %else 176 288 UNROLL_SECTORS_IN_CX_TO_QWORDS 289 %endif 177 290 mov bl, 8 ; Bit mask for toggling data low/high reg 178 291 ALIGN JUMP_ALIGN 179 .OutswLoop: 292 .NextIteration: 293 %ifdef EXTRA_LOOP_UNROLLING_LARGE 294 %rep 16 ; WORDs 295 XTIDE_OUTSW 296 %endrep 297 %ifdef USE_186 298 loop .NextIteration 299 %else 300 dec cx 301 jz SHORT .BlockTransferred 302 jmp .NextIteration 303 304 ALIGN JUMP_ALIGN 305 .BlockTransferred: 306 %endif 307 %elifdef EXTRA_LOOP_UNROLLING_SMALL 308 %rep 8 ; WORDs 309 XTIDE_OUTSW 310 %endrep 311 loop .NextIteration 312 %else 180 313 %rep 4 ; WORDs 181 314 XTIDE_OUTSW 182 315 %endrep 183 loop .OutswLoop 316 loop .NextIteration 317 %endif 184 318 ret 185 319 … … 198 332 ALIGN JUMP_ALIGN 199 333 IdePioBlock_WriteToXtideRev2: 334 %ifdef EXTRA_LOOP_UNROLLING_LARGE 335 UNROLL_SECTORS_IN_CX_TO_16WORDS 336 %elifdef EXTRA_LOOP_UNROLLING_SMALL 337 UNROLL_SECTORS_IN_CX_TO_OWORDS 338 %else 200 339 UNROLL_SECTORS_IN_CX_TO_QWORDS 201 ALIGN JUMP_ALIGN 202 .WriteNextQword: 340 %endif 341 ALIGN JUMP_ALIGN 342 .NextIteration: 343 %ifdef EXTRA_LOOP_UNROLLING_LARGE 344 %rep 16 ; WORDs 345 XTIDE_MOD_OUTSW 346 %endrep 347 %ifdef USE_186 348 loop .NextIteration 349 %else 350 dec cx 351 jz SHORT .BlockTransferred 352 jmp .NextIteration 353 354 ALIGN JUMP_ALIGN 355 .BlockTransferred: 356 %endif 357 %elifdef EXTRA_LOOP_UNROLLING_SMALL 358 %rep 8 ; WORDs 359 XTIDE_MOD_OUTSW 360 %endrep 361 loop .NextIteration 362 %else 203 363 %rep 4 ; WORDs 204 364 XTIDE_MOD_OUTSW 205 365 %endrep 206 loop .WriteNextQword 366 loop .NextIteration 367 %endif 207 368 ret 208 369 … … 227 388 228 389 %else ; 808x 390 %ifdef EXTRA_LOOP_UNROLLING_LARGE 391 UNROLL_SECTORS_IN_CX_TO_16WORDS 392 %elifdef EXTRA_LOOP_UNROLLING_SMALL 393 UNROLL_SECTORS_IN_CX_TO_OWORDS 394 %else 229 395 UNROLL_SECTORS_IN_CX_TO_QWORDS 230 ALIGN JUMP_ALIGN 231 .WriteNextQword: 396 %endif 397 ALIGN JUMP_ALIGN 398 .NextIteration: 399 %ifdef EXTRA_LOOP_UNROLLING_LARGE 400 %rep 32 ; BYTEs 401 lodsb ; Load BYTE from [DS:SI] 402 out dx, al ; Write BYTE 403 %endrep 404 %elifdef EXTRA_LOOP_UNROLLING_SMALL 405 %rep 16 ; BYTEs 406 lodsb ; Load BYTE from [DS:SI] 407 out dx, al ; Write BYTE 408 %endrep 409 %else 232 410 %rep 8 ; BYTEs 233 411 lodsb ; Load BYTE from [DS:SI] 234 412 out dx, al ; Write BYTE 235 413 %endrep 236 loop .WriteNextQword 414 %endif 415 loop .NextIteration 237 416 ret 238 417 %endif … … 260 439 261 440 %else ; 808x 441 %ifdef EXTRA_LOOP_UNROLLING_LARGE 442 UNROLL_SECTORS_IN_CX_TO_16WORDS 443 %elifdef EXTRA_LOOP_UNROLLING_SMALL 444 UNROLL_SECTORS_IN_CX_TO_OWORDS 445 %else 262 446 UNROLL_SECTORS_IN_CX_TO_QWORDS 263 ALIGN JUMP_ALIGN 264 .WriteNextQword: 447 %endif 448 ALIGN JUMP_ALIGN 449 .NextIteration: 450 %ifdef EXTRA_LOOP_UNROLLING_LARGE 451 %rep 16 ; WORDs 452 lodsw ; Load WORD from [DS:SI] 453 out dx, ax ; Write WORD 454 %endrep 455 %elifdef EXTRA_LOOP_UNROLLING_SMALL 456 %rep 8 ; WORDs 457 lodsw ; Load WORD from [DS:SI] 458 out dx, ax ; Write WORD 459 %endrep 460 %else 265 461 %rep 4 ; WORDs 266 462 lodsw ; Load WORD from [DS:SI] 267 463 out dx, ax ; Write WORD 268 464 %endrep 269 loop .WriteNextQword 465 %endif 466 loop .NextIteration 270 467 ret 271 468 %endif -
trunk/XTIDE_Universal_BIOS/Src/Initialization/AdvancedAta/AdvAtaInit.asm
r622 r623 188 188 ; as I/O delay. 189 189 ; 190 ; AdvAtaInit_In WithDelay190 ; AdvAtaInit_InputWithDelay 191 191 ; Parameters: 192 192 ; DX: Port to read from … … 195 195 ; Corrupts registers: 196 196 ; Nothing 197 ;-------------------------------------------------------------------- 197 ;-------------------------------------------------------------------- 198 198 AdvAtaInit_InputWithDelay: 199 199 in al, dx -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/FindDPT.asm
r621 r623 65 65 66 66 cmp ah, dl ; Check second drive if two, first drive if only one 67 j zSHORT .CalcDPTForDriveNumber67 je SHORT .CalcDPTForDriveNumber 68 68 cmp al, dl ; Check first drive in all cases, redundant but OK to repeat 69 jn zSHORT .DiskIsNotHandledByThisBIOS69 jne SHORT .DiskIsNotHandledByThisBIOS 70 70 %else 71 71 cmp dl, ah ; Above last supported? … … 100 100 101 101 test dl, dl 102 js .harddisk102 js SHORT .Harddisk 103 103 104 104 call RamVars_UnpackFlopCntAndFirstToAL … … 106 106 107 107 ALIGN JUMP_ALIGN 108 . harddisk:108 .Harddisk: 109 109 sub dl, al ; subtract off beginning of either hard disk or floppy list (as appropriate) 110 110 %else … … 114 114 .CalcDPTForNewDrive: 115 115 mov al, LARGEST_DPT_SIZE 116 117 116 mul dl 118 117 add ax, RAMVARS_size ; Clears CF (will not overflow) -
trunk/XTIDE_Universal_BIOS/Src/VariablesAndDPTs/RamVars.asm
r592 r623 135 135 136 136 137 ;--------------------------------------------------------------------138 ; RamVars_GetCountOfKnownDrivesToAX139 ; Parameters:140 ; DS: RAMVARS segment141 ; Returns:142 ; AX: Total hard disk count143 ; Corrupts registers:144 ; None145 ;--------------------------------------------------------------------146 ALIGN JUMP_ALIGN147 RamVars_GetCountOfKnownDrivesToAX:148 mov ax, [RAMVARS.wFirstDrvAndCount]149 add al, ah150 and ax, BYTE 7fh151 ret152 153 ;--------------------------------------------------------------------154 ; RamVars_GetIdeControllerCountToCX155 ; Parameters:156 ; Nothing157 ; Returns:158 ; CX: Number of IDE controllers to handle159 ; Corrupts registers:160 ; Nothing161 ;--------------------------------------------------------------------162 ALIGN JUMP_ALIGN163 RamVars_GetIdeControllerCountToCX:164 eMOVZX cx, [cs:ROMVARS.bIdeCnt]165 ret166 167 168 137 %ifdef MODULE_SERIAL_FLOPPY 169 138 ;-------------------------------------------------------------------- … … 184 153 ret 185 154 %endif 155 156 157 ;-------------------------------------------------------------------- 158 ; RamVars_GetIdeControllerCountToCX 159 ; Parameters: 160 ; Nothing 161 ; Returns: 162 ; CX: Number of IDE controllers to handle 163 ; Corrupts registers: 164 ; Nothing 165 ;-------------------------------------------------------------------- 166 ALIGN JUMP_ALIGN 167 RamVars_GetIdeControllerCountToCX: 168 eMOVZX cx, [cs:ROMVARS.bIdeCnt] 169 ret 170 171 172 ;-------------------------------------------------------------------- 173 ; RamVars_GetCountOfKnownDrivesToAX 174 ; Parameters: 175 ; DS: RAMVARS segment 176 ; Returns: 177 ; AX: Total hard disk count 178 ; Corrupts registers: 179 ; None 180 ;-------------------------------------------------------------------- 181 ALIGN JUMP_ALIGN 182 RamVars_GetCountOfKnownDrivesToAX: 183 mov ax, [RAMVARS.wFirstDrvAndCount] 184 add al, ah 185 and ax, BYTE 7Fh 186 ret
Note:
See TracChangeset
for help on using the changeset viewer.