Changeset 200


Ignore:
Timestamp:
Nov 7, 2017, 7:13:10 AM (8 years ago)
Author:
Ben Rietbroek
Message:

Also apply 'CRC_IGNORE' build option to configuration [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

File:
1 edited

Legend:

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

    r165 r200  
    363363        mov      cx,5
    364364
    365         mov     dx, [CFG_CheckConfig]
    366         mov     [CFG_CheckConfig], bx
     365        mov     dx, [CFG_CheckConfig]       ; Get current CRC for configuration
     366        mov     [CFG_CheckConfig], bx       ; Mark it as invalid
    367367    PCCC_Loop:
    368         call    MBR_GetCheckOfSector
     368        call    MBR_GetCheckOfSector        ; Calculate CRC
    369369        loop    PCCC_Loop
    370         cmp     bx, dx
    371         jne     PCCC_Failed
    372         mov     CFG_CheckConfig, dx
    373         ret
     370        cmp     bx, dx                      ; Validate CRC
     371
     372        ;
     373        ; The CRC is calculated and inserted in the loader image when
     374        ; AiR-BOOT is installed. Ignoring the CRC enables manually
     375        ; merging the loader without using the installer. This is used
     376        ; for debugging in virtual machines, where it is easy to
     377        ; merge the loader to the disk image of the VM.
     378        ;
     379IFNDEF  CRC_IGNORE
     380        jne     PCCC_Failed                 ; Validation failed, halt AiR-BOOT
     381ENDIF
     382
     383        mov     CFG_CheckConfig, dx         ; Restore the valid CRC
     384        ret
     385
     386        ;
     387        ; CRC validation for the configuration failed.
     388        ; Inform the user of this and halt the system.
     389        ;
    374390    PCCC_Failed:
    375391        mov     si, offset TXT_ERROR_CheckConfig
Note: See TracChangeset for help on using the changeset viewer.