From bb840ef326ab3570d201e045e894710fd6db18f2 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Wed, 17 Sep 2025 15:06:35 -0400 Subject: kern/amd64: proc: Add initial context switch logic This commit introduces new functions that will be useful for having multiple processes run on the system. - Add md_proc_yield() - Add md_proc_kick() - Add md_sched_switch() Signed-off-by: Ian Moffett --- src/sys/include/os/sched.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/sys/include/os/sched.h') diff --git a/src/sys/include/os/sched.h b/src/sys/include/os/sched.h index b393395..1850366 100644 --- a/src/sys/include/os/sched.h +++ b/src/sys/include/os/sched.h @@ -35,6 +35,7 @@ #include #include +#define SCHED_QUANTUM 10000 #define SCHED_NQUEUES 4 /* @@ -49,6 +50,13 @@ struct sched_queue { size_t nproc; }; +/* + * Context switch to another process + * + * @tf: Current CPU context frame + */ +void md_sched_switch(struct trapframe *tf); + /* * Enqueue a new process to a queue * -- cgit v1.2.3