Mercurial > lcfOS
comparison kernel/kernel.c3 @ 407:9eb1fc6aad6c
Minor improvements
author | Windel Bouwman |
---|---|
date | Fri, 20 Feb 2015 15:47:54 +0100 |
parents | 0fb6633c42f6 |
children | ad6be5454067 |
comparison
equal
deleted
inserted
replaced
406:b1daa462ee17 | 407:9eb1fc6aad6c |
---|---|
5 import scheduler; | 5 import scheduler; |
6 import arch; | 6 import arch; |
7 import io; | 7 import io; |
8 import debug; | 8 import debug; |
9 | 9 |
10 // Globals: | |
11 var process.process_t* init_proc; | |
12 | |
13 | 10 |
14 // Main entry point of the kernel: | 11 // Main entry point of the kernel: |
15 function void start() | 12 function void start() |
16 { | 13 { |
17 io.println("Welcome to lcfos!"); | 14 io.println("Welcome to lcfos!"); |
18 arch.init(); | 15 arch.init(); |
19 | 16 |
17 memory.init(); | |
20 process.init(); | 18 process.init(); |
21 memory.init(); | 19 load_init_process(); |
22 | 20 |
23 init_proc = process.create(); | |
24 | |
25 // TODO: copy content into process?? | |
26 | |
27 io.print2("init address ", cast<int>(init_proc)); | |
28 | |
29 //scheduler:queue(proc); | |
30 io.println("Kernel finished"); | 21 io.println("Kernel finished"); |
31 panic(); | 22 panic(); |
32 } | 23 } |
33 | 24 |
34 // Called in total stress: | 25 // Called in total stress: |
35 function void panic() | 26 function void panic() |
36 { | 27 { |
28 io.println("Kernel panic!"); | |
37 arch.halt(); | 29 arch.halt(); |
38 } | 30 } |
39 | 31 |
32 function void load_init_process() | |
33 { | |
34 var process.process_t* init_proc; | |
35 init_proc = process.create(); | |
36 process.enqueue(init_proc); | |
37 | |
38 io.print2("init address ", cast<int>(init_proc)); | |
39 } | |
40 |