Changeset 14

Show
Ignore:
Timestamp:
05/24/08 21:34:01
Author:
michaelfclarke
Message:

Made the bootloader compiler section less complex and more flexible.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/build.sh

    r13 r14  
    1 #!/bin/bash  
     1#!/bin/bash -x 
    22 
    33# MouthOS (wombat) Kernel 
     
    159159 
    160160if [ $ARCH = "intel" ] ; then 
    161  
    162         BOOTLOADER_COMPILER="nasm" 
    163         BOOTLOADER_OUTPUT="-f aout -o " 
    164         BOOTLOADER_INPUT=" " 
    165         BOOTLOADER_DIRECTIONS="output" 
    166  
     161        BOOTLOADER_COMPILER="nasm -f aout -o output input" 
    167162fi; 
    168163 
    169164if [ $ARCH = "SPARC" ] ; then 
    170  
    171         BOOTLOADER_COMPILER="gcc" 
    172         BOOTLOADER_OUTPUT="-o" 
    173         BOOTLOADER_INPUT="" 
    174         BOOTLOADER_DIRECTIONS="input" 
    175  
    176  
     165        BOOTLOADER_COMPILER="gcc input -o output" 
    177166fi; 
    178167 
     
    181170echo "Building the bootloader..." 
    182171 
    183 if [ "$BOOTLOADER_DIRECTIONS" = "input" ] ; then 
    184  
    185         $BOOTLOADER_COMPILER $BOOTLOADER_INPUT ./src/$ARCH/boot/boot.s \ 
    186         $BOOTLOADER_OUTPUT ./bin/boot.o; 
    187  
    188  
    189 fi; 
    190  
    191 if [ "$BOOTLOADER_DIRECTIONS" = "output" ] ; then 
    192  
    193         $BOOTLOADER_COMPILER $BOOTLOADER_OUTPUT ./bin/boot.o \ 
    194         $BOOTLOADER_INPUT ./src/$ARCH/boot/boot.s; 
    195  
    196 fi; 
     172 
     173INPUT_FILE="./src/$ARCH/boot/boot.s" 
     174OUTPUT_FILE="./bin/boot.o" 
     175 
     176RUN=`echo $BOOTLOADER_COMPILER | sed "s/input/\.\/src\/$ARCH\/boot\/boot\.s/g"` 
     177RUN=`echo $RUN | sed "s/output/\.\/bin\/boot\.o/g"` 
     178 
     179$RUN 
     180 
    197181 
    198182# Mount the MouthOS.img and then copy the MouthOS.bin binary to