diff options
Diffstat (limited to 'src/stem/core')
-rw-r--r-- | src/stem/core/kmain.c | 12 | ||||
-rw-r--r-- | src/stem/core/sys.c | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/src/stem/core/kmain.c b/src/stem/core/kmain.c index dbec8bd..28c2df7 100644 --- a/src/stem/core/kmain.c +++ b/src/stem/core/kmain.c @@ -10,13 +10,21 @@ #include <mem/mem.h> void kmain_othertask(void *data) { - while(1) monitor_write("2task "); + uint32_t i; + for(i = 0; i < 100; i++) { + monitor_write("2task "); + thread_sleep(0); + } + process_exit(0); } void kmain_stage2(void *data) { sti(); thread_new(current_thread->process, kmain_othertask, 0); - while (1) monitor_write("TASK1 "); + while (1) { + monitor_write("TASK1 "); + thread_sleep(0); + } } void kmain(struct multiboot_info_t* mbd, int32_t magic) { diff --git a/src/stem/core/sys.c b/src/stem/core/sys.c index 71d1c31..36ed6d0 100644 --- a/src/stem/core/sys.c +++ b/src/stem/core/sys.c @@ -36,6 +36,6 @@ void cli() { } void sti() { - if_locks--; + if (if_locks > 0) if_locks--; if (if_locks == 0) asm volatile("sti"); } |