aboutsummaryrefslogtreecommitdiff
path: root/src/features/load.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/features/load.c')
-rw-r--r--src/features/load.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/features/load.c b/src/features/load.c
index bc56235..36548bb 100644
--- a/src/features/load.c
+++ b/src/features/load.c
@@ -2,6 +2,7 @@
#include <def.h>
#include <fs.h>
+#include <load.h>
#include <mem.h>
#include <print.h>
#include <proc.h>
@@ -14,4 +15,11 @@ void bin_load(char *path, struct proc *proc)
proc->regs.ebp = (u32)stack;
proc->regs.esp = (u32)stack;
proc->regs.eip = (u32)data;
+
+ proc->regs.ds = GDT_DATA_OFFSET;
+ proc->regs.es = GDT_DATA_OFFSET;
+ proc->regs.fs = GDT_DATA_OFFSET;
+ proc->regs.gs = GDT_DATA_OFFSET;
+ proc->regs.cs = GDT_CODE_OFFSET;
+ proc->regs.eflags = EFLAGS_ALWAYS | EFLAGS_INTERRUPTS;
}