Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
Sorry, I missed some pertinent questions while being too focused on the version mentioned.

The default setting for LauncherOption is "Disabled". So when trying to add configs created by third parties, you don't need to specifically add the key if it is missing as the default will be used in such cases if it is a version that has this option.

What you need to do is check if the key is present or not and if it is present, it must be set to "Disabled" for that config to work within a MyBootMgr created setup.
 
  • Like
Reactions: osxfr33k

osxfr33k

macrumors regular
Jun 26, 2019
164
21
Well Config factory just excited answering yes or no. My current MacOS is Catalina on MacPro5,1 with a PC Graphics Card Nvidia GT710.
Screen Shot 2022-05-07 at 1.03.08 PM.png
Screen Shot 2022-05-07 at 1.03.23 PM.png
 
Last edited:

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
That is an Applescript memory usage limitation issue that starts happening once the script gets above a certain size. It unfortunately varies in showing up from unit to unit. I obviously don't have it on my unit and others are able to run it as well. I did have it before and thought I had brought the size down to a level that will not affect anyone but obviously not. Packing things in "Run-Only" mode also helps but I did that a long time ago.

I'm afraid there is no fix apart from reducing the code size, offloading more of the code to supplementary files or migrating the whole thing to another language.

I will have to go over the script later to see what can be done as it was never expected it would get so large at the beginning or I would have gone for a different language. You will have to try again on the next release after I have tried to optimise things a bit more.
 
  • Like
Reactions: osxfr33k

osxfr33k

macrumors regular
Jun 26, 2019
164
21
That is an Applescript memory usage limitation issue that starts happening once the script gets above a certain size. It unfortunately varies in showing up from unit to unit. I obviously don't have it on my unit and others are able to run it as well. I did have it before and thought I had brought the size down to a level that will not affect anyone but obviously not. Packing things in "Run-Only" mode also helps but I did that a long time ago.

I'm afraid there is no fix apart from reducing the code size, offloading more of the code to supplementary files or migrating the whole thing to another language.

I will have to go over the script later to see what can be done as it was never expected it would get so large at the beginning or I would have gone for a different language. You will have to try again on the next release after I have tried to optimise things a bit more.
So you have a couple of prior versions I could try for now or even build it on another device but it won’t be a MacPro5,1 not sure where I can change or what to change if I ran this on my MaxPro3,1 for the MacPro5,1.
 
Last edited:

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
Likely to be worse. I will PM you the current version which has had some more stuff offloaded to supplementary files as it is an ongoing process I have been doing with each version ... WIP and may have bugs though.

The kicker is that I started the whole thing in bash, which does not have this issue, but decided I wanted to have the fancy dialogue boxes in Applescript and switched it over at the time since it was "only ever going to be a few dozen lines of code at most". Famous last words as ConfigFactory now has about 5,000 lines excluding those already handed off to supplementary files.
 
  • Like
Reactions: osxfr33k

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
It turns out not to be a script size issue but that MyBootMgr, in its current form, is basically not supported on Catalina and newer due to how those versions of MacOS handle permission requests in AppleScript.

Even when the system requests permissions for a script on something and the user "grants" them, they are not actually quite granted without some other steps to be taken.


and


The limitations were introduced in Mojave where the system requests permissions for certain actions and which works when the user grants them:

This was changed as from Catalina and MyBootMgr will therefore need to be either refactored not to require such user approvals or explicitly limited to Mojave or earlier.
 
Last edited:
  • Like
Reactions: osxfr33k

osxfr33k

macrumors regular
Jun 26, 2019
164
21
Well I’ll have a copy of Mojave for macpro5,1 just to be able to build a working copy well worth the trouble. It’s way more problematic for me to lift this MacPro it’s heavy not that I can’t but re-opening it and swapping cards to get to where I need to be is impossible. It’s better to just have a supported MacOS to build a working copy of from ConfigFactory.
 

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
What's the benefit?

