1. 07:20 16th Feb 2012

    notes: 1

    tags: net80211

    net80211 port completed, drivers not yet

    Quick note to say that I have finally completed the net80211 port for OS X. Please check the Facebook page for links to download a detailed report and a presentation for those interest in knowing the inner workings of it. I basically deleted the old code and started from scratch this time, re-porting everything by hand after careful planning.

    For those curious to find out when/if working drivers will be released - I have ported Intel 3945 driver from OpenBSD to use net80211 and am currently trying to debug it. It’s failing on firmware load. All other Intel wireless cards (from 100- to 4-, 5- and 6- ranges) are supported by the BSD iwn driver and will also be ported soon.

    Also: Airport compatibility for OS X Lion 10.7 is also confirmed (at least the driver loads, but hasn’t been tested fully).

    Facebook page with more info

    More updates and source code to come soon.

    (Source: facebook.com)

     
  2. All source code for VoodooWireless, the Intel 3945 driver, and the unfinished net80211 port are uploaded to the linked website.

    See the Facebook page for more details.

    Programmers interested in helping can use VoodooWireless and VoodooIntel3945 as a starting point to fix bugs and make improvements, or to port it to 4965 and other wireless cards. The first thing that needs to be fixed is either the software WEP implementation, or to get it working with hardware WEP/WPA.

    Those who want to port BSD net80211 should use the uploaded version as a starting point. It is mostly complete except for hooking into Apple’s 80211 stack, and conversion to IOKit driver.

    Everything is released under BSD license (even if the individual source files have a different or nonexistent license header), except the files that have an APSL header. These files continue to be distributed under APSL.

     
  3. 21:24 29th Oct 2010

    notes: 8

    tags: download

    Download links

    Sorry for the delay guys, the download links are now up. I’ve switched web hosts.

    Click here for the download page

     
  4. 21:15 23rd Sep 2010

    notes: 4

    tags: progress

    20 September?

    Just a quick update - most of you were waiting for 20 September which is when I said the driver will either be done, or I will quit the project.

    The date has come and gone, so what’s the news?

    In a nutshell, the reason for me quitting the project after 20 Sept was that I was going away for a long time. But (un)fortunately, I am staying for another few months.

    So yes, the project lives on. For those dying to know how much is done: net80211 is ported and hooking it with Airport has just started.

    Estimated time needed: 50 hours.

    Estimated time I can spend: 2-3 hr/day.

    Notes

    1. Those looking for “download” link - I will add the latest driver downloads to this site tomorrow.

    2. Just to remind everyone that the “progress” that I talk about in status updates is the progress of a completely new rewrite based on BSD source code. There already exist ProjectCamphor drivers for Intel 2200 and Intel 3945 cards. They lack features like security, and are unreliable for many people.

    3. If you “Ask a question” as anonymous, please leave your e-mail address if you want a reply. Right now I have 48 unanswered questions, to which I would like to reply without publishing on this blog, but have no way to get back to you.

     
  5. 03:24 15th Sep 2010

    notes: 3

    Anonymous asked: Sorry, but where can I download the latest drivers? Just a bit confused by the simplicity of the blog...

    I will put up a “Downloads” page soon.

     
  6. 03:23

    notes: 3

    Anonymous asked: Any status updates on the project? Been a month since we last heard anything..

    Sorry, I was busy and traveling, though I updated the Facebook page with some information. The project was halted for the past 1 month but I have resumed coding.

     
  7. 17:45 5th Aug 2010

    notes: 4

    Anonymous asked: Great work! Could you make Ralink's drivers airport-compatible or make an airport-like menu item? (2860 for me) Thanks =)

    Sorry, can’t do that because we don’t have the source code. I contacted Ralink some time ago with the same proposition but they did not respond.

     
  8. 17:45

    notes: 2

    Anonymous asked: is this project dead? if it is it shouldnt theres a bunch of people waiting for these and you were almost there. Why?

    Jesus Christ, how many times do I have to repeat this:

    This project is not dead, but it is a HUGE PROJECT so it will take and is taking a long time. Remember - it took other commercial and free operating systems years to get stable WiFi working. You have just one person working on it right now, in his spare time, so OF COURSE it is progressing at a slow pace.

    Also keep in mind that the drivers are undergoing a complete redesign and rewrite from scratch, using OpenBSD source code as a basis. It is not simply a few bug fixes and updates to the existing drivers.

     
  9. Had a small breakthrough today

    More like a realization followed by revelation.

    $ kextfind . -dsym _ieee80211_ifattach
    IO80211Family.kext/Contents/PlugIns/AirPortAtheros.kext
    IO80211Family.kext/Contents/PlugIns/AirPortAtheros21.kext

    $ kextfind . -dsym _m_get
    System.kext/PlugIns/Private.kext
    System.kext/PlugIns/Unsupported.kext

    In other words, these symbols are accessible from any kext if we add a dependency on the kexts that “kextfind” command found.

    There are two things happening here:

    1. Since Apple and Atheros already ported FreeBSD net80211 to OS X, why should we duplicate the effort? It looks like we can actually ride on the Atheros driver’s back and call the functions from that kext.

    2. If instead I decide to go ahead with our own port, the legacy BSD mbuf functions are available from the Private and Unsupported kexts! Which means I can do away with a lot of manual code changes!

    This is cool. Let’s see what other info I dig up to make my job easier.

     
  10. 05:28 12th Jul 2010

    notes: 35

    tags: net80211

    Technical discussion on the net80211 port

    As I have mentioned previously, I’m working to port OpenBSD’s net80211 layer, which is an IEEE 802.11-2007 WiFi stack, to Mac OS X.

    Haiku, an open-source operating system, managed to do this last year for their own kernel. So why is it taking us so long to do a similar thing for OS X?

    To start off, although it appears that the OS X kernel being partly based on BSD should make things easier, it actually makes it more complicated to attempt a port such as this. Since almost half of the OS X kernel consists of FreeBSD code, there are lots of symbols predefined, like ifnet and mbuf. Apple’s own “Kernel Programming Interface” (KPIs) provide access to these data structures and functions through a slightly different API which is designed to prevent direct access. Unfortunately, most of the code from other BSD kernels heavily relies on direct access (most notable being the mbuf handling routines). To top it off, several of these data structures have been slightly modified in the XNU kernel compared to their BSD counterparts, making their usage very risky.

    Hence, simply including the source code for net80211 and some compatibility glue code (like Haiku does) would result in massive naming collisions between predefined structures and functions in the kernel vs. those redefined in the compatibility layer.

    Apple already includes a port of the net80211 stack for their drivers for the Atheros wireless adapters. Without access to that source code, it is difficult to figure out (at least for me) what approach they have taken. My approach has been to convert the entire net80211 source code to C++ and wrap them in a namespace. This will automatically cause all symbols to be prefixed with the namespace, hopefully avoiding collisions with their kernel counterparts.

    This sounds easy enough, but for some things it just doesn’t work. The mbuf handling routines in net80211 make heavy use of direct access to the mbuf structure. This is not possible in OS X (or not easily possible). OS X drivers use the mbuf_t structure and the mbuf KPI to manipulate mbufs. Now, mbufs are used to store all network data coming in and going out of the system. Thus, it is used extremely frequently. The two ways to deal with this were to either:

    1. Re-implement BSD’s mbuf API and structures in our compatibility layer. Bad option in my opinion because of the naming collisions, and more importantly, from a performance point of view, and being badly integrated with OS X’s networking tools.

    2. Wade through the hundreds of thousands of instances where mbufs have been used in net80211 source code, and convert them to their mbuf_t KPI equivalents.

    I chose the 2nd option as that was the only one which made sense, despite being extremely lengthy. I was actually recommended this by Apple kernel engineers on the darwin-drivers mailing list.

    So, the end result was to use Xcode’s “Find” feature to find every single mbuf instance, and replace it with their mbuf_t equivalent, after understanding its context. This was frustrating. But thankfully it’s done. Here’s an example snippet: mbuf code converted to mbuf_t

    And here’s the list of files which needed to be manually reviewed line by line (compiler errors are not always useful) to make sure every instance was properly converted:

    List of files in net80211

    The other issue was that a lot of functionality from OpenBSD (e.g. kernel cryptography) is not present in OS X (it probably is present, but inaccessible from the KPIs). So I included all of those. There were also several undefined symbols which I defined as equivalents. All in all, there is a compatibility layer for the compatibility layer:

    List of compatibility files for net80211

    For what it’s worth, there probably is a much better and more elegant way to do this. But sadly I am not knowledgeable enough to figure out how Apple/Atheros developers did it. How I wish I could at least get a glimpse of their source code! Ralink probably also uses the net80211 stack (or something similar) in the OS X drivers for their USB wifi adapter range. A few days ago I tried to contact Ralink to get access to their source code (in return for making their drivers Airport compatible), but have not received any reply yet.

    Anyway, with most of this mechanical porting done, what remains is to write code to glue the net80211 information/function calls to IOKit’s “Airport” interface, which is referred to as apple80211 in Kernel.framework from Leopard and older. Incidentally, Apple stopped supplying this particular set of header files from Snow Leopard onwards. Recreating the proper headers for Snow Leopard was a challenge which deserves a post of its own. Maybe later.

    So that’s a survey of the process and the difficulties so far. This week I’ll be working to finish off the “compatibility layer” for net80211 based drivers to access the hardware, and finally hooking it all up to parts of VoodooWireless so it can talk to Airport. Hopefully this approach will work. As is evident, I have not tested even a single line of all this code yet - simply because there are millions of nuts and bolts that all must fit in together before the whole thing will fly. This month I’m hoping it’ll all start to take shape. If not, well tough luck to us.

    Postscript: I mainly wrote this post so that future developers who might want to pick up on this project after I leave, can get an idea of what work is being done and how it’s intended to work. Feel free to write to me at voodoo@mercurysquad.com if you have more technical questions (don’t write to ask “how much longer” or “it doesn’t work”, though).

    Thanks for reading!