283
|
1 module kernel;
|
292
|
2
|
283
|
3 import memory;
|
|
4 import process;
|
292
|
5 import scheduler;
|
|
6 import arch;
|
283
|
7
|
|
8 // Main entry point of the kernel:
|
293
|
9 function void start()
|
283
|
10 {
|
353
|
11 arch.init();
|
340
|
12
|
353
|
13 print("Welcome to lcfos!");
|
308
|
14 process.init();
|
301
|
15 //memory:init();
|
292
|
16
|
|
17
|
296
|
18 //Process proc = new process:Process();
|
292
|
19
|
296
|
20 //scheduler:queue(proc);
|
340
|
21 while(true) {}
|
283
|
22 }
|
|
23
|
353
|
24 function int strlen(string txt)
|
|
25 {
|
|
26
|
|
27 }
|
|
28
|
|
29 function int getchar(string txt, int index)
|
|
30 {
|
|
31 if (index < strlen(txt))
|
|
32 {
|
|
33 }
|
|
34 }
|
|
35
|
|
36 function void print(string txt)
|
|
37 {
|
|
38 var int i;
|
|
39 i = 0;
|
|
40
|
|
41 while (i < strlen(txt))
|
|
42 {
|
|
43 arch.putc(getchar(txt, i));
|
|
44 i = i + 1;
|
|
45 }
|
|
46 }
|
283
|
47
|
293
|
48 function void panic()
|
283
|
49 {
|
308
|
50 arch.halt();
|
283
|
51 }
|
|
52
|