Alan Cox Archive

Alan Cox is a well-known Linux hacker. He is currently working on the development of drivers, security auditing, Linux/SGI porting, and modular sound. He can be reached at alan@lxorguk.ukuu.org.uk.
The Internals of Linux 2.2′s PCI Interface
Peripheral Component Interconnect (PCI) is a widely used bus standard that provides several advantages over other bus standards, such as EISA. Standard on most Pentium motherboards, PCI is a fast, wide (32-bit and 64-bit), and processor-independent bus. When PCI support was first added to Linux, the kernel interface was a wrapper to the PCI BIOS32 functions. There were several problems with this approach:
More on Writing Device Drivers for Video Capture Devices
Last month I began to develop a very simple camera driver as an illustration of Linux's video-capture interface. What we need to do now is to provide the functions to control the use of the device and to query its facilities. As with the radio driver, the major control interface is via the ioctl() function (Listing One). Video-capture devices support the same tuner calls as radio devices, and also support additional calls to control how the video functions are handled. In this simple example the card has no tuners, to avoid making the code complex.
Writing a Device Driver for Video-Capture Devices
Last month I talked about how to write a device driver for radio-tuner cards. This month, I'll cover video-capture devices, which share the same interfaces as radio devices.
Writing Radio Card Drivers for Linux
Video4Linux is the Linux 2.2 interface to TV- and radio- related cards. Prior kernels had a jumble of incompatible add-on modules. This made it very hard to write a general-purpose video application for Linux. A wide variety of radio interfaces are available for PCs, and these are generally very simple to program. Usually, the biggest problem with supporting such devices is extracting documentation from the vendor.
More on Mouse Drivers
Last month I walked through the steps of writing a serviceable mouse driver that contained a couple of bugs and that would not work with asynchronous I/O. In this month's column I'll smooth things out a bit. But first, I think we should take a look at some bugs.
Writing Linux Mouse Drivers
Mice are conceptually one of the simplest device drivers in the Linux operating system. Not all mice are handled by the kernel; rather, there is a two-layer abstraction. The kernel provides services for mice that cannot be driven directly by the user libraries and applications. That is, mice other than serial mice. On top of this library and application, programs (selection or gpm) provide a single common interface to all mice whether supported directly by the kernel or via a serial line.
Advanced SCSI Drivers and Other Tales
In last month's article, we looked at writing a basic Linux SCSI driver -- one that basically sucked. Actually, this driver was worse than planned because it contained a bug which anyone running on an SMP box would have found pretty quickly.
An Introduction to SCSI Drivers
This month, I'm going to talk about writing a driver for a simple SCSI controller under Linux. The Linux kernel SCSI layer does most of the work for SCSI device handling, so a simple SCSI driver is relatively painless to write. For more advanced devices, however, the kernel's SCSI code is actually too clever -- there are plans afoot to streamline it and solve these problems.
Porting Device Drivers to Linux 2.2: Part II
If you followed last issue's "Gearheads" column, all of your block and character devices should be running under Linux 2.2, albeit possibly with warnings about obsolete PCI interfaces. In this article, I will finish up with some of the smaller changes that may catch a driver author, cover networking, and then look at the new PCI layer.
Porting Linux 2.0 Drivers to Linux 2.2
The desire for more speed and better multi-processor support has caused inevitable changes in Linux, resulting in the development of the current kernel -- Linux 2.2. As a driver author, you may initially avoid taking advantage of the latest kernel changes. Ultimately, however, you'll probably end up re-writing your driver to stay current with kernel design, to improve your driver's performance, and to take advantage of the ever-increasing opportunities that appear on the horizon for Linux users in 1999.