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
|
393
|
9 // Globals:
|
|
10 var process.process_t* init_proc;
|
|
11
|
381
|
12
|
283
|
13 // Main entry point of the kernel:
|
293
|
14 function void start()
|
283
|
15 {
|
381
|
16 io.println("Welcome to lcfos!");
|
353
|
17 arch.init();
|
362
|
18
|
393
|
19 process.init();
|
367
|
20 memory.init();
|
292
|
21
|
393
|
22 init_proc = process.Create();
|
|
23
|
|
24 // TODO: copy content into process??
|
|
25 // Create a second process:
|
|
26 process.Create();
|
|
27
|
|
28 io.print2("init address ", cast<int>(init_proc));
|
292
|
29
|
296
|
30 //scheduler:queue(proc);
|
381
|
31 io.println("Kernel finished");
|
393
|
32 panic();
|
283
|
33 }
|
|
34
|
367
|
35 // Called in total stress:
|
293
|
36 function void panic()
|
283
|
37 {
|
308
|
38 arch.halt();
|
283
|
39 }
|
|
40
|