From 41a17c3428ae5a06ef779c7e8834349c294485b9 Mon Sep 17 00:00:00 2001 From: Yaossg Date: Fri, 15 Nov 2024 21:29:39 +0800 Subject: [PATCH] demo --- demo/hello.c | 6 ++++++ run.sh | 5 +++++ 2 files changed, 11 insertions(+) create mode 100644 demo/hello.c create mode 100644 run.sh diff --git a/demo/hello.c b/demo/hello.c new file mode 100644 index 0000000..4000513 --- /dev/null +++ b/demo/hello.c @@ -0,0 +1,6 @@ +int printf(const char* format, ...); + +int main() { + printf("hello world %d\n", 42); + return 0; +} \ No newline at end of file diff --git a/run.sh b/run.sh new file mode 100644 index 0000000..97cc6a2 --- /dev/null +++ b/run.sh @@ -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 $? \ No newline at end of file