Project cleanup

This commit is contained in:
Nocturn9x 2022-11-17 12:46:10 +01:00
parent 4af94012ca
commit c3b3024b0f
5 changed files with 14 additions and 8 deletions

2
.gitignore vendored
View File

@ -68,5 +68,7 @@ _deps
# TSOS stuff
*.bin
*.img
dist/

View File

@ -1,8 +1,12 @@
#!/bin/bash
i386-elf-gcc -ffreestanding -I src/ -c src/kernel/main.c -o kernel.o
i386-elf-gcc -ffreestanding -I src/ -c src/kernel/drivers/vga/screen.c -o screen.o
i386-elf-gcc -ffreestanding -I src/ -c src/kernel/drivers/ports/ports.c -o ports.o
nasm -f elf src/entrypoint.s -o entry.o
nasm -f bin src/boot/mbr.s -o mbr.bin
i386-elf-ld -o kernel.bin -Ttext 0x1000 entry.o kernel.o ports.o screen.o --oformat binary
cat mbr.bin kernel.bin > os.bin
# Compile the kernel and its drivers
i386-elf-gcc -ffreestanding -I src/ -c src/kernel/main.c -o obj/kernel.o
i386-elf-gcc -ffreestanding -I src/ -c src/kernel/drivers/vga/screen.c -o obj/screen.o
i386-elf-gcc -ffreestanding -I src/ -c src/kernel/drivers/ports/ports.c -o obj/ports.o
# Compile the assembly entry point and the MBR
nasm -f elf src/entrypoint.s -o obj/entry.o
nasm -f bin src/boot/mbr.s -o build/mbr.bin
# Link everything together
i386-elf-ld -o build/kernel.bin -Ttext 0x1000 entry.o kernel.o ports.o screen.o --oformat binary
# Produce a bootable image
cat build/mbr.bin build/kernel.bin > build/os.img

0
build/.gitkeep Normal file
View File

0
obj/.gitkeep Normal file
View File

2
run.sh
View File

@ -1,2 +1,2 @@
#!/bin/bash
qemu-system-x86_64 -drive format=raw,file=os.bin,index=0,media=disk
qemu-system-x86_64 -drive format=raw,file=build/os.bin,index=0,media=disk