diff options
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; +} |