Jump to content
Huberer

Broadcom bcm57781 - how do I patch the kext for ML 10.8.5?

91 posts in this topic

Recommended Posts

Hi. Sorry for my english. I try to do patch for Clover.

I understood that "replace" data is my own ID of network card?

For expl.

I have pci14e4,16b1. 

Than patch data for me is:

 

1 find e8 89 ad ff ff replace b8 e4 14 00 00

2 find e8 6e ad ff ff and replace with b8 b4 16 00 00  b8 b1 16 00 00 ?

3 find e8 65 ae ff ff replace  b8 b4 16 00 00  b8 b1 16 00 00 ?

???

 

No, no, no, you have to patch the binary exactly as described! Only in Info.plist you have to add your own NIC's ID in order to make the driver load.

 

Mieze

Share this post


Link to post
Share on other sites
Advertisement

Ok. So patches for 10.9 are:

find e8 89 ad ff ff replace b8 e4 14 00 00

find e8 6e ad ff ff replace b8 b4 16 00 00

find e8 65 ae ff ff replace b8 b1 16 00 00

In my I have dual boot to 10.8.5 and 10.9.

Patch for 10.9 can broke same kext from 10.8.5 and vice versa?

Share this post


Link to post
Share on other sites

I also can't get the driver to load under ML 10.8.5. I patched it, rebuild cache and repaired permissions several times, removed all necessary networking settings but no chance.

Will also check my DSDT maybe it's because of that.

Share this post


Link to post
Share on other sites

I also can't get the driver to load under ML 10.8.5. I patched it, rebuild cache and repaired permissions several times, removed all necessary networking settings but no chance.

Will also check my DSDT maybe it's because of that.

Please post your kernel logs and an IOReg dump so that I can see what is going on.

 

Mieze

Share this post


Link to post
Share on other sites

 

Hi Mieze,

 

I have tried all of these methods already, having googled extensively. There are no kexts outside of /S/L/E and everything else is in good working order. This is what I have tried so far:

 

sudo rm -r /System/Library/Caches/com.apple.kext.caches

 

Repair permissions: (having deleted above caches)

in DiskUtility

in Kext Wizard (latest)

in Terminal

in Safe mode -v

in stand alone mode -s

While booting -f

 

sudo touch /System/Library/Extensions

 

all of the following fail the same way:

 

sudo kextcache -update-volume /

sudo kextcache -system-prelinked-kernel

 

I have removed all network entries and deleted /L/P/SC/Preferences & NetworkInterfaces.plist which got recreated on reboot. The only thing that remains constant is the dependency on "com.apple.iokit.IOEthernetAVBController" for which I cannot find any useful info on the internet. What it is? What it does? and more importantly which part of my fricking system is continuously looking for it?

 

I should also mention that my WiFi card is also Broadcom based and functions perfectly with any version of the driver. Could something in my dsdt be the problem?

 

Thanks again

 

Serge

 

P.S. I've just checked my DSDT source and found the following:

 

Scope (_SB.PCI0)

{

Device (GLAN)

{

Name (_ADR, 0x00190000)

Method (_PRW, 0, NotSerialized)

{

Return (GPRW (0x0D, 0x04))

}

Method (_DSM, 4, NotSerialized)

{

Store (Package () {

"Name", Buffer (0x09) {"Ethernet"},

"Model", Buffer (0x12) {"Broadcom 57765-B0"},

"Device-id", Buffer (0x04) {0xB4, 0x16, 0x00, 0x00},

"Vendor-id", Buffer (0x04) {0xE4, 0x14, 0x00, 0x00},

"Compatible", Buffer (0x0D) {"Pci14e4, 16b4"},

"IOName", Buffer (0x0D) {"Pci14e4, 16b4"},

"IONameMatch", Buffer () {"Pci14e4"}, Buffer () {"16b4"},

"built-in", Buffer (One) {0x01}

}, Local0)

DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))

Return (Local0)

}

}

 

.....

This looks about right to me if indeed it's trying to fool the driver into thinking it's a 57765.

 

Update 2:

