-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
36 lines (27 loc) · 957 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
all: run
qrun: deploy_all
qemu-system-x86_64 -no-reboot floppy.bin
run: deploy_all
bochs -f bochsrc -q
deploy_all: deploy_kernel
deploy_kernel: compile_kernel deploy_bootloader
strip ./KERNEL/kernel.bin
#objcopy -O binary ./KERNEL/kernel.bin ./KERNEL/kernel.bin
cat ./KERNEL/kernel.bin >> floppy.bin
compile_kernel:
g++ -c -nostdlib -m64 -masm=intel -std=c++14 ./KERNEL/kernel_main.cpp -o ./KERNEL/kernel_main.o
g++ -c -nostdlib -m64 -masm=intel -std=c++14 ./KERNEL/vesa.cpp -o ./KERNEL/vesa.o
g++ ./KERNEL/kernel_main.o ./KERNEL/vesa.o
deploy_bootloader: compile_bootloader
cat ./BOOTLOADER/stage1.bin ./BOOTLOADER/stage2.bin > floppy.bin
compile_bootloader: ./BOOTLOADER/stage1.asm ./BOOTLOADER/stage2.asm
fasm ./BOOTLOADER/stage1.asm
fasm ./BOOTLOADER/stage2.asm
clean_temp:
rm ./BOOTLOADER/stage1.bin
rm ./BOOTLOADER/stage2.bin
rm ./KERNEL/vesa.o
rm ./KERNEL/kernel_main.o
rm ./KERNEL/kernel.bin
rm floppy.bin
rm bochsout.txt