Initial commit

This commit is contained in:
bdbrd 2025-10-22 15:51:24 +02:00
commit cbc51f523e
125 changed files with 34817 additions and 0 deletions

30
src/scheduler/sched.h Normal file
View file

@ -0,0 +1,30 @@
#include <stdint.h>
#pragma once
typedef enum proc_state {
RUNNING,
READY,
SLEEPING,
UNUSED = 0
}proc_state;
typedef struct context {
uint64_t rbx, rsp, rbp, r12, r13, r14, r15;
uint64_t rip, rflags;
} __attribute((packed))context;
typedef struct proc {
uint64_t *mem;
uint64_t *kstack;
proc_state state;
uint16_t pid;
context context;
}proc;
void scheduler_init();
#define PROC_MAX 512 // Max number of processes
#define INITIAL_STACK_SIZE 0x10000