I replaced the patched IONetworkingFamily with the original 10.8.5 one and rebooted. No further log entries for any dependency. So I cleaned & rebuilt the -system-prelinked-kernel & system-caches which completed without error. Reboot (Still no Ethernet). Replaced with the repatched version (with the only difference being 16b0 -> 16b1) plus the binary patch. Reboot and the Dependency Errors are back again.

 

this is from the logs:

 

09/10/2013 22:32:51.000 kernel[0]: Kext com.apple.iokit.AppleBCM5701Ethernet - library kext com.apple.iokit.IOEthernetAVBController not found.

09/10/2013 22:32:51.000 kernel[0]: Can't load kext com.apple.iokit.AppleBCM5701Ethernet - failed to resolve library dependencies.

09/10/2013 22:32:51.000 kernel[0]: Kext com.apple.iokit.AppleBCM5701Ethernet failed to load (0xdc00800e).

09/10/2013 22:32:51.000 kernel[0]: Failed to load kext com.apple.iokit.AppleBCM5701Ethernet (error 0xdc00800e).

09/10/2013 22:32:51.000 kernel[0]: Couldn't alloc class "BCM5701Enet"

09/10/2013 22:32:53.744 com.apple.kextd[12]: /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.

09/10/2013 22:32:53.800 com.apple.kextd[12]: Can't load /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext - failed to resolve dependencies.

09/10/2013 22:32:53.801 com.apple.kextd[12]: Load com.apple.iokit.AppleBCM5701Ethernet failed; removing personalities from kernel.

 

Cheers

Serge

 

Looks like you messed up the kext. Ok, start over with the vanilla kext from a backup. Patch it in place as this is the easiest way. In case it fails use your Timemachine backup to restore the vanilla one. First start with the Info.plist and make sure the kext loads. Use
sudo nano /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents/Info.plist
to edit it. When it loads successfully, go to the next step and do the binary patch.

 

Mieze

Patch for 10.9 can broke same kext from 10.8.5

and vice versa

?

I'm not sure if I understand what you are trying to ask, but in case you apply the 10.8.5 patch to the 10.9 kext (and vice versa) you'll damage it.

 

Mieze

Share this post


Link to post
Share on other sites

my setup. I have dual boot to 10.8.5 and 10.9. They are on different hdd's.

10.8.5 sits on ssd with clover v2 and 10.9 sits on hdd and don't has a boot loader. One clover with one config.plist boots all OS's.

Can I write patching data for 10.8.5 and 10.9 to one config. Will it works?

Or i need to do patch for kexts by hex edit? 

Share this post


Link to post
Share on other sites

Looks like you messed up the kext. Ok, start over with the vanilla kext from a backup. Patch it in place as this is the easiest way. In case it fails use your Timemachine backup to restore the vanilla one. First start with the Info.plist and make sure the kext loads. Use

sudo nano /System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents/Info.plist

to edit it. When it loads successfully, go to the next step and do the binary patch.

 

 

 

Done. No Change, but what is now certain is the problem starts with Info.plist:

 

Virgin 10.8.5 kext + 'Sudo touch /System/Library/Extensions'     == No kext loaded but no Log Errors reported either

 

as soon as I change Info.plist to include '<string>pci14e4,16b1</string>' + 'Sudo touch /System/Library/Extensions'

these Log errors start pouring out immediately and continue after reboot:

 

11/10/2013 17:04:18.042 sudo[264]:    Serge : TTY=ttys000 ; PWD=/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents ; USER=root ; COMMAND=/usr/bin/nano info.plist
11/10/2013 17:05:27.434 sudo[268]:    Serge : TTY=ttys000 ; PWD=/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents ; USER=root ; COMMAND=/usr/bin/touch /System/Library/Extensions/
11/10/2013 17:05:33.458 sudo[270]:    Serge : TTY=ttys000 ; PWD=/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents ; USER=root ; COMMAND=/sbin/reboot
11/10/2013 17:05:35.032 com.apple.kextd[12]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:35.039 com.apple.kextd[12]: Can't load AppleBCM5701Ethernet.kext - failed to resolve dependencies.
11/10/2013 17:05:35.040 com.apple.kextd[12]: Load com.apple.iokit.AppleBCM5701Ethernet failed; removing personalities from kernel.
11/10/2013 17:05:35.775 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:35.776 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
11/10/2013 17:05:36.391 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:38.382 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:38.383 com.apple.kextcache[274]: Prelink failed for com.apple.iokit.AppleBCM5701Ethernet; aborting prelink.

