diff options
| author | Galen Sagarin <gps5307@rit.edu> | 2025-04-29 14:18:40 -0400 |
|---|---|---|
| committer | Galen Sagarin <gps5307@rit.edu> | 2025-04-29 14:18:40 -0400 |
| commit | ae2cdd83ba4a0cae161db0b29031d5591005fa34 (patch) | |
| tree | 82fbdfcbb1fe4e3b5e232db195c8c331d69489fd /kernel/main.c | |
| parent | Started writing fat.c (diff) | |
| parent | fs header changes (diff) | |
| download | comus-ae2cdd83ba4a0cae161db0b29031d5591005fa34.tar.gz comus-ae2cdd83ba4a0cae161db0b29031d5591005fa34.tar.bz2 comus-ae2cdd83ba4a0cae161db0b29031d5591005fa34.zip | |
Merge branch 'main' of https://github.com/kenshineto/kern into fat32
Merging main into here
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(); } |