aboutsummaryrefslogtreecommitdiff
path: root/src/sys
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2022-02-19 13:40:17 -0700
committerChristian Cunningham <cc@localhost>2022-02-19 13:40:17 -0700
commit9de5e07bc3920d4b03903eb5b78847973075059b (patch)
treecd0c23664beccb4c53f532650d94b722dec5f453 /src/sys
parent5419a7174ef491427797196903c35ce921129f27 (diff)
Added comments and cleanup
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;