** Hackintosh ** Tips to make a bare metal MacOS


Recommended Posts

17 hours ago, Leoyzen said:

Yeah, hotkey works for me both with KVM

Hotkeys don't work for me...

I tried 0.5.6 stable from official acidanthera and also Leoyzen EFI/config 0.5.6 from his github.

The only way to access the boot picker for me is with the esc key.

No luck...

Can this be related to the keyboard itself?

Edited by ghost82
Link to comment
6 hours ago, ghost82 said:

Hotkeys don't work for me...

I tried 0.5.6 stable from official acidanthera and also Leoyzen EFI/config 0.5.6 from his github.

The only way to access the boot picker for me is with the esc key.

No luck...

Can this be related to the keyboard itself?

I'm not quite sure.I tested it with external usb keyboard(not the one qemu added).

It also quite tricky to triger bootpicker, you must enter the key(option/esc) multiple times when the uefi logo appears.

Link to comment
3 minutes ago, Leoyzen said:

It also quite tricky to triger bootpicker

I noticed that with the esc key, the only one which works, I can hold the key before booting or restart the vm, then the bios page pop up, I still keep the esc key pressed for 2-3 seconds, then I  release it, navigate with arrows to the "continue" menu, press enter and at the same time press and hold the esc key: now I'm always able to trig the picker.

Link to comment

I'm trying to configure the chime on boot, but I have some problems..Not sure if it's related to opencore or to my xml config, or both..

I have HDAU (nvidia gpu audio) and HDEF (Realtek ALC899) passed through.

Here are my tests:

 

./gfxutil -f HDEF
00:02.0 8086:1d20 /PCI0@0/HDEF@2 = PciRoot(0x1)/Pci(0x2,0x0)

This is the address of HDEF device.

 

config.plist relevant part:

		<key>Audio</key>
		<dict>
			<key>AudioCodec</key>
			<integer>0</integer>
			<key>AudioDevice</key>
			<string>PciRoot(0x1)/Pci(0x2,0x0)</string>
			<key>AudioOut</key>
			<integer>0</integer>
			<key>AudioSupport</key>
			<true/>
			<key>MinimumVolume</key>
			<integer>20</integer>
			<key>PlayChime</key>
			<true/>
			<key>VolumeAmplifier</key>
			<integer>1000</integer>
		</dict>

.......

		<key>Drivers</key>
		<array>
			<string>HfsPlusLegacy.efi</string>
			<string>OpenRuntime.efi</string>
			<string>UsbMouseDxe.efi</string>
			<string>AudioDxe.efi</string>
			<string>OpenCanopy.efi</string>
		</array>

Audio part is filled with info and AudioDxe is loaded.

 

Opencore log (relevant part):

