From f7a74ab248d3a033f795275fd4b9eda3e0b90834 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Fri, 11 Oct 2024 21:39:25 +0200 Subject: bin: Add helpers for gdb and qemu for RISC-V MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are now two scripts that can be used in order to quickly test a locally built Linux kernel which has been cross compiled for the RISC-V architecture. Signed-off-by: Miquel Sabaté Solà --- bin/run-riscv-gdb.sh | 54 +++++++++++++++++++++++++++++++++++++++++++++ bin/run-riscv-qemu.sh | 61 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100755 bin/run-riscv-gdb.sh create mode 100755 bin/run-riscv-qemu.sh (limited to 'bin') diff --git a/bin/run-riscv-gdb.sh b/bin/run-riscv-gdb.sh new file mode 100755 index 0000000..6efad17 --- /dev/null +++ b/bin/run-riscv-gdb.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env sh + +set -e + +TUI="" +BASE=${BASE:-~/src/git.kernel.org/linux/kernel} +PROFILE=${PROFILE:-riscv} +REPO=${REPO:-riscv} +VMLINUX=${VMLINUX:-$BASE/$REPO/vmlinux} + +while [[ $# -gt 0 ]]; do + case $1 in + -t | --tui) + TUI="-tui" + shift + ;; + -h | --help) + SHOW_HELP=1 + shift + ;; + -*) + echo "run-gdb (error): unknown option '$1'." + exit 1 + ;; + *) + echo "run-gdb (warning): argument '$1' will be ignored." + shift # past argument + ;; + esac +done + +# Print the show message if needed. +if [ -n "$SHOW_HELP" ]; then + cat <