extern "C" void platform_start_kernel(void) { preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>( gKernelArgs.kernel_image.Pointer()); addr_t kernelEntry = image->elf_header.e_entry; addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size; // clone the Flattened Device Tree blob into the kernel args if we've got it if (gFDT) { size_t fdtSize = fdt_totalsize(gFDT); gKernelArgs.platform_args.fdt = kernel_args_malloc(fdtSize); memcpy(gKernelArgs.platform_args.fdt, gFDT, fdtSize); } // smp_init_other_cpus(); serial_cleanup(); mmu_init_for_kernel(); // smp_boot_other_cpus(); dprintf("kernel entry at %lx\n", kernelEntry); status_t error = arch_start_kernel(&gKernelArgs, kernelEntry, stackTop); panic("kernel returned %lx!\n", error); }
int main(void) { void* entry = NULL; arch_init(); printf("elf-loader:\tStarted\n"); load_image(&entry); printf("elf-loader:\tentry point is %p\n", entry); arch_start_kernel(entry); printf("elf-loader:\tKernel start failed!\n"); abort(); return -1; }
extern "C" void platform_start_kernel(void) { preloaded_elf32_image *image = static_cast<preloaded_elf32_image *>( gKernelArgs.kernel_image.Pointer()); addr_t kernelEntry = image->elf_header.e_entry; addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size; // smp_init_other_cpus(); serial_cleanup(); mmu_init_for_kernel(); // smp_boot_other_cpus(); dprintf("kernel entry at %lx\n", kernelEntry); status_t error = arch_start_kernel(&gKernelArgs, kernelEntry, stackTop); panic("kernel returned!\n"); }
extern "C" void platform_start_kernel(void) { preloaded_elf32_image* image = static_cast<preloaded_elf32_image*>( gKernelArgs.kernel_image.Pointer()); addr_t kernelEntry = image->elf_header.e_entry; addr_t stackTop = gKernelArgs.cpu_kstack[0].start + gKernelArgs.cpu_kstack[0].size; printf("kernel entry at %p\n", (void*)kernelEntry); printf("kernel stack top: %p\n", (void*)stackTop); /* TODO: ? mmu_init_for_kernel(); smp_boot_other_cpus(); */ status_t error = arch_start_kernel(&gKernelArgs, kernelEntry, stackTop); panic("Kernel returned! Return value: %ld\n", error); }