Changes between Version 22 and Version 23 of About/HAL
- Timestamp:
- 09/20/07 16:17:45 (9 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
About/HAL
v22 v23 1 [[PageOutline(2 )]]1 [[PageOutline(2)]] 2 2 3 = The MadWifiHAL =3 = HAL = 4 4 5 == What is the HAL? == 5 This term is short for "Hardware Abstraction Layer". In context of !MadWifi it refers to a piece of software that all direct access to the Atheros hardware is routed through. Please note that the [http://www.freedesktop.org/wiki/Software/hal HAL] promoted by freedesktop.org. 6 6 7 HAL is short for Hardware Abstraction Layer. Think of it being something like the firmware of the card, with the only difference that it isn’t stored inside the card. Instead, the HAL is a kernel module which implements an API to present the hardware to the driver in a nice, uniform fashion. It is not exactly like firmware, because ‘firmware’ is a term which generally refers to code executed by an onboard microcontroller or DSP in other pieces of hardware). And yes, the HAL is closed source and only available as ready compiled binary for a bunch of different architectures.7 es. 8 8 9 T o easily see architectures the HAL is built for, see: source:/trunk/hal/public9 T 10 10 11 If the version you need isn’t there, then consider asking (nicely) on the madwifi-devel list. 11 == Frequently Asked Questions == 12 12 13 == Why is the HAL closed source? == 13 In the following we would like to answer some of the most often asked questions about the binary HAL. 14 14 15 The Atheros chipsets can tune to a wide range of frequencies, part of them being outside the bands that are permitted for unlicensed use (ISM-bands). Non-ISM-frequencies are licensed by various regulatory agencies for different purposes, such as military or civil radar use, military communications, wireless local loop installations, and so on. Furthermore, there may be regulations on the allowed transmission power on different frequencies, and on conditions such as indoor or outdoor use. 15 === Is the HAL some kind of firmware? === 16 16 17 The Atheros chipsets are capable of operating on frequencies outside those that are licensed, or legal to use without a license, and can vary the transmission power on these frequencies. So there must be some mechanism for enforcing the frequencies that are used. The limitations in regards to legal frequencies and transmission power change depending on the given region (such as Japan, UK, USA, etc), thus the HAL changes its behaviour depending on the 'regdomain' and country code. 17 Not exactly. The HAL performs tasks similar to that of a firmware, such as implementing an API to present the hardware to the driver in a nice, uniform fashion. But the term 'firmware' generally refers to code executed by an onboard microcontroller or DSP on the controlled device, while the HAL is executed on the host CPU. 18 19 === Why is the HAL closed source? === 20 21 As explained above, the Atheros chipsets can tune to a wide range of frequencies, part of them being outside the bands that are permitted for unlicensed use (ISM-bands). Non-ISM-frequencies are licensed by various regulatory agencies for different purposes, such as military or civil radar use, military communications, wireless local loop installations, and so on. Furthermore, there may be regulations on the allowed transmission power on different frequencies, and on conditions such as indoor or outdoor use. 22 23 The Atheros chipsets are capable of operating on frequencies outside those that are licensed, or legal to use without a license, and can vary the transmission power on these frequencies. So there must be some mechanism for enforcing the frequencies that are used. The limitations in regards to legal frequencies and transmission power change depending on the given region (such as Japan, UK, USA, etc), thus the HAL changes its behaviour depending on the regulatory domain and country code. 18 24 19 25 At least the USA Federal Communications Commission (FCC) requires that any manufactured products have a mechanism for limiting transmission power and frequencies, and that these mechanisms are not easily modifiable by the consumer. If you are in a region that limits the number of frequencies, say, Japan, it is illegal to broadcast out of those assigned channels, even though the chip is capable of operating outside of the limited frequency band assigned by Japan. 20 26 21 == Isn't binary-only code EVIL?==27 ==== 22 28 23 The Free Software and Open Source movements have good reasons for their philosophies and ideologies and you can read about them on their websites. However, due to regulations by regulatory authorities for the airwaves, Atheros isunable to release open specifications and/or code to set frequencies and transmission powers.29 The Free Software and Open Source unable to release open specifications and/or code to set frequencies and transmission powers. 24 30 25 Thankfully, Atheros and Sam Leffler have shown a lot of commitment to the Linux platform, so most of us are happy to have Atheros cards in our computers. 31 On the other hand, the binary HAL forces developers to deal with a black box that they can neither fix nor fully understand. The fact that Atheros and Sam Leffler have shown a lot of commitment to the Linux platform mitigates that a bit fortunately. 26 32 27 == Should I be worried that if Atheros goes out of business that the HAL will no longer be available? == 33 As far as the !MadWifi team is concerned: we did support the HAL approach as long as no acceptable alternative existed, but decided to take a different road. The binary HAL is not evil per se, but we see alternative ways to achieve the same goal with fewer negative side effects. 28 34 29 The HAL will always be available, as long as you have a copy of it. But it might well be that it won’t be developed further in this case, but that’s the same problem you’ll face with virtually any other vendor. I.e. if Prism were to go out of business the firmware for their cards would no longer be actively developed, but would still be available on the net. 35 === What happens if Atheros goes out of business? === 30 36 31 == What licensing issues are there in having non-free software in Linux (the kernel)? == 37 The HAL will always be available, as long as you have a copy of it. But it might well be that it won't be developed further in this case, but that's the same problem you'll face with virtually any other vendor. I.e. if Prism were to go out of business the firmware for their cards would no longer be actively developed, but would still be available on the net. 32 38 33 If you want to see Linus’ view on firmware vs binary drivers, [http://www.win.tue.nl/~aeb/linux/lk/COPYING-modules.txt here's] a collection of his e-mail on the subject. Interestingly, Linus says: You just can’t make a binary module for Linux, and claim that that module isn’t derived from the kernel. Because it generally is - the binary module not only included header files, but more importantly it clearly is _not_ a stand-alone work any more. So even if you made your own prototypes and tried hard to avoid kernel headers, it would _still_ be connected and dependent on the kernel. 39 === What about licensing issues? === 34 40 35 MadWifi gets around this by applying orthogonality to the problem. Rather than use a single precompiled binary module, the HAL module is split into two sections: the precompiled binary and ah_os.o (which comprises of [source:trunk/ath_hal/ah_os.c ah_os.c], [source:trunk/ath_hal/ah_os.h ah_os.h] and [source:trunk/ath_hal/ah_osdep.h ah_osdep.h]) that acts as an intermediary between the kernel and the binary HAL. The two sections are linked, and together they become the LKM (loadable kernel module) ath_hal.o.41 . 36 42 37 This design orthogonality means that the HAL binary is able to work without modification on any version of the linux kernel, as well as the BSDs, and a few other embedded projects. All that needs modifying is the ah_osdep.c, which must map HAL and kernel function calls to one another. 43 !MadWifi gets around this by applying orthogonality to the problem. Rather than use a single precompiled binary module, the HAL module is split into two sections: the precompiled binary and ah_os.o (which comprises of [source:trunk/ath_hal/ah_os.c ah_os.c], [source:trunk/ath_hal/ah_os.h ah_os.h] and [source:trunk/ath_hal/ah_osdep.h ah_osdep.h]) that acts as an intermediary between the kernel and the binary HAL. The two sections are linked, and together they become the loadable kernel module ath_hal.o. 44 45 This design orthogonality means that the HAL binary is able to work without modification on any version of the Linux kernel, as well as the BSDs, and a few other embedded projects. All that needs modifying is the ah_osdep.c, which must map HAL and kernel function calls to one another. 38 46 39 47 So, to conclude, hal.o (the binary module) is not a derived work of the linux (or any other) kernel, however {{{ath_hal.o}}} (the fully built and linked module) is, because the file ah_osdep.o does all of the OS specific mapping. 40 48 41 == What kind of access does the HAL have to my system's internals?==49 ==== 42 50 43 Because the HAL is a kernel module it runs in kernel space. It can therefore do anything it wants to any of the system's internals. However, all access to and from the HAL is done through the OS dependent wrapper, at least, as far is verifiable. However, standard problems with pointers and memory access in low-level languages remain.51 Because the HAL is a kernel module it runs in kernel space. It can therefore do anything it wants to any of the system's internals. However, all access to and from the HAL is done through the OS dependent wrapper, at least, as far is verifiable. tandard problems with pointers and memory access in low-level languages remain. 44 52 45 == What does 'ath0: HAL ABI mismatch' mean?==53 ==== 46 54 47 This message occurs when the actual HAL interface doesn’t match the interface that the driver is expecting. It generally happens when there was a cvs checkout problem, or you try to use an old HAL with the driver. If you have updated the source by doing 48 {{{ 49 svn update 50 }}} 51 in the madwifi-ng source directory you should be sure to do 52 {{{ 53 make clean 54 }}} 55 this way ath_hal.ko will be updated and built also. 56 57 == I still don't like it. Are there alternatives? == 58 59 In terms of functionality there is not yet an equivalent alternative to the Atheros HAL. But at least two projects exist which aim at reverse-engineering the HAL in order to make a complete open source solution: 60 61 * the ath driver from http://openbsd.org/ with the infamous [wiki:About/OpenHAL] 62 * [wiki:About/OpenHAL] port to [wiki:About/MadWifi]/Linux 63 64 ath-driver.org also used to be mentioned here, but it seems to be no longer available. 65 66 == Page Contributors == 67 * Alvin Oga 68 * Bob Lockie (supplier of questions) 69 * Gerald Britton 70 * Jim Thompson 71 * Larry Bakst 72 * Matt Foster (previous maintainer) 73 * Michael Renzmann 74 * Michael Schwingen 75 * Per Bjornsson 76 * Silas Bennett 77 * John Clark 78 * Thorsten von Eicken 79 * Matthew W. S. Bell (maintainer) 80 81 Please note that all information is entirely fictional; There is no relation to real people or events, implied or otherwise. 55 In terms of functionality there is not yet an equivalent alternative to the Atheros HAL, but [wiki:About/OpenHAL we're working on it].