aboutsummaryrefslogtreecommitdiff
path: root/src/scheduler
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-03-16 20:46:15 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2021-03-16 20:46:15 +0200
commit785d20a6b809e140448108e29b791d59c4650c91 (patch)
tree2617763dac6520d83a969157e89c339ee70c6ee3 /src/scheduler
parentSwitch lto to full (diff)
downloadkernel.cpp-785d20a6b809e140448108e29b791d59c4650c91.tar.xz
Mostly fix scheduler throwing page faults
Diffstat (limited to 'src/scheduler')
-rw-r--r--src/scheduler/task.cc8
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;
+}