Changeset 213


Ignore:
Timestamp:
Nov 9, 2017, 11:25:41 PM (8 years ago)
Author:
Ben Rietbroek
Message:

Fixed a small problem with too many partitions [v1.1.3-testing]

While no more partitions were scanned if the partition limit had been
reached, the scan-loop continued. This caused the error-box to popup
multiple times.

CAUTION:
This is a testbuild !
AirBoot uses the BIOS to access disks and a small coding error can trash
partition tables or other vital disk structures. You are advised to make
backups of TRACK0 and EBRs before using this testbuild. More info at:
https://rousseaux.github.io/netlabs.air-boot/pdf/AirBoot-v1.1.2-manual.pdf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/regular/partscan.asm

    r171 r213  
    442442        ; Ignore these partitions, because there are no real Partitions
    443443
     444
     445        ; If this flag is set, no scanning should be done.
     446        ; So we jump to the epilog which tries to mark a primary on the boot
     447        ; disk because we are in an 'overflow' situation and a properly setup
     448        ; MBR can do no harm.
     449        mov     al, cs:[TooManyPartitions]
     450        test    al, al
     451        jnz     PSSP_Epilog
     452
     453
     454        ; Check the number of partitions for this iteration of the scan-loop.
     455        ; If the maximum has been reached an error-box is shown to the user.
     456        cmp     word ptr cs:[NewPartitions],LocIPT_MaxPartitions
     457        jae     PSSP_TooManyPartitions
     458
     459
    444460        ;
    445         ; Stop scanning if too many partitions.
     461        ; The limit has not been reached yet, so check this partition for
     462        ; potential adding to the list and jump over the error-box.
    446463        ;
    447         cmp     word ptr cs:[NewPartitions],LocIPT_MaxPartitions
    448         jae     skip_check
    449464        call    PARTSCAN_CheckThisPartition
    450465        jmp     PSSP_IgnorePartition
    451     skip_check:
    452         ; Cannot boot LVM-Data partitions
     466
     467
     468    PSSP_TooManyPartitions:
     469
     470        ; If we are on the second iteration after we encountered too many
     471        ; partitions we stop scanning.
     472        mov     al, cs:[TooManyPartitions]
     473        test    al, al
     474        jnz     PSSP_NoMarkPrimary
     475
     476        ; First time we encountered too many partitions,
     477        ; show the error-box.
    453478        pusha
    454         mov     byte ptr cs:[TooManyPartitions],1
    455479        mov     cx, 0C04h
    456         ;~ mov     si, offset TXT_ERROR_TooManyPartitions
    457480        mov     si, offset TXT_TooManyPartitions
    458481        add     si,5    ; We stole this string, so skip new-line and dash.
    459         ;~ call    SETUP_Warning_AreYouSure
    460482        call    SETUP_ShowErrorBox
     483
     484        ; Record that too many partitions are present.
     485        mov     byte ptr cs:[TooManyPartitions],1
    461486        popa
     487
     488        ; Further scanning is aborted.
     489        jmp     PSSP_Epilog
     490
    462491
    463492    PSSP_IgnorePartition:
     
    471500        add     si, LocBRPT_LenOfEntry     ; 16 Bytes per partition entry
    472501        cmp     si, 500+offset PartitionSector
     502
     503
     504        ; Next iteration
    473505        jb      PSSP_ScanLoop
     506
     507
     508    PSSP_Epilog:
     509
    474510        ; If we are on first HDD and in primary partition table -> mark primary
    475511        mov     al, [BIOS_BootDisk]
Note: See TracChangeset for help on using the changeset viewer.