2024-12-24 13:31:12 +00:00
|
|
|
if [ $(uname -m) != "riscv64" ]; then
|
|
|
|
function compile_and_run() {
|
|
|
|
riscv64-linux-gnu-gcc-12 -static $1.s -o $1.elf
|
|
|
|
qemu-riscv64 $1.elf
|
|
|
|
}
|
|
|
|
else
|
|
|
|
function compile_and_run() {
|
|
|
|
gcc $1.s -o $1.elf
|
|
|
|
./$1.elf
|
|
|
|
}
|
|
|
|
fi
|
|
|
|
|
2024-12-23 14:42:31 +00:00
|
|
|
gcc boot.c -o boot.elf &&
|
|
|
|
./boot.elf < $1 > $1.s &&
|
2024-12-24 13:31:12 +00:00
|
|
|
compile_and_run $1
|
2024-12-07 06:13:34 +00:00
|
|
|
echo $?
|
2024-12-24 13:31:12 +00:00
|
|
|
rm $1.s $1.s.elf boot.elf 2> /dev/null
|