Jump to content
69 posts in this topic

Recommended Posts

this is OPEMU for Lilu Plugin

 
Intel Haswell Pentium / Celeron Series Or older processor expansion instruction set Emulation
 
USAGE:
copy Lilu.kext & OpcodeEmulator.kext To /EFI/CLOVER/kexts/Other/
 
NOTE:
if it don't work, please rebuild Lilu and OpcodeEmulator On Your Machine.
 
UPD: 2017/11/17   FIX kernel_trap
UPD: 2019/02/11   BMI1/BMI2 Instruction Set Fix
UPD: 2019/02/15   Store & Load x86/x64 Register Fix
UPD: 2019/02/18   Modrm Addressing、XMM/R64/R32 Register Store & Load Fix
UPD: 2019/02/20   BMI1/BMI2 Instruction Set Completed
UPD: 2019/02/22   IMM Byte Fix
UPD: 2019/03/03   High Sierra Support
UPD: 2019/03/07   "lock" & "ud2" instruction return

UPD: 2019/04/08   add YMM Register & F16C Instruction Set & VSSEX Instruction Set

UPD: 2019/04/25   add AES / VAES Instruction Set、AVX 2.0 Gather Instruction、VSIB Addressing

UPD: 2019/05/03   add AVX / AVX2 / FMA Instruction Set

UPD: 2019/05/15   VSSE (VEX SSE) 、VSSE2 (VEX SSE2) Instruction Set Completed.

UPD: 2019/05/18   VSSE3、VSSSE3、VSSE4.1 VSSE4.2 Instruction Set Completed.

UPD: 2019/05/19   add "vpclmulqdq" instruction. & fix BMI andn & bzhi instruction.

UPD: 2019/05/20   add "sysenter"、"sysexit" instruction for AMD Machines 32-bit Mode

UPD: 2019/05/21   add  "vpclmulqdq" VEX.256 Version & Update Lilu to 1.3.5 (Build based on Lilu 1.3.5)

UPD: 2019/05/25   YMM Register Store & Load FIX.

 

AVX、AVX 2.0 Opcode Emulator Completed.

 

 

 

 

 

OpcodeEmulator-20190525.zip

Edited by Meowthra
  • Like 16
  • Thanks 2
  • 1 month later...

@Meowthra

 

I have the Pentium G3220 so I am interested in this patch but I have a question. What does this patch do ? To make macOS 10.12 work I need 2 kernel patches for AVX and FakeCPUID. So with this patch we will get better performance for AVX instructions than the kernel patches ?

  • 1 year later...

@Meowthra

 

Hey Meowthra, I'm having a problem with my AMD CPU. I'll include pictures here, but I'm getting an OPEMU error after AppleACPICPU. After some Google-fu, it brought me to you. I have Lilu.kext in my other folder, but I do not have OpcodeEmulator.kext 

 

I see you posted an updated link here, but the link doesn't seem to be working. Is it possible to repost? EDIT: Sorry, I logged in, then was able to download.

 

Attached is a screenshot of my error. Sorry for the quality of the photo - I had to use slow motion video to capture it, then extract that. Would you have any ideas of how to correct this?

 

Thanks!!

 

20190307_161903.jpg

20190308_145755.jpg

Edited by chundles
  • 1 month later...
  • 4 weeks later...
On 4/23/2019 at 4:53 PM, El'Xsanori Leo said:

Very good project! But does not work on my AMD RYZEN CPU running Mojave 10.14.4, I got KP while starting 32-bit apps (Maybe AMD or Mojave is not supported by this OPEMU? So, can you start supporting it? Or can you tell, how to make it work with AMD?)

 

On 4/23/2019 at 4:57 PM, Meowthra said:

How to support AMD:

Migrate source code content to (opemu.c for AMD)

Rebuild xnu

 

 

El'Xsanori Leo, did you ever get the kext to compile and work for you?  If so, how did you do it?  Sorry, I'm such a noob at this and don't want to mess with my otherwise functioning build.  Plus, I can't completely understand Meowthra's instructions.

 

