- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkernel.cpp
More file actions
Latest commit
executable file
·51 lines (41 loc) · 1.41 KB
/
Copy pathkernel.cpp
File metadata and controls
executable file
·51 lines (41 loc) · 1.41 KB
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
#include"gdt.h"
#include"textio.h"
#include"types.h"
#include"port.h"
#include"memory.h"
#include"interrupts.h"
#include"keyboard.h"
#include"clock.h"
#include"mouse.h"
typedefvoid (*constructor)();
extern"C" constructor start_ctors;
extern"C" constructor end_ctors;
extern"C"voidcallConstructors() {
for(constructor* i = &start_ctors; i != &end_ctors; i++)
(*i)();
}
extern"C"voidkernelMain(constvoid* multiboot_structure, unsignedint multiboot_magic) {
print("[kernel - kernelMain] initializing GDT... ");
GlobalDescriptorTable gdt;
puts("done");
print("[kernel - kernelMain] instanciating interrupt manager... ");
InterruptManager interrupts(&gdt);
puts("done");
print("[kernel - kernelMain] instanciating clock...");
Clock clock(&interrupts);
puts("done");
print("[kernel - kernelMain] instanciating keyboard handler... ");
KeyboardDriver keyboard(&interrupts);
puts("done");
print("[kernel - kernelMain] instanciating mouse handler... ");
MouseDriver mouse(&interrupts);
puts("done");
print("[kernel - kernelMain] activating interrupt manager... ");
interrupts.activate();
puts("done");
print("\n");
print("WELCOME TO MoOS!\n", 0x0b);
print("Currently, this screen is the only thing I can offer here.\nFeel free to move around your mouse or type something nice... Have fun ;D\n");
while(true) {
}
}