- norootIcon_lzss = NULL;
- norootClut_lzss = NULL;
-
- PE_init_kprintf(TRUE);
- PE_init_printf(TRUE);
-
- kprintf("Kernel boot args: '%s'\n", PE_boot_args());
-
- /*
- * Fetch the CLUT and the noroot image.
- */
-
- if( kSuccess == DTLookupEntry(NULL, "/chosen/memory-map", &entry)) {
- if( kSuccess == DTGetProperty(entry, "BootCLUT", (void **) &map, &size)) {
- if (sizeof(appleClut8) <= map[1]) {
- bcopy( (void *)ml_static_ptovirt(map[0]), appleClut8, sizeof(appleClut8) );
- bootClutInitialized = TRUE;
- }
- }
-
- if( kSuccess == DTGetProperty(entry, "Pict-FailedBoot", (void **) &map, &size)) {
- bootPict = (boot_progress_element *) ml_static_ptovirt(map[0]);
- default_noroot.width = bootPict->width;
- default_noroot.height = bootPict->height;
- default_noroot.dx = 0;
- default_noroot.dy = bootPict->yOffset;
- default_noroot_data = &bootPict->data[0];
- noroot_rle_Initialized = TRUE;
- }
-
- if( kSuccess == DTGetProperty(entry, "FailedCLUT", (void **) &map, &size)) {
- norootClut_lzss = (uint8_t*) ml_static_ptovirt(map[0]);
- }
-
- if( kSuccess == DTGetProperty(entry, "FailedImage", (void **) &map, &size)) {
- norootIcon_lzss = (boot_icon_element *) ml_static_ptovirt(map[0]);
- if (norootClut_lzss == NULL) {
- printf("ERROR: No FailedCLUT provided for noroot icon!\n");
- }
- }
- }
-
- if (!bootClutInitialized) {
- bcopy( (void *) (uintptr_t) bootClut, (void *) appleClut8, sizeof(appleClut8) );
- }
-
- if (!noroot_rle_Initialized) {
- default_noroot.width = kFailedBootWidth;
- default_noroot.height = kFailedBootHeight;
- default_noroot.dx = 0;
- default_noroot.dy = kFailedBootOffset;
- default_noroot_data = failedBootPict;
- }
-
- /*
- * Initialize the panic UI
- */
- panic_ui_initialize( (unsigned char *) appleClut8 );
-
- /*
- * Initialize the spinning wheel (progress indicator).
- */
- vc_progress_initialize( &default_progress, default_progress_data,
- (unsigned char *) appleClut8 );
-
- (void) StartIOKit( PE_state.deviceTreeHead, PE_state.bootArgs, gPEEFIRuntimeServices, NULL);
+ norootIcon_lzss = NULL;
+ norootClut_lzss = NULL;
+
+ PE_init_printf(TRUE);
+
+ kprintf("Kernel boot args: '%s'\n", PE_boot_args());
+
+ /*
+ * Fetch the CLUT and the noroot image.
+ */
+
+ if (kSuccess == SecureDTLookupEntry(NULL, "/chosen/memory-map", &entry)) {
+ if (kSuccess == SecureDTGetProperty(entry, "BootCLUT", (void const **) &map, &size)) {
+ if (sizeof(appleClut8) <= map[1]) {
+ bcopy((void *)ml_static_ptovirt(map[0]), appleClut8, sizeof(appleClut8));
+ bootClutInitialized = TRUE;
+ }
+ }
+
+ if (kSuccess == SecureDTGetProperty(entry, "Pict-FailedBoot", (void const **) &map, &size)) {
+ bootPict = (boot_progress_element *) ml_static_ptovirt(map[0]);
+ default_noroot.width = bootPict->width;
+ default_noroot.height = bootPict->height;
+ default_noroot.dx = 0;
+ default_noroot.dy = bootPict->yOffset;
+ default_noroot_data = &bootPict->data[0];
+ noroot_rle_Initialized = TRUE;
+ }
+
+ if (kSuccess == SecureDTGetProperty(entry, "FailedCLUT", (void const **) &map, &size)) {
+ norootClut_lzss = (uint8_t*) ml_static_ptovirt(map[0]);
+ }
+
+ if (kSuccess == SecureDTGetProperty(entry, "FailedImage", (void const **) &map, &size)) {
+ norootIcon_lzss = (boot_icon_element *) ml_static_ptovirt(map[0]);
+ if (norootClut_lzss == NULL) {
+ printf("ERROR: No FailedCLUT provided for noroot icon!\n");
+ }
+ }
+ }
+
+ if (!bootClutInitialized) {
+ bcopy((void *) (uintptr_t) bootClut, (void *) appleClut8, sizeof(appleClut8));
+ }
+
+ if (!noroot_rle_Initialized) {
+ default_noroot.width = kFailedBootWidth;
+ default_noroot.height = kFailedBootHeight;
+ default_noroot.dx = 0;
+ default_noroot.dy = kFailedBootOffset;
+ default_noroot_data = failedBootPict;
+ }
+
+ /*
+ * Initialize the spinning wheel (progress indicator).
+ */
+ vc_progress_initialize(&default_progress,
+ default_progress_data1x,
+ default_progress_data2x,
+ default_progress_data3x,
+ (unsigned char *) appleClut8);
+
+ /*
+ * x86 only minimally enforces lockdown in hardware. Additionally, some pre-lockdown functionality
+ * such as commpage initialization requires IOKit enumeration of CPUs, which is heavily entangled
+ * with the ACPI stack. Therefore, we start the IOKit matching process immediately on x86.
+ */
+ InitIOKit(PE_state.deviceTreeHead);
+ StartIOKitMatching();