[][src]Function sunrise_kernel::main

fn main()

The kernel's main.

State

Called after the arch-specific initialisations are done.

At this point the scheduler is initialized, and we are running as process init.

Goal

Our job is to launch all the Kernel Internal Processes.

These are the minimal set of sysmodules considered essential to system bootup (filesystem, loader, sm, pm, boot), which either provide necessary services for loading a process, or may define the list of other processes to launch (boot).

We load their elf with a minimal elf_loader, add them to the schedule queue, and run them as regular userspace processes.

Afterwards

After this, our job here is done. We mark the init process (ourselves) as killed, unschedule, and kernel initialisation is considered finished.

From now on, the kernel's only job will be to respond to IRQs and serve syscalls.