aboutsummaryrefslogtreecommitdiff
path: root/kernel/main.c
blob: 5e236a7cf7021aa836b638b9ba6a3c484e570acf (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// MIT License, Copyright (c) 2020 Marvin Borner

#include <boot.h>
#include <cpu.h>
#include <fs.h>
#include <ide.h>
#include <interrupts.h>
#include <keyboard.h>
#include <load.h>
#include <mem.h>
#include <mouse.h>
#include <net.h>
#include <pci.h>
#include <random.h>
#include <serial.h>
#include <syscall.h>
#include <timer.h>

struct vid_info *boot_passed;

void kernel_main(struct vid_info *vid_info); // Decl
void kernel_main(struct vid_info *vid_info)
{
	heap_init(0x00f00000 + rand());

	boot_passed = vid_info;

	// Serial connection
	serial_install();
	serial_print("\nKernel was compiled at " __TIME__ " on " __DATE__ "\n");
	serial_print("Serial connected.\n");

	cpu_enable_features();
	cpu_print();

	// Install drivers
	vfs_install();
	device_install();
	ata_install();
	pci_install();
	interrupts_install();
	timer_install();
	keyboard_install();
	mouse_install();
	/* net_install(); */

	// Enable drivers
	sti();
	keyboard_reset();

	syscall_init();
	proc_init();

	idle();
}