fusee: add support for booting mesosphere

This commit is contained in:
Michael Scire 2020-07-17 22:25:51 -07:00 committed by SciresM
parent 0bd14b7114
commit 1c5b58ce66

View file

@ -963,6 +963,11 @@ void package2_patch_kernel(void *_kernel, size_t *kernel_size, bool is_sd_kernel
} }
if (kernel_info == NULL && is_sd_kernel) { if (kernel_info == NULL && is_sd_kernel) {
/* If the kernel is mesosphere, patch it. */
if (*(volatile uint32_t *)((uintptr_t)_kernel + 4) == 0x3053534D) {
*out_ini1 = (void *)((uintptr_t)_kernel + *(volatile uint32_t *)((uintptr_t)_kernel + 8));
*(volatile uint64_t *)((uintptr_t)_kernel + 8) = (uint64_t)*kernel_size;
}
return; return;
} }