If I'm understanding this correctly, this kext is designed to run the opemu code in kext form as opposed to patching the kernel.  I, too, am running Mojave on Ryzen via the Vanilla Kernel patching method (however, I'm running 10.14.1).  The only downside is you can't run 32-bit apps because the opemu code is needed.  If this kext can be modified (even at the source code level) to run the opemu code, I won't need to switch to a patched kernel to be able to run 32-bit apps just fine.  As of now, the only 32-bit app I need working is WINE, so it isn't much of a priority for me.  As I said, I don't want to mess with a functioning installation if it won't work.  Any help on how to do this is appreciated!

6 hours ago, iWin32 said:

 

El'Xsanori Leo, did you ever get the kext to compile and work for you?  If so, how did you do it?  Sorry, I'm such a noob at this and don't want to mess with my otherwise functioning build.  Plus, I can't completely understand Meowthra's instructions.

 

If I'm understanding this correctly, this kext is designed to run the opemu code in kext form as opposed to patching the kernel.  I, too, am running Mojave on Ryzen via the Vanilla Kernel patching method (however, I'm running 10.14.1).  The only downside is you can't run 32-bit apps because the opemu code is needed.  If this kext can be modified (even at the source code level) to run the opemu code, I won't need to switch to a patched kernel to be able to run 32-bit apps just fine.  As of now, the only 32-bit app I need working is WINE, so it isn't much of a priority for me.  As I said, I don't want to mess with a functioning installation if it won't work.  Any help on how to do this is appreciated!

Unfortunately not. I have to not use 32-bit applications. I am a programmer, but I haven’t been developing for OS X, so I don't know how to make it work as a kext. Meowthra's instructions are about including OPEMU into kernel source like this https://github.com/Shaneee92/Mojave_AMD_XNU/commit/ceae03a52ccdde7e54a66e8f668ac135e00722fe

14 hours ago, Download-Fritz said:

sysenter and sysexit are not supported by AMD in compatibility mode but are used by 32-bit applications

 

I have added sysenter/sysexit instruction.
But mojave didn't support 32-bit apps.

 

9 hours ago, Meowthra said:

 

I have added sysenter/sysexit instruction.
But mojave didn't support 32-bit apps.

 

 

Thanks for adding support but opening a 32bit application crashes the system.

 

Anonymous UUID:       1C475184-1B35-74E1-356C-0657ACDF03D9

Mon May 20 10:16:53 2019

*** Panic Report ***
panic(cpu 4 caller 0xffffff8019edb92d): Kernel trap at 0xffffff7f9e3be020, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x00000000000af43b, CR3: 0x00000002d560d000, CR4: 0x00000000003406e0
RAX: 0x000000000000000e, RBX: 0xffffff8048523d80, RCX: 0x0000000000000006, RDX: 0xffffff8048523dc0
RSP: 0xffffff81ffef3f80, RBP: 0xffffff81ffef3fa0, RSI: 0x0000000c05c2f7d4, RDI: 0xffffff8048523d80
R8:  0x0000000000000000, R9:  0x0000000000000000, R10: 0x0000000000000000, R11: 0x0000000000000000
R12: 0xffffff81ffef3fb0, R13: 0x0000000000000000, R14: 0x00000000000af43b, R15: 0xffffff8048523d80
RFL: 0x0000000000010097, RIP: 0xffffff7f9e3be020, CS:  0x0000000000000008, SS:  0x0000000000000000
Fault CR2: 0x00000000000af43b, Error code: 0x0000000000000001, Fault CPU: 0x4 SMAP fault, PL: 0, VF: 0

Backtrace (CPU 4), Frame : Return Address
0xffffff81ffef3a50 : 0xffffff8019daea2d mach_kernel : _handle_debugger_trap + 0x47d
0xffffff81ffef3aa0 : 0xffffff8019ee9e95 mach_kernel : _kdp_i386_trap + 0x155
0xffffff81ffef3ae0 : 0xffffff8019edb70a mach_kernel : _kernel_trap + 0x50a
0xffffff81ffef3b50 : 0xffffff8019d5bb40 mach_kernel : _return_from_trap + 0xe0
0xffffff81ffef3b70 : 0xffffff8019dae447 mach_kernel : _panic_trap_to_debugger + 0x197
0xffffff81ffef3c90 : 0xffffff8019dae293 mach_kernel : _panic + 0x63
0xffffff81ffef3d00 : 0xffffff8019edb92d mach_kernel : _kernel_trap + 0x72d
0xffffff81ffef3e70 : 0xffffff8019d5bb40 mach_kernel : _return_from_trap + 0xe0
0xffffff81ffef3e90 : 0xffffff7f9e3be020 as.lvs1974.OpcodeEmulator : __ZN14OpcodeEmulatorC2Ev + 0xf2e0
0xffffff81ffef3fa0 : 0xffffff8019d5ba4f mach_kernel : _hndl_alltraps + 0xdf
      Kernel Extensions in backtrace:
         as.lvs1974.OpcodeEmulator(1.2)[438006E8-0E60-3399-A5B1-67974B9278A9]@0xffffff7f9e384000->0xffffff7f9e3c6fff
            dependency: as.vit9696.Lilu(1.3.4)[7BA2EB23-FF86-331B-B0FF-AA4EA450FC6E]@0xffffff7f9e364000

BSD process name corresponding to current thread: cpu-x
Boot args: alcid=11 npci=0x2000 -v debug=0x100 keepsyms=1 

Mac OS version:
18F132

Kernel version:
Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
Kernel UUID: 7C8BB636-E593-3CE4-8528-9BD24A688851
Kernel slide:     0x0000000019a00000
Kernel text base: 0xffffff8019c00000
__HIB  text base: 0xffffff8019b00000
System model name: iMacPro1,1 (Mac-7BA5B2D9E42DDD94)

 

I couldn't even get as far as Shaneee; my system panics on boot right before I get to the login screen.  I'd give you a report, but I can't seem to find the right information in console.  I'm on Mojave 10.4.1.  If you can tell me where to look in Console for the panic report, please let me know and I'll gladly pass along the crash information to help you.

12 hours ago, Shaneee said:

 

 


 

as.lvs1974.OpcodeEmulator(1.2)[438006E8-0E60-3399-A5B1-67974B9278A9]@0xffffff7f9e384000->0xffffff7f9e3c6fff
      dependency: as.vit9696.Lilu(1.3.4)[7BA2EB23-FF86-331B-B0FF-AA4EA450FC6E]@0xffffff7f9e364000

 

 

OpcodeEmulator must correspond to the Lilu version

Rebuild OpcodeEmulator & Lilu

You can download the version you want to compile:
https://github.com/acidanthera/Lilu/releases
 

 

13 hours ago, Meowthra said:

 

 

OpcodeEmulator must correspond to the Lilu version

Rebuild OpcodeEmulator & Lilu

You can download the version you want to compile:
https://github.com/acidanthera/Lilu/releases
 

 

 

Downloaded your updated version and used the Lilu kext bundled in the zip.

 

   41    3 0xffffff7f84964000 0x20000    0x20000    as.vit9696.Lilu (1.3.5) C7B878A7-714E-3437-BA4D-7EB71E0DC47E <8 6 5 3 2 1>
   42    0 0xffffff7f84984000 0x43000    0x43000    as.lvs1974.OpcodeEmulator (1.2.0) 78B5DB74-D893-3784-8634-9CB075556FAD <41 8 6 5 3 2 1>

Same thing launching a 32bit application. I'm using CPU-X to test with as I know it's 32bit and does work with the modified kernel,

 

Anonymous UUID:       1C475184-1B35-74E1-356C-0657ACDF03D9

Tue May 21 12:50:01 2019

