now hangs at maxDec
This commit is contained in:
parent
72db7c22f3
commit
8a10b2c632
10 changed files with 177 additions and 28 deletions
|
@ -474,13 +474,15 @@ grub_xnu_boot (void)
|
|||
grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *)
|
||||
((char *) memory_map + descriptor_size * i);
|
||||
|
||||
/* Some EFI implementations set physical_start to 0 which
|
||||
causes XNU crash. */
|
||||
curdesc->virtual_start = curdesc->physical_start;
|
||||
|
||||
if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA
|
||||
|| curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE)
|
||||
{
|
||||
if (grub_xnu_is_64bit && (SIZEOF_OF_UINTN == 8))
|
||||
curdesc->virtual_start |= 0xffffff8000000000ULL;
|
||||
else
|
||||
curdesc->virtual_start &= 0x000000007fffffffULL;
|
||||
if (firstruntimeaddr > curdesc->physical_start)
|
||||
firstruntimeaddr = curdesc->physical_start;
|
||||
if (lastruntimeaddr < curdesc->physical_start
|
||||
|
@ -572,6 +574,9 @@ grub_xnu_boot (void)
|
|||
if (! grub_autoefi_finish_boot_services ())
|
||||
return grub_error (GRUB_ERR_IO, "can't exit boot services");
|
||||
|
||||
grub_autoefi_set_virtual_address_map (memory_map_size, descriptor_size,
|
||||
descriptor_version,memory_map);
|
||||
|
||||
grub_xnu_launch ();
|
||||
|
||||
/* Never reaches here. */
|
||||
|
|
14
loader/xnu.c
14
loader/xnu.c
|
@ -35,7 +35,7 @@
|
|||
struct grub_xnu_devtree_key *grub_xnu_devtree_root = 0;
|
||||
static int driverspackagenum = 0;
|
||||
static int driversnum = 0;
|
||||
static int is_64bit;
|
||||
int grub_xnu_is_64bit = 0;
|
||||
|
||||
/* Allocate heap by 32MB-blocks. */
|
||||
#define GRUB_XNU_HEAP_ALLOC_BLOCK 0x2000000
|
||||
|
@ -444,7 +444,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0);
|
||||
|
||||
grub_xnu_lock ();
|
||||
is_64bit = 0;
|
||||
grub_xnu_is_64bit = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -549,7 +549,7 @@ grub_cmd_xnu_kernel64 (grub_command_t cmd __attribute__ ((unused)),
|
|||
grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0);
|
||||
|
||||
grub_xnu_lock ();
|
||||
is_64bit = 1;
|
||||
grub_xnu_is_64bit = 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -668,7 +668,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
|
|||
return grub_error (GRUB_ERR_BAD_OS,
|
||||
"Extension doesn't contain suitable architecture");
|
||||
}
|
||||
if (is_64bit)
|
||||
if (grub_xnu_is_64bit)
|
||||
machosize = grub_macho_filesize64 (macho);
|
||||
else
|
||||
machosize = grub_macho_filesize32 (macho);
|
||||
|
@ -706,7 +706,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile)
|
|||
exthead->binaryaddr = (buf - grub_xnu_heap_start)
|
||||
+ grub_xnu_heap_will_be_at;
|
||||
exthead->binarysize = machosize;
|
||||
if (is_64bit)
|
||||
if (grub_xnu_is_64bit)
|
||||
err = grub_macho_readfile64 (macho, buf);
|
||||
else
|
||||
err = grub_macho_readfile32 (macho, buf);
|
||||
|
@ -810,13 +810,13 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)),
|
|||
}
|
||||
for (i = 0; i < narchs; i++)
|
||||
{
|
||||
if (!is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST32
|
||||
if (!grub_xnu_is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST32
|
||||
(grub_be_to_cpu32 (archs[i].cputype)))
|
||||
{
|
||||
readoff = grub_be_to_cpu32 (archs[i].offset);
|
||||
readlen = grub_be_to_cpu32 (archs[i].size);
|
||||
}
|
||||
if (is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST64
|
||||
if (grub_xnu_is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST64
|
||||
(grub_be_to_cpu32 (archs[i].cputype)))
|
||||
{
|
||||
readoff = grub_be_to_cpu32 (archs[i].offset);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue