'make check' will now try booting a kernel and will exit
gracefully once the kernel has finished loading.
Signed-off-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
.cscope
tags
include/common-cmds.h
+tests/boot/boot_test.iso
+tests/boot/rootfs/
check: $(PROGRAM)
$(MAKE) -C tests
./$(PROGRAM) run tests/pit/tick.bin
+ ./$(PROGRAM) run -d tests/boot/boot_test.iso -p "init=init"
.PHONY: check
clean:
$(Q) rm -f bios/*.elf
$(Q) rm -f bios/*.o
$(Q) rm -f bios/bios-rom.h
+ $(Q) rm -f tests/boot/boot_test.iso
+ $(Q) rm -rf tests/boot/rootfs/
$(Q) rm -f $(DEPS) $(OBJS) $(PROGRAM)
$(Q) rm -f cscope.*
$(Q) rm -f $(KVM_INCLUDE)/common-cmds.h
-all: kernel pit
+all: kernel pit boot
kernel:
$(MAKE) -C kernel
$(MAKE) -C pit
.PHONY: pit
+boot:
+ $(MAKE) -C boot
+.PHONY: boot
+
clean:
$(MAKE) -C kernel clean
$(MAKE) -C pit clean
+ $(MAKE) -C boot clean
.PHONY: clean
--- /dev/null
+NAME := init
+
+OBJ := $(NAME).o
+
+all: $(.o)
+ rm -rf rootfs
+ mkdir rootfs
+ gcc -static init.c -o rootfs/init
+ mkisofs rootfs > boot_test.iso
+
+clean:
+ rm -rf rootfs boot_test.iso
+.PHONY: clean
--- /dev/null
+#include <linux/reboot.h>
+#include <unistd.h>
+
+int main(int argc, char *argv[])
+{
+ puts("hello, KVM guest!\r");
+
+ reboot(LINUX_REBOOT_CMD_RESTART);
+
+ return 0;
+}