*** Panic Report ***
panic(cpu 6 caller 0xffffff80102db92d): Kernel trap at 0xffffff7f947be020, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x000000000004643b, CR3: 0x0000000354811000, CR4: 0x00000000003406e0
RAX: 0x000000000000000e, RBX: 0xffffff803ae23b20, RCX: 0x0000000000000006, RDX: 0xffffff803ae23b60
RSP: 0xffffff81f63d3f80, RBP: 0xffffff81f63d3fa0, RSI: 0x000000093cbe9106, RDI: 0xffffff803ae23b20
R8:  0x0000000000000000, R9:  0x0000000000000000, R10: 0x0000000000000000, R11: 0x0000000000000000
R12: 0xffffff81f63d3fb0, R13: 0x0000000000000000, R14: 0x000000000004643b, R15: 0xffffff803ae23b20
RFL: 0x0000000000010097, RIP: 0xffffff7f947be020, CS:  0x0000000000000008, SS:  0x0000000000000000
Fault CR2: 0x000000000004643b, Error code: 0x0000000000000001, Fault CPU: 0x6 SMAP fault, PL: 0, VF: 0

Backtrace (CPU 6), Frame : Return Address
0xffffff81f63d3a50 : 0xffffff80101aea2d 
0xffffff81f63d3aa0 : 0xffffff80102e9e95 
0xffffff81f63d3ae0 : 0xffffff80102db70a 
0xffffff81f63d3b50 : 0xffffff801015bb40 
0xffffff81f63d3b70 : 0xffffff80101ae447 
0xffffff81f63d3c90 : 0xffffff80101ae293 
0xffffff81f63d3d00 : 0xffffff80102db92d 
0xffffff81f63d3e70 : 0xffffff801015bb40 
0xffffff81f63d3e90 : 0xffffff7f947be020 
0xffffff81f63d3fa0 : 0xffffff801015ba4f 
      Kernel Extensions in backtrace:
         as.lvs1974.OpcodeEmulator(1.2)[78B5DB74-D893-3784-8634-9CB075556FAD]@0xffffff7f94784000->0xffffff7f947c6fff
            dependency: as.vit9696.Lilu(1.3.5)[C7B878A7-714E-3437-BA4D-7EB71E0DC47E]@0xffffff7f94764000

BSD process name corresponding to current thread: cpu-x
Boot args: alcid=11 npci=0x2000 -v 

Mac OS version:
18F132

Kernel version:
Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
Kernel UUID: 7C8BB636-E593-3CE4-8528-9BD24A688851
Kernel slide:     0x000000000fe00000
Kernel text base: 0xffffff8010000000
__HIB  text base: 0xffffff800ff00000
System model name: iMacPro1,1 (Mac-7BA5B2D9E42DDD94)

 

Here's a better crash report with keepsyms

 

Anonymous UUID:       1C475184-1B35-74E1-356C-0657ACDF03D9

Tue May 21 13:53:15 2019

*** Panic Report ***
panic(cpu 4 caller 0xffffff80186db92d): Kernel trap at 0xffffff7f9cbbe020, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x000000000081343b, CR3: 0x0000000408fb0000, CR4: 0x00000000003406e0
RAX: 0x000000000000000e, RBX: 0xffffff804839bf40, RCX: 0x0000000000000006, RDX: 0xffffff804839bf80
RSP: 0xffffff81fe80bf80, RBP: 0xffffff81fe80bfa0, RSI: 0x0000009b9466c6f2, RDI: 0xffffff804839bf40
R8:  0x0000000000000000, R9:  0x0000000000000000, R10: 0x0000000000000000, R11: 0x0000000000000000
R12: 0xffffff81fe80bfb0, R13: 0x0000000000000000, R14: 0x000000000081343b, R15: 0xffffff804839bf40
RFL: 0x0000000000010097, RIP: 0xffffff7f9cbbe020, CS:  0x0000000000000008, SS:  0x0000000000000000
Fault CR2: 0x000000000081343b, Error code: 0x0000000000000001, Fault CPU: 0x4 SMAP fault, PL: 0, VF: 0

