Changeset 145


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

Moved updating the MBR after 'PRECRAP' has finished [v1.1.1-testing]

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

Location:
trunk/bootcode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bootcode/airboot.asm

    r144 r145  
    11381138ENDIF
    11391139
     1140; -----------------------------------------------------------------------------
     1141;                                                                   UPDATE MBR
     1142; -----------------------------------------------------------------------------
     1143
     1144        ; Write MBR back to disk to sync MBR variables.
     1145        ; Otherwise subsequent MBR loads will differ from the RAM stored one,
     1146        ; which is used by MBR protection to validate parts of the MBR.
     1147        xor     bx, bx                  ; 0000h - our load address (8000:0000)
     1148        mov     cx, 1                   ; CHS sector 1, cylinder 0
     1149        xor     dh, dh                  ; CHS head 0
     1150        mov     dl, [BIOS_BootDisk]     ; The disk we were loaded from
     1151        mov     al, 1                   ; One sector to write
     1152        mov     ah, 03h                 ; BIOS write disk (legacy)
     1153        int     13h                     ; Call BIOS
     1154        ;!
     1155        ;! TODO: Check success
     1156        ;! Yes, we should check for errors here, coz it would mean AirBoot
     1157        ;! was loaded from a disk where the MBR cannot be written !
     1158        ;!
    11401159
    11411160; -----------------------------------------------------------------------------
  • trunk/bootcode/regular/other.asm

    r142 r145  
    183183        call    MBR_TeletypeNL
    184184
    185         ; Write MBR back to disk to sync MBR variables.
    186         ; Otherwise subsequent MBR loads will differ from the RAM stored one,
    187         ; which is used by MBR protection to validate parts of the MBR.
    188         xor     bx, bx
    189         mov     cx, 1
    190         xor     dh, dh
    191         mov     dl, [BIOS_BootDisk]
    192         mov     al, 1
    193         mov     ah, 03h
    194         int     13h
    195         ;!
    196         ;! TODO: Check success
    197         ;! Yes, we should check for errors here, coz it would mean AirBoot
    198         ;! was loaded from a disk where the MBR cannot be written !
    199         ;!
    200 
    201 
    202185        ;
    203186        ; Phase 1 Indicator
Note: See TracChangeset for help on using the changeset viewer.