07:634 00:006 OCAU: Matching PciRoot(0x1)/Pci(0x2,0x0)/VenMsg(A9003FEB-D806-41DB-A491-5405FEEF46C3,00000000)...
07:640 00:006 HdaCodecAudioIoGetOutputs(): start
07:647 00:006 HdaCodecGetSupportedPcmRates(): start
07:653 00:006 HdaCodecGetOutputDac(): start
07:659 00:006 HdaCodecGetSupportedPcmRates(): start
07:665 00:006 HdaCodecGetOutputDac(): start
07:671 00:006 HdaCodecGetSupportedPcmRates(): start
07:677 00:006 HdaCodecGetOutputDac(): start
07:683 00:005 HdaCodecGetSupportedPcmRates(): start
07:689 00:006 HdaCodecGetOutputDac(): start
07:695 00:005 OCAU: 1/2 PciRoot(0x0)/Pci(0x1,0x4)/Pci(0x0,0x1)/VenMsg(A9003FEB-D806-41DB-A491-5405FEEF46C3,00000000) (4 outputs) - Success
07:701 00:006 HdaCodecAudioIoGetOutputs(): start
07:707 00:005 HdaCodecGetSupportedPcmRates(): start
07:713 00:005 HdaCodecGetOutputDac(): start
07:719 00:005 HdaCodecGetSupportedPcmRates(): start
07:725 00:006 HdaCodecGetOutputDac(): start
07:732 00:006 HdaCodecGetSupportedPcmRates(): start
07:738 00:006 HdaCodecGetOutputDac(): start
07:744 00:006 HdaCodecGetSupportedPcmRates(): start
07:750 00:006 HdaCodecGetOutputDac(): start
07:756 00:006 HdaCodecGetSupportedPcmRates(): start
07:762 00:006 HdaCodecGetOutputDac(): start
07:768 00:006 HdaCodecGetSupportedPcmRates(): start
07:775 00:006 HdaCodecGetOutputDac(): start
07:781 00:006 HdaCodecGetSupportedPcmRates(): start
07:787 00:006 HdaCodecGetOutputDac(): start
07:793 00:005 OCAU: 2/2 PciRoot(0x0)/Pci(0x2,0x0)/VenMsg(A9003FEB-D806-41DB-A491-5405FEEF46C3,00000000) (7 outputs) - Success
07:799 00:006 OCAU: Cannot find specified audio device - Not Found
07:806 00:006 OC: Audio connection failed - Not Found

The 4 outputs device should be HDAU, the 7 outputs device should be HDEF, as also reported in the HdaCodecDump attached (dumped from Openshell in opencore).

 

I think that the problem could be related to what opencore reports as the address of HDEF: PciRoot(0x0)/Pci(0x2,0x0) instead of PciRoot(0x1)/Pci(0x2,0x0)

This also for the address of HDAU, it changes 1 with 0...

 

Do you know if this could be a problem/bug of opencore or of my xml?Can I change PciRoot(0x1) to PciRoot(0x0)? How?

Attached my xml.

The HDEF part is:

    <hostdev mode='subsystem' type='pci' managed='yes'>
      <driver name='vfio'/>
      <source>
        <address domain='0x0000' bus='0x00' slot='0x1b' function='0x0'/>
      </source>
      <alias name='hostdev2'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0' multifunction='on'/>
    </hostdev>

Thanks

xml.txt

HdaCodecDump.txt

Edited by ghost82
Link to comment
6 hours ago, ghost82 said:

I think that the problem could be related to what opencore reports as the address of HDEF: PciRoot(0x0)/Pci(0x2,0x0) instead of PciRoot(0x1)/Pci(0x2,0x0)

Problem solved, and now chime works at boot.

Here is the reply by vit9696:

Quote

It sometimes happens that firmwares and macOS have different device paths. There is not much to do to this, just use the one the firmware sees.

So, I changed in the config.plist from:

		<key>Audio</key>
		<dict>
			<key>AudioCodec</key>
			<integer>0</integer>
			<key>AudioDevice</key>
			<string>PciRoot(0x1)/Pci(0x2,0x0)</string>
			<key>AudioOut</key>
			<integer>0</integer>
			<key>AudioSupport</key>
			<true/>
			<key>MinimumVolume</key>
			<integer>20</integer>
			<key>PlayChime</key>
			<true/>
			<key>VolumeAmplifier</key>
			<integer>0</integer>
		</dict>

to this:

		<key>Audio</key>
		<dict>
			<key>AudioCodec</key>
			<integer>0</integer>
			<key>AudioDevice</key>
			<string>PciRoot(0x0)/Pci(0x2,0x0)</string>
			<key>AudioOut</key>
			<integer>0</integer>
			<key>AudioSupport</key>
			<true/>
			<key>MinimumVolume</key>
			<integer>20</integer>
			<key>PlayChime</key>
			<true/>
			<key>VolumeAmplifier</key>
			<integer>0</integer>
		</dict>

 

Link to comment

Just a note for AudioDxe: if you use it, use the release version from Applesupport package.

