61 |
} |
} |
62 |
} |
} |
63 |
if (conflicts) |
if (conflicts) |
64 |
panic ("Error: %s (0x%x - 0x%x) conflicts with memory of " |
panic ("%s (0x%x - 0x%x) conflicts with memory of " |
65 |
"type %i/%i (0x%x - 0x%x)", name, start, end, |
"type %i/%i (0x%x - 0x%x)", name, start, end, |
66 |
memory_map[nr].type, memory_map[nr].subtype, |
memory_map[nr].type, memory_map[nr].subtype, |
67 |
memory_map[nr].low << 10, memory_map[nr].high << 10); |
memory_map[nr].low << 10, memory_map[nr].high << 10); |
68 |
if (!fits) |
if (!fits) |
69 |
panic ("Error: %s (0x%x - 0x%x) does not fit into memory", |
panic ("%s (0x%x - 0x%x) does not fit into memory", |
70 |
name, start, end); |
name, start, end); |
71 |
} |
} |
72 |
|
|
98 |
{ |
{ |
99 |
if ((start >= used_regions[i].start && start < used_regions[i].end) |
if ((start >= used_regions[i].start && start < used_regions[i].end) |
100 |
|| (end >= used_regions[i].start && end < used_regions[i].end)) |
|| (end >= used_regions[i].start && end < used_regions[i].end)) |
101 |
panic ("Error: %s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)", |
panic ("%s (0x%x - 0x%x) conflicts with %s (0x%x - 0x%x)", |
102 |
name, start, end, used_regions[i].name, used_regions[i].start, |
name, start, end, used_regions[i].name, used_regions[i].start, |
103 |
used_regions[i].end); |
used_regions[i].end); |
104 |
} |
} |
112 |
add_region (char *name, l4_word_t start, l4_word_t end) |
add_region (char *name, l4_word_t start, l4_word_t end) |
113 |
{ |
{ |
114 |
if (nr_regions == MAX_REGIONS) |
if (nr_regions == MAX_REGIONS) |
115 |
panic ("Error: Too many memory regions, region %s doesn't fit", name); |
panic ("Too many memory regions, region %s doesn't fit", name); |
116 |
|
|
117 |
check_region (name, start, end); |
check_region (name, start, end); |
118 |
|
|
164 |
|| elf->e_ident[EI_MAG1] != ELFMAG1 |
|| elf->e_ident[EI_MAG1] != ELFMAG1 |
165 |
|| elf->e_ident[EI_MAG2] != ELFMAG2 |
|| elf->e_ident[EI_MAG2] != ELFMAG2 |
166 |
|| elf->e_ident[EI_MAG3] != ELFMAG3) |
|| elf->e_ident[EI_MAG3] != ELFMAG3) |
167 |
panic ("Error: %s is not an ELF file", name); |
panic ("%s is not an ELF file", name); |
168 |
|
|
169 |
if (elf->e_type != ET_EXEC) |
if (elf->e_type != ET_EXEC) |
170 |
panic ("Error: %s is not an executable file", name); |
panic ("%s is not an executable file", name); |
171 |
|
|
172 |
if (!elf->e_phoff) |
if (!elf->e_phoff) |
173 |
panic ("Error: %s has no valid program header offset", name); |
panic ("%s has no valid program header offset", name); |
174 |
|
|
175 |
#ifdef i386 |
#ifdef i386 |
176 |
if (elf->e_ident[EI_CLASS] != ELFCLASS32 |
if (elf->e_ident[EI_CLASS] != ELFCLASS32 |
177 |
|| elf->e_ident[EI_DATA] != ELFDATA2LSB |
|| elf->e_ident[EI_DATA] != ELFDATA2LSB |
178 |
|| elf->e_machine != EM_386) |
|| elf->e_machine != EM_386) |
179 |
panic ("Error: %s is not for this architecture", name); |
panic ("%s is not for this architecture", name); |
180 |
#else |
#else |
181 |
#error Not ported to this architecture! |
#error Not ported to this architecture! |
182 |
#endif |
#endif |
223 |
load_components (void) |
load_components (void) |
224 |
{ |
{ |
225 |
if (!kernel.low) |
if (!kernel.low) |
226 |
panic ("Error: No L4 kernel found"); |
panic ("No L4 kernel found"); |
227 |
add_region ("kernel-mod", kernel.low, kernel.high); |
add_region ("kernel-mod", kernel.low, kernel.high); |
228 |
|
|
229 |
if (!sigma0.low) |
if (!sigma0.low) |
230 |
panic ("Error: No sigma0 server found"); |
panic ("No sigma0 server found"); |
231 |
add_region ("sigma0-mod", sigma0.low, sigma0.high); |
add_region ("sigma0-mod", sigma0.low, sigma0.high); |
232 |
|
|
233 |
if (sigma1.low) |
if (sigma1.low) |
234 |
add_region ("sigma1-mod", sigma1.low, sigma1.high); |
add_region ("sigma1-mod", sigma1.low, sigma1.high); |
235 |
|
|
236 |
if (!rootserver.low) |
if (!rootserver.low) |
237 |
panic ("Error: No rootserver server found"); |
panic ("No rootserver server found"); |
238 |
add_region ("rootserver-mod", rootserver.low, rootserver.high); |
add_region ("rootserver-mod", rootserver.low, rootserver.high); |
239 |
|
|
240 |
elf_load ("kernel", kernel.low, kernel.high, |
elf_load ("kernel", kernel.low, kernel.high, |