From 8c5fef6e00b0afe7a4f72fe9f8c72ade1ce4c673 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Thu, 6 Aug 2020 20:41:07 +0200 Subject: Some context switch fixes. I'm quite tired actually and I don't seem to find my mistakes... --- src/inc/load.h | 6 ------ src/inc/proc.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'src/inc') diff --git a/src/inc/load.h b/src/inc/load.h index 697248e..60fecf9 100644 --- a/src/inc/load.h +++ b/src/inc/load.h @@ -5,12 +5,6 @@ #include -#define EFLAGS_ALWAYS 0x2 // Always one -#define EFLAGS_INTERRUPTS 0x200 // Enable interrupts - -#define GDT_DATA_OFFSET 0x10 // Data segment offset in GDT -#define GDT_CODE_OFFSET 0x8 // Code segment offset in GDT - void bin_load(char *path, struct proc *proc); #endif diff --git a/src/inc/proc.h b/src/inc/proc.h index dc8b9e9..8231810 100644 --- a/src/inc/proc.h +++ b/src/inc/proc.h @@ -6,17 +6,25 @@ #include #include +#define EFLAGS_ALWAYS 0x2 // Always one +#define EFLAGS_INTERRUPTS 0x200 // Enable interrupts + +#define GDT_DATA_OFFSET 0x10 // Data segment offset in GDT +#define GDT_CODE_OFFSET 0x8 // Code segment offset in GDT + enum state { PROC_RUNNING, PROC_ASLEEP }; struct proc { u32 pid; enum state state; + char name[32]; struct regs regs; /* struct proc *parent; */ struct proc *next; }; void proc_init(); +void proc_print(); struct proc *proc_make(); #endif -- cgit v1.2.3