283
|
1 module kernel;
|
292
|
2
|
283
|
3 import memory;
|
|
4 import process;
|
292
|
5 import scheduler;
|
|
6 import arch;
|
355
|
7 import io;
|
283
|
8
|
363
|
9 var int G;
|
|
10
|
|
11 function void do()
|
|
12 {
|
|
13 io.print2("G = ", G);
|
|
14 G = G + 1;
|
|
15 }
|
|
16
|
283
|
17 // Main entry point of the kernel:
|
293
|
18 function void start()
|
283
|
19 {
|
363
|
20 G = 0;
|
353
|
21 arch.init();
|
362
|
22
|
360
|
23 io.println("Welcome to lcfos!");
|
362
|
24
|
363
|
25 do();
|
|
26 do();
|
|
27 do();
|
|
28 do();
|
|
29
|
360
|
30 io.print_int(0x1337);
|
363
|
31 //io.print_int(0x1338);
|
|
32 //io.print2("Test: ", 0x13);
|
340
|
33
|
360
|
34 var int a;
|
362
|
35 for (a = 0; a < 2; a = a + 1)
|
360
|
36 {
|
362
|
37 //io.print2("a = ", a);
|
360
|
38 }
|
362
|
39
|
|
40 io.print2("PFR0 = ", arch.pfr0());
|
|
41 io.print2("PFR1 = ", arch.pfr1());
|
|
42 io.print2("MMFR0 = ", arch.mmfr0());
|
|
43 io.print2("MPUIR = ", arch.mpuir());
|
|
44
|
357
|
45 // process.init();
|
301
|
46 //memory:init();
|
292
|
47
|
296
|
48 //Process proc = new process:Process();
|
292
|
49
|
296
|
50 //scheduler:queue(proc);
|
340
|
51 while(true) {}
|
283
|
52 }
|
|
53
|
293
|
54 function void panic()
|
283
|
55 {
|
308
|
56 arch.halt();
|
283
|
57 }
|
|
58
|