Debug version has some problems: it doesn't boot with log to file (ex: Target 65, or Target 83).

The issue was reported on github and it should be solved in future.

 

UPDATE: this is fixed in master

Edited by ghost82
Link to comment
2 hours ago, david279 said:

Plist inside is a lot like the AGPMInjector kext we have been using here?

Yes, that kext includes "our" AGPM injector kext; if you look at the code the first part of the plist includes all the mac os systems for AGPM injection; the second part of the kext, from <key>RadeonVIIBoost</key>, as specified by the original poster, "injects the appropriate driver parameters to the RadeonFramebuffer".

If you look at the code you have several amd cards supported.

Unfortunately I cant test, I have nvidia.

Edited by ghost82
Link to comment

For the boot picker to show up, you just need to have "Misc/Boot/ShowPicker" set to True in the config.plist. 


On an unrelated note, has anyone successfully done USB port mapping with an Intel USB controller passed through to the Catalina VM?

Edited by autoturk
added more detail.
Link to comment

Hi, anyone knows what is the correct way to update the OVMF firmware in Unraid?

I'm able to compile OVMF from github and I tried the following:

1a- copy edk2/Build/OvmfX64/FV/OVMF.fd to /usr/share/qemu/ovmf-x64/OVMF-pure-efi.fd    (renamed)

1b- copy edk2/Build/OvmfX64/FV/OVMF_CODE.fd to /usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd    (renamed)

1c- copy edk2/Build/OvmfX64/FV/OVMF:VARS.fd to /usr/share/qemu/ovmf-x64/OVMF_VARS-pure-efi.fd    (renamed)

The VM doesn't boot

 

2- copy edk2/Build/OvmfX64/FV/OVMF.fd to /usr/share/qemu/ovmf-x64/OVMF-pure-efi.fd    (renamed)

The VM seems ok and it boots

 

Is it correct to replace only OVMF-pure-efi.fd?

 

UPDATE: it doesn't seem to be the correct way, since the vm is using the code and vars files...

UPDATE2: partially solved..I needed to check permissions on files, I copied the new OVMF_VARS.fd to /usr/share/qemu/ovmf-x64/ and /etc/libvirt/qemu/nvram; I copied OVMF_CODE.fd to /usr/share/qemu/ovmf-x64/; set permissions 666 to OVMF_VARS.fd in /etc/libvirt/qemu/nvram, 644 to OVMF_VARS.fd and OVMF_CODE.fd in /usr/share/qemu/ovmf-x64/

VM is now pointing pflash at /usr/share/qemu/ovmf-x64/OVMF_CODE.fd and nvram at /etc/libvirt/qemu/nvram/OVMF_VARS.fd

However the NOOPT version doesn't run, also the DEBUG version doesn't run, I'm able to work only with the RELEASE version :(

 

I know that probably it is not persistent after a reboot, but I think I know how to make it persistent.

 

This because sometimes it can be that opencore log to file is broken and I was asked to compile OVMF NOOPT with serial debug.

This was the case of broken AudioDXE driver, only if compiled as DEBUG, as the RELEASE version worked fine.

 

2nd part: once OVMF is compiled and replaced in Unraid, anyone knows how to work with serial debug?

 

@Leoyzen ?

Sorry to directly tag you but I know you are more expert in these things and probably you already replaced the Unraid OVMS firmware.

 

Here the steps to compile edk2 directly from sources in mac os (release build, X64):

git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update
cp OvmfPkg/OvmfPkgX64.dsc OvmfPkgX64.dsc  <-- I had an error of file not found without manually copying it -->
cd OvmfPkg
./build.sh -a X64 -t XCODE5   -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc

 

Edited by ghost82
Link to comment
On 2/19/2020 at 10:14 AM, Leoyzen said:

AMD GPU performance issues is well-known with 17th AMD Vanilla patches( see here). You can use 15/16th patches or back to IvyBridge.

It is not a opencore related issue.

