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