- PE_state.bootArgs = args;
- PE_state.video.v_baseAddr = PE_kbp->video.v_baseAddr;
- PE_state.video.v_rowBytes = PE_kbp->video.v_rowBytes;
- PE_state.video.v_height = PE_kbp->video.v_height;
- PE_state.video.v_width = PE_kbp->video.v_width;
- PE_state.video.v_depth = PE_kbp->video.v_depth;
- PE_state.video.v_display = PE_kbp->video.v_display;
- PE_fb_mode = PE_kbp->graphicsMode;
- PE_state.fakePPCBootArgs = (boot_args *)&fakePPCBootArgs;
- ((boot_args *)PE_state.fakePPCBootArgs)->machineType = 386;
-
- if (PE_fb_mode == TEXT_MODE)
- {
- /* Force a text display if the booter did not setup a
- * VESA frame buffer.
- */
- PE_state.video.v_display = 0;
+
+ // New EFI-style
+ PE_state.bootArgs = _args;
+ PE_state.deviceTreeHead = (void *) ml_static_ptovirt(args->deviceTreeP);
+ if (args->Video.v_baseAddr) {
+ PE_state.video.v_baseAddr = args->Video.v_baseAddr; // remains physical address
+ PE_state.video.v_rowBytes = args->Video.v_rowBytes;
+ PE_state.video.v_width = args->Video.v_width;
+ PE_state.video.v_height = args->Video.v_height;
+ PE_state.video.v_depth = args->Video.v_depth;
+ PE_state.video.v_display = args->Video.v_display;
+ strlcpy(PE_state.video.v_pixelFormat, "PPPPPPPP",
+ sizeof(PE_state.video.v_pixelFormat));
+ } else {
+ PE_state.video.v_baseAddr = args->VideoV1.v_baseAddr; // remains physical address
+ PE_state.video.v_rowBytes = args->VideoV1.v_rowBytes;
+ PE_state.video.v_width = args->VideoV1.v_width;
+ PE_state.video.v_height = args->VideoV1.v_height;
+ PE_state.video.v_depth = args->VideoV1.v_depth;
+ PE_state.video.v_display = args->VideoV1.v_display;
+ strlcpy(PE_state.video.v_pixelFormat, "PPPPPPPP",
+ sizeof(PE_state.video.v_pixelFormat));