Changeset 50 for trunk/BOOTCODE


Ignore:
Timestamp:
Apr 13, 2014, 1:31:04 PM (12 years ago)
Author:
Ben Rietbroek
Message:

Removed 'Force BIOS-LBA Usage' entry from AiR-BOOT SETUP [2012-05-15]

This commit eliminates the severe bug that previous commits warned
about in their commit-message. The cause of the bug is not handling
CHS values when modifying LVM-information. Thus, when LBA-access was
disabled, the CHS-access method was used with improper values. This
resulted in a CHS address of (0,0,1), which is the MBR, and then
erroneously writing the modified LVM-record to it.

While a freshly installed AiR-BOOT of v1.07 or higher defaults to having
LBA enabled, this is not the case for v1.06. Since AiR-BOOT merges the
previous configuration, any upgrade from v1.06 with LBA set to disabled
would propagate the setting to the new version. Modifying
LVM-information from the AiR-BOOT SETUP, like changing the label or
fiddling with drive-letter assignments, would then trigger the bug and
write the LVM-record to the MBR. Users fiddling with the SETUP could
also disable LBA-access and trigger the bug.

This commit removes the 'Force BIOS-LBA Usage' option from the
AiR-BOOT SETUP, preventing users to disable LBA. Also, when AiR-BOOT
starts, it now always enables LBA-addressing, so CHS-addressing is not
used anymore. Furthermore, the Installer is modified to always enable
LBA-addressing in the AiR-BOOT configuration it writes to disk.
This ensures that older versions, which do not implicitly enable LBA on
starting, will find LBA as enabled.

On today's systems there is no need to use CHS-addressing anymore.
In fact, it does more harm than good because the CHS values do not
represent true physical geometry anymore. Instead, the drive and
the BIOS do translations that can cause unpredictable results when
moving the drive between systems. This is particularly true for USB
mass storage devices.

Therefore, CHS-addressing will be removed from AiR-BOOT.
This will free-up badly needed code space and create some room in the
internal partition tables that can be put to other use.

Info

o Bug Description

Trashing the Master Boot Record.

o Cause

Not handling CHS values while modifying LVM-information.

o Effect

Writing the modified LVM-record to the MBR when modifying LVM
information from the AiR-BOOT SETUP.
(like the partition-label or drive-letter assignments)

o Measures

  • Remove 'Force BIOS-LBA Usage' from AiR-BOOT SETUP
  • Always enable LBA when AiR-BOOT starts
  • Always set LBA enabled when writing on-disk AiR-BOOT configuration

o Affected AiR-BOOT versions

*All* v1.0.8 pre-releases up and including commit [2012-05-13].

