|Summary:||[PATCH] boot1.efi remove consolecontrol as it's not in the UEFI specs|
|Product:||Base System||Reporter:||Emmanuel Vadot <manu>|
|Component:||kern||Assignee:||freebsd-bugs (Nobody) <bugs>|
|Severity:||Affects Some People||CC:||bcran, emaste, nao|
Description Emmanuel Vadot 2015-11-19 10:53:03 UTC
Created attachment 163324 [details] boot1.efi remove ConsoleControl Hello, The ConsoleControl->SetMode in boot1.efi breaks booting freebsd correctly on my machines (HP 840G1 and HP 840G2). The console during boot1.efi and loader.efi isn't setup correctly, neither is the framebuffer which means when kernel starts, display is garbage. After some research I've found that ConsoleControl isn't part of the UEFI specs but was only on the EDK implementation (there is a bug on grub about this). I suspect that HP firmware incorrectly implement it. i.e.: The LocateProtocol works but the SetMode screw things up. With this patch I can correctly boot FreeBSD on my HP 840 machines and also on my Samsung 870Z. Cheers,
Comment 1 Ed Maste 2015-11-19 16:45:18 UTC
Thank you for your contribution! Unfortunately just removing the SetMode is no good, because with other UEFI implementations the display is not set up correctly for us at boot and the loader output does not work w/o it. As you point out we should handle the case that ConsoleControl is not implemented (we just skip the SetMode if LocateProtocol fails), so this suggests that the failing systems here implement a broken ConsoleControl. It looks like we may need a blacklist of broken systems (or a whitelist of systems that implement & require ConsoleControl).
Comment 2 Emmanuel Vadot 2015-11-19 16:55:02 UTC
Hi, I've noticed that after. I've sent a mail to hacker@ (https://lists.freebsd.org/pipermail/freebsd-hackers/2015-November/048639.html). As said on my second mail, removing the mode selection and the reset of the conout resolves the problem. I had another idea of what could be wrong, it could be that setting the mode to text strictly disable the graphical mode so I tested to set the mode to graphical just before calling ExitBootService but this doesn't change anything. Maybe we can just remove the reset/mode change ? The console is cleared after and since the number of lines are hardcoded to 24 by default maybe it's sane to leave the text mode to 80x25 for now ?