diff --git a/flake.nix b/flake.nix index 12a74fc..2d3bfb5 100644 --- a/flake.nix +++ b/flake.nix @@ -273,8 +273,14 @@ rec { ''; }; - libiwasm = buildtype: flags: - i386_pkgs.stdenv.mkDerivation { + mkLibiwasm = { + buildenv, + platform, + buildtype, + cflags, + extraCmakeFlags ? [], + }: + buildenv.mkDerivation { pname = "libiwasm"; version = "2.4.4"; @@ -289,33 +295,64 @@ rec { nativeBuildInputs = with pkgs; [cmake]; cmakeBuildType = buildtype; - cmakeFlags = [ - "-DCMAKE_SYSTEM_NAME=Generic" - "-DCMAKE_SYSTEM_PROCESSOR=i386" - "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" + cmakeFlags = + extraCmakeFlags + ++ [ + "-DCMAKE_VERBOSE_MAKEFILE=ON" + "-DCMAKE_COLOR_DIAGNOSTICS=ON" - "-DCMAKE_VERBOSE_MAKEFILE=ON" - "-DCMAKE_COLOR_DIAGNOSTICS=ON" - - "-DWAMR_BUILD_PLATFORM=baremetal" - "-DWAMR_BUILD_TARGET=X86_32" - "-DWAMR_BUILD_AOT=1" - "-DWAMR_BUILD_WAMR_COMPILER=0" - "-DWAMR_BUILD_INTERP=1" - "-DWAMR_BUILD_FAST_INTERP=0" - "-DWAMR_BUILD_JIT=0" - "-DWAMR_BUILD_FAST_JIT=0" - "-DWAMR_BUILD_LIBC_BUILTIN=1" - "-DWAMR_BUILD_LIBC_WASI=0" - "-DWAMR_BUILD_SIMD=0" - ]; + "-DWAMR_BUILD_PLATFORM=${platform}" + "-DWAMR_BUILD_TARGET=X86_32" + "-DWAMR_BUILD_AOT=1" + "-DWAMR_BUILD_WAMR_COMPILER=0" + "-DWAMR_BUILD_INTERP=1" + "-DWAMR_BUILD_FAST_INTERP=0" + "-DWAMR_BUILD_JIT=0" + "-DWAMR_BUILD_FAST_JIT=0" + "-DWAMR_BUILD_LIBC_BUILTIN=1" + "-DWAMR_BUILD_LIBC_WASI=0" + "-DWAMR_BUILD_SIMD=0" + ]; # Since GCC 15, implicit declarations are an error. Disable this. - NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration " + flags; + NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration " + cflags; }; - libiwasm_debug = libiwasm "Debug" "-O0 -ggdb"; - libiwasm_release = libiwasm "Release" "-O2 -ggdb -DNDEBUG"; + libiwasm-baremetal-debug = mkLibiwasm { + buildenv = i386_pkgs.stdenv; + platform = "baremetal"; + buildtype = "Debug"; + cflags = "-O0 -ggdb"; + extraCmakeFlags = [ + "-DCMAKE_SYSTEM_NAME=Generic" + "-DCMAKE_SYSTEM_PROCESSOR=i386" + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" + ]; + }; + libiwasm-baremetal-release = mkLibiwasm { + buildenv = i386_pkgs.stdenv; + platform = "baremetal"; + buildtype = "Release"; + cflags = "-O2 -ggdb -DNDEBUG"; + extraCmakeFlags = [ + "-DCMAKE_SYSTEM_NAME=Generic" + "-DCMAKE_SYSTEM_PROCESSOR=i386" + "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY" + ]; + }; + + libiwasm-linux-debug = mkLibiwasm { + buildenv = pkgs.multiStdenv; + platform = "linux"; + buildtype = "Debug"; + cflags = "-O0 -ggdb"; + }; + libiwasm-linux-release = mkLibiwasm { + buildenv = pkgs.multiStdenv; + platform = "linux"; + buildtype = "Release"; + cflags = "-O2 -ggdb -DNDEBUG"; + }; # =========================================================================================== # Specify dependencies @@ -329,6 +366,7 @@ rec { # - Interpreters needed by patchShebangs for build scripts (with the --build flag), which can be the case for e.g. perl nativeBuildInputs = with pkgs; [ just + gdb xxd wabt grub2 @@ -398,7 +436,6 @@ rec { wasi-sdk = wasi-sdk; iwasm = iwasm; wamrc = wamrc; - libiwasm = libiwasm_release; }; apps = { default = flake-utils.lib.mkApp {drv = fail-bin;}; @@ -406,7 +443,6 @@ rec { wasi-sdk = wasi-sdk; iwasm = iwasm; wamrc = wamrc; - libiwasm = libiwasm_release; }; devShells = { @@ -427,10 +463,14 @@ rec { FAIL_SHARE = "${fail-bin}/share"; WASI_ROOT = wasi-sdk; WAMR_ROOT = wamr; - LIBIWASM_DEBUG = "${libiwasm_debug}/lib"; - LIBIWASM_RELEASE = "${libiwasm_release}/lib"; - CROSSCC = "${i386_pkgs.buildPackages.gcc}/bin/i386-elf-gcc"; - CROSSCXX = "${i386_pkgs.buildPackages.gcc}/bin/i386-elf-g++"; + LIBIWASM_DEBUG = "${libiwasm-baremetal-debug}/lib"; + LIBIWASM_RELEASE = "${libiwasm-baremetal-release}/lib"; + LIBIWASM_LINUX_DEBUG = "${libiwasm-linux-debug}/lib"; + LIBIWASM_LINUX_RELEASE = "${libiwasm-linux-release}/lib"; + CROSS_CC = "${i386_pkgs.stdenv.cc}/bin/i386-elf-gcc"; + CROSS_CXX = "${i386_pkgs.stdenv.cc}/bin/i386-elf-g++"; + LINUX_CC = "${pkgs.multiStdenv.cc}/bin/gcc"; + LINUX_CXX = "${pkgs.multiStdenv.cc}/bin/g++"; }; }; }); diff --git a/justfile b/justfile index ba9ff53..dff1079 100644 --- a/justfile +++ b/justfile @@ -7,10 +7,31 @@ WASI_ROOT := env("WASI_ROOT") WAMR_ROOT := env("WAMR_ROOT") LIBIWASM_DEBUG := env("LIBIWASM_DEBUG") LIBIWASM_RELEASE := env("LIBIWASM_RELEASE") -CROSS_CC := env("CROSSCC") -CROSS_CXX := env("CROSSCXX") +LIBIWASM_LINUX_DEBUG := env("LIBIWASM_LINUX_DEBUG") +LIBIWASM_LINUX_RELEASE := env("LIBIWASM_LINUX_RELEASE") +CROSS_CC := env("CROSS_CC") +LINUX_CC := env("LINUX_CC") -# C -> WASM +# =================================================================================================================== # +# Helper recipes +# =================================================================================================================== # + +[default] +[private] +list: + @just --list --unsorted + +[private] +create-build-dir module: + mkdir -p {{ BUILD_DIR }}-{{ module }} + +[doc("Delete the build directory")] +clean module: + rm -rf {{ BUILD_DIR }}-{{ module }} + +# =================================================================================================================== # +# Build WASM module recipes +# =================================================================================================================== # WASI_CC := f"{{WASI_ROOT}}/bin/clang" WASI_CFLAGS := "\ @@ -26,9 +47,6 @@ WASI_CFLAGS := "\ -Wl,--export=__heap_base \ -Wl,--export=__data_end \ " - -# WASM -> AOT - WAMRC := "wamrc" WAMRCFLAGS := "\ --target=i386 \ @@ -37,7 +55,25 @@ WAMRCFLAGS := "\ " XXD := "xxd" -# Load AOT from WAMR (FAIL+Baremetal) +[doc("C -> WASM: Compile a C function to a WASM module using WASI-SDK")] +[group("build-module")] +build-wasm-module module: (create-build-dir module) + {{ WASI_CC }} {{ WASI_CFLAGS }} targets/wasm-module/{{ module }}.c -o {{ BUILD_DIR }}-{{ module }}/wasm_module.wasm + +[doc("WASM -> AOT: Compile a WASM module ahead-of-time using WAMR")] +[group("build-module")] +build-wasm-aot module: (build-wasm-module module) + {{ WAMRC }} {{ WAMRCFLAGS }} -o {{ BUILD_DIR }}-{{ module }}/wasm_module.aot {{ BUILD_DIR }}-{{ module }}/wasm_module.wasm + +[doc("AOT -> C-Array: Dump a WASM module compiled ahead-of-time to a binary array")] +[group("build-module")] +build-wasm-aot-array module: (build-wasm-aot module) + {{ XXD }} -i {{ BUILD_DIR }}-{{ module }}/wasm_module.aot > {{ BUILD_DIR }}-{{ module }}/wasm_module_array.c + +# =================================================================================================================== # +# Host program recipes +# =================================================================================================================== # +# FAIL* CROSS_CFLAGS := "\ -I./targets/wasm-host \ @@ -66,38 +102,63 @@ CROSS_INCLUDES := f"\ -I{{WAMR_ROOT}}/core/shared/platform/baremetal \ " -# Build recipes +# LINUX-POSIX -[default] -[private] -list: - @just --list --unsorted +LINUX_CFLAGS := "\ +-I./targets/wasm-host \ +-O0 \ +-m32 \ +-ffunction-sections \ +-fdata-sections \ +-ggdb \ +" +LINUX_LDFLAGS := f"\ +-Wl,--build-id=none \ +-m32 \ +-Wl,-rpath,{{LIBIWASM_LINUX_DEBUG}} \ +-L{{LIBIWASM_LINUX_DEBUG}} \ +-liwasm \ +-lm \ +" +LINUX_INCLUDES := f"\ +-I{{WAMR_ROOT}}/core/iwasm/include \ +-I{{WAMR_ROOT}}/core/shared/utils \ +-I{{WAMR_ROOT}}/core/shared/platform/linux \ +" -[private] -create-build-dir module: - mkdir -p {{ BUILD_DIR }}-{{ module }} +# LINUX-Baremetal -[doc("Delete the build directory")] -clean module: - rm -rf {{ BUILD_DIR }}-{{ module }} +LINUX_BAREMETAL_CFLAGS := "\ +-I./targets/wasm-host \ +-O0 \ +-m32 \ +-ffunction-sections \ +-fdata-sections \ +-ffreestanding \ +-ggdb \ +" +LINUX_BAREMETAL_LDFLAGS := f"\ +-Wl,--build-id=none \ +-static \ +-nostdlib \ +-m32 \ +-L{{LIBIWASM_DEBUG}} \ +-liwasm \ +-lc \ +-lgcc \ +-lm \ +--entry main \ +" +LINUX_BAREMETAL_INCLUDES := f"\ +-I{{WAMR_ROOT}}/core/iwasm/include \ +-I{{WAMR_ROOT}}/core/shared/utils \ +-I{{WAMR_ROOT}}/core/shared/platform/baremetal \ +" -[doc("C -> WASM: Compile a C function to a WASM module using WASI-SDK")] -[group("build")] -build-wasm-module module: (create-build-dir module) - {{ WASI_CC }} {{ WASI_CFLAGS }} targets/wasm-module/{{ module }}.c -o {{ BUILD_DIR }}-{{ module }}/wasm_module.wasm - -[doc("WASM -> AOT: Compile a WASM module ahead-of-time using WAMR")] -[group("build")] -build-wasm-aot module: (build-wasm-module module) - {{ WAMRC }} {{ WAMRCFLAGS }} -o {{ BUILD_DIR }}-{{ module }}/wasm_module.aot {{ BUILD_DIR }}-{{ module }}/wasm_module.wasm - -[doc("AOT -> C-Array: Dump a WASM module compiled ahead-of-time to a binary array")] -[group("build")] -build-wasm-aot-array module: (build-wasm-aot module) - {{ XXD }} -i {{ BUILD_DIR }}-{{ module }}/wasm_module.aot > {{ BUILD_DIR }}-{{ module }}/wasm_module_array.c +# TODO: Grave mistake to template the commands depending on the target... Should've used shebang recipes instead [doc("Compile C-Host: The host uses WAMR to load the AOT module")] -[group("build")] +[group("build-host")] build-wasm-host module target="fail": (build-wasm-aot-array module) cp targets/wasm-host/{{ target }}.c {{ BUILD_DIR }}-{{ module }}/module_host.c sed -i \ @@ -105,50 +166,53 @@ build-wasm-host module target="fail": (build-wasm-aot-array module) -e "s/__WASM_ARRAY__/build_{{ module }}_wasm_module_aot/g" \ -e "s/__WASM_ARRAY_LEN__/build_{{ module }}_wasm_module_aot_len/g" \ {{ BUILD_DIR }}-{{ module }}/module_host.c - {{ CROSS_CC }} {{ CROSS_CFLAGS }} {{ CROSS_INCLUDES }} \ - -c {{ BUILD_DIR }}-{{ module }}/module_host.c \ - -o {{ BUILD_DIR }}-{{ module }}/system.o + + # Build depending on the target platform + {{ if target == "fail" { CROSS_CC + " " + CROSS_CFLAGS + " " + CROSS_INCLUDES } else if target == "linux" { LINUX_CC + " " + LINUX_CFLAGS + " " + LINUX_INCLUDES } else if target == "linux-baremetal" { CROSS_CC + " " + LINUX_BAREMETAL_CFLAGS + " " + LINUX_BAREMETAL_INCLUDES } else { error("invalid target") } }} \ + -c {{ BUILD_DIR }}-{{ module }}/module_host.c \ + -o {{ BUILD_DIR }}-{{ module }}/system.o [doc("Compile bootloader")] -[group("build")] -build-system-startup module: - {{ CROSS_CC }} targets/startup.s {{ CROSS_CFLAGS }} -c -o {{ BUILD_DIR }}-{{ module }}/startup.o +[group("build-host")] +build-system-startup module target="fail": + {{ if target == "fail" { CROSS_CC } else if target == "linux" { LINUX_CC } else if target == "linux-baremetal" { CROSS_CC } else { error("invalid target") } }} \ + targets/startup.s \ + {{ if target == "fail" { CROSS_CFLAGS } else if target == "linux" { LINUX_CFLAGS } else if target == "linux-baremetal" { LINUX_BAREMETAL_CFLAGS } else { error("invalid target") } }} \ + -c -o {{ BUILD_DIR }}-{{ module }}/startup.o [doc("Compile newlib syscall stubs")] -[group("build")] -build-system-syscalls module: - {{ CROSS_CC }} targets/syscalls.c {{ CROSS_CFLAGS }} -c -o {{ BUILD_DIR }}-{{ module }}/syscalls.o +[group("build-host")] +build-system-syscalls module target="fail": + {{ if target == "fail" { CROSS_CC } else if target == "linux" { LINUX_CC } else if target == "linux-baremetal" { CROSS_CC } else { error("invalid target") } }} \ + targets/syscalls.c \ + {{ if target == "fail" { CROSS_CFLAGS } else if target == "linux" { LINUX_CFLAGS } else if target == "linux-baremetal" { LINUX_BAREMETAL_CFLAGS } else { error("invalid target") } }} \ + -c -o {{ BUILD_DIR }}-{{ module }}/syscalls.o [doc("Link C-Host, syscall stubs and bootloader")] -[group("build")] -build-system module target="fail": (build-wasm-host module target) (build-system-syscalls module) (build-system-startup module) - {{ CROSS_CC }} -Wl,-T targets/linker.ld \ +[group("build-host")] +link-system module target="fail": (build-wasm-host module target) (build-system-syscalls module target) (build-system-startup module target) + {{ if target == "fail" { CROSS_CC } else if target == "linux" { LINUX_CC } else if target == "linux-baremetal" { CROSS_CC } else { error("invalid target") } }} \ + {{ if target == "fail" { "-Wl,-T targets/linker.ld" } else { "" } }} \ {{ BUILD_DIR }}-{{ module }}/system.o \ - {{ BUILD_DIR }}-{{ module }}/syscalls.o \ - {{ BUILD_DIR }}-{{ module }}/startup.o \ - {{ CROSS_LDFLAGS }} -o {{ BUILD_DIR }}-{{ module }}/system.elf + {{ if target == "fail" { f"{{BUILD_DIR}}-{{module}}/syscalls.o" + " " + f"{{BUILD_DIR}}-{{module}}/startup.o" } else { "" } }} \ + {{ if target == "linux-baremetal" { f"{{BUILD_DIR}}-{{module}}/syscalls.o" } else { "" } }} \ + {{ if target == "fail" { CROSS_LDFLAGS } else if target == "linux" { LINUX_LDFLAGS } else if target == "linux-baremetal" { LINUX_BAREMETAL_LDFLAGS } else { error("invalid target") } }} \ + -o {{ BUILD_DIR }}-{{ module }}/system.elf [doc("Create bootdisk")] -[group("build")] -build-iso module target="fail": (build-system module target) +[group("build-host")] +build-iso module target="fail": (link-system module target) mkdir -p {{ BUILD_DIR }}-{{ module }}/grub/boot/grub cp targets/grub.cfg {{ BUILD_DIR }}-{{ module }}/grub/boot/grub/ cp {{ BUILD_DIR }}-{{ module }}/system.elf {{ BUILD_DIR }}-{{ module }}/grub/boot/ grub-mkrescue -o {{ BUILD_DIR }}-{{ module }}/system.iso {{ BUILD_DIR }}-{{ module }}/grub -# FAIL* recipes - -BOCHS_RUNNER := "bochs-experiment-runner.py" -FAIL_TRACE := "fail-x86-tracing" -FAIL_DUMP := "dump-trace" -FAIL_IMPORT := "import-trace --database-option-file ./db.conf" -FAIL_PRUNE := "prune-trace --database-option-file ./db.conf" -FAIL_SERVER := "generic-experiment-server --database-option-file ./db.conf" -FAIL_INJECT := "generic-experiment-client" -RESULT_BROWSER := "resultbrowser.py -c ./db.conf" +# =================================================================================================================== # +# MySQL recipes +# =================================================================================================================== # [doc("Start MySQL container to receive FAIL* trace/campaign results")] -[group("fail")] +[group("fail-db")] start-db: docker run -d \ --name fail-db \ @@ -160,20 +224,33 @@ start-db: mysql [doc("Connect to MySQL database using DBeaver")] -[group("fail")] +[group("fail-db")] connect-db: dbeaver -con "name=fail|driver=mysql|host=localhost|port=3306|database=fail|user=fail|password=fail" [doc("Stop MySQL container")] -[group("fail")] +[group("fail-db")] stop-db: docker stop fail-db [doc("Remove MySQL container")] -[group("fail")] +[group("fail-db")] remove-db: docker container rm fail-db +# =================================================================================================================== # +# FAIL* recipes +# =================================================================================================================== # + +BOCHS_RUNNER := "bochs-experiment-runner.py" +FAIL_TRACE := "fail-x86-tracing" +FAIL_DUMP := "dump-trace" +FAIL_IMPORT := "import-trace" +FAIL_PRUNE := "prune-trace" +FAIL_SERVER := "generic-experiment-server" +FAIL_INJECT := "generic-experiment-client" +RESULT_BROWSER := "resultbrowser.py" + [doc("Trace a golden run using FAIL*")] [group("fail")] trace module: @@ -201,33 +278,50 @@ trace module: [doc("Import a FAIL* golden run trace")] [group("fail")] import module: - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i MemoryImporter \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i MemoryImporter \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b mem - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i RegisterImporter \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i RegisterImporter \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b regs --flags - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i RegisterImporter \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i RegisterImporter \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b ip --no-gp --ip - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i ElfImporter --objdump objdump \ + + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i ElfImporter --objdump objdump \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b ip - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i ElfImporter --objdump objdump \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i ElfImporter --objdump objdump \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b mem - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i ElfImporter --objdump objdump \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i ElfImporter --objdump objdump \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b regs - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i ElfImporter --objdump objdump \ + + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i ElfImporter --objdump objdump \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b ip --sources - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i ElfImporter --objdump objdump \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i ElfImporter --objdump objdump \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b mem --sources - {{ FAIL_IMPORT }} -t {{ BUILD_DIR }}-{{ module }}/trace.pb -i ElfImporter --objdump objdump \ + {{ FAIL_IMPORT }} --database-option-file ./db.conf -t {{ BUILD_DIR }}-{{ module }}/trace.pb \ + -i ElfImporter --objdump objdump \ -e {{ BUILD_DIR }}-{{ module }}/system.elf -v {{ module }} -b regs --sources - {{ FAIL_PRUNE }} -v {{ module }} -b %% --overwrite + + {{ FAIL_PRUNE }} --database-option-file ./db.conf -v {{ module }} -b %% --overwrite @echo "Next step: \"just server {{ module }}\"" [doc("Start the FAIL* campaign server")] [group("fail")] server module: - {{ FAIL_SERVER }} -v {{ module }} -b % --inject-single-bit --inject-registers & + {{ FAIL_SERVER }} --database-option-file ./db.conf -v {{ module }} -b % --inject-single-bit --inject-registers & @echo "Next step: \"just client {{ module }}\"" +[doc("Stop the FAIL* campaign server")] +[group("fail")] +stop-server: + pkill -f {{ FAIL_SERVER }} + [doc("Start a FAIL* campaign client")] [group("fail")] client module: @@ -244,7 +338,7 @@ client module: -Wf,--timeout=500000 \ -Wf,--ok-marker=ok_marker \ -Wf,--fail-marker=fail_marker \ - 2>/dev/null | grep -B 2 -A 8 'INJECT' + > /dev/null @echo "Next step: \"just result {{ module }}\" or \"just resultbrowser\"" [doc("Query FAIL* marker statistics from the database")] @@ -263,4 +357,18 @@ result module: [doc("Start the FAIL* resultbrowser")] [group("fail")] resultbrowser: - {{ RESULT_BROWSER }} --host=0.0.0.0 --port=5000 + {{ RESULT_BROWSER }} -c ./db.conf --host=0.0.0.0 --port=5000 + +# =================================================================================================================== # +# Debugging recipes +# =================================================================================================================== # + +[doc("Launch radare2 at os_main")] +[group("debug")] +radare module: + radare2 -AA -c "s dbg.os_main; pdf" {{ BUILD_DIR }}-{{ module }}/system.elf + +[doc("Launch gdb")] +[group("debug")] +gdb module: + gdb --tui {{ BUILD_DIR }}-{{ module }}/system.elf diff --git a/targets/wasm-host/baremetal.c b/targets/wasm-host/linux-baremetal.c similarity index 100% rename from targets/wasm-host/baremetal.c rename to targets/wasm-host/linux-baremetal.c