aboutsummaryrefslogtreecommitdiff
path: root/Common.mk
diff options
context:
space:
mode:
Diffstat (limited to 'Common.mk')
-rw-r--r--Common.mk15
1 files changed, 12 insertions, 3 deletions
diff --git a/Common.mk b/Common.mk
index 450e870..dba0faa 100644
--- a/Common.mk
+++ b/Common.mk
@@ -19,6 +19,9 @@ QFLAGS = -M raspi2b -cpu cortex-a7 -m 1G
QFLAGS += -chardev stdio,id=char0,mux=on,logfile=serial.log,signal=off -serial chardev:char0 -mon chardev=char0
#QFLAGS += -serial pipe:/tmp/guest
QFLAGS += -device usb-kbd
+ifneq ("$(wildcard ./sd.hda)","")
+ QFLAGS += -drive file=sd.hda,if=sd,format=raw
+endif
#QFLAGS += -trace events=events
#QFLAGS += -nographic
@@ -31,7 +34,7 @@ endif
CFLAGS += -DVERSION="\"0.1b\""
-.PHONY: clean run run-debug debug export tree
+.PHONY: clean run run-debug debug export tree disk
default: clean build/kernel7.img
@@ -52,8 +55,8 @@ build/kernel.elf: ${A_OBJECTD} ${C_OBJECTD}
@mkdir -p $(@D)
${CC} -T linker.ld -o $@ -ffreestanding -O3 -nostdlib $^
-export: build/kernel.list
- cp build/kernel-g.elf /mnt/c/Local/
+export: build/kernel.elf sd.hda
+ cp $^ /mnt/c/temp/
obj/%.co: src/%.c
@mkdir -p $(@D)
@@ -74,6 +77,12 @@ run-debug: build/kernel-g.elf
debug: build/kernel-g.elf build/kernel.list
${GDB} $< -command=gdbinit
+sd.hda:
+ cp README.md sd.hda
+ dd if=/dev/zero of=sd.hda count=1 bs=1 seek=16383
+
+disk: sd.hda
+
clean:
rm -rf obj/* build/*