EttinOS/make.sh

51 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
rm -f EttinOS.img
rm -f EttinOS-src.img
mkdir -p bin
cd src/
if [ "$1" = "-1440" ]
then nasm BOOT.ASM -d F1440 -f bin -o ../bin/BOOT.BIN
else nasm BOOT.ASM -f bin -o ../bin/BOOT.BIN
fi
nasm SYSTEM.ASM -f bin -o ../bin/SYSTEM.BIN
nasm ECHO.ASM -f bin -o ../bin/ECHO.BIN
nasm HELLO.ASM -f bin -o ../bin/HELLO.BIN
nasm LIST.ASM -f bin -o ../bin/LIST.BIN
nasm PRINT.ASM -f bin -o ../bin/PRINT.BIN
cd ..
if [ "$1" = "-1440" ]
then
mkfs.fat -C EttinOS.img 1440 1>/dev/null
mkfs.fat -C EttinOS-src.img 1440 1>/dev/null
else
mkfs.fat -C EttinOS.img 360 1>/dev/null
mkfs.fat -C EttinOS-src.img 360 1>/dev/null
fi
if which rw > /dev/null 2>&1
then rw -i bin/BOOT.BIN -o EttinOS.img -b 512 -c 1x
else dd if=bin/BOOT.BIN of=EttinOS.img conv=notrunc bs=512 count=1 1>/dev/null
fi
mcopy -i EttinOS.img bin/SYSTEM.BIN ::
mcopy -i EttinOS.img README.MD ::
mcopy -i EttinOS.img LICENSE.MD ::
mcopy -i EttinOS.img bin/ECHO.BIN ::
mcopy -i EttinOS.img bin/HELLO.BIN ::
mcopy -i EttinOS.img bin/LIST.BIN ::
mcopy -i EttinOS.img bin/PRINT.BIN ::
mcopy -i EttinOS-src.img src/BOOT.ASM ::
mcopy -i EttinOS-src.img src/SYSTEM.ASM ::
mcopy -i EttinOS-src.img src/PRINTSTR.INC ::
mcopy -i EttinOS-src.img src/READSTR.INC ::
mcopy -i EttinOS-src.img src/PRINTLN.INC ::
mcopy -i EttinOS-src.img src/READLN.INC ::
mcopy -i EttinOS-src.img README.MD ::
mcopy -i EttinOS-src.img LICENSE.MD ::
mcopy -i EttinOS-src.img src/ECHO.ASM ::
mcopy -i EttinOS-src.img src/HELLO.ASM ::
mcopy -i EttinOS-src.img src/LIST.ASM ::
mcopy -i EttinOS-src.img src/PRINT.ASM ::