Ignore:
Timestamp:
Apr 8, 2017, 12:26:16 AM (8 years ago)
Author:
Ben Rietbroek
Message:

More hard-coded '80h' corrections [v1.1.1-testing]

Code in 'partmain.asm' around line 1350 needs some more attention.
Possibly the whole 'boot-flag' stuff is not needed with modern BIOSses.
Updating them is disabled for now, which should only affect very old
BIOSses that don't leave this checking to the MBR code.

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.0-manual.pdf

File:
1 edited

Legend:

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

    r76 r78  
    13181318        ; --- HIDE COMPLETED ---
    13191319        ; So something got hidden and we have to remark a primary partition,
    1320         ;  if we are booting something non-primary from 1st hdd.
    1321         cmp     bptr [si+LocIPT_Drive], 80h
    1322         ja      PSP_HideAdjustPrimaryMark  ; When booting any hdd, but 1st
     1320        ;  if we are booting something non-primary from the boot-disk.
     1321        mov     al, [BIOS_BootDisk]
     1322        cmp     bptr [si+LocIPT_Drive], al
     1323        jne     PSP_HideAdjustPrimaryMark  ; When booting any hdd, but boot-disk
    13231324        mov     ax, wptr [si+LocIPT_AbsolutePartTable]
    13241325        mov     bx, wptr [si+LocIPT_AbsolutePartTable+2]
    13251326        or      ax, ax
    13261327        jnz     PSP_HideAdjustPrimaryMark  ; or booting non-primary partition
    1327         or      bx, bx                     ;  on 1st harddrive.
     1328        or      bx, bx                     ;  on boot-disk.
    13281329        jz      PSP_NoHideAdjustPrimaryMark
    13291330
     
    13331334        xor     bx, bx
    13341335        mov     cx, 0001h                  ; Cylinder 0, Sector 1
    1335         mov     dx, 0080h                  ; First HD, Head 0
    1336                                                                      ; Load MBR
     1336        xor     dh, dh                     ; Head 0
     1337        mov     dl, [BIOS_BootDisk]        ; Boot Disk
     1338
     1339        ; This uses the boot-disk and alters 'CurPartition_Location'.
     1340        ; CHECKME: How does 81h being the boot-disk influences this ?
    13371341        call    DriveIO_LoadPartition      ; Load Primary Partition Table
     1342
     1343        ; This would only be needed for very old BIOSses
    13381344        call    PART_MarkFirstGoodPrimary
    1339         call    DriveIO_SavePartition       ; Saves the Partition-Table
     1345
     1346        ; CHECKME: Disabled writing back MBR with modified boot flags
     1347        ; This is a safety measure now that booting AirBoot from other disks
     1348        ; than 80h can occur.
     1349        ;~ call    DriveIO_SavePartition       ; Saves the Partition-Table
    13401350
    13411351
Note: See TracChangeset for help on using the changeset viewer.