Hi everybody, do the 15/16th patches work with OpenCore and a 17th gen cpu?

Link to comment

I have a 2700x and i don't use the amd patches at all. I just let the VM think its using Ivy Bridge. As far as your config.plist  slim it down. You have a bunch drivers and kext you do not need. Take a look at @Leoyzen Git for a guide for how your EFI and config.plist should look. Read the opencore vanilla guide here it gives a lot of good info.

Edited by david279
Link to comment
2 minutes ago, tomnic said:

Don't worry ;) But since you said that you have a 2700x I think I cannot boot with the "old gen" patches with a 3950X

Yea i think that your issue. I will building a real ryzen hackintosh in the next week with a 3600 for a friend and looking at your config.plist i see why it was so different from ours. What GPU are you using?

 

Edited by david279
  • Thanks 1
Link to comment
On 4/24/2020 at 7:44 PM, ghost82 said:

Hi, anyone knows what is the correct way to update the OVMF firmware in Unraid?

I'm able to compile OVMF from github and I tried the following:

1a- copy edk2/Build/OvmfX64/FV/OVMF.fd to /usr/share/qemu/ovmf-x64/OVMF-pure-efi.fd    (renamed)

1b- copy edk2/Build/OvmfX64/FV/OVMF_CODE.fd to /usr/share/qemu/ovmf-x64/OVMF_CODE-pure-efi.fd    (renamed)

1c- copy edk2/Build/OvmfX64/FV/OVMF:VARS.fd to /usr/share/qemu/ovmf-x64/OVMF_VARS-pure-efi.fd    (renamed)

The VM doesn't boot

 

2- copy edk2/Build/OvmfX64/FV/OVMF.fd to /usr/share/qemu/ovmf-x64/OVMF-pure-efi.fd    (renamed)

The VM seems ok and it boots

 

Is it correct to replace only OVMF-pure-efi.fd?

 

UPDATE: it doesn't seem to be the correct way, since the vm is using the code and vars files...

UPDATE2: partially solved..I needed to check permissions on files, I copied the new OVMF_VARS.fd to /usr/share/qemu/ovmf-x64/ and /etc/libvirt/qemu/nvram; I copied OVMF_CODE.fd to /usr/share/qemu/ovmf-x64/; set permissions 666 to OVMF_VARS.fd in /etc/libvirt/qemu/nvram, 644 to OVMF_VARS.fd and OVMF_CODE.fd in /usr/share/qemu/ovmf-x64/

VM is now pointing pflash at /usr/share/qemu/ovmf-x64/OVMF_CODE.fd and nvram at /etc/libvirt/qemu/nvram/OVMF_VARS.fd

However the NOOPT version doesn't run, also the DEBUG version doesn't run, I'm able to work only with the RELEASE version :(

 

I know that probably it is not persistent after a reboot, but I think I know how to make it persistent.

 

This because sometimes it can be that opencore log to file is broken and I was asked to compile OVMF NOOPT with serial debug.

This was the case of broken AudioDXE driver, only if compiled as DEBUG, as the RELEASE version worked fine.

 

2nd part: once OVMF is compiled and replaced in Unraid, anyone knows how to work with serial debug?

 

@Leoyzen ?

Sorry to directly tag you but I know you are more expert in these things and probably you already replaced the Unraid OVMS firmware.

 

Here the steps to compile edk2 directly from sources in mac os (release build, X64):


git clone https://github.com/tianocore/edk2.git
cd edk2
git submodule init
git submodule update
cp OvmfPkg/OvmfPkgX64.dsc OvmfPkgX64.dsc  <-- I had an error of file not found without manually copying it -->
cd OvmfPkg
./build.sh -a X64 -t XCODE5   -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc

 

 The replacement is correct, but that did not mean that the "NOOP" nor the "Debug" version of opencore will work ,because from the github, it only for debug purpose, which mean it did not resolve the bug, but the way to get more debug information

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.