summaryrefslogtreecommitdiff
path: root/kernel/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/build.sh')
-rwxr-xr-xkernel/build.sh27
1 files changed, 20 insertions, 7 deletions
diff --git a/kernel/build.sh b/kernel/build.sh
index d8086b6..86842b1 100755
--- a/kernel/build.sh
+++ b/kernel/build.sh
@@ -9,10 +9,13 @@ GRUB_CFG_PATH="src/grub.cfg"
ARCH="x86_64"
TARGET="$ARCH-uff"
RUST_BIN="$TARGET_PATH/$TARGET/debug/libkernel.a"
+QUEMU="qemu-system-x86_64 -cdrom $TARGET_PATH/uff.iso"
-remove_target() {
- rm -rf $TMP_PATH/* &> /dev/null
+cleanup_target() {
rm -f $TARGET_PATH/uff.iso &> /dev/null
+ rm -rf $TARGET_PATH/kernel.bin
+
+ cleanup_temp
}
create_target() {
@@ -54,7 +57,11 @@ build_init() {
}
build_launch() {
- qemu-system-x86_64 -cdrom $TARGET_PATH/uff.iso
+ $QUEMU
+}
+
+build_launch_serial() {
+ $QEMU -device isa-debug-exit,iobase=0xf4,iosize=0x04 -serial stdio #-display none
}
build_run() {
@@ -65,16 +72,20 @@ build_run() {
}
build_clean() {
- remove_target
+ cleanup_target
}
build_build() {
cargo xbuild
- rm -rf $TARGET_PATH/sysroot
- rm -rf $TARGET_PATH/kernel.bin
- rm -rf $TARGET_PATH/uff.iso
+ cleanup_target
build_run
}
+build_build() {
+ cargo xbuild --features testing
+ cleanup_target
+ build_kernel_iso
+ build_launch_serial
+}
build_all() {
build_kernel_elf
@@ -91,6 +102,7 @@ for arg in "$@"; do
"run") build_run;;
"clean") build_clean;;
"build") build_build;;
+ "test") build_tests;;
"all") build_all;;
*)
echo "warn: ignoring unknown option '$arg'"
@@ -107,6 +119,7 @@ print_help() {
echo " clean cleanup binaries"
echo " launch launch iso in qemu"
echo " run creates iso if necessary and runs it in qemu"
+ echo " test runs tests in qemu"
echo
echo " kernel-elf build the kernel-elf"
echo " kernel-iso build the kernel-elf if necessary and the kernel-iso"