Changeset 31 for trunk/BOOTCODE/REGULAR
- Timestamp:
- Jan 13, 2013, 8:15:35 AM (13 years ago)
- Location:
- trunk/BOOTCODE/REGULAR
- Files:
-
- 6 edited
-
AUXIO.ASM (modified) (1 diff)
-
BOOTMENU.ASM (modified) (2 diffs)
-
DRIVEIO.ASM (modified) (11 diffs)
-
OTHER.ASM (modified) (1 diff)
-
PARTMAIN.ASM (modified) (15 diffs)
-
STD_TEXT.ASM (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/REGULAR/AUXIO.ASM
r30 r31 25 25 ; ----------------------- 26 26 ; Output some stuff to the serial port. 27 ; Word at 1B0h inMBR must be initialized for this.27 ; The aux parameters in the MBR must be initialized for this. 28 28 ; Lower byte is com-port, 0=disabled, 1=com1, etc. 29 29 ; High byte is initialization; see below. (0e3h) -
trunk/BOOTCODE/REGULAR/BOOTMENU.ASM
r30 r31 190 190 mov cx, CLR_INFO_WINDOW_BM 191 191 ;mov cx, 0C06h ; brown, main background 192 call VideoIO_Color ; Rousseau:color info window192 call VideoIO_Color ; Ccolor info window 193 193 194 194 mov bx, 1401h … … 211 211 212 212 mov cx, CLR_INFO_TEXT_BM ; Info text 213 call VideoIO_Color ; Rousseau: color info text213 call VideoIO_Color ; Color info text 214 214 215 215 mov si, offset TXT_BootMenuHelpText1 -
trunk/BOOTCODE/REGULAR/DRIVEIO.ASM
r30 r31 61 61 mov si, offset Configuration ; Calculate new checksum 62 62 xor bx, bx 63 mov cx, 5 ; Total of 5 Config-Sectors 63 64 ; Changed from 5 to calculated 65 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 66 mov cx, (MBR_BackUpMBR - Configuration) / 2 ; Size of the ab-configuration 67 ; TASM does not evaluate expression above corrrectly. 68 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 69 ; Casting to byte also does not work (overflow). 70 ; So we swap back here -- must be removed in JWasm version !! 71 xchg ch,cl 72 64 73 mov dx, [CFG_CheckConfig] 65 74 mov [CFG_CheckConfig], bx … … 73 82 mov dx, 0080h ; First harddrive, Sector 55... 74 83 mov cx, 0037h 75 mov ax, 0305h ; Function 03, 5 sectors to write 84 85 ; Changed from 5 to calculated 86 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 87 mov ax, (MBR_BackUpMBR - Configuration) / 2 ; sizeof(ab-configuration) to write 88 ; TASM does not evaluate expression above corrrectly. 89 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 90 ; Casting to byte also does not work (overflow). 91 ; So we swap back here -- must be removed in JWasm version !! 92 xchg ah,al 93 mov ah,03h 94 76 95 int 13h 77 96 jnc DIOSC_NoError … … 147 166 ; This is calculated by Sector*Heads. Comparing will get done with Bit 25-10 148 167 ; on LBA sectors, so we actually divide sector number by 1024. 149 DriveIO_InitLBASwitchTable Proc Near Uses es di ; Rousseau: LBA !168 DriveIO_InitLBASwitchTable Proc Near Uses es di 150 169 mov di, offset LBASwitchTable 151 170 mov dh, TotalHarddiscs … … 166 185 mov ah,0 167 186 168 mov bl, dh ; DH -> head count ; Rousseau: nope, it's max head number !187 mov bl, dh ; DH -> max head number 169 188 mul bl ; AX = Sectors*Heads 170 189 shl ah, 1 … … 188 207 ; Rousseau: Enhanced to handle sector-numbers 127 and 255 besides 63 for LVM-info sectors. 189 208 ; Ugly, need to cleanup. 190 DriveIO_LVMAdjustToInfoSector Proc Near Uses ; Rousseau: LVM stuff !209 DriveIO_LVMAdjustToInfoSector Proc Near Uses 191 210 192 211 … … 555 574 mov cx, wptr cs:[CurPartition_Location+6] ; Gets cur. partition location 556 575 557 call DriveIO_LVMAdjustToInfoSector ; Rousseau: LVM stuff !576 call DriveIO_LVMAdjustToInfoSector 558 577 559 578 mov si, offset LVMSector … … 593 612 ;popf 594 613 595 call LVM_CheckSectorSignature ; Rousseau: LVM stuff !614 call LVM_CheckSectorSignature 596 615 jnc DIOLLVMS_NoLVMSector 597 call LVM_CheckSectorCRC ; Rousseau: LVM stuff !616 call LVM_CheckSectorCRC 598 617 jnc DIOLLVMS_NoLVMSector 599 618 ret … … 662 681 ; Preserve: all registers 663 682 ; ######################################################################### 664 DriveIO_LoadSector Proc Near Uses ax bx ds si es di ; Rousseau: Disk IO683 DriveIO_LoadSector Proc Near Uses ax bx ds si es di 665 684 test cs:[CurIO_UseExtension], 1 666 685 jz DIOLS_UseNormal 667 ; Are we forced do use LBA via Setting? 668 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA 686 ; Are we forced do use LBA via Setting? ; Rousseau: LBA 669 687 jnz DIOLS_UseExtension 670 688 ; Is the drive not a harddrive? … … 685 703 pop es 686 704 mov bx, si ; ES:BX - Destination 687 mov ax, 0201h ; Function 2 - Load Sector ; Rousseau: Disk IO -- legacy BIOS call705 mov ax, 0201h ; Function 2 - Load Sector 688 706 int 13h 689 707 jnc DIOLS_Success … … 704 722 pop ds 705 723 mov si, offset DriveIO_DAP 706 mov ah, 42h ; Extended Read ; Rousseau: Disk IO -- extended BIOS call724 mov ah, 42h ; Extended Read 707 725 int 13h 708 726 pop cx … … 728 746 jz DIOSS_UseNormal 729 747 ; Are we forced do use LBA via Setting? 730 test cs:[CFG_ForceLBAUsage], 1 ; Rousseau: LBA748 test cs:[CFG_ForceLBAUsage], 1 731 749 jnz DIOSS_UseExtension 732 750 ; Is the drive not a harddrive? -
trunk/BOOTCODE/REGULAR/OTHER.ASM
r30 r31 363 363 mov si, offset Configuration 364 364 xor bx, bx 365 mov cx, 5 ; Total of 5 Sectors 365 366 ; Changed from 5 to calculated 367 ; Fixes issue: #2987 -- "air-boot doesn't remember drive letter" 368 mov cx, (MBR_BackUpMBR - Configuration) / 2 ; Size of the ab-configuration 369 ; TASM does not evaluate expression above corrrectly. 370 ; Listing shows correct opcode but generated opcode has imm. word byteswapped. 371 ; Casting to byte also does not work (overflow). 372 ; So we swap back here -- must be removed in JWasm version !! 373 xchg ch,cl 374 366 375 mov dx, CFG_CheckConfig 367 376 mov CFG_CheckConfig, bx -
trunk/BOOTCODE/REGULAR/PARTMAIN.ASM
r30 r31 435 435 ret 436 436 PART_FillOutSizeElement EndP 437 438 439 440 441 442 443 444 445 446 447 448 ; This routine is called to hide a partition 449 ; In: DL - Partition to hide 450 ; Destroyed: None 451 PART_HidePartition Proc Near Uses ax bx cx dx si di 452 call PART_GetPartitionPointer ; Pointer to partition (DL) -> SI 453 454 ; First load the partition table of that partition... 455 mov ax, wptr [si+LocIPT_AbsolutePartTable+0] 456 mov bx, wptr [si+LocIPT_AbsolutePartTable+2] 457 mov cx, wptr [si+LocIPT_LocationPartTable+1] 458 mov dh, bptr [si+LocIPT_LocationPartTable+0] 459 mov dl, [si+LocIPT_Drive] 460 call DriveIO_LoadPartition 461 ; Partition-Table now LOADED 462 mov di, offset PartitionSector+446 ; ES:DI - 1st partitionentry... 463 464 ; Put our partition's location into registers... 465 mov ax, wptr [si+LocIPT_AbsoluteBegin+0] 466 mov bx, wptr [si+LocIPT_AbsoluteBegin+2] 467 sub ax, wptr [si+LocIPT_AbsolutePartTable+0] 468 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2] 469 ; BX:AX - absolute position of partition relative to partition table 470 ; ...and search for it... 471 PHP_SearchLoop: 472 cmp ax, wptr es:[di+LocBRPT_RelativeBegin] 473 jne PHP_SearchMismatch 474 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2] 475 jne PHP_SearchMismatch 476 jmp PHP_SearchMatch 477 PHP_SearchMismatch: 478 add di, LocBRPT_LenOfEntry ; 16 Bytes per partition entry 479 cmp di, 500+offset PartitionSector 480 jb PHP_SearchLoop 481 jmp MBR_HaltSystem ; not found, something is wrong here 482 483 ; Found entry... 484 PHP_SearchMatch: 485 mov al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL 486 call PART_SearchFileSysHiddenID ; Put on =STEALTH= 487 mov bptr es:[di+LocBRPT_SystemID], al 488 IFDEF ReleaseCode 489 call DriveIO_SavePartition ; Saves Partition-Table 490 ENDIF 491 ret 492 PART_HidePartition EndP 493 494 ; This here is for marking the first "good" non-hidden partition as being 495 ; active. It requires the partition table at EXECBASE. 496 ; Some BIOSes have problems with no primary marked active. Actually this is 497 ; a buggy implementation, because the MBR-code should normally check, 498 ; *not* the BIOS. This one *could* cause havoc to some systems, but I can't 499 ; do anything else. 500 PART_MarkFirstGoodPrimary Proc Near Uses ax si di 501 mov di, offset PartitionSector+446 ; DS:SI - 1st partitionentry 502 ; First action to do: Remove the active flag from every partition 503 push di 504 mov cl, 4 505 PMPP_RemoveActiveFlagLoop: 506 and bptr es:[di+LocBRPT_Flags], 7Fh 507 add di, LocBRPT_LenOfEntry 508 dec cl 509 jnz PMPP_RemoveActiveFlagLoop 510 pop di 511 ; First Search, will hit on any PartitionID that is: 512 ; a) not 0 513 ; b) not hidden 514 ; c) not extended partition (05h or 0Fh) 515 PMPP_Search1Loop: 516 mov al, bptr es:[di+LocBRPT_SystemID] 517 or al, al 518 jz PMPP_Search1NoHit 519 cmp al, 05h 520 je PMPP_Search1NoHit 521 cmp al, 0Fh 522 je PMPP_Search1NoHit 523 mov bl, al ; BL == AL == PartitionID 524 push si 525 call PART_SearchFileSysName 526 pop si ; AL == UnhiddenPartitionID 527 cmp al, bl ; if ID is unhidden... 528 je PMPP_SearchHit 529 PMPP_Search1NoHit: 530 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 531 cmp di, 500+offset PartitionSector 532 jb PMPP_Search1Loop 533 534 mov di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry 535 ; Second Search, hit on anything that is not an extended partition 536 ; (05 or 0Fh) 537 PMPP_Search2Loop: 538 mov al, bptr es:[di+LocBRPT_SystemID] 539 or al, al 540 jz PMPP_Search2NoHit 541 cmp al, 05h 542 je PMPP_Search2NoHit 543 cmp al, 0Fh 544 jne PMPP_SearchHit 545 PMPP_Search2NoHit: 546 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry 547 cmp di, 500+offset PartitionSector 548 jb PMPP_Search2Loop 549 jmp PMPP_SearchFailed 550 551 PMPP_SearchHit: 552 or bptr es:[di], 80h ; SET ACTIVE PARTITION 553 PMPP_SearchFailed: 554 ret 555 PART_MarkFirstGoodPrimary EndP 556 557 ; Searches the Name and Flags to a FileSysID (PartitionID) 558 ; In: AL - FileSysID 559 ; Out: AL - Unhidden File-System-ID, AH - Flags for this File-System 560 ; SI - Pointer to Name (8char) 561 ; Destroyed: *none* 562 PART_SearchFileSysName Proc Near Uses bx dx 563 ;movzx bx, al 564 mov bl,al 565 mov bh,0 566 567 mov si, offset FileSysIDs 568 PSFSN_SearchLoop: 569 lodsw ; AL - NormalID, AH-HiddenID 570 mov dl, ds:[si] ; DL - File-System-Flags 571 inc si 572 cmp al, bl ; Check, if Unhidden-ID matches... 573 je PSFSN_Match 574 cmp ah, bl ; Check, if Hidden-ID matches... 575 je PSFSN_Match 576 mov al, bl ; So Unhidden-ID will be Original-ID 577 cmp ah, 0 ; Unknown (last ID in table) 578 je PSFSN_Match 579 inc bh 580 jmp PSFSN_SearchLoop 581 582 PSFSN_Match: 583 ; AL is already Unhidden-ID 584 mov ah, dl 585 ; AH is now the FileSystem-Flag 586 ;movzx bx, bh 587 mov bl,bh 588 mov bh,0 589 590 shl bx, 3 ; Offsets * 8 591 mov si, offset FileSysNames 592 add si, bx 593 ret 594 PART_SearchFileSysName EndP 595 596 ; Searches the Hidden ID corresponding to a FileSysID (PartitionID) 597 ; In: AL - FileSysID 598 ; Out: AL - Hidden File-System-ID 599 PART_SearchFileSysHiddenID Proc Near Uses bx 600 ;movzx bx, al 601 mov bl,al 602 mov bh,0 603 604 mov si, offset FileSysIDs 605 PSFSHI_SearchLoop: 606 lodsw ; AL - NormalID, AH-HiddenID 607 inc si 608 cmp al, bl ; Check, if Unhidden-ID matches... 609 je PSFSHI_Match 610 cmp ah, bl ; Check, if Hidden-ID matches... 611 je PSFSHI_Match 612 mov ah, bl ; So Unhidden-ID will get replied... 613 cmp ah, 0 ; Unknown (last ID in table) 614 je PSFSHI_Match 615 inc bh 616 jmp PSFSHI_SearchLoop 617 618 PSFSHI_Match: 619 mov al, ah ; AL = Hidden ID 620 ret 621 PART_SearchFileSysHiddenID EndP 622 623 ; In: DS:SI - Partition-Name, CX - Maximum/Total Length 624 ; Out: Carry-Flag set, if valid Partition-Name 625 ; Destroyed: None 626 PART_CheckForValidPartName Proc Near Uses ax cx dx si 627 ; Our logic is as follows: 628 ; If all chars are U -> Invalid (due reformated signature) 629 ; If anything below 32, but 0 -> Invalid (due invalid chars) 630 ; If anything above 165 -> Invalid (due invalid chars) 631 ; If anything between 123-128 -> Invalid (due invalid chars) 632 ; DX - holds count of 'U's 633 push cx 634 or cx, cx 635 jz PCFVPN_InvalidName 636 xor dx, dx 637 PCFVPN_CheckLoop: 638 lodsb 639 cmp al, 0 640 je PCFVPN_ValidChar 641 cmp al, 32 642 jb PCFVPN_InvalidName 643 cmp al, 165 644 ja PCFVPN_InvalidName 645 cmp al, 123 646 jb PCFVPN_ValidChar 647 cmp al, 128 648 jbe PCFVPN_InvalidName 649 PCFVPN_ValidChar: 650 cmp al, 'U' 651 jne PCFVPN_NoMagic 652 inc dx 653 PCFVPN_NoMagic: 654 dec cx 655 jnz PCFVPN_CheckLoop 656 pop cx 657 cmp cx, dx 658 clc 659 je PCFVPN_WasMagic 660 stc 661 PCFVPN_WasMagic: 662 ret 663 PCFVPN_InvalidName: 664 pop cx 665 clc 666 ret 667 PART_CheckForValidPartName EndP 668 669 670 ; Rousseau: added 671 ; Compare a volume-label in the IPT to the install-volume 672 ; SI holds pointer to entry in IPT 673 ; CY set if this entry is also the install-volume 674 PART_IsInstallVolume Proc Near Uses ax cx dx si di 675 cld ; Advance upwards with lodsb 676 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars) 677 678 mov cx, 11 ; Maximum length of label 679 xor dl, dl ; Not found yet 680 681 ; Compare next character 682 PART_IsInstallVolumeNext: 683 lodsb ; Load byte from SI (IPT-entry) 684 ;cmp al,' ' ; If space then use zero 685 ;jne PART_IsInstallVolume_skip1 686 ;xor al,al 687 PART_IsInstallVolume_skip1: 688 xchg ah,al ; Save char to AH 689 xchg si,di ; Exchange pointers 690 lodsb ; Load byte from SI (install-volume label) 691 ;cmp al,' ' ; If space then use zero 692 ;jne PART_IsInstallVolume_skip2 693 ;xor al,al 694 PART_IsInstallVolume_skip2: 695 xchg si,di ; Reexchange pointers 696 call AuxIO_Teletype 697 call CONV_ToUpper 698 call AuxIO_Teletype 699 xchg al,ah 700 call AuxIO_Teletype 701 call CONV_ToUpper 702 call AuxIO_Teletype 703 call AuxIO_TeletypeNL 704 705 ; Are both of them zero ? 706 ; Then the names could be the same, but cx must not equal 11 707 ; because that would indicate a null-string. 708 mov dh,al 709 or dh,ah 710 jz PART_IsInstallVolumeFound 711 712 cmp ah,al ; Are the the same ? 713 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended 714 loop PART_IsInstallVolumeNext ; Yep, Compare next character 715 716 PART_IsInstallVolumeFound: 717 ; If CX is still 11 this was a zero string 718 ; and thus not a valid volume-name. 719 ; This should not occur as this function is only called when the first 720 ; byte is non-zero. 721 cmp cx,11 722 je PART_IsInstallVolumeNotFound 723 ; Found ! 724 mov dl,1 ; Found 725 jmp PART_IsInstallVolumeEnd 726 727 728 PART_IsInstallVolumeNotFound: 729 mov dl,0 730 jmp PART_IsInstallVolumeEnd 731 732 733 PART_IsInstallVolumeEnd: 734 ; Set the status in CY 735 mov al,dl 736 add al,'0' 737 call AuxIO_TeletypeHexByte 738 call AuxIO_TeletypeNL 739 rcr dl,1 ; Put found-flag in CY 740 ret 741 PART_IsInstallVolume EndP 437 742 438 743 … … 525 830 mov dh, bptr [si+LocIPT_LocationPartTable+0] 526 831 mov dl, [si+LocIPT_Drive] 527 call DriveIO_LoadPartition ; Load Table... ; Rousseau: LOAD PARTITION ! 832 833 call DriveIO_LoadPartition ; Load Table... [LOAD] 834 528 835 ; --------------------------------------------------- MODIFY PARTITION TABLE 529 836 push cs … … 565 872 or byte ptr es:[di+LocBRPT_Flags], 80h ; set ACTIVE partition 566 873 IFDEF ReleaseCode 567 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE PARTITION !874 call DriveIO_SavePartition ; Saves the Partition-Table [SAVE] 568 875 ENDIF 569 876 … … 578 885 ; BX:AX -> Absolute End-Position of Partition 579 886 580 test CFG_ForceLBAUsage, 1 ; Rousseau: LBA887 test CFG_ForceLBAUsage, 1 581 888 jnz PSP_ForceI13X 582 889 ; LBA-boundary at 16450560 (FB0400h) (16320x16x63) … … 641 948 mov cx, 0001h ; Cylinder 0, Sector 1 642 949 mov dx, 0080h ; First HD, Head 0 643 call DriveIO_LoadPartition ; Load Primary Partition Table ; Rousseau: LOAD MBR ! 950 ; Load MBR 951 call DriveIO_LoadPartition ; Load Primary Partition Table 644 952 call PART_MarkFirstGoodPrimary 645 953 IFDEF ReleaseCode 646 call DriveIO_SavePartition ; Saves the Partition-Table ; Rousseau: SAVE MBR ! 954 ; Save MBR 955 call DriveIO_SavePartition ; Saves the Partition-Table 647 956 ENDIF 648 957 PSP_NoHideAdjustPrimaryMark: … … 716 1025 mov dh, [si+LocIPT_LocationBegin+0] 717 1026 mov dl, [si+LocIPT_Drive] 718 call DriveIO_LoadPartition ; Loads boot-sector... ; Rousseau: LOAD PART BOOT-SECTOR !!1027 call DriveIO_LoadPartition ; Loads boot-sector... [PARTBOOTSEC] 719 1028 720 1029 test CFG_DetectVIBR, 1 … … 806 1115 807 1116 ; Rousseau: # Boot Logical Partitions) 808 ; FreeDOS and eCS on extpart on non-huge needs special support. (old ja jump) 809 ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. (also when offset at 20MiB) 810 ; PCD7 bonkt vast als in 2GiB log at start of space. "Starting PC DOS..." verschijnt. PCD Loader probleem. 1117 ; FreeDOS and eCS on extpart on non-huge needs special support. 1118 ; (old ja jump) 1119 ; PC-DOS7 on huge pri fat16 2G works with both (XP too) when at start of disk. 1120 ; (also when offset at 20MiB) 1121 ; PCD7 bonkt vast als in 2GiB log at start of space. 1122 ; "Starting PC DOS..." verschijnt. PCD Loader probleem. 811 1123 ; Offset van start-of-disk bij PCD7 niet meer dan 2GiB maken. 812 1124 ; Special is needed to boot ECS-CXXVAC (log-part) on Douwskie Box with 40G disk. … … 819 1131 ; Laatste 63 is MBR. 820 1132 ; 821 ; It seems PRI's already get special treatment in that they get their hidden secs updated. 822 ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, but AiR-BOOT corrects it before booting) 1133 ; It seems PRI's already get special treatment in that they get their 1134 ; hidden secs updated. 1135 ; (100MB HD, moved 50MB PRI-DOS part UP, DFSee complains about wrong hidden, 1136 ; but AiR-BOOT corrects it before booting) 823 1137 824 1138 ; FreeDOS zet 63 in SPT in BPB op 255/255 geo !!!! … … 829 1143 830 1144 ; Display volume-name 1145 ; Just before booting the selected partition 831 1146 pushf 1147 pusha 832 1148 push si 833 1149 add si, LocIPT_Name 834 1150 call MBR_TeletypeVolName 835 1151 xor si,si 836 call MBR_TeletypeNL ; Rousseau: Just before booting the selected partition1152 call MBR_TeletypeNL 837 1153 pop si 1154 popa 838 1155 popf 839 1156 840 1157 841 1158 842 jmp special ; Rousseau: GOT IT !!! (LOG-BOOT) (alleen op huge disks !) 843 ;jmp PSP_NoSpecialSupport 844 ;ja PSP_NoSpecialSupport ; Rousseau: original M. Kiewitz... 845 ;jbe PSP_NoSpecialSupport ; had to change to opposite ! 1159 1160 1161 1162 ; 1163 ; This section will be sanitized in the JWasm version. 1164 ; 1165 1166 jmp special 1167 ;jmp PSP_NoSpecialSupport 1168 1169 ;ja PSP_NoSpecialSupport 1170 ;jbe PSP_NoSpecialSupport 846 1171 847 1172 … … 855 1180 ; Special Support needed 856 1181 special: 857 ; Write actual drive-letter to partition boot-record. 858 ; This is according to BPB. 1182 ; Write actual drive-letter to partition boot-record in memory. 859 1183 mov al, bptr [si+LocIPT_Drive] 1184 860 1185 ; Also an influence with FreeDOS ! 861 1186 ; Generates JFS ERROR when not set correctly !!! 862 mov bptr es:[di+36], al ; Write Actual Drive-Letter (80h id first drive) !!!!!!!!!!!!!!!!!!!!!!! 1187 mov bptr es:[di+36], al ; Write Actual Drive-Letter to 1188 ; PBR in RAM. (BIOS notation) 1189 1190 ; 1191 ; Display drive info (debug) 1192 ; 1193 push ax 1194 mov al,' ' 1195 call VideoIO_PrintSingleChar 1196 pop ax 1197 call VideoIO_PrintHexByte 1198 mov al,'-' 1199 call VideoIO_PrintSingleChar 1200 1201 ; 1202 ; Absolute offset of volume 1203 ; 1204 mov ax, [si+LocIPT_AbsoluteBegin+2] 1205 call VideoIO_PrintHexWord 1206 mov ax, [si+LocIPT_AbsoluteBegin] 1207 call VideoIO_PrintHexWord 1208 mov al,'-' 1209 call VideoIO_PrintSingleChar 1210 1211 ; 1212 ; Relative offset (3fh/63 with logicals) 1213 ; 1214 mov ax,es:[di+30] 1215 call VideoIO_PrintHexWord 1216 mov ax,es:[di+28] 1217 call VideoIO_PrintHexWord 863 1218 864 1219 ; This could be incorrect when a partition is moved, 865 1220 ; or the system installer puts the wrong value here. 866 ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not a the start of the disk. 1221 ; FreeDOS (log-part) i.e. puts 03fH (63d) here, eventhough it is not 1222 ; at the start of the disk. 867 1223 ; This fixing is done by OS/2 BM as well, according to Martin. 868 1224 mov ax, [si+LocIPT_AbsoluteBegin] … … 876 1232 ;jmp PSP_NoLogicalSupport 877 1233 1234 1235 ; 1236 ; Test if the drive-letter feature is active for this partition. 1237 ; If so, then the drive that the user defined will be placed at 1238 ; byte 25h (37d) of the in-ram PartitionSector (BPB). 1239 ; (BIOS 80h notation: 80h=C, 81h=D, etc.) 1240 ; This is a remedy for when the corresponding field (25h) in the BPB on 1241 ; disk is zero. 1242 ; 878 1243 test byte ptr [si+LocIPT_Flags], Flags_DriveLetter 879 1244 jz PSP_NoLogicalSupport … … 886 1251 mov bptr es:[di+37], al ; Write Drive Letter (OS/2 only) 887 1252 1253 ; Display dl-feature drive if active 1254 push ax 1255 mov al,'-' 1256 call VideoIO_PrintSingleChar 1257 pop ax 1258 call VideoIO_PrintHexByte 1259 888 1260 ; -------------------------------------------- COPY BOOT-RECORD TO STARTBASE 889 1261 PSP_NoLogicalSupport: 1262 1263 1264 mov al,'-' 1265 call VideoIO_PrintSingleChar 1266 mov al,[ExtendedAbsPosSet] 1267 call VideoIO_PrintHexByte 1268 1269 890 1270 push si 891 1271 mov ax, StartBaseSeg … … 896 1276 rep movsw 897 1277 pop si 898 ; ---------------------------------------------------- NOW START BOOT-RECORD ; Rousseau: START PARTITION BOOT-RECORD !! 1278 ; ---------------------------------------------------- NOW START BOOT-RECORD 1279 1280 899 1281 900 1282 … … 903 1285 ENDIF 904 1286 905 ; 906 ; ########################### WAIT FOR KEY ################################ 907 ; 908 909 ; Rousseau: 910 ; Wait for key so we can see which volume is going to be started. 911 ;xor ax, ax 912 ;int 16h 913 ;cmp al, 1bh ; is escape-key ? 914 ;jne skip_reenter 915 916 ;jmp MBR_Main_ReEnterBootMenuPre ; yep, re-enter boot-menu 917 918 skip_reenter: 919 920 921 922 923 924 925 1287 1288 1289 1290 ; 1291 ; ################################## BYE BYE ################################## 1292 ; 1293 1294 ; 1295 ; Wait for keypress 1296 ; 1297 xor ax, ax 1298 int 16h 1299 1300 ; Is escape-key ? 1301 cmp al, 1bh 1302 1303 ; Nope, Go activate PBR loader 1304 jne start_pbr 1305 1306 ; Yep, Reenter bootmenu 1307 jmp MBR_Main_ReEnterBootMenuPre 1308 1309 1310 1311 ; 1312 ; Transfer control to the PBR 1313 ; 1314 start_pbr: 926 1315 927 1316 ; … … 936 1325 mov dl, cs:[si+LocIPT_Drive] ; Drive Physical No 937 1326 1327 ; 1328 ; JUMP TO PBR loader 1329 ; 938 1330 IFDEF ReleaseCode 939 db 0EAh ; JUMP TO Entry Point...Bye Bye1331 db 0EAh 940 1332 dw StartBasePtr 941 1333 dw StartBaseSeg 942 1334 ENDIF 1335 1336 943 1337 PART_StartPartition EndP 944 1338 945 1339 946 947 948 949 950 951 952 953 954 955 ; This routine is called to hide a partition956 ; In: DL - Partition to hide957 ; Destroyed: None958 PART_HidePartition Proc Near Uses ax bx cx dx si di959 call PART_GetPartitionPointer ; Pointer to partition (DL) -> SI960 961 ; First load the partition table of that partition...962 mov ax, wptr [si+LocIPT_AbsolutePartTable+0]963 mov bx, wptr [si+LocIPT_AbsolutePartTable+2]964 mov cx, wptr [si+LocIPT_LocationPartTable+1]965 mov dh, bptr [si+LocIPT_LocationPartTable+0]966 mov dl, [si+LocIPT_Drive]967 call DriveIO_LoadPartition968 ; Partition-Table now LOADED969 mov di, offset PartitionSector+446 ; ES:DI - 1st partitionentry...970 971 ; Put our partition's location into registers...972 mov ax, wptr [si+LocIPT_AbsoluteBegin+0]973 mov bx, wptr [si+LocIPT_AbsoluteBegin+2]974 sub ax, wptr [si+LocIPT_AbsolutePartTable+0]975 sbb bx, wptr [si+LocIPT_AbsolutePartTable+2]976 ; BX:AX - absolute position of partition relative to partition table977 ; ...and search for it...978 PHP_SearchLoop:979 cmp ax, wptr es:[di+LocBRPT_RelativeBegin]980 jne PHP_SearchMismatch981 cmp bx, wptr es:[di+LocBRPT_RelativeBegin+2]982 jne PHP_SearchMismatch983 jmp PHP_SearchMatch984 PHP_SearchMismatch:985 add di, LocBRPT_LenOfEntry ; 16 Bytes per partition entry986 cmp di, 500+offset PartitionSector987 jb PHP_SearchLoop988 jmp MBR_HaltSystem ; not found, something is wrong here989 990 ; Found entry...991 PHP_SearchMatch:992 mov al, bptr es:[di+LocBRPT_SystemID] ; Partition-ID into AL993 call PART_SearchFileSysHiddenID ; Put on =STEALTH=994 mov bptr es:[di+LocBRPT_SystemID], al995 IFDEF ReleaseCode996 call DriveIO_SavePartition ; Saves Partition-Table997 ENDIF998 ret999 PART_HidePartition EndP1000 1001 ; This here is for marking the first "good" non-hidden partition as being1002 ; active. It requires the partition table at EXECBASE.1003 ; Some BIOSes have problems with no primary marked active. Actually this is1004 ; a buggy implementation, because the MBR-code should normally check,1005 ; *not* the BIOS. This one *could* cause havoc to some systems, but I can't1006 ; do anything else.1007 PART_MarkFirstGoodPrimary Proc Near Uses ax si di1008 mov di, offset PartitionSector+446 ; DS:SI - 1st partitionentry1009 ; First action to do: Remove the active flag from every partition1010 push di1011 mov cl, 41012 PMPP_RemoveActiveFlagLoop:1013 and bptr es:[di+LocBRPT_Flags], 7Fh1014 add di, LocBRPT_LenOfEntry1015 dec cl1016 jnz PMPP_RemoveActiveFlagLoop1017 pop di1018 ; First Search, will hit on any PartitionID that is:1019 ; a) not 01020 ; b) not hidden1021 ; c) not extended partition (05h or 0Fh)1022 PMPP_Search1Loop:1023 mov al, bptr es:[di+LocBRPT_SystemID]1024 or al, al1025 jz PMPP_Search1NoHit1026 cmp al, 05h1027 je PMPP_Search1NoHit1028 cmp al, 0Fh1029 je PMPP_Search1NoHit1030 mov bl, al ; BL == AL == PartitionID1031 push si1032 call PART_SearchFileSysName1033 pop si ; AL == UnhiddenPartitionID1034 cmp al, bl ; if ID is unhidden...1035 je PMPP_SearchHit1036 PMPP_Search1NoHit:1037 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry1038 cmp di, 500+offset PartitionSector1039 jb PMPP_Search1Loop1040 1041 mov di, offset PartitionSector+446 ; DS:SI - 1st Partition-Entry1042 ; Second Search, hit on anything that is not an extended partition1043 ; (05 or 0Fh)1044 PMPP_Search2Loop:1045 mov al, bptr es:[di+LocBRPT_SystemID]1046 or al, al1047 jz PMPP_Search2NoHit1048 cmp al, 05h1049 je PMPP_Search2NoHit1050 cmp al, 0Fh1051 jne PMPP_SearchHit1052 PMPP_Search2NoHit:1053 add di, LocBRPT_LenOfEntry ; 16 Bytes per Partition-Entry1054 cmp di, 500+offset PartitionSector1055 jb PMPP_Search2Loop1056 jmp PMPP_SearchFailed1057 1058 PMPP_SearchHit:1059 or bptr es:[di], 80h ; SET ACTIVE PARTITION1060 PMPP_SearchFailed:1061 ret1062 PART_MarkFirstGoodPrimary EndP1063 1064 ; Searches the Name and Flags to a FileSysID (PartitionID)1065 ; In: AL - FileSysID1066 ; Out: AL - Unhidden File-System-ID, AH - Flags for this File-System1067 ; SI - Pointer to Name (8char)1068 ; Destroyed: *none*1069 PART_SearchFileSysName Proc Near Uses bx dx1070 ;movzx bx, al1071 mov bl,al1072 mov bh,01073 1074 mov si, offset FileSysIDs1075 PSFSN_SearchLoop:1076 lodsw ; AL - NormalID, AH-HiddenID1077 mov dl, ds:[si] ; DL - File-System-Flags1078 inc si1079 cmp al, bl ; Check, if Unhidden-ID matches...1080 je PSFSN_Match1081 cmp ah, bl ; Check, if Hidden-ID matches...1082 je PSFSN_Match1083 mov al, bl ; So Unhidden-ID will be Original-ID1084 cmp ah, 0 ; Unknown (last ID in table)1085 je PSFSN_Match1086 inc bh1087 jmp PSFSN_SearchLoop1088 1089 PSFSN_Match:1090 ; AL is already Unhidden-ID1091 mov ah, dl1092 ; AH is now the FileSystem-Flag1093 ;movzx bx, bh1094 mov bl,bh1095 mov bh,01096 1097 shl bx, 3 ; Offsets * 81098 mov si, offset FileSysNames1099 add si, bx1100 ret1101 PART_SearchFileSysName EndP1102 1103 ; Searches the Hidden ID corresponding to a FileSysID (PartitionID)1104 ; In: AL - FileSysID1105 ; Out: AL - Hidden File-System-ID1106 PART_SearchFileSysHiddenID Proc Near Uses bx1107 ;movzx bx, al1108 mov bl,al1109 mov bh,01110 1111 mov si, offset FileSysIDs1112 PSFSHI_SearchLoop:1113 lodsw ; AL - NormalID, AH-HiddenID1114 inc si1115 cmp al, bl ; Check, if Unhidden-ID matches...1116 je PSFSHI_Match1117 cmp ah, bl ; Check, if Hidden-ID matches...1118 je PSFSHI_Match1119 mov ah, bl ; So Unhidden-ID will get replied...1120 cmp ah, 0 ; Unknown (last ID in table)1121 je PSFSHI_Match1122 inc bh1123 jmp PSFSHI_SearchLoop1124 1125 PSFSHI_Match:1126 mov al, ah ; AL = Hidden ID1127 ret1128 PART_SearchFileSysHiddenID EndP1129 1130 ; In: DS:SI - Partition-Name, CX - Maximum/Total Length1131 ; Out: Carry-Flag set, if valid Partition-Name1132 ; Destroyed: None1133 PART_CheckForValidPartName Proc Near Uses ax cx dx si1134 ; Our logic is as follows:1135 ; If all chars are U -> Invalid (due reformated signature)1136 ; If anything below 32, but 0 -> Invalid (due invalid chars)1137 ; If anything above 165 -> Invalid (due invalid chars)1138 ; If anything between 123-128 -> Invalid (due invalid chars)1139 ; DX - holds count of 'U's1140 push cx1141 or cx, cx1142 jz PCFVPN_InvalidName1143 xor dx, dx1144 PCFVPN_CheckLoop:1145 lodsb1146 cmp al, 01147 je PCFVPN_ValidChar1148 cmp al, 321149 jb PCFVPN_InvalidName1150 cmp al, 1651151 ja PCFVPN_InvalidName1152 cmp al, 1231153 jb PCFVPN_ValidChar1154 cmp al, 1281155 jbe PCFVPN_InvalidName1156 PCFVPN_ValidChar:1157 cmp al, 'U'1158 jne PCFVPN_NoMagic1159 inc dx1160 PCFVPN_NoMagic:1161 dec cx1162 jnz PCFVPN_CheckLoop1163 pop cx1164 cmp cx, dx1165 clc1166 je PCFVPN_WasMagic1167 stc1168 PCFVPN_WasMagic:1169 ret1170 PCFVPN_InvalidName:1171 pop cx1172 clc1173 ret1174 PART_CheckForValidPartName EndP1175 1176 1177 ; Rousseau: added1178 ; Compare a volume-label in the IPT to the install-volume1179 ; SI holds pointer to entry in IPT1180 ; CY set if this entry is also the install-volume1181 PART_IsInstallVolume Proc Near Uses ax cx dx si di1182 cld ; Advance upwards with lodsb1183 mov di, offset eCS_InstallVolume ; Address of install-volume label (max. 11 chars)1184 1185 mov cx, 11 ; Maximum length of label1186 xor dl, dl ; Not found yet1187 1188 ; Compare next character1189 PART_IsInstallVolumeNext:1190 lodsb ; Load byte from SI (IPT-entry)1191 ;cmp al,' ' ; If space then use zero1192 ;jne PART_IsInstallVolume_skip11193 ;xor al,al1194 PART_IsInstallVolume_skip1:1195 xchg ah,al ; Save char to AH1196 xchg si,di ; Exchange pointers1197 lodsb ; Load byte from SI (install-volume label)1198 ;cmp al,' ' ; If space then use zero1199 ;jne PART_IsInstallVolume_skip21200 ;xor al,al1201 PART_IsInstallVolume_skip2:1202 xchg si,di ; Reexchange pointers1203 call AuxIO_Teletype1204 call CONV_ToUpper1205 call AuxIO_Teletype1206 xchg al,ah1207 call AuxIO_Teletype1208 call CONV_ToUpper1209 call AuxIO_Teletype1210 call AuxIO_TeletypeNL1211 1212 ; Are both of them zero ?1213 ; Then the names could be the same, but cx must not equal 111214 ; because that would indicate a null-string.1215 mov dh,al1216 or dh,ah1217 jz PART_IsInstallVolumeFound1218 1219 cmp ah,al ; Are the the same ?1220 jnz PART_IsInstallVolumeNotFound ; Nope, compare ended1221 loop PART_IsInstallVolumeNext ; Yep, Compare next character1222 1223 PART_IsInstallVolumeFound:1224 ; If CX is still 11 this was a zero string1225 ; and thus not a valid volume-name.1226 ; This should not occur as this function is only called when the first1227 ; byte is non-zero.1228 cmp cx,111229 je PART_IsInstallVolumeNotFound1230 ; Found !1231 mov dl,1 ; Found1232 jmp PART_IsInstallVolumeEnd1233 1234 1235 PART_IsInstallVolumeNotFound:1236 mov dl,01237 jmp PART_IsInstallVolumeEnd1238 1239 1240 PART_IsInstallVolumeEnd:1241 ; Set the status in CY1242 mov al,dl1243 add al,'0'1244 call AuxIO_TeletypeHexByte1245 call AuxIO_TeletypeNL1246 rcr dl,1 ; Put found-flag in CY1247 ret1248 PART_IsInstallVolume EndP -
trunk/BOOTCODE/REGULAR/STD_TEXT.ASM
r30 r31 29 29 CopyrightVersionLen equ 6 30 30 ;Copyright db ' AiR-BOOT v1.06 - (c) 1998-2009 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 31 Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 032 31 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Rousseau test-version >502G (build: #24)', 0 33 32 ;Copyright db ' AiR-BOOT v1.07 - (c) 2011 M. Kiewitz - Release Candidate 1 - (build: #25)', 0 … … 36 35 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc4-b33)', 0 37 36 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz (rc5-b35)', 0 38 39 ;BootEndMsg db 'Free usage allowed, as long as you dont or have not worked for US government', 037 ;Copyright db ' AiR-BOOT v1.07 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 38 Copyright db ' AiR-BOOT v1.08 - (c) 1998-2011 M. Kiewitz, Dedicated to Gerd Kiewitz', 0 40 39 41 40 ; Rousseau: switch around 42 BootEndMsg db 'This is GPLv3+ software. Please visit http:// AiR-BOOT.sourceforge.net', 043 BootEndMsg2 db 'http://www.gnu.org/licenses/gpl.txt', 041 BootEndMsg db 'This is GPLv3+ software. Please visit http://svn.netlabs.org/air-boot', 0 42 BootEndMsg2 db 'http://www.gnu.org/licenses/gpl.txt', 0 44 43 45 44 AuxInitMsg db 'Initializing Serial Communications on COM',0 46 45 47 CheckID_MBR db 'AiRBOOT'48 BrokenHDD db ' (HDDx)', 046 CheckID_MBR db 'AiRBOOT' 47 BrokenHDD db ' (HDDx)', 0 49 48 50 49 ; Colors for special words hard-coded. Keep all 0s. 51 50 TXT_SETUP_LowerMessage db 'This software is released under ', 0, 'GPLv3+.', 0 52 ; db 'It may not be used by US government', 053 51 db 'http://www.gnu.org/licenses/gpl.txt', 0 54 52 db 'For more information and source, please visit', 0 55 db 'http://AiR-BOOT.sourceforge.net', 0 56 ; db 'Contact via e-mail: ', 0, 'm_kiewitz [AT] users.sourceforge.net', 0 53 db 'http://svn.netlabs.org/air-boot', 0 57 54 db 'Contact via e-mail: ', 0, 'airboot@ecomstation.com', 0 58 55
Note:
See TracChangeset
for help on using the changeset viewer.
