summaryrefslogtreecommitdiff
path: root/kernel/main.c
diff options
context:
space:
mode:
authorIan McFarlane <i.mcfarlane2002@gmail.com>2025-04-25 11:51:09 -0400
committerIan McFarlane <i.mcfarlane2002@gmail.com>2025-04-25 11:51:09 -0400
commit25359ed1cb1a6131e9d3d26c8f2c8634670ed864 (patch)
tree559750220ff5084e33a2e1f5bc4f0c90b959a4f8 /kernel/main.c
parentfix freeing of virtual memory (diff)
parentpoweroff syscall (diff)
downloadcomus-25359ed1cb1a6131e9d3d26c8f2c8634670ed864.tar.gz
comus-25359ed1cb1a6131e9d3d26c8f2c8634670ed864.tar.bz2
comus-25359ed1cb1a6131e9d3d26c8f2c8634670ed864.zip
resolve format conflict
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/main.c b/kernel/main.c
index 4047a64..c15c38d 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -7,6 +7,7 @@
#include <comus/drivers/pci.h>
#include <comus/drivers/gpu.h>
#include <comus/drivers/ata.h>
+#include <comus/user.h>
#include <comus/fs.h>
#include <comus/procs.h>
#include <lib.h>
@@ -21,7 +22,7 @@ void kreport(void)
gpu_report();
}
-void main(long magic, volatile void *mboot)
+__attribute__((noreturn)) void main(long magic, volatile void *mboot)
{
// initalize idt and pic
cpu_init();
@@ -47,6 +48,12 @@ void main(long magic, volatile void *mboot)
// report system state
kreport();
- // halt
- kprintf("halting...\n");
+ // load init process
+ pcb_alloc(&init_pcb);
+ if (user_load(init_pcb, &fs_disks[0]))
+ panic("failed to load init");
+
+ // schedule and dispatch init
+ schedule(init_pcb);
+ dispatch();
}