scheduler: initial implementation

This commit is contained in:
Matheus
2023-04-27 23:34:57 -03:00
parent 03a134445a
commit 5d33fe828f
4 changed files with 345 additions and 1 deletions
+7 -1
View File
@@ -10,8 +10,9 @@
#include <kernel/interrupt.h>
#include <kernel/vmm.h>
#include <kernel/timer.h>
#include <kernel/scheduler.h>
typedef struct {
typedef struct cpu_t {
uint64_t gdt[7];
ist_t ist;
long id;
@@ -21,8 +22,13 @@ typedef struct {
timer_t *timer;
bool intstatus;
long ipl;
thread_t *thread;
thread_t *idlethread;
timerentry_t schedtimerentry;
} cpu_t;
#define CPU_HALT() asm volatile("hlt")
static inline cpu_t *_cpu() {
return (cpu_t *)rdmsr(MSR_GSBASE);
}