Changeset 52 for trunk/BOOTCODE/SETUP
- Timestamp:
- Apr 13, 2014, 4:45:41 PM (12 years ago)
- File:
-
- 1 edited
-
trunk/BOOTCODE/SETUP/PART_SET.ASM (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/SETUP/PART_SET.ASM
r51 r52 620 620 je PSCPN_NotLVMSupported 621 621 622 ; ------------------------------------------------------------[LVM CHECK]--- 623 ; Load LVM-Sector here and seek to PartitionName 624 ; Set CurPartition_Location information of destination partition 625 mov ax, [si+LocIPT_AbsolutePartTable] 626 mov [CurPartition_Location+0], ax 627 mov ax, [si+LocIPT_AbsolutePartTable+2] 628 mov [CurPartition_Location+2], ax 629 mov ah, byte ptr [si+LocIPT_LocationPartTable+0] 630 mov al, byte ptr [si+LocIPT_Drive] 631 mov [CurPartition_Location+4], ax 632 mov ax, [si+LocIPT_LocationPartTable+1] 633 mov [CurPartition_Location+6], ax 634 mov di, si ; Put SI into DI 635 call DriveIO_LoadLVMSector 636 jnc PSCPN_LVMGotError ; Security again, if problem -> halt 637 push dx 622 ; 623 ; BOOKMARK: LVM Label Manipulations 624 ; 625 626 ; ------------------------------------------------------------[LVM CHECK]--- 627 ; Load LVM-Sector here and seek to PartitionName 628 ; Set CurPartition_Location information of destination partition 629 mov ax, [si+LocIPT_AbsolutePartTable] 630 mov [CurPartition_Location+0], ax 631 mov ax, [si+LocIPT_AbsolutePartTable+2] 632 mov [CurPartition_Location+2], ax 633 mov ah, byte ptr [si+LocIPT_LocationPartTable+0] 634 mov al, byte ptr [si+LocIPT_Drive] 635 mov [CurPartition_Location+4], ax 636 mov ax, [si+LocIPT_LocationPartTable+1] 637 mov [CurPartition_Location+6], ax 638 mov di, si ; Put SI into DI 639 call DriveIO_LoadLVMSector 640 jnc PSCPN_LVMGotError ; Security again, if problem -> halt 641 push dx 638 642 mov ax, [di+LocIPT_AbsoluteBegin] 639 643 mov dx, [di+LocIPT_AbsoluteBegin+2] 640 644 call LVM_SearchForPartition 641 pop dx642 jnc PSCPN_LVMGotError ; Not Found? -> display error and halt645 pop dx 646 jnc PSCPN_LVMGotError ; Not Found? -> display error and halt 643 647 644 648 645 649 ; Point to LVM VolumeName 646 add si, LocLVM_VolumeName 647 648 649 xchg si, di ; SI-IPTEntry, DI-LVM PartName 650 jmp PSCPN_CheckPartName ; Check, if match... 651 652 653 654 PSCPN_LVMGotError: 655 jmp MBR_LoadError 656 657 658 659 ; mov si, di ; Restore SI and bootrecord fall-back 660 PSCPN_NotLVMSupported: 661 ; ----------------------------------------------------[BOOT-RECORD CHECK]--- 662 ; Load Boot-Record... 663 push dx 650 add si, LocLVM_VolumeName 651 652 653 xchg si, di ; SI-IPTEntry, DI-LVM PartName 654 jmp PSCPN_CheckPartName ; Check, if match... 655 656 657 658 PSCPN_LVMGotError: 659 jmp MBR_LoadError 660 661 662 663 ; mov si, di ; Restore SI and bootrecord fall-back 664 PSCPN_NotLVMSupported: 665 ; ----------------------------------------------------[BOOT-RECORD CHECK]--- 666 ; Load Boot-Record... 667 ; BOOKMARK: Load Boot Record 668 push dx 664 669 mov ax, [si+LocIPT_AbsoluteBegin+0] 665 670 mov bx, [si+LocIPT_AbsoluteBegin+2] … … 668 673 mov dl, [si+LocIPT_Drive] 669 674 call DriveIO_LoadPartition 670 pop dx671 672 ; We seek to Partition Label within boot-record here673 mov di, offset PartitionSector674 675 push si675 pop dx 676 677 ; We seek to Partition Label within boot-record here 678 mov di, offset PartitionSector 679 680 push si 676 681 mov al, [si+LocIPT_SystemID] 677 682 call PART_SearchFileSysName 678 683 ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSysNamePtr 679 pop si680 681 test ah, FileSysFlags_NoName ; If NoName by FileSysFlag682 jnz PSCPN_LetUserEditPartName ; -> don't put it into BR at anytime683 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting684 jz PSCPN_ResumeNormal685 add di, 1Ch ; Fix for FAT 32, shit686 PSCPN_ResumeNormal:687 add di, 2Bh ; ES:DI - Name of Partition688 689 690 691 692 693 ; This code is used for BR and LVM checking694 ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied695 ; to the IPT, this compare fails when the LVM_PartitionName is not696 ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName697 ; is updated. If they are the same, both are upated so they are the same698 ; again after the edit.699 700 PSCPN_CheckPartName:684 pop si 685 686 test ah, FileSysFlags_NoName ; If NoName by FileSysFlag 687 jnz PSCPN_LetUserEditPartName ; -> don't put it into BR at anytime 688 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting 689 jz PSCPN_ResumeNormal 690 add di, 1Ch ; Fix for FAT 32, shit 691 PSCPN_ResumeNormal: 692 add di, 2Bh ; ES:DI - Name of Partition 693 694 695 696 697 698 ; This code is used for BR and LVM checking 699 ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied 700 ; to the IPT, this compare fails when the LVM_PartitionName is not 701 ; the same as the LVM_VolumeName. In that case, only the LVM_VolumeName 702 ; is updated. If they are the same, both are upated so they are the same 703 ; again after the edit. 704 705 PSCPN_CheckPartName: 701 706 702 707 ; Do no synchronization initially. 703 708 mov byte ptr [SyncLvmLabels],0 704 709 705 ; SI = IPT_Enty, DI points to LVM VolumeName.710 ; SI = IPT_Enty, DI points to LVM VolumeName. 706 711 707 712 ; If the partition is an LVM partition then disable editing completely. … … 709 714 jnz no_type_35h 710 715 711 ; Cannot boot LVM-Data partitions712 pusha713 mov cx, 0C04h714 mov si, offset TXT_SETUP_NoEditType35715 call SETUP_ShowErrorBox716 popa716 ; Cannot boot LVM-Data partitions 717 pusha 718 mov cx, 0C04h 719 mov si, offset TXT_SETUP_NoEditType35 720 call SETUP_ShowErrorBox 721 popa 717 722 718 723 … … 740 745 741 746 742 mov cx, 11 ; Partition-Name-Length = 11 Bytes743 push si744 push di747 mov cx, 11 ; Partition-Name-Length = 11 Bytes 748 push si 749 push di 745 750 add si, LocIPT_Name ; DS:SI -> Partition-Name 746 751 repz cmpsb 747 pop di748 pop si749 jne PSCPN_LetUserEditPartName ; -> No BR/LVM Changing/Saving750 751 mov byte ptr [ChangePartNameSave], 1 ; Remember, so we will save to BR752 753 ; SI = IPT_Enty, DI points to LVM PartitionName.754 PSCPN_LetUserEditPartName:755 ; User will now edit the volume label...756 mov cx, 11757 add si, LocIPT_Name ; DS:SI -> Partition-Name758 call VideoIO_LetUserEditString ; -> does actual editing759 jnc PSCPN_AllDone ; Did user abort ?760 761 test byte ptr [ChangePartNameSave], 1762 jz PSCPN_AllDone ; Actually we just skip BR/LVM-Save763 764 ; Check, where to save 2nd destination to...765 766 ;movzx bx, dl767 mov bl,dl768 mov bh,0769 770 cmp byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM771 je PSCPN_SaveBootRecord772 773 774 ; Make DI point to LVM VolumeName in LVM-entry775 ;~ sub di,20752 pop di 753 pop si 754 jne PSCPN_LetUserEditPartName ; -> No BR/LVM Changing/Saving 755 756 mov byte ptr [ChangePartNameSave], 1 ; Remember, so we will save to BR 757 758 ; SI = IPT_Enty, DI points to LVM PartitionName. 759 PSCPN_LetUserEditPartName: 760 ; User will now edit the volume label... 761 mov cx, 11 762 add si, LocIPT_Name ; DS:SI -> Partition-Name 763 call VideoIO_LetUserEditString ; -> does actual editing 764 jnc PSCPN_AllDone ; Did user abort ? 765 766 test byte ptr [ChangePartNameSave], 1 767 jz PSCPN_AllDone ; Actually we just skip BR/LVM-Save 768 769 ; Check, where to save 2nd destination to... 770 771 ;movzx bx, dl 772 mov bl,dl 773 mov bh,0 774 775 cmp byte ptr [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM 776 je PSCPN_SaveBootRecord 777 778 779 ; Make DI point to LVM VolumeName in LVM-entry 780 ;~ sub di,20 776 781 777 782 ; Points to LVM VolumeName. … … 831 836 832 837 LVM_no_sync_labels: 833 834 ; Update LVM-CRC now... 835 mov si, offset LVMSector 836 call LVM_UpdateSectorCRC 837 IFDEF ReleaseCode 838 call DriveIO_SaveLVMSector ; Save sector 839 ENDIF 840 jmp PSCPN_AllDone 841 842 ; -----------------------------------------------------[BOOT-RECORD SAVE]--- 843 PSCPN_SaveBootRecord: 844 ; Copy 11 bytes from IPT to Boot-Record 845 mov cx, 11 846 push si 847 rep movsb ; Copy IPT-name to Boot-Record 848 pop si 849 IFDEF ReleaseCode 850 call DriveIO_SavePartition ; Saves Boot-Record 851 ENDIF 852 853 ; And reset VIBR-CRC, otherwise virus-warning and system-halt 854 sub si, LocIPT_Name ; Now pointer points to base again... 855 call PART_UpdateBootRecordCRC 856 857 PSCPN_AllDone: 858 ; This here is done for safety, because we misused CurPartition_Location 859 xor ax, ax 860 mov di, offset CurPartition_Location 861 mov cx, 4 862 rep stosw ; NUL out CurPartition_Location 863 ret 838 ; Update LVM-CRC now... 839 mov si, offset LVMSector 840 call LVM_UpdateSectorCRC 841 IFDEF ReleaseCode 842 call DriveIO_SaveLVMSector ; Save sector 843 ENDIF 844 jmp PSCPN_AllDone 845 846 ; -----------------------------------------------------[BOOT-RECORD SAVE]--- 847 ; BOOKMARK: Save Boot Record (After change from Setup Menu) 848 PSCPN_SaveBootRecord: 849 ; Copy 11 bytes from IPT to Boot-Record 850 mov cx, 11 851 push si 852 rep movsb ; Copy IPT-name to Boot-Record 853 pop si 854 IFDEF ReleaseCode 855 call DriveIO_SavePartition ; Saves Boot-Record 856 ENDIF 857 858 ; And reset VIBR-CRC, otherwise virus-warning and system-halt 859 ; BOOKMARK: Update CRC on Partition Sector 860 sub si, LocIPT_Name ; Now pointer points to base again... 861 mov bx, offset [PartitionSector] 862 call PART_UpdateBootRecordCRC 863 864 PSCPN_AllDone: 865 ; This here is done for safety, because we misused CurPartition_Location 866 xor ax, ax 867 mov di, offset CurPartition_Location 868 mov cx, 4 869 rep stosw ; NUL out CurPartition_Location 870 ret 864 871 PARTSETUP_ChangePartitionName EndP 865 872
Note:
See TracChangeset
for help on using the changeset viewer.
