Jump to content

Using Darwin Airport Driver With Osx86 10.4.1


  • This topic is locked This topic is locked
297 replies to this topic

#1
lagnat

lagnat

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
This is a relatively complex HOWTO for patching the Darwin Airport driver to work on oxs86.

N O T E: You shouldn't even attempt this unless you are already comfortable in Terminal.

This is known to work on a dell D600 with a Broadcom BCM4306.

EDIT: I have another d600 that didn't work at first. The problem ended up being a BIOS setting. Go into the BIOS and alt-p until you get to the page with the wireless settings. One of the settings turns the card on and off.. sorry, I can't remember exactly what it says and I don't have the machine with me now. The text to the right explains that even if it's off, the OS can still turn it on but that doesn't seem to be the case with osx. Enable the card in the BIOS and try again. If this works for you, please make a note of the exact setting and let me know.

EDIT: There is probably a pre-patched driver posted later in this thread.

You'll need:
o Darwin install CD
o MacOS x86 with gcc installed. I used gcc4.

1. Insert Darwin CD
2. Run Terminal.app
3. Make a working directory
$ mkdir work
$ cd work
4. Untar the driver from the Darwin CD
$ bunzip2 -c /Volumes/Darwin8_i386/System/Installation/BinaryDrivers_i386/AirPortDriver2-350.5.tar.bz2 | tar xvf -
5. Optional: Try loading the unpatched driver manually. It should fail.
$ sudo chown -R root:wheel System/Library/Extensions/AppleAirPort2.kext
$ sudo kextload System/Library/Extensions/AppleAirPort2.kext
ld(): Undefined symbols:
_OSDequeueAtomic
_OSEnqueueAtomic
...
6. Goto http://fxr.watson.or....c?v=OPENDARWIN
Copy and paste the missing functions into a new file. I called mine "foo.c".
7. Add the following include lines to the top of the file:
#include <libkern/OSTypes.h>
#include <libkern/OSAtomic.h>
#define NULL 0

The file should now look something like this
#include <libkern/OSTypes.h>
#include <libkern/OSAtomic.h>
#define NULL 0

void * OSDequeueAtomic(void ** inList, SInt32 inOffset)
{
( source code deleted )
}

void OSEnqueueAtomic(void ** inList, void * inNewLink, SInt32 inOffset)
{
( source code deleted )
}
8. Relink the driver with the new functions
$ gcc -o AppleAirPort2 foo.c System/Library/Extensions/AppleAirPort2.kext/Contents/MacOS/AppleAirPort2 -fasm-blocks -g -O0 -DJAGUAR -DDEBUG=1 -fmessage-length=0 -mfix-and-continue -fno-common -nostdinc -fno-builtin -finline -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static -DKERNEL -DKERNEL_PRIVATE -DDRIVER_PRIVATE -DAPPLE -DNeXT -I/System/Library/Frameworks/Kernel.framework/PrivateHeaders -I/System/Library/Frameworks/Kernel.framework/Headers -lkmod -lcc_kext -lcpp_kext -static -nostdlib -r
9. Move the patched driver into the work kext
$ sudo mv AppleAirPort2 System/Library/Extensions/AppleAirPort2.kext/Contents/MacOS/
9. Test the new driver. It should load and if your hardware is supported, you should see it show up in network prefs.
$ sudo chown -R root:wheel System/Library/Extensions/AppleAirPort2.kext
$ sudo kextload System/Library/Extensions/AppleAirPort2.kext
kextload: System/Library/Extensions/AppleAirPort2.kext loaded successfully
10. If all goes well, move the working kext into the system
$ sudo cp -r System/Library/Extensions/AppleAirPort2.kext /System/Library/Extensions

#2
Passe

Passe

    InsanelyMac Protégé

  • Members
  • Pip
  • 17 posts
What chipset is used in airports ?

I heard it's a broadcom one, can you confirm this and tell which specific model ?

Other wireless cards use the same chipset as airport so your method may work with them.

#3
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
A quick question... I just did the XCode install, but most things I try to compile error out with this "i686-apple-darwin8-gcc-4.0.0: spec failure: unrecognized spec option 'Q'". Any ideas here?

