-
Notifications
You must be signed in to change notification settings - Fork 0
/
kernel.c
61 lines (50 loc) · 1.22 KB
/
kernel.c
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
#include "include/screen.h"
#include "include/kb.h"
#include "include/isr.h"
#include "include/idt.h"
kmain()
{
isr_install();
clearScreen();
print("Wellcome to Opperations System One: \n");
while (1)
{
print("\nos> ");
string ch = readStr();
if (strEql(ch,"help"))
{
print ("\n -------- HELP -------- ");
print ("\n Current OS1 commads are : ");
print ("\n");
print ("\n quit - ends kernel loop");
print ("\n cls - clear screen");
print ("\n numbers - convert integer to char representation and print");
print ("\n interrupt0 - executes a dvision by Zero");
}
if (strEql(ch,"quit"))
{
halt();
}
if (strEql (ch,"cls"))
{
clearScreen ();
}
if (strEql (ch, "numbers"))
{
string lengthstr;
int2str ( 1012, lengthstr);
print("\n int2str (1012) : "); print ( lengthstr);
int2str ( -2312, lengthstr);
print("\n int2str (-3212) : "); print ( lengthstr);
print("\n"); print ( (string) toStr(74123047));
int2str ( strlength (ch), lengthstr);
print("\n strlength: "); print( lengthstr ) ;
print("\n You entered: "); print (ch);
}
if (strEql(ch,"interrupt0"))
{
print("\nExecuting a Division By Zero:\n");
uint16 test = 7 / 0;
}
}
}