summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2016-10-10 00:32:43 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2016-10-10 00:32:43 -0400
commitb4e7da079f9dab9720b89e4899247b8ef976d247 (patch)
tree910bc45d66c662a4b3f899073abc7476dc397d6e
parentf0a321a91230dafc3d9d5c68bbcec86fcf0511e0 (diff)
downloadkernel-fun-b4e7da079f9dab9720b89e4899247b8ef976d247.tar.gz
C testing entry point
-rw-r--r--Makefile12
1 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 8bb5127..2a6fc61 100644
--- a/Makefile
+++ b/Makefile
@@ -15,11 +15,17 @@ irq.o: irq.asm
kernel.o: kernel.asm
$(nasm) -o kernel.o kernel.asm
-$(TARGET): irq.o io.o kernel.o boot.o
- ld -g -m elf_i386 -T link.ld -o $(TARGET) boot.o io.o irq.o kernel.o
+ctest.o: ctest.c
+ gcc -c -o ctest.o -m32 -O3 -nostdlib -nostdinc \
+ -fno-builtin -fno-stack-protector \
+ -nostartfiles -nodefaultlibs \
+ -Wall -Wextra \
+ ctest.c
+$(TARGET): ctest.o irq.o io.o kernel.o boot.o
+ ld -g -m elf_i386 -T link.ld -o $(TARGET) boot.o io.o irq.o ctest.o kernel.o
run: $(TARGET)
- qemu-system-i386 -m 2M -kernel $(TARGET)
+ qemu-system-i386 -m 8M -kernel $(TARGET)
debug: $(TARGET)
qemu-system-i386 -d int,guest_errors -no-reboot -s -S -m 8M -kernel $(TARGET) &