diff options
author | Marvin Borner | 2021-03-28 12:00:16 +0200 |
---|---|---|
committer | Marvin Borner | 2021-03-28 12:00:16 +0200 |
commit | ba2c07447ba1278d8ad38ca58a8ae94c82d2d008 (patch) | |
tree | 36984c091376e51b37bf119c27e22ecf6df46106 /kernel/inc | |
parent | 71e7dbd806326c21877eefc27f17eb9a06f63cbc (diff) |
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.
Diffstat (limited to 'kernel/inc')
-rw-r--r-- | kernel/inc/proc.h | 4 |
1 files changed, 3 insertions, 1 deletions
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; |