Was going to compile this and then bring the file home to test on the laptop. hehe

#4
lagnat

lagnat

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts

A quick question...  I just did the XCode install, but most things I try to compile error out with this "i686-apple-darwin8-gcc-4.0.0: spec failure: unrecognized spec option 'Q'".  Any ideas here?

Was going to compile this and then bring the file home to test on the laptop. hehe

<{POST_SNAPBACK}>


I got the same error but I didn't investigate it since it didn't seem to cause any harm.

#5
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
Ahh, ok. I was worried, since fink actually errors out on gzip or something during its CVS source install.

THis isn't actually compiling for me either, at least no file appears where I am typing the command.

Here is the complete error:
i686-apple-darwin8-gcc-4.0.0: spec failure: unrecognized spec option 'Q'
foo.c: In function 'OSDequeueAtomic':
foo.c:10: error: 'NULL' undeclared (first use in this function)
foo.c:10: error: (Each undeclared identifier is reported only once
foo.c:10: error: for each function it appears in.)

Thanks, btw. I've not done much (any) compiling in OSX or Darwin, I'm only used to some in Linux.

#6
lagnat

lagnat

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts

Ahh, ok.  I was worried, since fink actually errors out on gzip or something during its CVS source install.

THis isn't actually compiling for me either, at least no file appears where I am typing the command.

Here is the complete error:

i686-apple-darwin8-gcc-4.0.0: spec failure: unrecognized spec option 'Q'
foo.c: In function 'OSDequeueAtomic':
foo.c:10: error: 'NULL' undeclared (first use in this function)
foo.c:10: error: (Each undeclared identifier is reported only once
foo.c:10: error: for each function it appears in.)

Thanks, btw.  I've not done much (any) compiling in OSX or Darwin, I'm only used to some in Linux.

<{POST_SNAPBACK}>


Oh dammit.. replace the NULL with a zero (0). I'll fix my post.

#7
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
Nevermind, you have to make sure foo.c also has this in it at the top:

enum {
false = 0,
true = 1
};

#define NULL 0L

EDIT: You beat me to it. hehe Thanks a lot for all the help. :P

#8
weeguy

weeguy

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 149 posts
just wondering how many have gotten their wireless cards to work using this method? what chipsets were your wireless cards based on?

#9
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
This is only going to work on cards that use the same Broadcom chipset that an airpot card uses I think. One such card is the Linksys WPC54G anyway (at least it shows up as a normal airport card in a mac laptop).

I can't test this out at home until I get there, but I've compiled it for now. I think some of us are going to have PCMCIA problems that will prevent any card from working, unless you have a lucky motherboard chipset like lagnat.

#10
weeguy

weeguy

    InsanelyMac Geek

  • Members
  • PipPipPip
  • 149 posts
tried it out but as expected, it didn't work on my Atheros based card. can anyone confirm Linksys WPC54G works?

#11
eight_sixx

eight_sixx

    InsanelyMac Protégé

  • Members
  • Pip
  • 35 posts

This is only going to work on cards that use the same Broadcom chipset that an airpot card uses I think.  One such card is the Linksys WPC54G anyway (at least it shows up as a normal airport card in a mac laptop).

I can't test this out at home until I get there, but I've compiled it for now.  I think some of us are going to have PCMCIA problems that will prevent any card from working, unless you have a lucky motherboard chipset like lagnat.

<{POST_SNAPBACK}>


Wireless cards with ralink chipsets work. My ralink based card is a D-Link DWL-G122(B1) USB dongle and it works. Here is a link to that forum topic: Wireless Cards in OSX

#12
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
This may be of use:
http://www.osxhax.co...ves/000060.html

I think I have rev 1 wpc54g, but I can't check for another 2 hours or so when I get home. LOL. And, again, this driver won't help w/Atheros stuff I'm pretty sure. My current laptop has some 855GM chipset I think, but I get one with a 915PM in a week, so between the two of them, one has to have supported PCMCIA chipset I'd think, too.

