---------------------------------------------------------- Permission is granted for below article to forward, reprint, distribute, use for ezine, newsletter, website, offer as free bonus or part of a product for sale as long as no changes are made and byline, copyright, and resource box below is included. ----------------------------------------------------------Device Driver Basics
By Stephen Bucaro
Most people understand that "hardware" part of their computer is real physical parts, like keyboard, mouse, modem, hard drive and so on. They understand that "software" is computer bits stored on hard drive, CD-ROM, or other storage media. But most people are a little hazy about exactly what a "driver" is.
In this article, I'm going to reveal in plain English what a driver is, why we need drivers, and exactly where drivers are hiding. To give you a basic understanding, I'm going to go back, way back, to early days of computers.
The Early Days
The year is 1981 and world is in midst of a severe resession. IBM's main frame business has slowed and company is losing money. Up until now they had been laughing at array of microcomputers on market: Atari, Commodore, sinclair. Toys really, mostly used to play computer games.
The problem was, these "toys" were selling like hot cakes. IBM had to get into that market and get into it fast. They didn't have time to design and build a computer complete enough to compete in market, so they built an "open system". They used commonly available electronic components and they published every design detail (including code), and they even provided plug in slots so that others could build components for their computer.
And people did provide components for IBM PC. They provided video cards, memory expansion cards, input-output port cards, game port cards, hard disk interface cards, and much more. How were all these various devices able to interface with PC's operating system? That's where a "driver" comes in.
A hardware device is constructed with various electronic components using various control signals, but software interface to operating system is standardized. A device's interface to operating system must follow interface specification. A driver is a piece of software that translates hardware's control signals to signals that operating system expects, and translates signals from operating system to hardware's control signals.
When computer is started up, it would look in "system" directory for files with extension ".drv" and load them into memory. Specific files like autoexec.bat, config.sys, and win.ini were used to inform operating system about drivers. Hardware would be configured through these files, or through jumpers located on device itself.
The driver specification evolved along with PC. Today when a PC starts, it executes program ntdetect.com which queries hardware components and builds registery key HKEY_LOCAL_MACHINEHARDWARESYSTEMCurrentControlSet. This key exists only in memory and is created each time computer boots. If all drivers are loaded successfully, a copy of key is saved as ControlSet00X.
Under registery key CurrentControlSet, subkey "Enum" contains a subkey for each harware device on computer. Each device key contains fields for Hardware ID, Driver ID, Device Parameters, and other configuration data. The 32-bit drivers are files with extension ".sys" and can be found in folder C:/winnt/system32.
Driver Signing
Microsoft has been brunt of much criticism because of poor reliability of Windows Operating System. I feel that much of this criticism is justified. On other hand, as I described in part 1 of this article, PC was designed by IBM as an "open" system. Anyone can sell a hardware device (or software) for PC. Should Microsoft be held responsible for quality from a third-party?