Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OcMainLib: Add UEFI/Unload config option to unload existing firmware drivers #553

Merged
merged 2 commits into from
Oct 6, 2024

Conversation

mikebeaton
Copy link
Contributor

This is split out from #549.

I don't know of any current use for this apart from network boot, but it is definitely useful there; e.g. HttpBootDxe may be present but produce non-working entries when used within the context of OC (e.g. because it is modified to work in a GUI); HttpDxe may be present but locked to https:// only, when the user wishes to use http://.

@mikebeaton
Copy link
Contributor Author

It is worth adding that when deciding on this approach, I did initially look at trying to disconnect relevant existing drivers (e.g. perhaps triggered via certain optional arguments to this driver).

However it turns out it is very hard - approaching impossible, afaict - to work out which handles need disconnecting. Certainly there is no particular PCI device to find and disconnect, as there is with audio or video. Instead, each driver binds to handles created by previous drivers in the stack, and because of IP 4 vs 6, most drivers also create two driver binding protocol instances as well (one on the loaded image handle and one on a new handle).

I spent quite a lot of time hunting around all this in UEFI Shell trying to figure out what to disconnect and eventually became fairly convinced it was not possible, whereas unloading cleanly removes what was set up by a given driver - assuming it correctly supports unloading, as the network stack drivers do.

Docs/Configuration.tex Outdated Show resolved Hide resolved
Docs/Configuration.tex Show resolved Hide resolved
Docs/Configuration.tex Show resolved Hide resolved
Library/OcMainLib/OpenCoreUefiUnloadDrivers.c Show resolved Hide resolved
Library/OcMainLib/OpenCoreUefiUnloadDrivers.c Show resolved Hide resolved
Library/OcMainLib/OpenCoreUefiUnloadDrivers.c Show resolved Hide resolved
@vit9696 vit9696 merged commit 3830364 into acidanthera:master Oct 6, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants