aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
Diffstat (limited to 'src/sys')
-rw-r--r--src/sys/kernel.S5
-rw-r--r--src/sys/schedule.c2
2 files changed, 3 insertions, 4 deletions
diff --git a/src/sys/kernel.S b/src/sys/kernel.S
index 90e1c4f..3ffc6a5 100644
--- a/src/sys/kernel.S
+++ b/src/sys/kernel.S
@@ -4,10 +4,7 @@
kernel_main:
///https://wiki.osdev.org/ARM_Paging
// Query the ID_MMFR0 register
- mrc p15, 0, r2, c0, c1, 4
- mov r0, #0
- mov r1, #7
- bl draw_hex32
+ mrc p15, 0, r0, c0, c1, 4
bl sysinit
// Intentional undefined instruction
// .word 0xf7f0a000
diff --git a/src/sys/schedule.c b/src/sys/schedule.c
index dd59891..347b91a 100644
--- a/src/sys/schedule.c
+++ b/src/sys/schedule.c
@@ -42,8 +42,10 @@ void init_scheduler(void)
struct RStack get_stack(void)
{
struct RStack r = {.sp = 0, .idx = -1};
+ // Find an available stack
for (int i = 0; i < MAX_THREADS; i++) {
if (stacks_table[i] == 0) {
+ // Mark unavailable
stacks_table[i] = 1;
r.idx = i;
r.sp = (void*)0x20000000 - STACK_SIZE*i;