1
0
Fork 0
mirror of https://github.com/tailix/kernel.git synced 2024-11-20 11:16:10 -05:00

Task switch to user mode works

This commit is contained in:
Braiden Vasco 2017-11-05 17:03:00 +00:00
parent f8ab00c358
commit 1afdbaa6fe
2 changed files with 4 additions and 3 deletions

View file

@ -26,8 +26,8 @@
#define GDT_NULL_SELECTOR GDT_SEGMENT_SELECTOR(GDT_NULL_INDEX)
#define GDT_KERNEL_CS_SELECTOR GDT_SEGMENT_SELECTOR(GDT_KERNEL_CS_INDEX)
#define GDT_KERNEL_DS_SELECTOR GDT_SEGMENT_SELECTOR(GDT_KERNEL_DS_INDEX)
#define GDT_USER_CS_SELECTOR GDT_SEGMENT_SELECTOR(GDT_USER_CS_INDEX)
#define GDT_USER_DS_SELECTOR GDT_SEGMENT_SELECTOR(GDT_USER_DS_INDEX)
#define GDT_USER_CS_SELECTOR (GDT_SEGMENT_SELECTOR(GDT_USER_CS_INDEX) | 3)
#define GDT_USER_DS_SELECTOR (GDT_SEGMENT_SELECTOR(GDT_USER_DS_INDEX) | 3)
#define GDT_TSS_SELECTOR GDT_SEGMENT_SELECTOR(GDT_TSS_INDEX)
#define INT_EXCEPTION_COUNT 32

View file

@ -5,6 +5,7 @@
#include "paging.h"
#include "timer.h"
#include "kprintf.h"
#include "tasks.h"
#include <kernelmq/info.h>
#include <kernelmq/stdlib.h>
@ -69,7 +70,7 @@ void main(const struct KernelMQ_Info *const kinfo_ptr)
paging_load();
for (unsigned int i = 0; i < kinfo.modules_count; ++i) {
((KernelMQ_Module_Function)kinfo.modules[i].base)();
tasks_switch_to_user(kinfo.modules[i].base);
}
timer_register_handler(on_timer);