Share this post


Link to post
Share on other sites

 

Done. No Change, but what is now certain is the problem starts with Info.plist:

 

Virgin 10.8.5 kext + 'Sudo touch /System/Library/Extensions'     == No kext loaded but no Log Errors reported either

 

as soon as I change Info.plist to include '<string>pci14e4,16b1</string>' + 'Sudo touch /System/Library/Extensions'

these Log errors start pouring out immediately and continue after reboot:

 

11/10/2013 17:04:18.042 sudo[264]:    Serge : TTY=ttys000 ; PWD=/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents ; USER=root ; COMMAND=/usr/bin/nano info.plist
11/10/2013 17:05:27.434 sudo[268]:    Serge : TTY=ttys000 ; PWD=/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents ; USER=root ; COMMAND=/usr/bin/touch /System/Library/Extensions/
11/10/2013 17:05:33.458 sudo[270]:    Serge : TTY=ttys000 ; PWD=/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents ; USER=root ; COMMAND=/sbin/reboot
11/10/2013 17:05:35.032 com.apple.kextd[12]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:35.039 com.apple.kextd[12]: Can't load AppleBCM5701Ethernet.kext - failed to resolve dependencies.
11/10/2013 17:05:35.040 com.apple.kextd[12]: Load com.apple.iokit.AppleBCM5701Ethernet failed; removing personalities from kernel.
11/10/2013 17:05:35.775 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:35.776 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext is missing dependencies (including anyway; dependencies may be available from elsewhere)
11/10/2013 17:05:36.391 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:38.382 com.apple.kextcache[274]: AppleBCM5701Ethernet.kext - no dependency found for com.apple.iokit.IOEthernetAVBController.
11/10/2013 17:05:38.383 com.apple.kextcache[274]: Prelink failed for com.apple.iokit.AppleBCM5701Ethernet; aborting prelink.

 

I would suggest to get rid of the DSDT patch as it is superfluous and might even be the cause for the problem.

 

Mieze

Share this post


Link to post
Share on other sites

Hi Mieze,  I was curious myself so yesterday I swapped to my prev DSDT which didn't have it, just to see if there was any change in anyway.  That was fruitless.  I will try a few more things, to track this down.  One curious thing is that this is the only version of the driver, I've seen, that doesn't have IOEthernetAVBController.kext.  Adding one from a virgin 10.8 to the plugins of 10.8.5 results in this in the logs:

 

11/10/2013 17:56:52.000 kernel[0]: AppleBCM5701Ethernet:        0     16b1 getAdapterInfo - Device is unknown
11/10/2013 17:56:52.000 kernel[0]: AppleBCM5701Ethernet:        0        0 start - getAdapterInfo failed, giving up
 
so I came across this thread which is probably behind how PJALMs Asrock dsdt patch, came to have the entry in the first place.
 
I'd love to know how it gets that 16b1, and if it can be intercepted.  It's been a couple of decades since my assembler days, but I've even started casually checking the binary in hopper to see if anything jumps out.

I appreciate your help, and will be happy to try out any ideas.

 

Serge 

Share this post


Link to post
Share on other sites

I just added the list of Broadcom NICs (all members of the BCM 57785 family) for which the described patch should work to my post describing the procedure.

 

Mieze

Share this post


Link to post
Share on other sites

I just added the list of Broadcom NICs (all members of the BCM 57785 family) for which the described patch should work to my post describing the procedure.

 

Mieze

 

Hello Mieze

 

It's been a long time since we spoke last, hope things are well on your side of the pond. Late Merry Christmas by the way. =)

 

Do you happen to have and updated hex patch for 10.9.1?

 

Can you confirm the patch below would work for the BCM57781 with OSX Mavericks 10.9.1?

 

 

