Changeset 117 for trunk/bootcode/regular/driveio.asm
- Timestamp:
- Apr 8, 2017, 12:27:15 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/driveio.asm
r116 r117 35 35 mov dl, [BIOS_BootDisk] ; We check using the boot-disk 36 36 int 13h 37 38 IFDEF AUX_DEBUG 39 IF 0 40 pushf 41 pusha 42 push si 43 mov si, offset $+5 44 jmp @F 45 db 10,'DriveIO_CheckFor13extensions:',10,0 46 @@: 47 call AuxIO_Print 48 pop si 49 call DEBUG_DumpRegisters 50 ;~ call AuxIO_DumpParagraph 51 ;~ call AuxIO_TeletypeNL 52 53 mov si, offset [INT13X_DiskParams] 54 mov word ptr [si], 50h 55 mov ah, 48h 56 int 13h 57 call DEBUG_DumpRegisters 58 ;~ call AuxIO_DumpSector 59 60 61 popa 62 popf 63 ENDIF 64 ENDIF 65 37 66 jc PCCF13E_NotFound ; Error occured 38 67 cmp bx, 0AA55h … … 351 380 ; ######################################################################### 352 381 DriveIO_LoadPartition Proc Near Uses si 382 383 IFDEF AUX_DEBUG 384 IF 0 385 pushf 386 pusha 387 push si 388 mov si, offset $+5 389 jmp @F 390 db 10,'DriveIO_LoadPartition:',10,0 391 @@: 392 call AuxIO_Print 393 pop si 394 call DEBUG_DumpRegisters 395 ;~ call AuxIO_DumpParagraph 396 ;~ call AuxIO_TeletypeNL 397 popa 398 popf 399 ENDIF 400 ENDIF 401 353 402 mov wptr cs:[CurPartition_Location+0], ax 354 403 mov wptr cs:[CurPartition_Location+2], bx … … 369 418 DIOLP_Success: 370 419 371 IFDEF AUX_DEBUG 372 ; show current partition location 373 ;~ pushf 374 ;~ pusha 375 ;~ call AuxIO_TeletypeNL 376 ;~ mov si,offset db_curpartloc 377 ;~ call AuxIO_Print 378 ;~ mov dx,word ptr [CurPartition_Location+02] 379 ;~ mov ax,word ptr [CurPartition_Location+00] 380 ;~ call AuxIO_TeletypeHexDWord 381 ;~ call AuxIO_TeletypeNL 382 ;~ mov si,offset PartitionSector 383 ;~ call AuxIO_DumpSector 384 ;~ call AuxIO_TeletypeNL 385 ;~ popa 386 ;~ popf 387 ENDIF 420 388 421 389 422 ret … … 462 495 call AuxIO_Print 463 496 pop si 464 ;~ call DEBUG_DumpRegisters 497 call DEBUG_DumpRegisters 498 call AuxIO_DumpSector 465 499 ;~ call AuxIO_DumpParagraph 466 500 ;~ call AuxIO_TeletypeNL … … 479 513 call DriveIO_LVMAdjustToInfoSector 480 514 481 mov si, offset LVMSector515 mov si, offset [LVMSector] 482 516 call DriveIO_LoadSector 483 517 484 IFDEF AUX_DEBUG 485 ; show current partition location 486 ;~ pushf 487 ;~ pusha 488 ;~ call AuxIO_TeletypeNL 489 ;~ mov si,offset db_curlvmsec 490 ;~ call AuxIO_Print 491 ;~ mov dx,bx 492 ;~ call AuxIO_TeletypeHexDWord 493 ;~ call AuxIO_TeletypeNL 494 ;~ mov si,offset LVMSector 495 ;~ call AuxIO_DumpSector 496 ;~ call AuxIO_TeletypeNL 497 ;~ popa 498 ;~ popf 499 ENDIF 518 IFDEF AUX_DEBUG 519 IF 0 520 pushf 521 pusha 522 push si 523 mov si, offset $+5 524 jmp @F 525 db 10,'lvm record ex',10,0 526 @@: 527 call AuxIO_Print 528 pop si 529 ;~ call AuxIO_TeletypeHexWord 530 ;~ call AuxIO_TeletypeNL 531 call DEBUG_DumpRegisters 532 ;~ call AuxIO_DumpSector 533 ;~ mov cx, 7 534 mov cx, 32 535 @@: 536 call AuxIO_DumpParagraph 537 call AuxIO_TeletypeNL 538 add si, 16 539 loop @B 540 popa 541 popf 542 ENDIF 543 ENDIF 544 500 545 501 546 call LVM_CheckSectorSignature … … 545 590 jnc DIOSLVMS_SevereError ; LVM Signature must be there 546 591 547 IFDEF AUX_DEBUG 548 ;~ dioatlvm db 'DriveIO_LVMAdjustToInfoSector',10,0 549 ;~ pushf 550 ;~ pusha 551 ;~ mov si,offset dioatlvm 552 ;~ call AuxIO_Print 553 ;~ popa 554 ;~ popf 555 call DEBUG_DumpRegisters 556 call DEBUG_DumpCHS 557 ENDIF 592 IFDEF AUX_DEBUG 593 IF 0 594 pushf 595 pusha 596 ;~ dioatlvm db 'DriveIO_LVMAdjustToInfoSector',10,0 597 ;~ pushf 598 ;~ pusha 599 ;~ mov si,offset dioatlvm 600 ;~ call AuxIO_Print 601 ;~ popa 602 ;~ popf 603 call DEBUG_DumpRegisters 604 call DEBUG_DumpCHS 605 popa 606 popf 607 ENDIF 608 ENDIF 558 609 559 610 call DriveIO_LVMAdjustToInfoSector 560 611 561 IFDEF AUX_DEBUG 562 call DEBUG_DumpRegisters 563 call DEBUG_DumpCHS 564 ENDIF 612 IFDEF AUX_DEBUG 613 IF 0 614 pushf 615 pusha 616 call DEBUG_DumpRegisters 617 call DEBUG_DumpCHS 618 popa 619 popf 620 ENDIF 621 ENDIF 565 622 566 623 mov si, offset LVMSector … … 621 678 call AuxIO_Print 622 679 pop si 623 ;~call DEBUG_DumpRegisters680 call DEBUG_DumpRegisters 624 681 ;~ call AuxIO_DumpParagraph 625 682 ;~ call AuxIO_TeletypeNL … … 707 764 708 765 DIOLS_Success: 766 767 IFDEF AUX_DEBUG 768 IF 0 769 pusha 770 push si 771 mov si, offset $+5 772 jmp @F 773 db 10,'sector loaded',10,0 774 @@: 775 call AuxIO_Print 776 pop si 777 ;~ call DEBUG_DumpRegisters 778 call AuxIO_DumpSector 779 ;~ call AuxIO_DumpParagraph 780 ;~ call AuxIO_TeletypeNL 781 popa 782 ENDIF 783 ENDIF 709 784 ret 710 785 DriveIO_LoadSector EndP … … 714 789 ;############################################################################## 715 790 ;# ACTION : Reads a sector from disk using INT13 extensions 791 ;# ---------------------------------------------------------------------------- 792 ;# EFFECTS : Modifies DAP structure and fills transfer buffer 716 793 ;# ---------------------------------------------------------------------------- 717 794 ;# IN : BX:CX - LBA address of sector … … 719 796 ;# ---------------------------------------------------------------------------- 720 797 ;# OUT : CF=1 - failure, AH failure code 721 ;# ----------------------------------------------------------------------------722 ;# EFFECTS : Modifies DAP structure and fills transfer buffer723 798 ;############################################################################## 724 799 DriveIO_ReadSectorLBA Proc Near Uses bx cx dx si di ds es … … 783 858 ;############################################################################## 784 859 ;# ACTION : Writes a sector to disk using INT13 extensions 860 ;# ---------------------------------------------------------------------------- 861 ;# EFFECTS : Modifies DAP structure and mofifies the disk 785 862 ;# ---------------------------------------------------------------------------- 786 863 ;# IN : AL - write flags, AL.0 verify (1.0,2.0), AL.1 verify (2.1+) … … 789 866 ;# ---------------------------------------------------------------------------- 790 867 ;# OUT : CF=1 - failure, AH failure code 791 ;# ----------------------------------------------------------------------------792 ;# EFFECTS : Modifies DAP structure and mofifies the disk793 868 ;############################################################################## 794 869 DriveIO_WriteSectorLBA Proc Near Uses bx cx dx si di ds es … … 1160 1235 ENDIF 1161 1236 1162 ;! 1163 ;! DEBUG_BLOCK 1164 ;! Force write to LBA0 to test interception routine. 1165 ;! Do *NOT* enable unless you are debugging, will overwrite MBR ! 1166 ;! 1167 ;~ __DIO_FORCE_LBA0_WRITE__ EQU 1168 IFDEF AUX_DEBUG 1169 IFDEF __DIO_FORCE_LBA0_WRITE__ 1237 1238 ;! 1239 ;! DEBUG_BLOCK 1240 ;! Force write to LBA0 to test interception routine. 1241 ;! Do *NOT* enable unless you are debugging, will overwrite MBR ! 1242 ;! 1243 IFDEF AUX_DEBUG 1244 IF 0 1245 pushf 1246 pusha 1170 1247 xor ax,ax 1171 1248 xor bx,bx … … 1173 1250 inc cx 1174 1251 xor dh,dh 1175 ENDIF 1252 popa 1253 popf 1176 1254 ENDIF 1255 ENDIF 1177 1256 1178 1257 ; … … 1210 1289 1211 1290 1212 IFDEF AUX_DEBUG 1213 pusha 1214 mov si, offset NonMBRwrite 1291 IFDEF AUX_DEBUG 1292 IF 0 1293 pushf 1294 pusha 1295 mov si, offset [NonMBRwrite] 1215 1296 call AuxIO_TeletypeNL 1216 1297 call AuxIO_Print 1217 1298 call AuxIO_TeletypeNL 1218 popa 1299 popa 1300 popf 1219 1301 ENDIF 1302 ENDIF 1220 1303 1221 1304 ; Show popup and halt the system. … … 1442 1525 call LVM_ValidateSector 1443 1526 1527 1528 1444 1529 IFDEF AUX_DEBUG 1445 1530 IF 0 … … 1454 1539 pop si 1455 1540 call DEBUG_DumpRegisters 1541 ;~ call AuxIO_DumpSector 1542 mov cx, 7 1543 @@: 1456 1544 call AuxIO_DumpParagraph 1457 1545 call AuxIO_TeletypeNL 1546 add si, 16 1547 loop @B 1458 1548 popa 1459 1549 popf … … 1590 1680 call AuxIO_Print 1591 1681 pop si 1592 ;~call DEBUG_DumpRegisters1682 call DEBUG_DumpRegisters 1593 1683 ;~ call AuxIO_DumpParagraph 1594 1684 ;~ call AuxIO_TeletypeNL … … 1615 1705 ; so we clear the whole buffer to be sure. 1616 1706 mov cx, i13xbuf_size ; Dynamically calculated by assembler. 1617 mov di, offset i13xbuf; Points to size field.1707 mov di, offset [i13xbuf] ; Points to size field. 1618 1708 mov [di],cx ; Setup buffer-size. 1619 1709 inc di … … 1626 1716 mov ah, 48h ; Get Drive Parameters (extended version) 1627 1717 ;mov dl, 80h ; Drive number 1628 mov si, offset i13xbuf; Buffer for result-info1718 mov si, offset [i13xbuf] ; Buffer for result-info 1629 1719 push dx 1630 1720 int 13h ; Call the BIOS-function … … 1689 1779 1690 1780 ; Store total secs 1691 mov bx, offset BIOS_TotalSecs1781 mov bx, offset [BIOS_TotalSecs] 1692 1782 add bx,dx 1693 1783 add bx,dx … … 1703 1793 1704 1794 ; Store number of bytes per sector 1705 mov bx, offset BIOS_Bytes1795 mov bx, offset [BIOS_Bytes] 1706 1796 add bx,dx 1707 1797 mov ax,[si+18h]
Note:
See TracChangeset
for help on using the changeset viewer.