#ifndef TASK_H #define TASK_H #include <stdint.h> extern void initTasking(); typedef struct { uint32_t eax, ebx, ecx, edx, esi, edi, esp, ebp, eip, eflags, cr3; } Registers; typedef struct Task { Registers registers; // the register states for the task struct Task *nextTask; // linked list of tasks that need to be done } Task; extern void initTasking(); extern void createTask(Task *task, uint32_t mainFunction, uint32_t flags, uint32_t *pagedir); extern void yield(); extern void yields(); // yield, but schedule the currently running task extern void switchTask(Registers *old, Registers *new); // swicht from the old to the new task extern void schedule(Task* task); // schedule a task to be run in the future extern void setRunningTask(Task* task); // set the task currently executed #endif