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