-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
28 lines (22 loc) · 868 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
V := @
OBJ_DIR := build
.PHONY: all
all:$(OBJ_DIR)/xv6-rs.img
qemu: $(OBJ_DIR)/xv6-rs.img
qemu-system-i386 -no-reboot -nographic -serial mon:stdio build/xv6-rs.img
#qemu-system-i386 -d int -no-reboot -hda $<
clean:
make -C bootloader V=$(V) clean
make -C kernel V=$(V) clean
rm -rf $(OBJ_DIR)
$(OBJ_DIR)/bootloader/bootloader:
$(V)make -C bootloader V=$(V)
$(OBJ_DIR)/kernel/kernel:
$(V)make -C kernel V=$(V)
# How to build the kernel disk image
$(OBJ_DIR)/xv6-rs.img: $(OBJ_DIR)/bootloader/bootloader $(OBJ_DIR)/kernel/kernel
@echo + mk $@
$(V)dd if=/dev/zero of=$(OBJ_DIR)/xv6-rs.img~ count=10000 2>/dev/null
$(V)dd if=$(OBJ_DIR)/bootloader/bootloader of=$(OBJ_DIR)/xv6-rs.img~ conv=notrunc 2>/dev/null
$(V)dd if=$(OBJ_DIR)/kernel/kernel of=$(OBJ_DIR)/xv6-rs.img~ seek=1 conv=notrunc 2>/dev/null
$(V)mv $(OBJ_DIR)/xv6-rs.img~ $(OBJ_DIR)/xv6-rs.img