summaryrefslogtreecommitdiffstats
path: root/main.c
blob: a5862870e26e8eed941021a54191fe775c0f20f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include "device/serial.h"
#include "arch/processor.h"
#include "arch/cpu.h"
#include "memory.h"
#include "commandline.h"
#include "tasking.h"
#include "initrd.h"
#include "print.h"

/**Setup datastructures and other fields required for the execution manager
 * and interfaces used by init.*/
void
kernel_main(void)
{
    serial_setup();

    cpu_setup();
    processor_setup(proc_bsp);

    mm_setup_early();
    mm_setup();

    tasking_setup();
    kpanic("Reached end of kernel_main\n");
}

/**Kernel execution context that sets up init.*/
void
kernel_stage2(void)
{
    cmdline_kernel_setup();

    initrd_setup();

    extern void kinit(void);
    kinit();
}