aboutsummaryrefslogtreecommitdiff
path: root/src/kernel/core/thread.c
diff options
context:
space:
mode:
authorAlex Auvolat <alex.auvolat@ens.fr>2015-02-13 18:53:36 +0100
committerAlex Auvolat <alex.auvolat@ens.fr>2015-02-13 18:53:36 +0100
commit0ea68568372b7b7b20bca6985ae4b36e8c99c0e9 (patch)
tree832f7f4ac8e2537cf5aee531634d01499bb4a318 /src/kernel/core/thread.c
parent7aafc22a01de5cabb99aed76782f6c0999b7de05 (diff)
downloadkogata-0ea68568372b7b7b20bca6985ae4b36e8c99c0e9.tar.gz
kogata-0ea68568372b7b7b20bca6985ae4b36e8c99c0e9.zip
Implement switching to usermode.
Diffstat (limited to 'src/kernel/core/thread.c')
-rw-r--r--src/kernel/core/thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/kernel/core/thread.c b/src/kernel/core/thread.c
index 9d11da2..519ba41 100644
--- a/src/kernel/core/thread.c
+++ b/src/kernel/core/thread.c
@@ -2,6 +2,7 @@
#include <malloc.h>
#include <dbglog.h>
#include <idt.h>
+#include <gdt.h>
#include <frame.h>
#include <paging.h>
@@ -88,6 +89,7 @@ void run_scheduler() {
current_thread = dequeue_thread();
if (current_thread != 0) {
+ set_kernel_stack(current_thread->stack_region->addr + current_thread->stack_region->size);
resume_context(&current_thread->ctx);
} else {
// Wait for an IRQ
@@ -146,7 +148,6 @@ thread_t *new_thread(entry_t entry, void* data) {
// used by user processes
t->proc = 0;
- t->usermem_pf_handler = 0;
t->kmem_violation_handler = 0;
return t;