summaryrefslogtreecommitdiff
path: root/makefile
diff options
context:
space:
mode:
authorBenji Dial <benji3.141@gmail.com>2019-12-14 18:31:34 -0500
committerBenji Dial <benji3.141@gmail.com>2019-12-14 18:31:34 -0500
commitcdc7b2ae532fd3a93e13784812f7501f2fd5c07a (patch)
tree9ea27c32a7f3dc0acc62b421b139d3e8a1dd1cb6 /makefile
parentaeff38fe153addba50b40600166acd42e7885e99 (diff)
downloadportland-os-cdc7b2ae532fd3a93e13784812f7501f2fd5c07a.tar.gz
more of bootloader, tiny kernel stub
Diffstat (limited to 'makefile')
-rw-r--r--makefile17
1 files changed, 15 insertions, 2 deletions
diff --git a/makefile b/makefile
index c3d4174..2c9d11c 100644
--- a/makefile
+++ b/makefile
@@ -1,10 +1,23 @@
-floppy: out bootloader
- mkfs.fat -C -f 1 -F 12 -n "PORTLAND OS" -R 2 -S 512 out/floppy.img 1440
+floppy: out bootloader files
+ mkfs.fat -C -f 1 -F 12 -n "PORTLAND OS" -R 4 -S 512 out/floppy.img 1440
+ mkdir out/floppy_mount
+ mount out/floppy.img out/floppy_mount
+ cp out/fs/* out/floppy_mount/
+ umount out/floppy_mount
dd if=obj/bootloader.bin of=out/floppy.img bs=1 seek=62 conv=notrunc
bootloader: obj
nasm src/bootloader.bin -o obj/bootloader.bin
+kernel: obj out
+ gcc -c src/kernel/main.c -o obj/kmain.o -ffreestanding
+ gcc -c src/kernel/vga.c -o obj/kvga.o -ffreestanding
+ ld obj/kmain.o obj/kvga.o -o out/kernel.out -nostdlib --oformat=i386-aout
+
+files: kernel
+ mkdir out/fs
+ cp out/kernel.out out/fs/kernel.sys
+
obj:
mkdir -p obj