Initial commit
This commit is contained in:
commit
cbc51f523e
125 changed files with 34817 additions and 0 deletions
30
src/scheduler/sched.h
Normal file
30
src/scheduler/sched.h
Normal 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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue