Changeset 117 for trunk/bootcode/regular
- Timestamp:
- Apr 8, 2017, 12:27:15 AM (8 years ago)
- Location:
- trunk/bootcode/regular
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bootcode/regular/bootmenu.asm
r102 r117 691 691 mov ah, [si+LocIPT_SystemID] 692 692 693 IFDEF AUX_DEBUG 694 mov al, ' ' 695 call VideoIO_PrintSingleChar 696 mov al, ah 697 call VideoIO_PrintHexByte 698 mov al, ' ' 699 call VideoIO_PrintSingleChar 700 ENDIF 693 IFDEF AUX_DEBUG 694 IF 1 695 pushf 696 pusha 697 mov al, ' ' 698 call VideoIO_PrintSingleChar 699 mov al, ah 700 call VideoIO_PrintHexByte 701 mov al, ' ' 702 call VideoIO_PrintSingleChar 703 popa 704 popf 705 ENDIF 706 ENDIF 701 707 702 708 mov al, ah … … 723 729 mov al, [si+25h] 724 730 725 IFDEF AUX_DEBUG 726 call VideoIO_PrintHexByte 727 ENDIF 731 IFDEF AUX_DEBUG 732 IF 1 733 pushf 734 pusha 735 call VideoIO_PrintHexByte 736 popa 737 popf 738 ENDIF 739 ENDIF 728 740 729 741 mov dh,al -
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] -
trunk/bootcode/regular/other.asm
r111 r117 167 167 168 168 ; Copyright 169 mov si, offset Copyright169 mov si, [offset Copyright] 170 170 call MBR_Teletype 171 171 xor si,si … … 198 198 mov ah, 03h 199 199 int 13h 200 ;! 201 ;! TODO: Check success 202 ;! Yes, we should check for errors here, coz it would mean AirBoot 203 ;! was loaded from a disk where the MBR cannot be written ! 204 ;! 200 205 201 206 ; ============================================================================= … … 227 232 pushf 228 233 229 mov bx, offset [TrueSecs] 230 add bx,cx 231 add bx,cx 232 add bx,cx 233 add bx,cx 234 mov bx, offset [TrueSecs] 235 add bx,cx 236 add bx,cx 237 add bx,cx 238 add bx,cx 239 240 IFDEF AUX_DEBUG 241 IF 0 242 pushf 243 pusha 244 mov al, '#' 245 call AuxIO_Teletype 246 mov ax, [bx] 247 call AuxIO_TeletypeHexWord 248 mov al, '#' 249 call AuxIO_Teletype 250 call AuxIO_TeletypeNL 251 popa 252 popf 253 ENDIF 254 ENDIF 255 234 256 popf 235 257 … … 276 298 ; ============================================================================= 277 299 278 279 ; Write some debug-info to the com-port280 300 IFDEF AUX_DEBUG 301 IF 1 302 call DEBUG_Dump1 281 303 ENDIF 304 ENDIF 282 305 283 306 ;~ jz NoValidMasterLVM … … 299 322 ; call AuxIO_TeletypeNL 300 323 301 324 ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 302 325 303 326 ; Huge Disk indicator … … 392 415 call PRECRAP_CheckConfiguration 393 416 417 418 IFDEF AUX_DEBUG 419 IF 1 420 mov dl, [BIOS_BootDisk] 421 ;~ mov dl, 81h 422 call DriveIO_LocateMasterLVMSector 423 call DEBUG_DumpRegisters 424 mov si, offset [TmpSector] 425 call AuxIO_DumpSector 426 ENDIF 427 ENDIF 394 428 395 429 ; ======================================= -
trunk/bootcode/regular/partmain.asm
r111 r117 1122 1122 1123 1123 IFDEF AUX_DEBUG 1124 pusha 1125 mov si,offset [ptetb] 1126 call AuxIO_Print 1127 call DEBUG_DumpRegisters 1128 call AuxIO_TeletypeNL 1129 mov ax, word ptr [FreeDriveletterMap+00h] 1130 mov dx, word ptr [FreeDriveletterMap+02h] 1131 call AuxIO_TeletypeBinDWord 1132 popa 1124 IF 1 1125 pushf 1126 pusha 1127 mov si,offset [ptetb] 1128 call AuxIO_Print 1129 call DEBUG_DumpRegisters 1130 call AuxIO_TeletypeNL 1131 mov ax, word ptr [FreeDriveletterMap+00h] 1132 mov dx, word ptr [FreeDriveletterMap+02h] 1133 call AuxIO_TeletypeBinDWord 1134 popa 1135 popf 1136 ENDIF 1133 1137 ENDIF 1134 1138 … … 1969 1973 1970 1974 IFDEF AUX_DEBUG 1971 pusha 1972 call AuxIO_TeletypeNL 1973 mov bx, [PhysDiskBpbIndex] 1974 inc bx 1975 mov al, [di+bx] 1976 call AuxIO_TeletypeHexByte 1977 mov bl,[BootPartNo] 1978 mov al, [DriveLetters+bx] 1979 call AuxIO_TeletypeHexByte 1980 mov al, [PartitionVolumeLetters+bx] 1981 add al, 3dh 1982 call AuxIO_TeletypeHexByte 1983 mov al, [LVMdl] 1984 add al, 3dh 1985 call AuxIO_TeletypeHexByte 1986 mov al, [si+LocIPT_SystemID] 1987 call AuxIO_TeletypeHexByte 1988 mov al,[FSType] 1989 call AuxIO_TeletypeHexByte 1990 popa 1975 IF 1 1976 pushf 1977 pusha 1978 call AuxIO_TeletypeNL 1979 mov bx, [PhysDiskBpbIndex] 1980 inc bx 1981 mov al, [di+bx] 1982 call AuxIO_TeletypeHexByte 1983 mov bl,[BootPartNo] 1984 mov al, [DriveLetters+bx] 1985 call AuxIO_TeletypeHexByte 1986 mov al, [PartitionVolumeLetters+bx] 1987 add al, 3dh 1988 call AuxIO_TeletypeHexByte 1989 mov al, [LVMdl] 1990 add al, 3dh 1991 call AuxIO_TeletypeHexByte 1992 mov al, [si+LocIPT_SystemID] 1993 call AuxIO_TeletypeHexByte 1994 mov al,[FSType] 1995 call AuxIO_TeletypeHexByte 1996 popa 1997 popf 1998 ENDIF 1991 1999 ENDIF 1992 2000 … … 2105 2113 2106 2114 2107 IFDEF AUX_DEBUG 2115 IFDEF AUX_DEBUG 2116 IF 1 2117 pushf 2108 2118 pusha 2109 call DEBUG_Dump22110 ;~ call DEBUG_DumpBSSSectors2111 call DEBUG_DumpDriveLetters2112 call DEBUG_DumpVolumeLetters2113 call AuxIO_TeletypeNL2119 call DEBUG_Dump2 2120 ;~ call DEBUG_DumpBSSSectors 2121 call DEBUG_DumpDriveLetters 2122 call DEBUG_DumpVolumeLetters 2123 call AuxIO_TeletypeNL 2114 2124 popa 2115 ENDIF 2125 popf 2126 ENDIF 2127 ENDIF 2116 2128 2117 2129 -
trunk/bootcode/regular/partscan.asm
r111 r117 68 68 mov byte ptr [CurIO_Scanning], 0 ; Reset flag due scanning complete 69 69 70 IFDEF AUX_DEBUG 71 ;~ pusha 72 ;~ call DEBUG_DumpHidePartTables 73 ;~ popa 74 ENDIF 70 IFDEF AUX_DEBUG 71 IF 0 72 pushf 73 pusha 74 call DEBUG_DumpHidePartTables 75 popa 76 popf 77 ENDIF 78 ENDIF 79 75 80 ; Use X-Reference to sync NewPartitionTable with Hide-Config 76 81 call PARTSCAN_SyncHideConfigWithXref 77 82 78 IFDEF AUX_DEBUG 79 ;~ pusha 80 ;~ call DEBUG_DumpHidePartTables 81 ;~ popa 82 ENDIF 83 IFDEF AUX_DEBUG 84 IF 0 85 pushf 86 pusha 87 call DEBUG_DumpHidePartTables 88 popa 89 popf 90 ENDIF 91 ENDIF 83 92 84 93 ; Now we copy the new IPT over the old one... … … 418 427 PARTSCAN_CheckThisPartition Proc Near Uses di si 419 428 429 local PartSystemID:byte, PartTypeFlags:byte 430 local PartCRC:word, PartPtr:word 431 420 432 IFDEF AUX_DEBUG 421 433 IF 0 … … 437 449 ENDIF 438 450 439 local PartSystemID:byte, PartTypeFlags:byte440 local PartCRC:word, PartPtr:word441 451 442 452 mov wptr [PartPtr], si ; Save Pointer to PartitionEntry … … 512 522 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 513 523 adc dx, wptr [CurPartition_Location+2] ; sectors 514 mov si, offset LVMSector 524 525 mov si, offset [LVMSector] 526 515 527 call LVM_SearchForPartition ; Search for DX:AX partition 528 516 529 jnc PCCTP_CheckBootRecord 517 530 ; Check, if volume has driveletter assigned and remember it for later … … 1078 1091 1079 1092 1080 IFDEF AUX_DEBUG 1081 ;~ pusha 1082 ;~ mov al,dl 1083 ;~ call AuxIO_TeletypeHexByte 1084 ;~ call AuxIO_TeletypeNL 1085 ;~ popa 1086 ENDIF 1093 IFDEF AUX_DEBUG 1094 IF 0 1095 pushf 1096 pusha 1097 mov al,dl 1098 call AuxIO_TeletypeHexByte 1099 call AuxIO_TeletypeNL 1100 popa 1101 popf 1102 ENDIF 1103 ENDIF 1087 1104 1088 1105 … … 1098 1115 1099 1116 IFDEF AUX_DEBUG 1100 ; debug code 1101 ;~ mov ax,di 1102 ;~ call AuxIO_TeletypeHexWord 1103 ;~ call AuxIO_TeletypeNL 1117 IF 0 1118 pushf 1119 pusha 1120 mov ax,di 1121 call AuxIO_TeletypeHexWord 1122 call AuxIO_TeletypeNL 1123 popa 1124 popf 1125 ENDIF 1104 1126 ENDIF 1105 1127 -
trunk/bootcode/regular/videoio.asm
r94 r117 887 887 push dx 888 888 ; Offset of array containing LVM SPT values for each disk found 889 mov bx,offset TrueSecs889 mov bx,offset [TrueSecs] 890 890 ; DX to index 891 891 xor dh,dh
Note:
See TracChangeset
for help on using the changeset viewer.