Location:
trunk/BOOTCODE
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/BOOTCODE/AIR-BOOT.ASM

    r49 r50  
    864864
    865865IFDEF   AUX_DEBUG
    866                 call    DEBUG_DumpIPT
     866                ;~ call    DEBUG_DumpIPT
    867867                ;~ call    DEBUG_DumpPartitionPointers
    868                 call    DEBUG_DumpPartitionXref
     868                ;~ call    DEBUG_DumpPartitionXref
    869869                ;~ call    DEBUG_DumpNewPartTable
     870                ;~ call    DEBUG_DumpDriveLetters
    870871ENDIF
    871872
     
    899900
    900901IFDEF   AUX_DEBUG
    901                 call    DEBUG_DumpIPT
     902                ;~ call    DEBUG_DumpIPT
    902903                ;~ call    DEBUG_DumpPartitionPointers
    903                 call    DEBUG_DumpPartitionXref
     904                ;~ call    DEBUG_DumpPartitionXref
    904905                ;~ call    DEBUG_DumpNewPartTable
    905906ENDIF
     
    940941
    941942IFDEF   AUX_DEBUG
    942                 call    DEBUG_DumpIPT
     943                ;~ call    DEBUG_DumpIPT
    943944                ;~ call    DEBUG_DumpPartitionPointers
    944                 call    DEBUG_DumpPartitionXref
     945                ;~ call    DEBUG_DumpPartitionXref
    945946                ;~ call    DEBUG_DumpNewPartTable
    946947ENDIF
     
    11441145                ;~ call    DEBUG_DumpIPT
    11451146                ;~ call    DEBUG_DumpPartitionPointers
    1146                 call    DEBUG_DumpPartitionXref
     1147                ;~ call    DEBUG_DumpPartitionXref
    11471148                ;~ call    DEBUG_DumpNewPartTable
    11481149ENDIF
  • trunk/BOOTCODE/AIR-BOOT.HIS

    r49 r50  
    2727; v1.0.8-rc3-bld201205nn
    2828; ----------------------
     29; # Removed Force LBA Usage from Setup #
     30;   When AiR-BOOT is installed on an USB-stick, there is a possibility that
     31;   the CHS-geometry varies between different machines where the stick is
     32;   booted. This would invalidate any CHS-values that were stored in the IPT.
     33;   To prevent more nasty things like below from happening, LBA-addressing
     34;   is now always used.
     35;
     36;!## Fixed a very very nasty bug that can destroy the MBR on multiple disks ##!
     37;   When Force BIOS-LBA usage is disabled (the default is enabled), and the
     38;   the driveletter feature is being set, and valid LVM information is present,
     39;   then the MBR of the disk containing the partition of which the driveletter
     40;   is changed will be overwritten with the LVM sector !
     41;   In addition, if the driveletter was already in use by another partition
     42;   on another disk, the MBR of that disk will be overwritten too !!
     43;
    2944; # Fixed a nasty bug when eCS phase1 is active #
    3045;   When creating a partition in a free space between partitions for
  • trunk/BOOTCODE/REGULAR/DEBUG.ASM

    r49 r50  
    235235DEBUG_DumpPartitionXref     EndP
    236236
     237
     238
     239DEBUG_DumpDriveLetters      Proc
     240        pushf
     241        pusha
     242
     243        call    AuxIO_TeletypeNL
     244
     245        mov     si,offset [DriveLetters]
     246        mov     cx,2
     247
     248    DEBUG_DumpDriveLetters_next:
     249        call    AuxIO_DumpParagraph
     250        add     si,16
     251        call    AuxIO_TeletypeNL
     252        loop    DEBUG_DumpDriveLetters_next
     253
     254        popa
     255        popf
     256        ret
     257DEBUG_DumpDriveLetters      EndP
     258
     259
     260DEBUG_DumpRegisters     Proc
     261        pushf
     262        pusha
     263
     264        call    AuxIO_TeletypeHexWord
     265        call    AuxIO_TeletypeNL
     266
     267        mov     ax,bx
     268        call    AuxIO_TeletypeHexWord
     269        call    AuxIO_TeletypeNL
     270
     271        mov     ax,cx
     272        call    AuxIO_TeletypeHexWord
     273        call    AuxIO_TeletypeNL
     274
     275        mov     ax,dx
     276        call    AuxIO_TeletypeHexWord
     277        call    AuxIO_TeletypeNL
     278
     279        mov     ax,si
     280        call    AuxIO_TeletypeHexWord
     281        call    AuxIO_TeletypeNL
     282
     283        mov     ax,di
     284        call    AuxIO_TeletypeHexWord
     285        call    AuxIO_TeletypeNL
     286
     287        mov     ax,ds
     288        call    AuxIO_TeletypeHexWord
     289        call    AuxIO_TeletypeNL
     290
     291        mov     ax,es
     292        call    AuxIO_TeletypeHexWord
     293        call    AuxIO_TeletypeNL
     294
     295        call    AuxIO_TeletypeNL
     296
     297        popa
     298        popf
     299        ret
     300DEBUG_DumpRegisters     EndP
     301
    237302;
    238303; Dump information before the menu is displayed.
  • trunk/BOOTCODE/REGULAR/DRIVEIO.ASM

    r49 r50  
    607607        call    LVM_CheckSectorSignature
    608608        jnc     DIOSLVMS_SevereError                  ; LVM Signature must be there
     609
     610IFDEF   AUX_DEBUG
     611        ;~ call    DEBUG_DumpRegisters
     612ENDIF
     613
    609614        call    DriveIO_LVMAdjustToInfoSector
     615
     616IFDEF   AUX_DEBUG
     617        ;~ call    DEBUG_DumpRegisters
     618ENDIF
     619
    610620        mov     si, offset LVMSector
    611621        call    DriveIO_SaveSector
     
    788798; #########################################################################
    789799DriveIO_SaveSector              Proc Near  Uses ax bx cx ds si es di
     800
     801IFDEF   AUX_DEBUG
     802        call    DEBUG_DumpRegisters
     803        call    AuxIO_DumpSector
     804        call    AuxIO_TeletypeNL
     805ENDIF
     806
    790807        test    byte ptr cs:[CurIO_UseExtension], 1
    791808        jz      DIOSS_UseNormal
    792809        ; Are we forced do use LBA via Setting?
    793         test    byte ptr cs:[CFG_ForceLBAUsage], 1
    794         jnz     DIOSS_UseExtension
     810        ; Always use INT13X on v1.0.8.
     811        ;~ test    byte ptr cs:[CFG_ForceLBAUsage], 1
     812        ;~ jnz     DIOSS_UseExtension
     813        jmp     DIOSS_UseExtension
    795814        ; Is the drive not a harddrive?
    796815        cmp     dl, 80h
     
    932951
    933952IFDEF AUX_DEBUG
    934       ; Dump the value
    935       ;call     AuxIO_TeletypeHexByte
    936       ;call     AuxIO_TeletypeNL
     953        ; Dump the value
     954        ;~ call     AuxIO_TeletypeHexByte
     955        ;~ call     AuxIO_TeletypeNL
    937956ENDIF
    938957
  • trunk/BOOTCODE/REGULAR/OTHER.ASM

    r46 r50  
    133133        call    MBR_TeletypeNL
    134134
     135
     136        ; This sets [CurIO_UseExtension] flag
     137        call    PRECRAP_CheckFor13extensions
     138        mov     al,[CurIO_UseExtension]
     139        test    al,al
     140        jnz     INT13X_Present
     141
     142;
     143; Change this to a popup.
     144;
     145INT13X_Missing db '!! NO INT13X !!',0
     146        mov     si, offset INT13X_Missing
     147        call    MBR_Teletype
     148        jmp     MBR_HaltSystem
     149
     150INT13X_Present:
    135151        xor     cx,cx
    136152    PRECRAP_Main_next_disk:
     
    290306
    291307
    292         ; This sets [CurIO_UseExtension] flag.
    293         call    PRECRAP_CheckFor13extensions
    294308
    295309    IFNDEF ReleaseCode
  • trunk/BOOTCODE/REGULAR/PARTMAIN.ASM

    r49 r50  
    10241024
    10251025   test    byte ptr [CFG_ForceLBAUsage], 1
    1026    jnz     PSP_ForceI13X
     1026    ;~ jnz     PSP_ForceI13X
     1027    jmp     PSP_ForceI13X
     1028
    10271029   ; LBA-boundary at 16450560 (FB0400h) (16320x16x63)
    10281030   cmp     bx, 00FBh
     
    17601762   call     DEBUG_Dump2
    17611763   ;~ call     DEBUG_DumpBSSSectors
     1764   ;~ call     DEBUG_DumpDriveLetters
    17621765ENDIF
    17631766
  • trunk/BOOTCODE/REGULAR/PARTSCAN.ASM

    r49 r50  
    4949
    5050IFDEF   AUX_DEBUG
    51         pusha
    52         call    DEBUG_DumpHidePartTables
    53         popa
     51        ;~ pusha
     52        ;~ call    DEBUG_DumpHidePartTables
     53        ;~ popa
    5454ENDIF
    5555        ; Use X-Reference to sync NewPartitionTable with Hide-Config
     
    5757
    5858IFDEF   AUX_DEBUG
    59         pusha
    60         call    DEBUG_DumpHidePartTables
    61         popa
     59        ;~ pusha
     60        ;~ call    DEBUG_DumpHidePartTables
     61        ;~ popa
    6262ENDIF
    6363
  • trunk/BOOTCODE/REGULAR/STD_TEXT.ASM

    r49 r50  
    5555             db BLDLVL_MINOR_VERSION,' - (c) '
    5656             db BLDLVL_YEAR
    57              db ' M. Kiewitz  <<Internal Release 3b>> (bld: '
     57             db ' M. Kiewitz  <<Internal Release 3e>> (bld: '
    5858             ;~ db ' M. Kiewitz  <<Release Candidate 2>> (bld: '
    5959             db BLDLVL_YEAR
  • trunk/BOOTCODE/SETUP/MENUS.ASM

    r40 r50  
    213213                dw      offset TXT_SETUP_IgnoreLVM, offset TXT_SETUPHELP_IgnoreLVM
    214214                dw      6 dup (0)
    215                 dw      offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage            ; Rousseau: LBA
    216                 dw      offset TXT_SETUP_ForceLBAUsage, offset TXT_SETUPHELP_ForceLBAUsage
    217                 dw      6 dup (0)
     215
     216                ;~ dw      offset SETUPMAGIC_EnableDisable, offset CFG_ForceLBAUsage
     217                ;~ dw      offset TXT_SETUP_ForceLBAUsage, offset TXT_SETUPHELP_ForceLBAUsage
     218                ;~ dw      6 dup (0)
     219
     220                dw      0, 0    ; added for removal of force-lba
     221                dw      0, 0    ; added for removal of force-lba
     222
    218223                dw      offset SETUPMAGIC_EnableDisable, offset CFG_ExtPartitionMShack
    219224                dw      offset TXT_SETUP_ExtPartMShack, offset TXT_SETUPHELP_ExtPartMShack
    220225                dw      6 dup (0)
     226
     227
     228
    221229                dw      0, 0
    222230                dw      0, 0
  • trunk/BOOTCODE/SPECIAL/LVM.ASM

    r46 r50  
    324324   or      cl, cl
    325325   jz      LVMDLR_SkipRemove
     326
    326327  LVMDLR_RemoveLoop:
    327328      cmp     bptr [PartitionVolumeLetters+bx], ch
     
    349350   dec     cl
    350351   jnz     LVMDLR_RemoveLoop
     352
    351353  LVMDLR_SkipRemove:
    352354   ; Set CurPartition_Location information of destination partition
  • trunk/BOOTCODE/VERSION.INC

    r49 r50  
    1717AB_YEAR             EQU     2012h
    1818AB_MONTH            EQU     05h
    19 AB_DAY              EQU     13h
     19AB_DAY              EQU     14h
    2020
    2121; The Hours, Minutes and Seconds, again in BCD for easy manipulation.
    22 AB_HOURS            EQU     00h
    23 AB_MINUTES          EQU     25h
     22AB_HOURS            EQU     22h
     23AB_MINUTES          EQU     21h
    2424AB_SECONDS          EQU     00h
    2525
Note: See TracChangeset for help on using the changeset viewer.