aboutsummaryrefslogtreecommitdiff
path: root/tests/simple_uart/hello.c
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-09-22 22:45:18 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2024-09-22 22:45:18 +0300
commitb1d67364b4b4832b8efed112f7b0ead1a0b3cd3b (patch)
tree7926bfb428703515438c08b98c61cbffd34b3cbb /tests/simple_uart/hello.c
parent32f9719e29762001f73460acd31f2a6da8fd6298 (diff)
downloadgran-b1d67364b4b4832b8efed112f7b0ead1a0b3cd3b.tar.gz
gran-b1d67364b4b4832b8efed112f7b0ead1a0b3cd3b.zip
start experimenting with processor grids
Diffstat (limited to 'tests/simple_uart/hello.c')
-rw-r--r--tests/simple_uart/hello.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/simple_uart/hello.c b/tests/simple_uart/hello.c
new file mode 100644
index 0000000..30719e0
--- /dev/null
+++ b/tests/simple_uart/hello.c
@@ -0,0 +1,18 @@
+/* compile with
+ * riscv64-unknown-elf-gcc -ffreestanding -nostdlib -Wl,-Ttext=0 -march=rv64i -mabi=lp64 -O2 hello.c -o simple_hello
+ * xxd --include simple_hello
+ */
+void _start()
+{
+ /* relies on hard-coded system, good enough for this simple test */
+ volatile char *uart = (char *)4096;
+ *uart = 'H';
+ *uart = 'e';
+ *uart = 'l';
+ *uart = 'l';
+ *uart = 'o';
+ *uart = '!';
+ *uart = '\n';
+
+ asm ("ebreak\n");
+}