A poorly written OS for the x86 arch. (WIP)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
eOS/compile.sh

26 lines
623 B

#!/usr/bin/bash
3 years ago
srcdir=src
bindir=bin
compile_bootloader() {
echo "Compiling bootloader... "
3 years ago
nasm -f bin $srcdir/bootloader/bootloader.asm -i $srcdir/bootloader -o $bindir/bootloader.bin
}
compile_kernel() {
echo "Compiling kernel... "
3 years ago
gcc -fno-pie -m32 -Os -ffreestanding -c $srcdir/kernel/kernel.c -o $bindir/kernel.o && gcc -o $bindir/kernel.bin $bindir/kernel.o -Wl,--oformat=binary -ffreestanding -nostdlib -shared -Ttext 0x1000 -m32
}
create_os_image() {
echo "Creating OS image... "
3 years ago
cat $bindir/bootloader.bin $bindir/kernel.bin > $bindir/os-image
}
compile_bootloader
compile_kernel
create_os_image