riscv back
This commit is contained in:
parent
92f4b4f561
commit
2b9ed2e2a4
4 changed files with 58 additions and 13 deletions
17
run.sh
17
run.sh
|
@ -1,6 +1,17 @@
|
|||
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
|
||||
|
||||
gcc boot.c -o boot.elf &&
|
||||
./boot.elf < $1 > $1.s &&
|
||||
riscv64-linux-gnu-gcc-12 -static $1.s -o $1.elf &&
|
||||
qemu-riscv64 $1.elf
|
||||
compile_and_run $1
|
||||
echo $?
|
||||
rm $1.s $1.elf boot.elf 2> /dev/null
|
||||
rm $1.s $1.s.elf boot.elf 2> /dev/null
|
Loading…
Add table
Add a link
Reference in a new issue