diff options
author | Freya Murphy <freya@freyacat.org> | 2025-04-25 11:36:23 -0400 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2025-04-25 11:36:23 -0400 |
commit | 16f5d0443aa072d977517be45dcf9b0d12f584b4 (patch) | |
tree | a673b4889b0d4f4c3a5d355cceb884e1cc0e57d1 /kernel/main.c | |
parent | fmt (diff) | |
download | comus-16f5d0443aa072d977517be45dcf9b0d12f584b4.tar.gz comus-16f5d0443aa072d977517be45dcf9b0d12f584b4.tar.bz2 comus-16f5d0443aa072d977517be45dcf9b0d12f584b4.zip |
load init from ata and run it
Diffstat (limited to '')
-rw-r--r-- | kernel/main.c | 13 |
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(); } |