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 {
|
364
|
13 G = G + 1;
|
363
|
14 io.print2("G = ", G);
|
|
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
|
364
|
23 do();
|
360
|
24 io.println("Welcome to lcfos!");
|
362
|
25
|
363
|
26 do();
|
|
27 do();
|
|
28 do();
|
|
29 do();
|
|
30
|
360
|
31 io.print_int(0x1337);
|
364
|
32 io.print_int(cast<int>(&G));
|
363
|
33 //io.print2("Test: ", 0x13);
|
340
|
34
|
360
|
35 var int a;
|
362
|
36 for (a = 0; a < 2; a = a + 1)
|
360
|
37 {
|
362
|
38 //io.print2("a = ", a);
|
360
|
39 }
|
362
|
40
|
|
41 io.print2("PFR0 = ", arch.pfr0());
|
|
42 io.print2("PFR1 = ", arch.pfr1());
|
|
43 io.print2("MMFR0 = ", arch.mmfr0());
|
|
44 io.print2("MPUIR = ", arch.mpuir());
|
|
45
|
357
|
46 // process.init();
|
301
|
47 //memory:init();
|
292
|
48
|
296
|
49 //Process proc = new process:Process();
|
292
|
50
|
296
|
51 //scheduler:queue(proc);
|
340
|
52 while(true) {}
|
283
|
53 }
|
|
54
|
293
|
55 function void panic()
|
283
|
56 {
|
308
|
57 arch.halt();
|
283
|
58 }
|
|
59
|