diff options
author | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-16 20:46:15 +0200 |
---|---|---|
committer | Aqua-sama <aqua@iserlohn-fortress.net> | 2021-03-16 20:46:15 +0200 |
commit | 785d20a6b809e140448108e29b791d59c4650c91 (patch) | |
tree | 2617763dac6520d83a969157e89c339ee70c6ee3 /src/scheduler | |
parent | Switch lto to full (diff) | |
download | kernel.cpp-785d20a6b809e140448108e29b791d59c4650c91.tar.xz |
Mostly fix scheduler throwing page faults
Diffstat (limited to 'src/scheduler')
-rw-r--r-- | src/scheduler/task.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/scheduler/task.cc b/src/scheduler/task.cc new file mode 100644 index 0000000..7f62f8d --- /dev/null +++ b/src/scheduler/task.cc @@ -0,0 +1,8 @@ +#include "scheduler.h" + +Scheduler::task::task(uint8_t* stack, void (*entry)(), uint16_t cs) { + cpu = reinterpret_cast<cpu_state_t*>(stack + 4096 - sizeof(cpu_state_t)); + cpu->eip = reinterpret_cast<uint32_t>(entry); + cpu->cs = cs; + cpu->eflags = 0x202; +} |