Right, Most of the responses will be, or have, questions back to you as trying to answer these will better provide the answers to your questions.

First off, what the process uses is called RefindPlus. It is derived from rEFInd but is not rEFInd. Secondly, MyBootMgr is not a boot picker. It is a process that whereby RefindPlus and OpenCore are set up to work together.

Moving on, when you say "layer" and "layered", you basically mean "chain". Well, to start with, every time you start your Mac, you trigger a chain-loading sequence, where something is loaded and then loads something else which loads something else in turn, culminating in your target OS running.

The term 'chain-loading' is often used to refer to certain modifications to the default boot chain and this can give the impression that chain-loading is something special/unusual. The fact however, is that chain-loading is how things work by default. For instance, when you start a program from Finder, you are in fact chain-loading that program via Finder as opposed to issuing the direct command for running that program via a console. Chain-loading is how things work.

For the default boot chain, you press the power button, the firmware starts and does some things after which it loads and hands control to a boot loader which does some things in turn and then loads and hands control to the Kernel which does some things and then loads and hands control to the OS which loads and does things ... basically allowing you to run programs. As said, a chain-loading sequence.

Basic Chain 1: Firmware -> Default Boot Loader -> Kernel -> OS

With this basic chain, you don't see anything (apart from "pacifier" graphics in the form of a progress bar) until the OS presents you a log in screen.

If you have more than one (1) OS present and running a supported GPU, you can press some keys before the firmware loads the default boot loader and it will instead load a default boot manager/picker. The boot manager displays a screen, AKA Boot Screen, that allows you to select a boot loader of your choice to load an associated OS.

Basic Chain 2: Firmware -> Default Boot Manager -> Selected Boot Loader -> Kernel -> OS

When running OpenCore, you are simply inserting a custom boot manager into the boot chain to end up with:

Modified Chain 1: Firmware -> OpenCore -> Selected Boot Loader -> Kernel -> OS

OpenCore is more of a boot loader with a boot picker attached and it can make boot loader style changes to OS kernels. These changes are what allow you to load unsupported MacOS versions. We focus on the boot picker function here.

You can set OpenCore up not to display anything (as the firmware does with the default boot manager) and simply load the default boot loader. You press the button, you see the loading bar and the OS loads. Just as with the basic chain. You can interrupt by pressing the 'ESC' key to get a boot screen, again just like the basic chain.

The setup created by MyBootMgr inserts the RefindPlus Boot Manager into this boot chain:

Modified Chain 2A: Firmware -> RefindPlus -> OpenCore -> Selected Boot Loader -> Kernel -> OS

It could also work as below, depending on what you want to load:

Modified Chain 2B: Firmware -> RefindPlus -> Selected Boot Loader -> Kernel -> OS

You can set RefindPlus and/or OpenCore up not to display anything as the firmware does with the default boot manager) and simply load a default boot loader/manager (the default in RefindPlus can be OpenCore). You press the button, you see the loading bar and the OS loads again or OpenCore loads again just as with the basic chain. You can interupt by pressing the ESC key to get a display for selecting a choice, again just like the basic chain. The display will be RefindPlus or OpenCore depending on when you press the key.

Modified Chain 2A is for when trying to run something RefindPlus cannot run such as Unsupported MacOS or something it can run but may be better or preferred via OpenCore such as UEFI Windows, Supported MacOS or Linux. Modified Chain 2B is for when trying to run something OpenCore cannot run such as Legacy Windows or something it can run but may be better or preferred via RefindPlus such as UEFI Windows, Supported MacOS or Linux.

Basically, with the two in a boot chain, it doesn't matter what you want to run in your setup, one or both of the two will be able to run it and you don't need to change your setup to fit the boot manager.

With that background out of the way, the first question:

Q1: What does having 2 or 3 (or even 200 or 300) additional boot loaders/managers in the chain have to do with the BootROM, or more specifically, the NVRAM (fragile or robust), if they do not write anything to the NVRAM and simply just load the next boot loader/manager (with or without presenting a screen)?

