aboutsummaryrefslogtreecommitdiff
path: root/kernel/head.S
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2024-12-02 21:02:35 +0100
committerMiquel Sabaté Solà <mikisabate@gmail.com>2024-12-02 21:02:35 +0100
commit6132623dbf3076da11cdb85c494fadd7ee0f0a93 (patch)
treebcfeaade99c13b9a02fff282e8ef3998e405f14a /kernel/head.S
parentd4e2441ad7063ce7ca29981ca527b1aa643b0b0c (diff)
downloadfbos-6132623dbf3076da11cdb85c494fadd7ee0f0a93.tar.gz
fbos-6132623dbf3076da11cdb85c494fadd7ee0f0a93.zip
Share the same stack everywhere
As documented in the code, we are not implementing any kind of memory protection, so in theory any process (regardless if running in user or kernel space) would be able to tamper with other processes' stack. Hence, don't even pretend that we are separating stacks and share the same global stack everywhere. This simplifies things a bit. Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'kernel/head.S')
-rw-r--r--kernel/head.S8
1 files changed, 5 insertions, 3 deletions
diff --git a/kernel/head.S b/kernel/head.S
index 9a12833..4390cc9 100644
--- a/kernel/head.S
+++ b/kernel/head.S
@@ -94,11 +94,13 @@ _start_kernel:
li t6, 0
csrw sscratch, 0
- // Point tp and sp to the init task. The 'tp' register will always point to
- // the current process being executed, and it will be shown on debug when
+ // Point 'tp' to the init task. The 'tp' register will always point to the
+ // current process being executed, and it will be shown on debug when
// printing out messages.
la tp, tasks
- la sp, tasks + THREAD_SIZE
+
+ // Point 'sp' the our general stack.
+ la sp, stack + THREAD_SIZE
// The `start_kernel` function requires an argument to be passed, which is
// the pointer to the `fdt` blob. The bootloader puts this on the `a1`