Backtrace (CPU 4), Frame : Return Address
0xffffff81fe80ba50 : 0xffffff80185aea2d mach_kernel : _handle_debugger_trap + 0x47d
0xffffff81fe80baa0 : 0xffffff80186e9e95 mach_kernel : _kdp_i386_trap + 0x155
0xffffff81fe80bae0 : 0xffffff80186db70a mach_kernel : _kernel_trap + 0x50a
0xffffff81fe80bb50 : 0xffffff801855bb40 mach_kernel : _return_from_trap + 0xe0
0xffffff81fe80bb70 : 0xffffff80185ae447 mach_kernel : _panic_trap_to_debugger + 0x197
0xffffff81fe80bc90 : 0xffffff80185ae293 mach_kernel : _panic + 0x63
0xffffff81fe80bd00 : 0xffffff80186db92d mach_kernel : _kernel_trap + 0x72d
0xffffff81fe80be70 : 0xffffff801855bb40 mach_kernel : _return_from_trap + 0xe0
0xffffff81fe80be90 : 0xffffff7f9cbbe020 as.lvs1974.OpcodeEmulator : __ZN14OpcodeEmulatorC2Ev + 0xf2e0
0xffffff81fe80bfa0 : 0xffffff801855ba4f mach_kernel : _hndl_alltraps + 0xdf
      Kernel Extensions in backtrace:
         as.lvs1974.OpcodeEmulator(1.2)[78B5DB74-D893-3784-8634-9CB075556FAD]@0xffffff7f9cb84000->0xffffff7f9cbc6fff
            dependency: as.vit9696.Lilu(1.3.5)[C7B878A7-714E-3437-BA4D-7EB71E0DC47E]@0xffffff7f9cb64000

BSD process name corresponding to current thread: TextWrangler
Boot args: alcid=11 npci=0x2000 -v debug=0x100 keepsyms=1 

Mac OS version:
18F132

Kernel version:
Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
Kernel UUID: 7C8BB636-E593-3CE4-8528-9BD24A688851
Kernel slide:     0x0000000018200000
Kernel text base: 0xffffff8018400000
__HIB  text base: 0xffffff8018300000
System model name: iMacPro1,1 (Mac-7BA5B2D9E42DDD94)

 

On 5/20/2019 at 5:18 PM, Shaneee said:

 

Thanks for adding support but opening a 32bit application crashes the system.

 


Anonymous UUID:       1C475184-1B35-74E1-356C-0657ACDF03D9

Mon May 20 10:16:53 2019

*** Panic Report ***
panic(cpu 4 caller 0xffffff8019edb92d): Kernel trap at 0xffffff7f9e3be020, type 14=page fault, registers:
CR0: 0x0000000080010033, CR2: 0x00000000000af43b, CR3: 0x00000002d560d000, CR4: 0x00000000003406e0
RAX: 0x000000000000000e, RBX: 0xffffff8048523d80, RCX: 0x0000000000000006, RDX: 0xffffff8048523dc0
RSP: 0xffffff81ffef3f80, RBP: 0xffffff81ffef3fa0, RSI: 0x0000000c05c2f7d4, RDI: 0xffffff8048523d80
R8:  0x0000000000000000, R9:  0x0000000000000000, R10: 0x0000000000000000, R11: 0x0000000000000000
R12: 0xffffff81ffef3fb0, R13: 0x0000000000000000, R14: 0x00000000000af43b, R15: 0xffffff8048523d80
RFL: 0x0000000000010097, RIP: 0xffffff7f9e3be020, CS:  0x0000000000000008, SS:  0x0000000000000000
Fault CR2: 0x00000000000af43b, Error code: 0x0000000000000001, Fault CPU: 0x4 SMAP fault, PL: 0, VF: 0

