summaryrefslogtreecommitdiff
path: root/kernel/run
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/run')
-rwxr-xr-xkernel/run41
1 files changed, 12 insertions, 29 deletions
diff --git a/kernel/run b/kernel/run
index 8c52bd9..a1add1b 100755
--- a/kernel/run
+++ b/kernel/run
@@ -8,7 +8,7 @@ onerr() {
trap onerr ERR
name="uff"
-build_mode=release
+build_mode=debug
action=help
target=x86_64
test_mode=false
@@ -28,19 +28,16 @@ function define_vars() {
define_vars
print_help() {
- echo "usage: $0 (options) [action]"
+ echo "usage: $0 (options) [Path]"
+ echo " build and lauch the iso in qemu"
+ echo
echo "options:"
echo " -name=<str> set application name (standard: $name)"
echo " -mode=<str> set build mode (standard: $build_mode)"
echo " -target=<str> set target (standard: $target)"
echo " -test enable test mode (standard: disabled)"
echo " -serial enable serial mode (standard: disabled)"
- echo
- echo "actions:"
- echo " build build the iso"
- echo " run build and lauch the iso in qemu"
- echo " test build iso in test mode and run it in qemu"
- echo " help show this help message"
+ echo " -help show this help message"
exit
}
@@ -76,14 +73,6 @@ build() {
if test ! -d "$iso_path/isofiles"; then
prepare_iso
fi
- #if $test_mode; then
- # RUSTFLAGS="-Clink-arg=-r -Clink-dead-code" cargo xtest --no-run
- #else
- # cargo xbuild
- #fi
- if ! $test_mode; then
- cargo xbuild "--$build_mode"
- fi
build_iso
}
@@ -93,9 +82,9 @@ run() {
qemu="qemu-system-x86_64 -cdrom $iso_path/$name.iso"
if $test_mode; then
qemu="$qemu -device isa-debug-exit,iobase=0xf4,iosize=0x04 -serial stdio -no-reboot "
- if $serial_mode; then
- qemu="$qemu -display none"
- fi
+ fi
+ if $serial_mode; then
+ qemu="$qemu -display none"
fi
$qemu
case "$?" in
@@ -122,21 +111,15 @@ for arg in "$@"; do
test_mode=true; define_vars;;
-serial)
serial_mode=true; define_vars;;
- "run") action=run;;
- "build") action=build;;
- "test") action=test;;
- "help") action=help;;
+ -help)
+ print_help;;
*)
# echo "warn: ignoring unknown option '$arg'"
kernel_libary=$arg;;
esac
done
-case "$action" in
- "help") print_help;;
- "build") build;;
- "test") test_mode=true; build; run;;
- "run") build; run;;
-esac
+build
+run
echo -e "\x1b[1;32mdone\x1b[m"