Changes in kernel/generic/src/main/main.c [26aafe8:dabbe28] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/src/main/main.c
r26aafe8 rdabbe28 68 68 #include <mm/page.h> 69 69 #include <genarch/mm/page_pt.h> 70 #include <mm/km.h> 70 71 #include <mm/tlb.h> 71 72 #include <mm/as.h> … … 86 87 #include <sysinfo/sysinfo.h> 87 88 #include <sysinfo/stats.h> 89 #include <lib/ra.h> 88 90 89 91 /** Global configuration structure. */ 90 config_t config; 92 config_t config = { 93 .identity_configured = false, 94 .non_identity_configured = false, 95 .physmem_end = 0 96 }; 91 97 92 98 /** Initial user-space tasks */ … … 145 151 size_t i; 146 152 for (i = 0; i < init.cnt; i++) { 147 if (PA_OVERLAPS(config.stack_base, config.stack_size, 148 init.tasks[i].addr, init.tasks[i].size)) 149 config.stack_base = ALIGN_UP(init.tasks[i].addr + 150 init.tasks[i].size, config.stack_size); 153 if (overlaps(KA2PA(config.stack_base), config.stack_size, 154 init.tasks[i].paddr, init.tasks[i].size)) { 155 /* 156 * The init task overlaps with the memory behind the 157 * kernel image so it must be in low memory and we can 158 * use PA2KA on the init task's physical address. 159 */ 160 config.stack_base = ALIGN_UP( 161 PA2KA(init.tasks[i].paddr) + init.tasks[i].size, 162 config.stack_size); 163 } 151 164 } 152 165 … … 205 218 */ 206 219 arch_pre_mm_init(); 220 km_identity_init(); 207 221 frame_init(); 208 209 /* Initialize at least 1 memory segment big enough for slab to work. */210 222 slab_cache_init(); 223 ra_init(); 211 224 sysinfo_init(); 212 225 btree_init(); … … 214 227 page_init(); 215 228 tlb_init(); 229 km_non_identity_init(); 216 230 ddi_init(); 217 231 arch_post_mm_init(); … … 243 257 for (i = 0; i < init.cnt; i++) 244 258 LOG("init[%zu].addr=%p, init[%zu].size=%zu", 245 i, (void *) init.tasks[i]. addr, i, init.tasks[i].size);259 i, (void *) init.tasks[i].paddr, i, init.tasks[i].size); 246 260 } else 247 261 printf("No init binaries found.\n"); … … 262 276 * Create the first thread. 263 277 */ 264 thread_t *kinit_thread 265 =thread_create(kinit, NULL, kernel, 0, "kinit", true);278 thread_t *kinit_thread = 279 thread_create(kinit, NULL, kernel, 0, "kinit", true); 266 280 if (!kinit_thread) 267 281 panic("Cannot create kinit thread.");
Note:
See TracChangeset
for help on using the changeset viewer.