mirror of https://github.com/E-Almqvist/eOS
commit
ae6578e25c
@ -1,16 +1,25 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
done="[OK]" |
||||
fail="[FAIL]" |
||||
srcdir=src |
||||
bindir=bin |
||||
|
||||
srcDir=src |
||||
binDir=bin |
||||
compile_bootloader() { |
||||
echo "Compiling bootloader... " |
||||
nasm -f bin $srcdir/bootloader/bootloader.asm -i $srcdir/bootloader -o $bindir/bootloader.bin |
||||
} |
||||
|
||||
echo "Compiling bootloader... " |
||||
nasm -f bin $srcDir/bootloader.asm -i $srcDir -o $binDir/bootloader.bin |
||||
compile_kernel() { |
||||
echo "Compiling kernel... " |
||||
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 |
||||
} |
||||
|
||||
echo "Compiling kernel... " |
||||
gcc -fno-pie -m32 -Os -ffreestanding -c $srcDir/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... " |
||||
cat $bindir/bootloader.bin $bindir/kernel.bin > $bindir/os-image |
||||
} |
||||
|
||||
echo "Creating OS image... " |
||||
cat $binDir/bootloader.bin $binDir/kernel.bin > $binDir/os-image |
||||
|
||||
|
||||
compile_bootloader |
||||
compile_kernel |
||||
create_os_image |
||||
|
@ -0,0 +1,20 @@ |
||||
#!/usr/bin/bash |
||||
|
||||
srcdir=src |
||||
bindir=bin |
||||
|
||||
make_grub() { |
||||
echo "Making GRUB..." |
||||
mkdir -p $bindir/boot/grub |
||||
cp $bindir/kernel.bin $bindir/boot/eOS.bin |
||||
cp $srcdir/grub/grub.cfg $bindir/boot/grub/grub.cfg |
||||
grub-mkrescue -o $bindir/eOS.iso $bindir |
||||
} |
||||
|
||||
compile_kernel() { |
||||
echo "Compiling kernel... " |
||||
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 |
||||
} |
||||
|
||||
compile_kernel |
||||
make_grub |
@ -0,0 +1,3 @@ |
||||
menuentry "eOS" { |
||||
multiboot /boot/eOS.bin |
||||
} |
Loading…
Reference in new issue