aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2024-02-12 17:23:44 +0000
committersotech117 <michael_foiani@brown.edu>2024-02-12 17:23:44 +0000
commitb02edfea01006ea536a8329666eae452b9b8978e (patch)
tree119f83ae5b0c9eef81f1e64b27892df99bbc3771
parent0e570e7302462034214c8082bd8e2b2c3706e0e0 (diff)
another docker conatiner fix and small weenix updates
-rw-r--r--.devcontainer/Dockerfile2
-rw-r--r--kernel/main/kmain.c6
-rw-r--r--kernel/proc/sched.c8
3 files changed, 13 insertions, 3 deletions
diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile
index 82b877f..9cf7799 100644
--- a/.devcontainer/Dockerfile
+++ b/.devcontainer/Dockerfile
@@ -2,4 +2,4 @@ FROM --platform=linux/x86_64 mcr.microsoft.com/devcontainers/base:ubuntu-22.04
LABEL authors="sotech117"
RUN sudo apt-get update
-RUN sudo apt-get install python2 python2-minimal cscope nasm make build-essential grub2-common qemu qemu-system xorriso genisoimage xterm gdb -y \ No newline at end of file
+RUN sudo apt-get install python2 python2-minimal cscope nasm make build-essential grub2-common grub-pc-bin qemu qemu-system xorriso genisoimage xterm gdb -y \ No newline at end of file
diff --git a/kernel/main/kmain.c b/kernel/main/kmain.c
index 1d61270..e45299a 100644
--- a/kernel/main/kmain.c
+++ b/kernel/main/kmain.c
@@ -168,7 +168,7 @@ static void *initproc_run(long arg1, void *arg2)
proctest_main(0, NULL);
- dbg(DBG_PROC, "%s", "In main thread!");
+ dbg(DBG_PROC, "%s", "In main thread!\n");
// see if there are any children to wait for
while (do_waitpid(-1, 0, 0) != -ECHILD)
@@ -205,7 +205,11 @@ void initproc_start()
sched_make_runnable(init_thread);
+ // update current thread to main thread
+ curthr = init_thread;
+
context_make_active(&curcore.kc_ctx); // start the scheduler
+ // context_make_active(&init_thread->kt_ctx);
// TODO: ask about how the core is linked to scheduler
}
diff --git a/kernel/proc/sched.c b/kernel/proc/sched.c
index c4f1d5a..d0e634f 100644
--- a/kernel/proc/sched.c
+++ b/kernel/proc/sched.c
@@ -270,7 +270,13 @@ void sched_make_runnable(kthread_t *thr)
{
// NOT_YET_IMPLEMENTED("PROCS: sched_make_runnable");
- dbg(DBG_SCHED, "Making thread with proc pid %d runnable\n", thr->kt_proc->p_pid);
+ dbg(DBG_SCHED, "Making thread with proc pid %d runnable\n in thread\n", thr->kt_proc->p_pid);
+ if (curthr == NULL)
+ {
+ dbg(DBG_SCHED, "I did this ^^ with a null thread!\n");
+ } else {
+ dbg(DBG_SCHED, "I did this ^^ with thread %d\n", curthr->kt_proc->p_pid);
+ }
KASSERT(thr != curthr);
KASSERT(thr->kt_state != KT_RUNNABLE);