Changeset 36 for trunk/BOOTCODE/SETUP/PART_SET.ASM
- Timestamp:
- Jan 13, 2013, 9:29:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/SETUP/PART_SET.ASM
r31 r36 600 600 pop dx 601 601 jnc PSCPN_LVMGotError ; Not Found? -> display error and halt 602 603 ; 604 ; While AiR-BOOT v1.0.8+ displays the LVM VolumeName, the LVM PartitionName 605 ; is used here to compare to the IPT. 606 ; The IPT has the LVM VolumeName, so if they differ the compare will fail 607 ; and the user-entry will noy be written to the LVM-info sector. 608 ; 602 609 add si, LocLVM_PartitionName 610 611 603 612 xchg si, di ; SI-IPTEntry, DI-LVM PartName 604 613 jmp PSCPN_CheckPartName ; Check, if match... … … 606 615 PSCPN_LVMGotError: 607 616 jmp MBR_LoadError 617 618 608 619 609 620 ; mov si, di ; Restore SI and bootrecord fall-back … … 619 630 call DriveIO_LoadPartition 620 631 pop dx 632 621 633 ; We seek to Partition Label within boot-record here 622 634 mov di, offset PartitionSector 635 623 636 push si 624 637 mov al, [si+LocIPT_SystemID] … … 626 639 ; Replies AH - FileSysFlags, AL - UnhiddenID, SI - FileSysNamePtr 627 640 pop si 641 628 642 test ah, FileSysFlags_NoName ; If NoName by FileSysFlag 629 643 jnz PSCPN_LetUserEditPartName ; -> don't put it into BR at anytime 630 644 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting 631 645 jz PSCPN_ResumeNormal 632 add di, 1Ch ; Fix f r FAT 32, shit646 add di, 1Ch ; Fix for FAT 32, shit 633 647 PSCPN_ResumeNormal: 634 add di, 2Bh ; ES:DI - Name der Partition 648 add di, 2Bh ; ES:DI - Name of Partition 649 650 651 652 635 653 636 654 ; This code is used for BR and LVM checking 655 ; Rousseau: Because AiR-BOOT v1.0.8 uses the LVM_VolumeName, which is copied 656 ; to the IPT, this compare fails when the LVM_PartitionName is not 657 ; the same as the LVM_VolumeName. 658 ; This is a protection against editing the Label when these names differ. 659 ; MiniLVM assigns the same value to both, so partitions created with MiniLVM 660 ; can be edited. 637 661 PSCPN_CheckPartName: 662 663 ; SI = IPT_Enty 664 665 ; If the partition is an LVM partition then disable editing completely. 666 cmp byte ptr [si+LocIPT_SystemID], 035h 667 jnz no_type_35h 668 jmp PSCPN_AllDone 669 no_type_35h: 670 638 671 mov cx, 11 ; Partition-Name-Length = 11 Bytes 639 672 push si di … … 642 675 pop di si 643 676 jne PSCPN_LetUserEditPartName ; -> No BR/LVM Changing/Saving 677 644 678 mov ChangePartNameSave, 1 ; Remember, so we will save to BR 645 679 … … 662 696 cmp [PartitionVolumeLetters+bx], 0 ; ==0 means not supported by LVM 663 697 je PSCPN_SaveBootRecord 664 ; -------------------------------------------------------------[LVM SAVE]--- 665 ; Copy 11 bytes from IPT into LVM-Sector also fill 9 bytes with NUL 698 699 700 ; Make DI point to LVM VolumeName in LVM-entry 701 sub di,20 702 703 ; -------------------------------------------------[LVM SAVE VOLUME NAME]--- 704 ; Copy 11 bytes from IPT into LVM VolumeName, back-padd with zero's 666 705 mov cx, 11 667 706 push si … … 671 710 mov cx, 9 672 711 rep stosb 712 713 714 ; 715 ; The AiR-BOOT Label Editor inserts spaces when a label is edited 716 ; and characters are backspaced. 717 ; This is fine for filesystem labels, which are space padded, 718 ; but the LVM VolumeName and PartitionName need to be zero padded. 719 ; So, below we replace all trailing spaces with zero's. 720 ; 721 ; Correct LVM VolumeName 722 ; 723 push di 724 mov cx,20 725 vn_padd_next: 726 jcxz vn_padded 727 dec di 728 dec cx 729 mov al,[di] 730 test al,al 731 jz vn_padd_next 732 cmp al,' ' 733 jnz vn_padded 734 mov byte ptr [di],0 735 jmp vn_padd_next 736 vn_padded: 737 pop di 738 739 740 741 742 ; ----------------------------------------------[LVM SAVE PARTITION NAME]--- 743 ; Copy 11 bytes from IPT into LVM PartitonName, back-padd with zero's 744 mov cx, 11 745 push si 746 rep movsb 747 pop si 748 xor al, al 749 mov cx, 9 750 rep stosb 751 752 753 ; 754 ; The AiR-BOOT Label Editor inserts spaces when a label is edited 755 ; and characters are backspaced. 756 ; This is fine for filesystem labels, which are space padded, 757 ; but the LVM VolumeName and PartitionName need to be zero padded. 758 ; So, below we replace all trailing spaces with zero's. 759 ; 760 ; Correct LVM PartitionName 761 ; 762 push di 763 mov cx,20 764 pn_padd_next: 765 jcxz pn_padded 766 dec di 767 dec cx 768 mov al,[di] 769 test al,al 770 jz pn_padd_next 771 cmp al,' ' 772 jnz pn_padded 773 mov byte ptr [di],0 774 jmp pn_padd_next 775 pn_padded: 776 pop di 777 778 673 779 ; Update LVM-CRC now... 674 780 mov si, offset LVMSector
Note:
See TracChangeset
for help on using the changeset viewer.