Almost finished scheduler, switched to circular linked list

This commit is contained in:
ssimnb 2026-02-09 06:33:12 +01:00
parent edfbfdad14
commit 4c7ecb4012
10 changed files with 124 additions and 89 deletions

View file

@ -9,20 +9,23 @@ typedef enum proc_state {
UNUSED = 0
}proc_state;
typedef struct context {
struct context {
uint64_t r15, r14, r13, r12, rbp, rbx, rip;
} context;
};
typedef struct proc {
struct thread {
struct thread *next;
struct thread *prev;
uint64_t *mem;
uint64_t *kstack;
proc_state state;
uint16_t pid;
context *context;
}proc;
struct context *context;
};
void scheduler_init();
void enter_scheduler();
[[noreturn]] void sched();
void yield();
#define PROC_MAX 512 // Max number of processes