Mercurial > lcfOS
comparison kernel/kernel.c3 @ 410:6aa9743ed362 tip
Reflect change in c3 public modifier
author | Windel Bouwman |
---|---|
date | Mon, 23 Feb 2015 21:06:04 +0100 |
parents | ad6be5454067 |
children |
comparison
equal
deleted
inserted
replaced
408:ad6be5454067 | 410:6aa9743ed362 |
---|---|
18 io.println("Kernel loading finished, now switching to next process"); | 18 io.println("Kernel loading finished, now switching to next process"); |
19 process.execute_next(); | 19 process.execute_next(); |
20 } | 20 } |
21 | 21 |
22 // Called in total stress: | 22 // Called in total stress: |
23 function void panic() | 23 public function void panic() |
24 { | 24 { |
25 io.println("Kernel panic!"); | 25 io.println("Kernel panic!"); |
26 arch.halt(); | 26 arch.halt(); |
27 } | 27 } |
28 | 28 |
33 | 33 |
34 // Load init process (first image) from ram image: | 34 // Load init process (first image) from ram image: |
35 function void load_init_process() | 35 function void load_init_process() |
36 { | 36 { |
37 // Load image: | 37 // Load image: |
38 var byte* image_addr; | 38 var byte* image_addr = arch.get_image_address(); |
39 image_addr = arch.get_image_address(); | |
40 io.print2("ramdisk address: ", cast<int>(image_addr)); | 39 io.print2("ramdisk address: ", cast<int>(image_addr)); |
41 | 40 |
42 var ramdisk_header_t* ramdisk_header; | 41 var ramdisk_header_t* ramdisk_header = image_addr; |
43 ramdisk_header = image_addr; | 42 var byte* image_ptr = image_addr; |
44 var byte* image_ptr; | |
45 image_ptr = image_addr; | |
46 if (0x1337 == ramdisk_header->magic) | 43 if (0x1337 == ramdisk_header->magic) |
47 { | 44 { |
48 image_ptr += 8; | 45 image_ptr += 8; |
49 io.print2("Number of images: ", ramdisk_header->num_images); | 46 io.print2("Number of images: ", ramdisk_header->num_images); |
50 if (ramdisk_header->num_images > 0) | 47 if (ramdisk_header->num_images > 0) |
51 { | 48 { |
52 io.println("Loading init"); | 49 io.println("Loading init"); |
53 var int init_size; | 50 var int init_size = *(cast<int*>(image_ptr)); |
54 init_size = *(cast<int*>(image_ptr)); | |
55 io.print2("Init size:", init_size); | 51 io.print2("Init size:", init_size); |
56 image_ptr += 4; | 52 image_ptr += 4; |
57 | 53 |
58 // Allocate physical memory: | 54 // Allocate physical memory: |
59 var byte* prog_mem; | 55 var byte* prog_mem; |