2020-01-03 14:07:50 +01:00
|
|
|
run: bin
|
2020-01-02 12:19:32 +01:00
|
|
|
qemu-system-i386 -drive format=raw,file=target/boot.bin -monitor stdio
|
|
|
|
|
2020-01-03 14:07:50 +01:00
|
|
|
clean:
|
|
|
|
rm -r ./target/
|
|
|
|
mkdir -p ./target/helpers
|
|
|
|
mkdir ./target/bootloader
|
|
|
|
mkdir ./target/kernel
|
2019-12-28 13:47:10 +01:00
|
|
|
|
2020-01-03 14:07:50 +01:00
|
|
|
bin: compile_bootloader compile_kernel compile_helpers
|
|
|
|
./target/helpers/make_bin
|
|
|
|
|
|
|
|
compile_helpers:
|
2020-01-05 22:47:40 +01:00
|
|
|
gcc -g -o ./target/helpers/make_bin ./helpers/make_bin.c
|
2020-01-03 14:07:50 +01:00
|
|
|
|
|
|
|
compile_bootloader:
|
|
|
|
rm -rf target/bootloader/bootloader.bin
|
|
|
|
nasm -f bin -o target/bootloader/bootloader.bin bootloader/main.asm
|
2019-12-27 16:17:28 +01:00
|
|
|
|
2020-01-02 12:19:32 +01:00
|
|
|
compile_kernel:
|
2020-01-03 14:07:50 +01:00
|
|
|
nasm -felf32 kernel/wrapper.asm -o target/kernel/wrapper.o
|
|
|
|
i686-elf-gcc -c kernel/kernel.c -o target/kernel/kernel.o -std=gnu99 -ffreestanding -O2 -Wall -Wextra
|
|
|
|
i686-elf-gcc -T kernel/linker.ld -o target/kernel/kernel.bin -ffreestanding -O2 -nostdlib target/kernel/wrapper.o target/kernel/kernel.o -lgcc
|