summaryrefslogtreecommitdiff
path: root/kernel/main.c
blob: 5b06ae29044b9d280701947994242a10bf93ed31 (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
#include <comus/cpu.h>
#include <comus/memory.h>
#include <comus/mboot.h>
#include <comus/drivers.h>
#include <comus/fs.h>
#include <lib.h>

struct memory_map mmap;

void main(long magic, volatile void *mboot)
{
	(void)magic; // TODO: check multiboot magic

	// initalize idt and pic
	// WARNING: must be done before anything else
	cpu_init();

	// load memory map
	mboot_load_mmap(mboot, &mmap);

	// initalize memory
	memory_init(&mmap);

	// initalize devices
	drivers_init();

	// load file systems
	fs_init();

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