Kernel Loader: Difference between revisions
| Line 140: | Line 140: | ||
| Then, it calls the kernel's libc .init_array functions. | Then, it calls the kernel's libc .init_array functions. | ||
| <pre> | <pre> | ||
| //  | // This is standard libc init_array code, but called for the kernel's binary instead of kernelldr's. | ||
| for (uintptr_t cur_func = final_virtual_kernel_base + init_array_offset; cur_func < final_virtual_kernel_base + init_array_end_offset; cur_func += 8) { | |||
|     ((void (*)(void))(*(uint64_t *)cur_func)(); | |||
| } | |||
| </pre> | </pre> | ||