From ba2c07447ba1278d8ad38ca58a8ae94c82d2d008 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Sun, 28 Mar 2021 12:00:16 +0200 Subject: Added ring0 privileges to kernel processes This enables a more efficient idling process using the hlt instruction. The context-switching is a bit slower now, too. I have to look into that. --- kernel/inc/proc.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kernel/inc') diff --git a/kernel/inc/proc.h b/kernel/inc/proc.h index eb972d3..71d1284 100644 --- a/kernel/inc/proc.h +++ b/kernel/inc/proc.h @@ -14,6 +14,8 @@ #define EFLAGS_ALWAYS 0x2 // Always one #define EFLAGS_INTERRUPTS 0x200 // Enable interrupts +#define GDT_SUPER_CODE_OFFSET 0x08 // Super (kernel) code segment offset in GDT +#define GDT_SUPER_DATA_OFFSET 0x10 // Super (kernel) data segment offset in GDT #define GDT_USER_CODE_OFFSET 0x1b // User code segment offset in GDT (with ring3 mask) #define GDT_USER_DATA_OFFSET 0x23 // User data segment offset in GDT (with ring3 mask) @@ -48,12 +50,12 @@ struct stream { struct proc { u32 pid; u32 entry; - u8 priv; char name[32]; struct stream streams[4]; struct page_dir *page_dir; struct regs regs; struct proc_wait wait; // dev_id + enum proc_priv priv; enum proc_state state; struct stack *messages; struct list *memory; -- cgit v1.2.3