From 32bb6a933e55821da4ea3cd192d4aea11d4b1994 Mon Sep 17 00:00:00 2001 From: karina Date: Sun, 26 Apr 2026 11:09:56 +0400 Subject: [PATCH] build: removed drun, dcrun, crun and combined it as flags to run --- justfile | 57 +++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 27 deletions(-) diff --git a/justfile b/justfile index 749656d..45f5896 100644 --- a/justfile +++ b/justfile @@ -67,44 +67,47 @@ _prep: @mcopy -i {{IMG_FILE}} {{BOOT_BIN}} ::/EFI/BOOT/BOOTAA64.EFI @mcopy -i {{IMG_FILE}} {{BUILD_DIR}}/Kernel/ksOSKernel.elf ::/ksOSKernel.elf -@run: _image - @echo "๐Ÿš€ Launching (accel: {{ACCEL_INFO}})..." - qemu-system-aarch64 {{ACCEL}} \ - -machine virt,acpi=off \ - -cpu {{CPU}} \ - -m {{RAM}} \ - -device ramfb \ - {{DISPLAY_FLAGS}} \ - -drive if=pflash,format=raw,readonly=on,file={{OVMF_ARM}} \ - -drive file={{IMG_FILE}},format=raw,if=none,id=hd0 \ - -device virtio-blk-device,drive=hd0 \ - -serial stdio \ - -monitor telnet:127.0.0.1:5555,server,nowait -@drun: _image - @echo "๐Ÿš€ Debugging (accel: {{ACCEL_INFO}})..." +run *FLAGS: + #!/usr/bin/env bash + set -e + + FLAGS=" {{FLAGS}} " + + if [[ "$FLAGS" == *" -clean "* ]]; then + echo "๐Ÿงน Cleaning..." + just clean + fi + + just _image + + DEBUG_ARGS="" + DISPLAY_ARGS="{{DISPLAY_FLAGS}}" + STATE_MSG="Launching" + + if [[ "$FLAGS" == *" -debug "* ]]; then + DEBUG_ARGS="-s -S" + STATE_MSG="Debugging" + fi + + if [[ "$FLAGS" == *" -nographic "* ]]; then + DISPLAY_ARGS="-nographic" + fi + + echo "๐Ÿš€ $STATE_MSG (accel: {{ACCEL_INFO}})..." + qemu-system-aarch64 {{ACCEL}} \ -machine virt,acpi=off \ -cpu {{CPU}} \ -m {{RAM}} \ -device ramfb \ - {{DISPLAY_FLAGS}} \ + $DISPLAY_ARGS \ -drive if=pflash,format=raw,readonly=on,file={{OVMF_ARM}} \ -drive file={{IMG_FILE}},format=raw,if=none,id=hd0 \ -device virtio-blk-device,drive=hd0 \ -serial stdio \ -monitor telnet:127.0.0.1:5555,server,nowait \ - -s -S - -@crun: - @echo "๐Ÿงน Cleaning and running.." - just clean - just run - -@dcrun: - @echo "๐Ÿงน Cleaning and debugging.." - just clean - just drun + $DEBUG_ARGS @clean: just Bootloader clean