summaryrefslogtreecommitdiff
path: root/kernel/main.c
blob: 86665113648c8c31650c6deb85faff4036cefc95 (plain)
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
38
39
40
41
42
43
44
45
46
#include <comus/cpu.h>
#include <comus/memory.h>
#include <comus/mboot.h>
#include <comus/efi.h>
#include <comus/drivers.h>
#include <comus/drivers/acpi.h>
#include <comus/drivers/pci.h>
#include <comus/drivers/gpu.h>
#include <comus/fs.h>
#include <lib.h>

void kreport(void)
{
	cpu_report();
	memory_report();
	acpi_report();
	pci_report();
	gpu_report();
}

void main(long magic, volatile void *mboot)
{
	// initalize idt and pic
	cpu_init();

	// load multiboot information
	mboot_init(magic, mboot);

	// load efi structures
	efi_init(mboot_get_efi_hdl(), mboot_get_efi_st());

	// initalize memory
	memory_init();

	// initalize devices
	drivers_init();

	// load file systems
	fs_init();

	// report system state
	kreport();

	// halt
	kprintf("halting...\n");
}