In terms of the benefit of inserting RefindPlus into the chain, some another questions:

Q2: Have you ever needed to amend an OpenCore config and reboot into this to achieve a specific purpose (such as updating or anything else) and then needed to revert to the original?
- With the RefindPlus|OpenCore setup, you simply reboot into an appropriate OpenCore instance for the task and reboot back to your regular instance when done.

Q3: What happens when you are unable to boot OpenCore due to a misconfiguration error?
- With the RefindPlus|OpenCore setup, you simply reboot, select another OpenCore instance or the native MacOS boot option and you are back in.

Q4: How would you manage running versions of MacOS that can't use the same OpenCore configuration? For instance, some still need to run HiSierra for Final Cut Pro but want newer versions of MacOS for other things.
- With the RefindPlus|OpenCore setup, you simply reboot and select an appropriate OpenCore instance as required.


Now, there are perfectly fine alternative answers to those questions that some may prefer and the point is not that the RefindPlus|OpenCore setup is the only or best way to answer those but simply to address your query of why anyone would want to use this.

Another query:

Q5: Are you aware that there are things in OpenCore today that have been ported from RefindPlus or from rEFInd directly and that until that was done, the only way to access those features was by adding RefindPlus to the chain? Are you aware for instance that until the feature was ported, users with Nvidia GPUs could only get a boot screen in OpenCore if they load OpenCore via RefindPlus?

Circling back to the NVRAM fragility, let's look at Windows. OpenCore only supports UEFI Windows while RefindPlus supports both UEFI and Legacy Windows. Yet, the MyBootMgr instructions repeatedly recommends sticking with Legacy Windows.

Q6: An earlier post in the original thread actively encourages UEFI Windows but are you aware that your Legacy MacPro is *NOT* a UEFI 2.x device and that each time you boot a UEFI 2.x based operating system such as UEFI Windows on a Legacy MacPro, you are in effect playing Russian Roulette with that Legacy MacPro?

Q7: Are you aware that UEFI Windows theoretically expects to be able to write a single NVRAM variable with a size of 64kb? Are you therefore aware that on the next UEFI Windows update for instance, the updater could theoretically attempt to write a 64kb variable to the NVRAM store?

Q8: Are you aware that the size of the entire NVRAM store on a Legacy MacPro is in fact only 64kb and are you therefore aware of the consequences of attempts to write NVRAM variables of up to this size to this store?


You can forget about Windows Certificates, as they are small in the scheme of things and easily mitigated. Just to put a few things in context, I checked in RefindPlus and can tell you that an El Cheapo Dell Inspiron laptop from 2015 has an NVRAM that is six (6) times the size of that in your Legacy MacPro and is set up to handle single NVRAM variables of up to, yes, you guessed it, 64kb ... the size for your entire NVRAM store.

The difference is that the laptop is a UEFI-PC while the Legacy MacPro is a EFI 1.x device that Apple patched up with just enough changes to handle a managed MacOS UEFI Setup that stayed within what it can handle. Once you start running a real UEFI 2.x based OS on that patched up hybrid, all bets are off.

Q9: Are you aware that OpenCore was written primarily for those trying to run MacOS on UEFI-PC and not for an EFI 1.x to UEFI 2.x partial-patch-up Legacy MacPro?

Between all that, some might want to use the MyBootMgr setup but it is perfectly fine to use any other you prefer. Some tinker with or test OpenCore configs and need a setup that allows a hassle free way to get back in when it goes bad, some need more than one OpenCore setup for other reasons, mainly to run different MacOS, while some simply want the convenience of the MyBootMgr automation and don't need anything special.

It's just an option. Read Post 1 to get more insight.

21 Jul 22: Amended for Boot Managers/Pickers (Separated from Boot Loaders) and explained chain-loading
 
