W1 linux kernel module
-
Synposis
Rather than talk to the 1-wire bus masters directly (e.g. over a serial port or USB port), we could use the linux kernel's "w1" abstration layer.
-
Advantages
-
Less need for external libraries (like libusb).
-
faster support for embedded GPIO masters (like the Freescale MX-27)
-
More efficient bit-banging support.
-
-
Disadvantages
-
Linux only (v2.6.29+)
-
Linux only
- Rather poor performance
- No independent control over multiple bus-masters
-
-
Status
- Evgeniy Polyakov, the kernel developer, has been kindly assisting with w1 support implementation. Design limitations have improved over time.
-
-
Background
w1 is a linux kernel system that takes several types of 1-wire bus masters, and supports a subset of the 1-wire protocol on them. It seems to have been initially designed to extend the hardware monitoring function (temperature monitoring) but has evolved to support a more general 1-wire functionality. Natively, temperature readings and some memory reading is supported. Polling of 1-wire devices and values is supported.
Without OWFS 1-wire support, there is a conflict in the interaction of w1 and OWFS. The w1 system grabs the bus-masters (specifically the USB-based DS9490) and doesn't allow OWFS access. The current work-arounds are to either- disable the ds9490.ko module. Probably by modifying udev rules (or hotplug in older kernels).
- Run as root so OWFS can unload the kernel mudule.
-
Design
- w1 grabs a list of bus masters and slaves and sends assynchronous messages as they appear in the system.
- All bus masters are grouped together. The order is not predictable and hardware details are not exposed.
- Slaves are grouped together and not assigned to particular bus masters.
- Communication from user-space (OWFS) to the kernel module is handled using netlink socket. In particular the connector subtype that gives a single channel for all moduile communication.
- OWFS uses a single thread to listen to the netlink socket, and then uses pipes internally to send the kernel messages to the relevant places in the program.
-
Status
- w1 (now called wire1) is functional for UISB but slow.
Previous page: OMAP
Next page: Embedded Data System's OW-SERVER-ENET