/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents/Info.plist

<key>IONameMatch</key>
<array>
    <string>pci14e4,16b0</string>
    <string>pci14e4,16b1</string>
    <string>pci14e4,16b2</string>
    <string>pci14e4,16b4</string>
    <string>pci14e4,16b5</string>
    <string>pci14e4,16b6</string>
    <string>pci14e4,1682</string>
    <string>pci14e4,1684</string>
    <string>pci14e4,1686</string>
</array>

 

/System/Library/Extensions/IONetworkingFamily.kext/Contents/PlugIns/AppleBCM5701Ethernet.kext/Contents/MacOS/AppleBCM5701Ethernet

Find  -->
Replace


Step 1 - Replace 5 bytes at offset 0x6f94 with 5 bytes


BA 02 00 00 00 E8 57 A9 FF FF 66 89 83  -—>
BA 02 00 00 00 B8 B4 16 00 00 66 89 83


Step 2 - Replace 5 bytes at offset 0x7070 with 5 bytes


BA 2C 00 00 00 E8 7B A8 FF FF 66 89 83  -—>
BA 2C 00 00 00 B8 B4 16 00 00 66 89 83


Step 3 - Replace 5 bytes at offset 0x708b with 5 bytes


BA 2E 00 00 00 E8 60 A8 FF FF 66 89 83  -—>
BA 2E 00 00 00 B8 B4 16 00 00 66 89 83

I'm going to try and use your method again with Pikes new style of extension patching at:

http://pikeralpha.wordpress.com/2013/12/17/new-style-of-applehda-kext-patching/

 

Hopefully I'll have some success and post my result (and kext if works)

 

Gratitude,

 

Robert (mrengles)

Edited by mrengles

Share this post


Link to post
Share on other sites

If any one is interested in patching for Broadcom 57781 on the fly with Clover for Mavericks OS X 10.9.2

		<key>KextsToPatch</key>
		<array>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 1)</string>
				<key>Find</key>
				<data>6H+o//8=</data>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<data>uLQWAAA=</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 2)</string>
				<key>Find</key>
				<data>6I2n//8=</data>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<data>uLQWAAA=</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 3)</string>
				<key>Find</key>
				<data>6HKn//8=</data>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<data>uLQWAAA=</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 4)</string>
				<key>InfoPlistPatch</key>
				<true/>
				<key>Find</key>
				<string>pci14e4,1686</string>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<string>pci14e4,16b1</string>
			</dict>
		</array>

I would recommend patching the plist file manually otherwise you have to deal with kernel cache issues, and having to reboot several times after booting without cache.

 

Enjoy!

 

Robert aka Mrengles

http://organicdata.net/

Share this post


Link to post
Share on other sites

If any one is interested in patching for Broadcom 57781 on the fly with Clover for Mavericks OS X 10.9.2

		<key>KextsToPatch</key>
		<array>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 1)</string>
				<key>Find</key>
				<data>6H+o//8=</data>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<data>uLQWAAA=</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 2)</string>
				<key>Find</key>
				<data>6I2n//8=</data>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<data>uLQWAAA=</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 3)</string>
				<key>Find</key>
				<data>6HKn//8=</data>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<data>uLQWAAA=</data>
			</dict>
			<dict>
				<key>Comment</key>
				<string>Enable: Broadcom 57781 GbE Ethernet (Step 4)</string>
				<key>InfoPlistPatch</key>
				<true/>
				<key>Find</key>
				<string>pci14e4,1686</string>
				<key>Name</key>
				<string>AppleBCM5701Ethernet</string>
				<key>Replace</key>
				<string>pci14e4,16b1</string>
			</dict>
		</array>

I would recommend patching the plist file manually otherwise you have to deal with kernel cache issues, and having to reboot several times after booting without cache.

 

Enjoy!

 

Robert aka Mrengles

http://organicdata.net/

 

Hi, Would this method work for BCM57760 14e4:1690 ?

 

Been trying many methods without any result !

Share this post


Link to post
Share on other sites

Hi, Would this method work for BCM57760 14e4:1690 ?

 

