This commit is contained in:
Yaossg 2024-11-15 21:29:39 +08:00
parent 917ba6b619
commit 41a17c3428
2 changed files with 11 additions and 0 deletions

6
demo/hello.c Normal file
View File

@ -0,0 +1,6 @@
int printf(const char* format, ...);
int main() {
printf("hello world %d\n", 42);
return 0;
}

5
run.sh Normal file
View File

@ -0,0 +1,5 @@
gcc boot.c boot-lib.c &&
./a.out < $1 > $1.s &&
riscv64-linux-gnu-gcc-12 -static $1.s boot-lib.c -o $1.out &&
qemu-riscv64 $1.out
echo $?