Ignore:
Timestamp:
Apr 12, 2014, 8:23:32 AM (11 years ago)
Author:
Ben Rietbroek
Message:

Various Changes [2012-04-14]

WARNING!!

All commits upto and including the commit of [2012-05-13] contain
a severe bug!! Building from these sources and then disabling
the 'force LBA' feature while also using the drive-letter feature or
editing the label can DESTROY THE MBR on ALL ATTACHED DISKS!!
DO NOT DISABLE 'FORCE LBA USAGE' WHEN BUILT FROM THE THESE COMMITS!!

Changes

o Added BLDLEVEL support
o Enhanced Master Make
o Sanitized sources
o Support for Wasm and Masm6 (experimental)
o Renamed MBR_PROT.ASM to MBR-PROT.ASM
o Merged bitfield code Into Installer
o First steps for cross platform Installer
o More...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TOOLS/INTERNAL/FIXCODE

    r43 r46  
    44# $airboot@ecomstation.com$
    55#
    6 # This is a hack until the Linux version of FIXCODE.C is finished.
     6# This is a quick-hack until the Linux version of FIXCODE.C is finished.
    77# Note that it does not search for the AiR-BOOT Protection Signature,
    88# but embeds it at the 'well known' location.
    9 # It the protection image is moved, this script will corrupt AIR-BOOT.COM
    10 # of which the final AIRBOOT.BIN is derived.
     9# If the protection image is moved, this script will produce a corrupted
     10# AIRBOOT.BIN.
    1111# Also, a code-size of 35h (max size) is always inserted.
    12 # Furthermore, it does no sanity checks whatsoever.
     12# Furthermore, it does not do any sanity checks whatsoever.
    1313#
    1414
    15 PROT_IMG="MBR-PROT/MBR_PROT.COM"
     15#
     16# This script is now obsolete.
     17#
     18exit 1;
     19
     20
     21PROT_IMG="MBR-PROT/MBR-PROT.BIN"
    1622AB_INTERIM_IMG="AIR-BOOT.COM"
     23AB_IMG="AIRBOOT.BIN"
    1724CODE_SIZE_OFFSET=16
    1825PROT_IMG_OFFSET=26624
    1926
    2027
     28function    echox() {
     29    echo -e $@;
     30}
     31
     32
    2133function        Header() {
    22         echo "Header";
     34    echox "\t## FIXCODE script for Linux ##";
    2335}
    2436
    2537function        CheckIfFileExists() {
    26         echo "CheckIfFileExists";
     38        echox "\tCheckIfFileExists";
    2739        if [ ! -f "${1}" ]; then
    28                 echo "ERROR: File ${1} could not be found !";
    29                 echo "       Aborting...";
     40                echox "\tERROR: File ${1} could not be found !";
     41                echox "\t       Aborting...";
    3042                exit 1;
    3143        else
    32                 echo "File ${1} found, OK.";
     44                echox "\tFile ${1} found, OK.";
    3345        fi;
    3446}
    3547
     48function    CreateImage() {
     49    echox "\tCreateImage";
     50    cp -a "${1}" "${2}";
     51}
     52
    3653function        EmbedCodeSize() {
    37         echo "EmbedCodeSize";
    38         echo -n "5" | dd of="${1}" bs=1 seek=${CODE_SIZE_OFFSET} conv=notrunc;
     54        echox "\tEmbedCodeSize";
     55    echo "${1}"
     56        echo -n "5" | dd of="${1}" bs=1 seek=${CODE_SIZE_OFFSET} conv=notrunc 2> /dev/null;
    3957}
    4058
    4159function        EmbedProtectionImage() {
    42         echo "EmbedProtectionImage";
    43         dd if="${1}" of="${2}" bs=1 seek=${PROT_IMG_OFFSET} conv=notrunc;
     60        echox "\tEmbedProtectionImage";
     61        dd if="${1}" of="${2}" bs=1 seek=${PROT_IMG_OFFSET} conv=notrunc 2> /dev/null;
    4462}
    4563
    4664function        VerifyImage() {
    47         echo "VerfyImage";
     65        echox "\tVerfyImage";
    4866}
    4967
    5068function        Footer() {
    51         echo "Footer";
     69        echox "\t## AiR-BOOT code fixed ##";
     70    echo "";
    5271}
    5372
     
    5877#
    5978function        Main() {
    60         echo "## Main ##";
     79    echo "";
    6180        Header;
    62         CheckIfFileExists "${PROT_IMG}"
    63         CheckIfFileExists "${AB_INTERIM_IMG}"
    64         EmbedCodeSize "${AB_INTERIM_IMG}";
    65         EmbedProtectionImage "${PROT_IMG}" "${AB_INTERIM_IMG}";
     81        CheckIfFileExists "${PROT_IMG}";
     82        CheckIfFileExists "${AB_INTERIM_IMG}";
     83    CreateImage "${AB_INTERIM_IMG}" "${AB_IMG}";
     84        EmbedProtectionImage "${PROT_IMG}" "${AB_IMG}";
     85    EmbedCodeSize "${AB_IMG}";
    6686        Footer;
    6787}
Note: See TracChangeset for help on using the changeset viewer.