diff options
author | Alexis211 <alexis211@gmail.com> | 2010-02-05 19:37:47 +0100 |
---|---|---|
committer | Alexis211 <alexis211@gmail.com> | 2010-02-05 19:37:47 +0100 |
commit | c0018a3607947922a51597df12fd2a6528af2fa2 (patch) | |
tree | 031225d03933dfe4e1f2ace1d91f5e98bcfd94d4 /src/stem/core | |
parent | 674014901a1e90ce1587a7709fe9bf5893b0e36e (diff) | |
download | TCE-c0018a3607947922a51597df12fd2a6528af2fa2.tar.gz TCE-c0018a3607947922a51597df12fd2a6528af2fa2.zip |
More work on tasking, paging, syscalls, stuff.
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"); } |