From 63167f223e1f54910f6b80e698390ee60aec79ee Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Tue, 11 Aug 2020 11:33:21 -0400 Subject: lots of progress currently, BAR fields of IDE drives are all returning zero, and the ATA read function isn't working. i'm not sure why. i'm going to work on VESA next, and come back to the IDE driver later --- makefile | 51 ++++++++++++++++++++++++++++++++++----------------- 1 file changed, 34 insertions(+), 17 deletions(-) (limited to 'makefile') diff --git a/makefile b/makefile index bc4bdd7..03ab19a 100644 --- a/makefile +++ b/makefile @@ -1,12 +1,12 @@ -disk: kernel boot fs- +disk: kernel boot skel hello mkdir -p obj out - /sbin/mkfs.fat -C -f 1 -F 16 -n "PORTLAND OS" -R 17 -s 1 -S 512 obj/shadow.img 8192 + /sbin/mkfs.fat -C -f 1 -F 16 -n "PORTLAND OS" -R 65 -s 1 -S 512 obj/shadow.img 8192 echo -n -e '\xeb\x3c' > obj/jmp.bin dd if=obj/jmp.bin of=obj/shadow.img obs=2 conv=notrunc dd if=out/boot.bin of=obj/shadow.img obs=1 seek=62 conv=notrunc dd if=out/kernel.bin of=obj/shadow.img seek=1 conv=notrunc mv obj/shadow.img out/disk.img - mcopy -i out/disk.img -s out/fs/bleh.txt ::/ + mcopy -i out/disk.img -s out/fs/* ::/ vdi-file: disk VBoxManage convertfromraw out/disk.img out/disk.vdi --uuid a61929ed-3bf2-45ff-b98a-44f87c616dba @@ -14,27 +14,44 @@ vdi-file: disk debug: disk gdb -x qemu-debug.gdb -fs-: - cp -r fs out/fs +clean: + rm -r obj out + +skel: + mkdir -p out/fs + cp -r fs-skel/* out/fs/ + +kgccargs = -Wall -m32 -Og -ffreestanding -fno-asynchronous-unwind-tables +ugccargs = ${kgccargs} -Isrc/libc/inc +nasmargs = -f elf32 + +hello: + mkdir -p obj/hello out/fs/bin + nasm ${nasmargs} src/user/hello/hello.asm -o obj/hello/hello.o + ld -T src/user-elf.ld obj/hello/hello.o -o obj/hello.elf + objcopy -O binary obj/hello.elf out/fs/bin/hello.ple + +init: + #TODO -kgccargs = -m32 -ffreestanding -fno-asynchronous-unwind-tables kernel: mkdir -p obj/kernel out - gcc ${kgccargs} -c src/kernel/main.c -o obj/kernel/main.o - gcc ${kgccargs} -c src/kernel/vga.c -o obj/kernel/vga.o + gcc ${kgccargs} -c src/kernel/drive.c -o obj/kernel/drive.o gcc ${kgccargs} -c src/kernel/fat.c -o obj/kernel/fat.o - gcc ${kgccargs} -c src/kernel/fs.c -o obj/kernel/fs.o - gcc ${kgccargs} -c src/kernel/ata.c -o obj/kernel/ata.o - gcc ${kgccargs} -c src/kernel/util.c -o obj/kernel/utilc.o + gcc ${kgccargs} -c src/kernel/ide.c -o obj/kernel/ide.o + gcc ${kgccargs} -c src/kernel/main.c -o obj/kernel/main.o + gcc ${kgccargs} -c src/kernel/mem.c -o obj/kernel/mem.o gcc ${kgccargs} -c src/kernel/panic.c -o obj/kernel/panic.o + gcc ${kgccargs} -c src/kernel/pci.c -o obj/kernel/pci.o + gcc ${kgccargs} -c src/kernel/plef.c -o obj/kernel/plef.o gcc ${kgccargs} -c src/kernel/serial.c -o obj/kernel/serial.o - nasm -f elf32 src/kernel/util.asm -o obj/kernel/utila.o - ld -T src/kernel/link.ld obj/kernel/main.o obj/kernel/vga.o obj/kernel/fat.o obj/kernel/fs.o obj/kernel/ata.o obj/kernel/utilc.o obj/kernel/panic.o obj/kernel/utila.o obj/kernel/serial.o -o obj/kernel.elf - objcopy -O binary -j .entry -j .bin obj/kernel.elf out/kernel.bin + gcc ${kgccargs} -c src/kernel/task.c -o obj/kernel/task.o + gcc ${kgccargs} -c src/kernel/util.c -o obj/kernel/util.o + gcc ${kgccargs} -c src/kernel/vesa.c -o obj/kernel/vesa.o + gcc ${kgccargs} -c src/kernel/vga.c -o obj/kernel/vga.o + ld -T src/kernel/elf-link.ld obj/kernel/*.o -o obj/kernel.elf + objcopy -O binary obj/kernel.elf out/kernel.bin boot: mkdir -p out nasm src/boot.asm -o out/boot.bin - -clean: - rm -r obj out -- cgit v1.2.3