aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2022-09-14 23:34:58 +0300
committerKimplul <kimi.h.kuparinen@gmail.com>2022-09-14 23:34:58 +0300
commit30055ec1753b5f8cfc2940dba5d4188475fdbf7f (patch)
tree5497eb92f0f7083755589ca5a31755166a739522 /arch
parentcabbf335824db0df835e4c541c19d3803ce38454 (diff)
downloadkmi-30055ec1753b5f8cfc2940dba5d4188475fdbf7f.tar.gz
kmi-30055ec1753b5f8cfc2940dba5d4188475fdbf7f.zip
add putch syscall for easier userspace debugging
+ Note that it is NOT intended for end user usage, just for debugging.
Diffstat (limited to 'arch')
-rwxr-xr-xarch/riscv64/conf/initbin1096 -> 1232 bytes
-rw-r--r--arch/riscv64/conf/initrdbin1536 -> 1536 bytes
-rw-r--r--arch/riscv64/conf/s.S44
-rw-r--r--arch/riscv64/kernel/entry.S2
4 files changed, 45 insertions, 1 deletions
diff --git a/arch/riscv64/conf/init b/arch/riscv64/conf/init
index 0a67c41..23c3097 100755
--- a/arch/riscv64/conf/init
+++ b/arch/riscv64/conf/init
Binary files differ
diff --git a/arch/riscv64/conf/initrd b/arch/riscv64/conf/initrd
index 6021c8f..efba349 100644
--- a/arch/riscv64/conf/initrd
+++ b/arch/riscv64/conf/initrd
Binary files differ
diff --git a/arch/riscv64/conf/s.S b/arch/riscv64/conf/s.S
index 516dc39..7dbaf4f 100644
--- a/arch/riscv64/conf/s.S
+++ b/arch/riscv64/conf/s.S
@@ -10,3 +10,47 @@ li a2, 2
li a3, 3
li a4, 4
ecall
+
+/* "print" hello world */
+li a0, 1
+li a1, 'H'
+ecall
+li a0, 1
+li a1, 'e'
+ecall
+li a0, 1
+li a1, 'l'
+ecall
+li a0, 1
+li a1, 'l'
+ecall
+li a0, 1
+li a1, 'o'
+ecall
+li a0, 1
+li a1, ','
+ecall
+li a0, 1
+li a1, ' '
+ecall
+li a0, 1
+li a1, 'w'
+ecall
+li a0, 1
+li a1, 'o'
+ecall
+li a0, 1
+li a1, 'r'
+ecall
+li a0, 1
+li a1, 'l'
+ecall
+li a0, 1
+li a1, 'd'
+ecall
+li a0, 1
+li a1, '!'
+ecall
+li a0, 1
+li a1, '\n'
+ecall
diff --git a/arch/riscv64/kernel/entry.S b/arch/riscv64/kernel/entry.S
index 7301d4e..1bd6046 100644
--- a/arch/riscv64/kernel/entry.S
+++ b/arch/riscv64/kernel/entry.S
@@ -128,7 +128,7 @@ restore_noreturn:
lr s2, offsetof_s2(sp)
lr s3, offsetof_s3(sp)
lr s4, offsetof_s4(sp)
- lr s5, offsetof_s4(sp)
+ lr s5, offsetof_s5(sp)
lr s6, offsetof_s6(sp)
lr s7, offsetof_s7(sp)
lr s8, offsetof_s8(sp)