Backtrace (CPU 4), Frame : Return Address
0xffffff81ffef3a50 : 0xffffff8019daea2d mach_kernel : _handle_debugger_trap + 0x47d
0xffffff81ffef3aa0 : 0xffffff8019ee9e95 mach_kernel : _kdp_i386_trap + 0x155
0xffffff81ffef3ae0 : 0xffffff8019edb70a mach_kernel : _kernel_trap + 0x50a
0xffffff81ffef3b50 : 0xffffff8019d5bb40 mach_kernel : _return_from_trap + 0xe0
0xffffff81ffef3b70 : 0xffffff8019dae447 mach_kernel : _panic_trap_to_debugger + 0x197
0xffffff81ffef3c90 : 0xffffff8019dae293 mach_kernel : _panic + 0x63
0xffffff81ffef3d00 : 0xffffff8019edb92d mach_kernel : _kernel_trap + 0x72d
0xffffff81ffef3e70 : 0xffffff8019d5bb40 mach_kernel : _return_from_trap + 0xe0
0xffffff81ffef3e90 : 0xffffff7f9e3be020 as.lvs1974.OpcodeEmulator : __ZN14OpcodeEmulatorC2Ev + 0xf2e0
0xffffff81ffef3fa0 : 0xffffff8019d5ba4f mach_kernel : _hndl_alltraps + 0xdf
      Kernel Extensions in backtrace:
         as.lvs1974.OpcodeEmulator(1.2)[438006E8-0E60-3399-A5B1-67974B9278A9]@0xffffff7f9e384000->0xffffff7f9e3c6fff
            dependency: as.vit9696.Lilu(1.3.4)[7BA2EB23-FF86-331B-B0FF-AA4EA450FC6E]@0xffffff7f9e364000

BSD process name corresponding to current thread: cpu-x
Boot args: alcid=11 npci=0x2000 -v debug=0x100 keepsyms=1 

Mac OS version:
18F132

Kernel version:
Darwin Kernel Version 18.6.0: Thu Apr 25 23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64
Kernel UUID: 7C8BB636-E593-3CE4-8528-9BD24A688851
Kernel slide:     0x0000000019a00000
Kernel text base: 0xffffff8019c00000
__HIB  text base: 0xffffff8019b00000
System model name: iMacPro1,1 (Mac-7BA5B2D9E42DDD94)

 

cpu-x can work at 10.13.6 in FX-6300 hackintosh.

Full compatibility at 10.13.6(17G6030 & 17G7024) only, other 32-bit app will cause instant reboot at 10.14.4 & 10.14.5 in FX-6300 hackintosh.

I'll test it in Ryzen 1700X hackintosh as soon as possible !

Edited by jsl2000
8 hours ago, jsl2000 said:

cpu-x can work at 10.13.6 in FX-6300 hackintosh.

Full compatibility at 10.13.6(16G6030) only, other 32-bit app will cause instant reboot at 10.13.6(16G7024), 10.14.4 & 10.14.5 in FX-6300 hackintosh.

I'll test it in Ryzen 1700X hackintosh as soon as possible !

 

Same thing with other 32bit binaries though, not just cpu-x.

On 5/22/2019 at 5:26 PM, Shaneee said:

 

Same thing with other 32bit binaries though, not just cpu-x.

Unfortunately this patch can not work in my Ryzen 1700X hackintosh at all:

It can boot to desktop at 10.14.1 & 10.14.5 only, but open any 32-bit app got instant reboot.

At 10.13.6 (17G6030), 10.14.3 & 10.14.4 it got reboot before login desktop.

So it seems only working in my FX-6300 hackintosh at 10.13.6.

[Edit]

The newer version dated on 2019-05-25 got the same errors as previous version in Ryzen1700X hackintosh.

Is there anyone got working in Ryzen hackintosh ?

[Edit2]

It can boot to desktop at 10.13.6(17G65) only in my Ryzen 1700X hackintosh, but open any 32-bit app got instant reboot.

Edited by jsl2000
2 hours ago, Meowthra said:

Mojave has started removing the 32-bit library
Some 32-bit apps don't work on Mojave.

 

High Sierra or older versions support 32-bit App.

 

So ... Don't waste your time.

Thanks for your prompt reply.

2 hours ago, Meowthra said:

 

 

AVX/AVX2 instruction set for Pentium / Celeron CPU

 

Thanks for your explanation.

Is there any special patch for AMD FX-6300 or Ryzen 1700X CPU's hackintosh for its 32-bit application ?

 

Edited by jsl2000
×
×
  • Create New...