Last edited:

hwojtek

macrumors 68020
Jan 26, 2008
2,274
1,277
Poznan, Poland
Still no answer regarding the basic question: why chainloading OpenCore from Refind+. The very first question asked in this thread.

"Legacy Windows" is not an answer. OC works perfectly with UEFI Windows without the risk of damaging the NVRAM. Zero reasons to run legacy Windows.
"Updates" is not an answer. OC set up properly allows for updates just fine. Point releases, OS upgrades, you name it.

This approach multiplies the effort needed to set up the computer (numerous OC configurations, actually setting up the chainload, etc) and creates multiple conflicting configurations designed for discrete operations. It is as if I had to change the wheels on my car in order to go for an oil change. I understand you are proud of this "left hand to the rear right pocket" contraption, but this is generally bad computing.
 
  • Like
Reactions: prefuse07

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
I am sure anyone that actually read my post above, or is at least able to understand it, will find the answer to the specific question of why chainload OpenCore.

At the end of the day, you are free to hold your views (which I have already expresed my opinion of ... which remains unchanged) but I believe even you will agree with me that it is up to each person to make a call based on their needs.
 
Last edited:

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
Q6: An earlier post in the original thread actively encourages UEFI Windows but are you aware that your Legacy MacPro is NOT a UEFI device and that each time you boot a UEFI Operating System such as UEFI Windows on a Legacy MacPro, you are in effect playing Russian Roulette with that Legacy MacPro?

For anyone enjoying the discussion, running with the above a bit further and picking up on this statement:
"OC works perfectly with UEFI Windows without the risk of damaging the NVRAM. Zero reasons to run legacy Windows"

That is an opinion and there are plenty of such around but the facts on the other hand are this:
Fact 1. UEFI Windows expects to be able to write up to 64kb in one go to the NVRAM.
You can read more about this on Page 7 of the UEFI Windows hardware spec document:

Fact 2. User Space Windows Apps are allowed to write to the NVRAM. That is, when running Windows, an application in use can, consistent with the applicable hardware specs, try to write up to 64kb to the NVRAM in one go.

Fact 3. The total NVRAM Variable store on a Legacy MacPro is 64kb and the maximum variable size is 2kb (according to info by syncretic).

Fact 4. OpenCore, as of the current version, does not do anything whatsoever to stop such an NVRAM write attempt. It is not an issue on UEFI-PC

Fact 5. When running Legacy Windows, there is no such thing as writing to the NVRAM. A user space trying this will get an error and the specs advise on handling such.

Would not say every one on a Legacy MacPro must run Legacy Windows, it is their call as long as they make the call based on facts and not fictional assumptions.
 
Last edited:

hwojtek

macrumors 68020
Jan 26, 2008
2,274
1,277
Poznan, Poland
For anyone enjoying the discussion, running with the above a bit further and picking up on this statement:
"OC works perfectly with UEFI Windows without the risk of damaging the NVRAM. Zero reasons to run legacy Windows"

That is an opinion

It's a fact. Read up about using nvram.plist in OpenCore.

I ceased to expect a single argument about this approach being reasonable once I read "allows you to have to create two separate configs, one for daily use and one only for updating". Ridiculous but if it suits you... just make sure you do not put anyone into trouble, as you already did.
 

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
Let me get this straight. You are saying people should use the LegacyEnable feature ... the one referenced below?
I suppose you mean LegacyEnable, which uses a plist for storing variables. This mode is indeed untested on the classic Mac Pro. The reason is that it is really just intended for machines without any NVRAM hardware and may lead to a very suboptimal experience.

I assume you actively using it and that you can perhaps shed some light your experience because according to those that should know, it does not do what you THINK it does and it appears to be yet another example of a fanciful assumption that you have plucked out of thin air.
I don't think the existing LegacyEnable/LegacySchema can help. Actually, that conclusion depends on what OcLoadLegacyNvram actually does (e.g. Does it load the plist file and set up a replacement runtime NVRAM service? But it doesn't, it just loads the file and sets permitted variables into the existing NVRAM service).
You really need to stop showing yourself up and only post when you actually know what you are talking about.

