Changeset 30 for trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
- Timestamp:
- May 6, 2011, 4:25:19 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/BOOTCODE/REGULAR/PARTSCAN.ASM
r29 r30 20 20 ;--------------------------------------------------------------------------- 21 21 22 23 IFDEF ModuleNames 24 DB 'PARTSCAN',0 25 ENDIF 26 22 27 ; Note: This is complex code. So make sure that you know what you are doing in 23 28 ; here. … … 48 53 mov si, offset NewPartTable 49 54 mov di, offset PartitionTable 50 movzx ax, NewPartitions 55 ;movzx ax, NewPartitions 56 mov al,NewPartitions 57 mov ah,0 58 51 59 mov CFG_Partitions, al 52 60 mov bl, LocIPT_LenOfIPT … … 58 66 mov si, offset NewDriveLetters 59 67 mov di, offset DriveLetters 60 mov cx, LocIPT_MaxPartitions /261 rep movs w68 mov cx, LocIPT_MaxPartitions 69 rep movsb 62 70 63 71 ; [Linux support removed since v1.02] … … 82 90 or dl, dl 83 91 jz PSSFP_NoAutoDriveLetter 84 movzx cx, CFG_Partitions 92 ;movzx cx, CFG_Partitions 93 mov cl,CFG_Partitions 94 mov ch,0 95 85 96 or cx, cx 86 97 jz PSSFP_NoAutoDriveLetter … … 118 129 mov wptr [ExtendedAbsPos+2], ax 119 130 PSSDFP_LoadThisPartition: 120 call DriveIO_LoadPartition 131 132 call DriveIO_LoadPartition ; Rousseau: load a partition record 133 121 134 jc PSSDFP_InvalidPartition 135 122 136 ; LVM Support - Reads LVM Information Sector 123 call DriveIO_LoadLVMSector 137 call DriveIO_LoadLVMSector ; Rousseau: load LVM sector 138 124 139 call PARTSCAN_ScanPartition 125 140 IFDEF ReleaseCode … … 223 238 add ax, wptr [CurPartition_Location+0] ; +Partition-Absolute 224 239 adc bx, wptr [CurPartition_Location+2] ; sectors 225 call DriveIO_LoadTmpSector ; Loads Boot record 240 call DriveIO_LoadTmpSector ; Loads Boot record ; Rousseau: LOAD PARTITION BOOT RECORD !! 226 241 ; Sets up DS:SI - TmpSector 227 242 … … 249 264 cmp PartSystemID, 07h ; We got IFS here? 250 265 jne PCCTP_IFSdone 251 ; Check, if 'JFS ' is at DWORD offset 36h 266 ; Check, if 'JFS ' is at DWORD offset 36h ; Rousseau: JFS check (LVM / IPT?) 252 267 cmp wptr [si+36h], 'FJ' 253 268 jne PCCTP_IFSnoJFS … … 284 299 PCCTP_HasVolumeLetter: 285 300 ; Save VolumeLetter in separate table 286 movzx bx, NewPartitions ; NewPartitions is one behind here, so 301 ;movzx bx, NewPartitions ; NewPartitions is one behind here, so 302 mov bl,NewPartitions ; NewPartitions is one behind here, so 303 mov bh,0 304 287 305 mov [PartitionVolumeLetters+bx], al ; it's already a zero-based offset 288 306 ; Now copy VolumeID and VolumeName to temporary space … … 291 309 stosw 292 310 mov ax, [si+LocLVM_PartitionID+2] 293 stosw ; Set Serial-Field to LVM-VolumeID 311 stosw 312 ; Set Serial-Field to LVM-VolumeID 313 push di 294 314 add si, LocLVM_PartitionName 315 295 316 mov cx, 5 296 317 rep movsw ; Copy LVM-PartitionName to Temp Space 297 movsb ; (11 bytes in total) 318 movsb ; (11 bytes in total) 319 320 pop di 321 cmp PartSystemID, 0ah 322 323 jne PCCTP_NoIbmBm 324 mov si, offset ibm_bm_name 325 mov cx,5 326 rep movsw 327 movsb 328 329 330 331 PCCTP_NoIbmBm: 332 333 298 334 pop di si dx ax 299 335 mov si, offset MBR_NoName_Patched … … 304 340 pop di si dx ax 305 341 test ah, FileSysFlags_NoName ; No-Name-Flag ? -> No Partition Name 306 jnz PCCTP_ThereIsNoName ; available 342 343 jz PCCTP_ThereIsAName 344 jmp PCCTP_ThereIsNoName ; available 345 346 PCCTP_ThereIsAName: 347 307 348 ; We check for NTFS (got detected a little bit earlier in this routine) 308 349 cmp PartSystemID, 08h ; We got IFS/NTFS here? … … 312 353 add si, 2Bh ; DS:SI - Partition-Name 313 354 test ah, FileSysFlags_FAT32 ; FAT32 specific name getting ? 355 314 356 jz PCCTP_ResumeNormal 357 315 358 add si, 1Ch ; Fix for FAT 32, shiat 316 359 PCCTP_ResumeNormal: 317 360 mov cx, 11 ; 11 bytes length 318 361 call PART_CheckForValidPartName 319 jnc PCCTP_ThereIsNoName 362 jc PCCTP_ThereIsAName2 363 364 jmp PCCTP_ThereIsNoName 365 366 PCCTP_ThereIsAName2: 367 320 368 sub si, 4 ; DS:SI -> Serial&Name (15-Bytes) 321 369 xor ah, ah ; no Flags_NoPartName … … 343 391 repz cmpsb 344 392 pop di si 345 je PCCTP_Match 393 394 jne PCCTP_NoMatchYet 395 396 jmp PCCTP_Match 397 398 PCCTP_NoMatchYet: 399 346 400 PCCTP_SerialNameAlreadyFound: 347 401 add di, LocIPT_LenOfIPT … … 477 531 PCCTP_LocCompFailed: 478 532 jmp PCCTP_CompareFailed 479 533 480 534 ; ================================== 481 535 ; =MATCH=, found partition in IPT... … … 557 611 ; Calculate Pointer to IPT 558 612 mov di, offset NewPartTable ; ES:DI - NewPartTable 559 movzx ax, NewPartitions 613 ;movzx ax, NewPartitions 614 mov al,NewPartitions 615 mov ah,0 616 560 617 mov bl, LocIPT_LenOfIPT 561 618 mul bl … … 575 632 stosb 576 633 mov al, cl ; Partition-Flags from register... 577 stosb 634 stosb 578 635 mov ax, PartCRC ; BootRecordCRC... 579 636 stosw … … 620 677 621 678 ; Calculate Size of this partition and put it into separate table... 622 movzx ax, NewPartitions 679 ;movzx ax, NewPartitions 680 mov al,NewPartitions 681 mov ah,0 682 623 683 dec ax 624 684 mov bx, ax … … 658 718 ; Destroyed: None 659 719 PARTSCAN_DefXref Proc Near Uses ax bx cx dx si di 660 movzx bx, dl 720 ;movzx bx, dl 721 mov bl,dl 722 mov bh,0 723 661 724 mov bptr [PartitionXref+bx], dh ; X-Reference 662 725 ; Copy Hide-Config of IPT partition to new location in new table … … 673 736 rep movsb ; Copy Hide-Config to NewHideTable 674 737 ; Process Logical-Drive-Letter table as well... 675 movzx bx, dl 738 ;movzx bx, dl 739 mov bl,dl 740 mov bh,0 741 676 742 mov al, bptr [DriveLetters+bx] ; Get Drv-Letter from org. pos 677 movzx bx, dh 743 ;movzx bx, dh 744 mov bl,dl 745 mov bh,0 746 678 747 mov bptr [NewDriveLetters+bx], al ; Put Drv-Letter to new pos 679 748 ret … … 684 753 ; Destroyed: None 685 754 PARTSCAN_GetXref Proc Near Uses bx 686 movzx bx, dl 755 ;movzx bx, dl 756 mov bl,dl 757 mov bh,0 758 687 759 mov dh, bptr [PartitionXref+bx] ; X-Reference 688 760 ret … … 702 774 cmp al, 0FFh 703 775 je PSSHCWX_SyncEmpty 704 movzx bx, al 776 ;movzx bx, al 777 mov bl,al 778 mov bh,0 779 705 780 mov al, [PartitionXref+bx] ; Translate it 706 781 cmp al, 0FFh … … 729 804 ret 730 805 PARTSCAN_SyncHideConfigWithXref EndP 806 807 ibm_bm_name: db 'IBM BootMan',0
Note:
See TracChangeset
for help on using the changeset viewer.