Code organizing

This commit is contained in:
Jarkko Toivanen 2023-06-18 05:37:30 +03:00
parent 79dcbb8393
commit 1a9201b529
Signed by: jt
GPG key ID: 9151B109B73ECAD5
11 changed files with 14 additions and 19 deletions

1
.gitignore vendored
View file

@ -2,3 +2,4 @@
*.o *.o
*.img *.img
mnt/ mnt/
build/

View file

@ -1,24 +1,16 @@
all: kernel-i386.elf all: build/kernel-i386.elf
clean: clean:
-@rm *.o *.elf 2> /dev/null || true -@rm build/*.o build/*.elf 2> /dev/null || true
start32.o: start32.asm build/start32.o: build/ src/start32.asm
fasm start32.asm fasm src/start32.asm build/start32.o
kernel.o: kernel.c build/kernel-i386.elf: build/start32.o
tcc -m32 -c kernel.c tcc -m32 -nostdlib -Wl,-Ttext,0x100000 -o build/kernel-i386.elf src/*.c build/start32.o
vga.o: vga.c
tcc -m32 -c vga.c
serial.o: serial.c
tcc -m32 -c serial.c
xtoa.o: xtoa.c
tcc -m32 -c xtoa.c
kernel-i386.elf: kernel.o start32.o vga.o serial.o xtoa.o
tcc -m32 -nostdlib -Wl,-Ttext,0x100000 start32.o kernel.o vga.o serial.o xtoa.o -o kernel-i386.elf
qemu-multiboot: kernel-i386.elf qemu-multiboot: build/kernel-i386.elf
qemu-system-i386 -kernel kernel-i386.elf -serial stdio qemu-system-i386 -kernel build/kernel-i386.elf -serial stdio
qemu-image: kernel-i386.elf mount qemu-image: build/kernel-i386.elf mount
cp kernel-i386.elf mnt/ cp build/kernel-i386.elf mnt/
sync sync
qemu-system-i386 koalemos.img -serial stdio qemu-system-i386 koalemos.img -serial stdio
@ -30,3 +22,5 @@ umount:
@sudo umount mnt @sudo umount mnt
mnt/: mnt/:
@mkdir mnt @mkdir mnt
build/:
@mkdir build

View file

View file

View file

View file