Speaking of knowing what you are saying, this setup has never put anyone into any trouble but I can understand you saying so, given what appears to be a very relaxed attitude to facts.

Anyway, at the end of the day, I repeat that I am sure we can at least agree that people can make their own minds up on what they want to do. I'll leave things there and you can have a free shot now if it pleases you.
 

Bmju

macrumors 6502a
Dec 16, 2013
702
767
It's a fact. Read up about using nvram.plist in OpenCore.

I ceased to expect a single argument about this approach being reasonable once I read "allows you to have to create two separate configs, one for daily use and one only for updating". Ridiculous but if it suits you... just make sure you do not put anyone into trouble, as you already did.
LegacyEnable does not enable emulated NVRAM - it just reads settings from nvram.plist into whatever NVRAM store is in use at that point. To use emulated NVRAM, and therefore avoid writes to real NVRAM, you would additionally have to either be using OpenDuet (which adds a UEFI layer on top of legacy BIOS, and includes emulated NVRAM), or else at least the emulated NVRAM driver from OpenDuet (which from my own recent testing, I believe does not currently work on real Apple hardware - but does on non-Apple).
 

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
@Bmju ... do you happen to know what will happen if a process tries to write an NVRAM variable that is larger than the max allowed? The max on Legacy MacPro is apparently 2kb based on findings by @Syncretic . What will happen if something tries to write a 3kb or 4kb sized variable for instance?

If it will simply get discarded without any negative impact, then the UEFI Windows 64kb size might not be a problem at the end of the day. If it is the opposite, I suppose OpenCore could be updated to also filter such out (filter on size) and return a security violation error similar to the Windows Certificates. I just added such a filter to RefindPlus (locally, not yet pushed) but wondering whether it is worth it.
 

Bmju

macrumors 6502a
Dec 16, 2013
702
767
I'm afraid I do not know - as you are of course already aware, @tsialex is the expert on such things, if I can take the liberty of cc-ing him here.
 

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
Thanks. Just thought you might.

@tsialex or perhaps @Syncretic or any one else ... can you chime in?
Please do not hesitate on account of the earlier slightly toxic stuff which has now hopefully blown over.

Wonder whether someone (with a Matt Card perhaps) can volunteer to test this to advance science.
 
Last edited:

tsialex

Contributor
Jun 13, 2016
13,454
13,601
Did some digging and found this:

Seems the data is just discarded. Might not be the ultimate function that is used, or the one always used, but they are generally similar from previous experience
I think that maybe this don't apply to Macs, or at least to all Macs.

One anedoctal example, yesterday I had a crash with my MacPro9,2 MacBookPro9,2 and the aapl,panic-info was over 5KB. Since SIP was enabled I couldn't dump the BootROM, but I saved the nvram -xp to a file. If my back of the napkin math is correct, 5KB base64 encoded = ~3.5KB.


I'm gonna do some investigation for @Bmju to see the needed GUIDs and I'll also check for the maximum entry size I can find.

Edited to correct MacPro9,2 to MacBookPro9,2
 

Attachments

  • Screen Shot 2022-05-09 at 16.28.34.png
    Screen Shot 2022-05-09 at 16.28.34.png
    205.2 KB · Views: 83
  • Screen Shot 2022-05-09 at 16.28.46.png
    Screen Shot 2022-05-09 at 16.28.46.png
    323.3 KB · Views: 86
Last edited:
  • Like
Reactions: Bmju

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
I think that maybe this don't apply to Macs
That is actually an important point.

The Legacy MacPro is tricky because on the surface, it has the characteristics of a UEFI 2.x device and this can lull one into forgetting that it is not. This means that the fact that something is implemented in one way in the UEFI Specs does not mean the implementation is the same.

