-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkernal.cpp
88 lines (72 loc) · 2.68 KB
/
kernal.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "header/types.h"
#include "header/std.h"
#include "header/gdt.h"
#include "header/keyboard.h"
#include "header/mouse.h"
#include "header/interrupts.h"
typedef void (*constructor)();
extern "C" constructor start_ctors;
extern "C" constructor end_ctors;
extern "C" void callConstructors()
{
for(constructor* i = &start_ctors; i != &end_ctors; i++)
(*i)();
}
extern "C" void kernelMain(const void* multiboot_structure, unsigned int /*multiboot_magic*/)
{
cls();
GlobalDescriptorTable gdt;
InterruptManager interrupts(0x20, &gdt);
printf("\n Started GDT ...");
KeyboardDriver keyboard(&interrupts);
printf("\n Started keyboard ...");
MouseDriver mouse(&interrupts);
printf("\n Started mouse ...");
interrupts.Activate();
printf( " _____ _ _ _____ _ __ \n");
printf( "/ ____| | | | /\\ / ____| |/ / \n");
printf( " (___ | |__| | / \\ | | | ' / \n");
printf( " \\___ \\| __ | / /\\ \\| | | < \n");
printf( "___) | | | |/ ____ \\ |____| . \\ \n");
printf( "_____/|_| |_/_/ \\_\\_____|_|\\_\\ \n");
printf("Welcome to Sudev operating system\nPlease enter a command\n");
{
// printf("\nSUDEV> ");
// char * ch = readStr();
// if (strEql(ch , "sudev") == 1)
// {
// printf("\nyou are in god mode");
// }
// else if (strEql(ch , "shutdown") == 1)
// {
// printf("\nGoodbye");
// shutdown();
// }
// else if (strEql(ch , "restart") == 1)
// {
// printf("\nSee you soon");
// reboot();
// }
// else if (strEql(ch , "help") == 1)
// {
// printf("\nFollowing Commands are available");
// printf("\nshutdown - what does it sound like");
// printf("\nrestart - give me an another chance to grow up once again");
// printf("\ncls - clean slate");
// }
// else if (strEql(ch , "cls") == 1)
// {
// cls();
// }
// else
// {
// printf("\nType help");
// printf("\nyou typed ");printf(ch);
// }
}
// KeyboardConfig KeyboardConfigobj;
// printf("\nYour keyboard mode is ");printf(KeyboardConfigobj.mode);
// char * ch = readStr();
// printf("\nyou typed ");printf(ch);
while(1);
}