-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
21 lines (19 loc) · 1.07 KB
/
Makefile
File metadata and controls
21 lines (19 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
all:
mkdir -p bin
nasm -f bin src/boot.asm -o bin/boot.bin
nasm -f elf64 src/isr_defs.asm -o bin/isr_defs.o
clang -g -O0 -ffreestanding -target x86_64-none-elf -c src/kernel.c -o bin/kernel.o
clang -g -O0 -ffreestanding -target x86_64-none-elf -c src/ports.c -o bin/ports.o
clang -g -O0 -ffreestanding -target x86_64-none-elf -c src/vga.c -o bin/vga.o
clang -g -O0 -ffreestanding -target x86_64-none-elf -c src/idt.c -o bin/idt.o
clang -g -O0 -ffreestanding -target x86_64-none-elf -c src/isr.c -o bin/isr.o
clang -g -O0 -ffreestanding -target x86_64-none-elf -c src/timer.c -o bin/timer.o
ld.lld -N -T linker.ld bin/kernel.o bin/isr_defs.o bin/ports.o bin/vga.o bin/isr.o bin/idt.o bin/timer.o -o bin/kernel.elf
ld.lld -N -T linker.ld --oformat=binary bin/kernel.o bin/isr_defs.o bin/ports.o bin/vga.o bin/isr.o bin/idt.o bin/timer.o -o bin/kernel.bin
cat bin/boot.bin bin/kernel.bin > bin/os_raw.bin
dd if=/dev/zero of=bin/os.img bs=1024 count=1440
dd if=bin/os_raw.bin of=bin/os.img conv=notrunc
run:
qemu-system-x86_64 -drive format=raw,file=bin/os.img
clean:
rm -rf bin