The very fact that it can be bricked by writing too much data to the NVRAM is inconsistent with the UEFI specs for NVRAM implementation in the first place.

Anyway, thanks to your comment, I decided to revisit an earlier post and found this:
It's hard to be certain, but it appears that variables larger than 2048 bytes might actually be able to cause problems, due to bugs/oversights in the EFI code. Various variable-handling routines check the size, then silently fail mid-execution if the variable is too large; if a huge variable slips past what should be the earliest size checks (which seems possible), it could potentially make a mess. I haven't experienced it firsthand, but the code doesn't look all that robust with respect to huge variables.
 
Last edited:
  • Like
Reactions: Bmju

joevt

macrumors 604
Jun 21, 2012
6,963
4,257
One anedoctal example, yesterday I had a crash with my MacPro9,2 MacBookPro9,2 and the aapl,panic-info was over 5KB. Since SIP was enabled I couldn't dump the BootROM, but I saved the nvram -xp to a file. If my back of the napkin math is correct, 5KB base64 encoded = ~3.5KB.

I'm gonna do some investigation for @Bmju to see the needed GUIDs and I'll also check for the maximum entry size I can find.

Edited to correct MacPro9,2 to MacBookPro9,2
On my MacPro3,1, aapl,panic-info is split into separate 768 byte variables with names like AAPL,PanicInfo000K
 

joevt

macrumors 604
Jun 21, 2012
6,963
4,257
There are at least two types of PanicInfo logs with MacPro3,1/MacPro4,1/MacPro5,1 and more with MacPro6,1 forward. We talked about that years ago and I wrote about it recently:
That post doesn't mention the split PanicInfo logs that I mentioned.
There's an example at https://forums.macrumors.com/threads/opencore-on-the-mac-pro.2207814/post-27958819
They seem to start counting from "K" and I think the full compressed log comes from concatenating them together. I don't know a method to uncompress it.
 

Dayo

macrumors 68020
Original poster
Dec 21, 2018
2,257
1,279
at least the emulated NVRAM driver from OpenDuet (which from my own recent testing, I believe does not currently work on real Apple hardware - but does on non-Apple).
This may have legs as the reason a driver will only load on UEFI-PC is typically because it checks whether the device is UEFI 2.x compliant before proceeding with installation. This check fails on Legacy Apple as it tells the truth about not being UEFI 2.x on such checks.

If that is the case, as both OC and RP can get Legacy Apple to lie about spoof UEFI 2.x support, it is possible to fool such drivers into installing there as well. The spoof is enough to get many of them working as they actually do not need anything specific to UEFI 2.x that is absent on the Apple unit and only run the check because the specs say they have to.

It does need checking the source to see whether it actually calls either one of BootServices->CreateEventEx or RuntimeServices->QueryVariableInfo in particular.

Current State of Those on UEFI 2.x Spoof:
  1. OpenCore
    • CreateEventEx
      • Spoofed (Needs Confirming)
      • Call to this is likely to hang
    • QueryVariableInfo
      • Not available
      • Call to this will definitely hang
  2. RefindPlus
    • CreateEventEx
      • Full Emulation but not tested in anger
      • Call to this should work
      • Needs testing
    • QueryVariableInfo
      • Partial Emulation (unreleased code) Withdrawn as current implementation affects FileVault.
      • Call to this returns EFI_NOT_SUPPORTED Call to this will definitely hang
      • Does not work but does not hang and returns a proper error response
      • Not sure what the driver will do if it needs this and is told it is not supported ... needs checking
Best situation will be that the driver fails to install on Apple just because of UEFI 2.x checks and that it only checks because this is mandated and it does not actually need the missing items.

OpenCore might need a QueryVariableInfo handling update for ForgeUEFI to avoid hanging by returning a proper error at some point. High chance NVRAM emu driver might be calling this. Available in the interim when loaded via RefindPlus
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.