aboutsummaryrefslogtreecommitdiff
path: root/src/core/scheduler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/scheduler.h')
-rw-r--r--src/core/scheduler.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/core/scheduler.h b/src/core/scheduler.h
index 8495e77..9055fda 100644
--- a/src/core/scheduler.h
+++ b/src/core/scheduler.h
@@ -1,7 +1,36 @@
#ifndef SCHEDULER_H
#define SCHEDULER_H
+#include "mem.h"
+
+
+#define MAX_PROC 10
+
+// If you change the following struct
+// please consider updating the code in scheduler_asm.S
+typedef struct REGISTERS {
+ u32 eax, ebx, ecx, edx;
+ u32 cs, eip;
+ u32 ss, esp, ebp;
+ u32 esi, edi;
+ u32 ds, es, fs, gs;
+ u32 eflags;
+} __attribute__((packed)) REGISTERS;
+
+// If you change the following struct
+// please consider updating the code in scheduler_asm.S
+typedef struct PROC {
+ u16 id;
+ u16 pid;
+ u32* page_dir;
+ REGISTERS regs;
+} __attribute__((packed)) PROC;
+
extern char show_tics;
+extern char scheduler_on;
+extern PROC procs[MAX_PROC];
+extern u16 current_id;
+extern u16 nproc;
void clock();
void schedule();