Been trying many methods without any result !

 

Like Mieze said earlier...

 

I just added the list of Broadcom NICs (all members of the BCM 57785 family) for which the described patch should work to my post describing the procedure.

 

Mieze

 

In principle this method should work with all members of the BCM57785 family:

  • BCM57781 = 0x16B1
  • BCM57785 = 0x16B5 
  • BCM57785X  = 0x16B5 
  • BCM57761  = 0x16B0
  • BCM57791  = 0x16B2
  • BCM57795  = 0x16B6
  • BCM57795X  = 0x16B6 ​​

 

Same goes for the Clover automatic patching. After all its the same exact patch.

Share this post


Link to post
Share on other sites

Like Mieze said earlier...

 

 

In principle this method should work with all members of the BCM57785 family:

  • BCM57781 = 0x16B1
  • BCM57785 = 0x16B5 
  • BCM57785X  = 0x16B5 
  • BCM57761  = 0x16B0
  • BCM57791  = 0x16B2
  • BCM57795  = 0x16B6
  • BCM57795X  = 0x16B6 ​​

 

Same goes for the Clover automatic patching. After all its the same exact patch.

 

 

Ofcourse. My Ethernet Card however is Broadcom Corporation NetXtreme BCM57760 14e4:1690. 

 

Using yours and Mieze's method i have been able to get the AppleBCM kext to recognise and register it. However, i have been unable to get the Kext to recognise that the Cable is plugged. It only shows that the Cable is unplugged. Tried to put in manually address's however that doesn't work either as ifconfig states en0 as inactive even with cable connected.

Share this post


Link to post
Share on other sites

Well, I guess you have come to a dead end with regard to patching this driver. Why don't you try the BCM5722 driver from this site? It has proven to work with a number of other Broadcom NICs too.

 

Mieze

Share this post


Link to post
Share on other sites

Well, I guess you have come to a dead end with regard to patching this driver. Why don't you try the BCM5722 driver from this site? It has proven to work with a number of other Broadcom NICs too.

 

Mieze

 

I have been using just that since 10.9. Was able to patch 10.8.x kexts. Problem with BCM5722 driver is we have to reload the kext after every sleep, and incase of boot up with ethernet cable attached.

Share this post


Link to post
Share on other sites

I have been using just that since 10.9. Was able to patch 10.8.x kexts. Problem with BCM5722 driver is we have to reload the kext after every sleep, and incase of boot up with ethernet cable attached.

 

I guess you should get in contact with Alex and work with him in order to fix the issue. Broadcom offers documentation making driver development much easier than most manufacturers.

 

Mieze

Share this post


Link to post
Share on other sites

Hi Mieze,  I was curious myself so yesterday I swapped to my prev DSDT which didn't have it, just to see if there was any change in anyway.  That was fruitless.  I will try a few more things, to track this down.  One curious thing is that this is the only version of the driver, I've seen, that doesn't have IOEthernetAVBController.kext.  Adding one from a virgin 10.8 to the plugins of 10.8.5 results in this in the logs:

 

11/10/2013 17:56:52.000 kernel[0]: AppleBCM5701Ethernet:        0     16b1 getAdapterInfo - Device is unknown
11/10/2013 17:56:52.000 kernel[0]: AppleBCM5701Ethernet:        0        0 start - getAdapterInfo failed, giving up
 
so I came across this thread which is probably behind how PJALMs Asrock dsdt patch, came to have the entry in the first place.
 
I'd love to know how it gets that 16b1, and if it can be intercepted.  It's been a couple of decades since my assembler days, but I've even started casually checking the binary in hopper to see if anything jumps out.

I appreciate your help, and will be happy to try out any ideas.

 

Serge 

I have the same problem as you do. Only difference is i am getting this in logs:

 

AppleBCM5701Ethernet:        0        0 start - Allocate Interrupt event source failed

Still trying to figure out how to solve it....

Share this post


Link to post
Share on other sites

hello, I'm using the 16B5 BCM57785 ,I wanna just put a new ID in the dsdt and it's calling inject?

which id will be work? tks~

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×