Bug 204674 - boot1.efi remove consolecontrol as it's not in the UEFI specs
Summary: boot1.efi remove consolecontrol as it's not in the UEFI specs
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-bugs (Nobody)
URL:
Keywords: uefi
Depends on:
Blocks:
 
Reported: 2015-11-19 10:53 UTC by Emmanuel Vadot
Modified: 2023-10-01 14:34 UTC (History)
4 users (show)

See Also:


Attachments
boot1.efi remove ConsoleControl (1.14 KB, patch)
2015-11-19 10:53 UTC, Emmanuel Vadot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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 freebsd_committer freebsd_triage 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 ?
Comment 3 Naomichi Nonaka 2016-03-17 14:39:39 UTC
Hi,

I wrote another patch bug #207940 which removes ConsoleControl dependency (and add boot partition selection) from boot1.efi. I'm grad if you try that.

Thanks
Comment 4 Graham Perrin freebsd_committer freebsd_triage 2022-12-31 04:23:09 UTC
Triage: 

* link
* the patch keyword is deprecated
* summary line tags such as [patch] are no longer used.