-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernel.cpp
41 lines (30 loc) · 1.11 KB
/
kernel.cpp
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
#include "utils.h"
#include "architecture/types.h"
#include "architecture/ia32/globalDescriptorTable.h"
#include "architecture/ia32/interrupts/interruptManager.h"
#include "architecture/ia32/pics/intel8259a/intel8259aManager.h"
extern "C" void kernelMain(const void* multiboot_structure, uint32_t magicnumber)
{
clearScreen();
printf("==================================================\n");
printf("# Welcome to cppOS #\n");
printf("==================================================\n");
printf("\n");
printf("Initializing PIC Manager...");
Intel8259AManager picManager(0x20);
printf("Done\n");
printf("Disabling Interrupts...");
picManager.StopInterrupts();
printf("Done\n");
printf("Initializing Global Descriptor Table (GDT)...");
GlobalDescriptorTable globalDescriptorTable;
printf("Done\n");
printf("Initializing Interrupt Manager...");
InterruptManager interruptManager(0x20, &globalDescriptorTable, &picManager);
printf("Done\n");
printf("Activating Interrupts...");
picManager.StartInterrupts();
printf("Done\n\n\n");
// Keep the Kernel running
while(1);
}