#13
Buddyroe333

Buddyroe333

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 2 posts
Okay, I have a Broadcom wireless adapter built-in to my laptop, and I've followed your directions exactly. But after entering in..

gcc -o AppleAirPort2 foo.c System/Library/Extensions/AppleAirPort2.kext/Contents/MacOS/AppleAirPort2 -fasm-blocks -g -O0 -DJAGUAR -DDEBUG=1 -fmessage-length=0 -mfix-and-continue -fno-common -nostdinc -fno-builtin -finline -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static -DKERNEL -DKERNEL_PRIVATE -DDRIVER_PRIVATE -DAPPLE -DNeXT -I/System/Library/Frameworks/Kernel.framework/PrivateHeaders -I/System/Library/Frameworks/Kernel.framework/Headers -lkmod -lcc_kext -lcpp_kext -static -nostdlib -r


I get the following error....

cc1: error: invalid option `fix-and-continue'

Any clue on how to fix this? The only thing I could think of is because my GCC version is 3.3. Could that be the problem? If so, how do you update it? I went to the GCC website and didn't see any info at all for OSx86 systems.

#14
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
Yes, set it to use GCC 4.0 I think it is done by typing 'sudo gcc_select 4.0'. At least I compiled it with GCC 4. (xcode 2.1 of course, just google for xcode download, but you'll need the 'freebie' ADC membership to get it, like a 600MB download)

#15
gtkow

gtkow

    InsanelyMac Protégé

  • Members
  • Pip
  • 11 posts
hi,
I have a intel pro/wireless 2100 this manipulation working or not???

:D
I hope!!!

or it's only for broadcom hardware??

#16
Buddyroe333

Buddyroe333

    InsanelyMac Protégé

  • Just Joined
  • Pip
  • 2 posts

Yes, set it to use GCC 4.0  I think it is done by typing 'sudo gcc_select 4.0'.  At least I compiled it with GCC 4. (xcode 2.1 of course, just google for xcode download, but you'll need the 'freebie' ADC membership to get it, like a 600MB download)

<{POST_SNAPBACK}>


Thank you so much! I typed that in, followed the rest of the intructions, and bang! I have built-in wireless internet! Woo-hoo!!

Funny thing is, I didn't have to download Xcode, I just typed in what you said "sudo gcc-select 4.0" and it worked without downloading anything else. (maybe it's already included with the deadmoo image, just not selected by default?)

#17
lagnat

lagnat

    InsanelyMac Protégé

  • Members
  • Pip
  • 7 posts
I just checked this dell, and it is indeed a broadcom BCM4306.

#18
suleiman

suleiman

    Your Anchorman

  • Retired
  • 640 posts
  • Gender:Male
  • Location:USA, UK, and CANADA :)
  • Interests:OS X
This sounds like great news..and just before I went out to buy that belkin usb adapter! Just one quick inquiry though, does this mean i will need to download the darwin x86 install CD first? I was under the impression that Mac x86 came with darwin pre-installed.

#19
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there
My laptop (HP Compaq NC6000) isn't initialising PCMCIA properly. <_< The kext will load but since my PCMCIA isn't working, it doesn't help.

For those who get it working, what PCMCIA chipset do you have? (check in windows device manager or perhaps just in system info in OS X).

And again, this is just BROADCOM (which Airport happens to use). Nothing else will be helped by this.

#20
cyrana

cyrana

    Prophetess of Doom

  • Retired
  • 1,462 posts
  • Gender:Female
  • Location:Somewhere out there

This sounds like great news..and just before I went out to buy that belkin usb adapter! Just one quick inquiry though, does this mean i will need to download the darwin x86 install CD first? I was under the impression that Mac x86 came with darwin pre-installed.

<{POST_SNAPBACK}>


Yeah, I downloaded that 8.0.1 CD.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

© 2014 InsanelyMac  |   News  |   Forum  |   Downloads  |   OSx86 Wiki  |   Mac Netbook  |   PHP hosting by CatN  |   Designed by Ed Gain  |   Logo by irfan  |   Privacy Policy