Flag This Hub

What is a hardware device driver?

By


What do drivers do and how?

Whenever we buy a device to use with our computer it comes with a disk containing drivers but just what are they, and why are they so important?

When a computer is sold, it usually contains a suite of programs called the operating system, and the most common by far is Windows.  The operating system is the set of programs that are always running on the machine for as long as it is on, and between them they allow the user to access the resources, run other programs, access files and devices.

The computer typically contains some standard hardware including a screen, a keyboard, a mouse and a hard drive.   Now if the operating system was written to support only one set of such devices, we would be unable to change them or update them.  For that reason, the programs that communicate with hardware are of a special type called driver files.  These are all able to talk to the operating system but all communication with the device is channelled through the driver itself.

That has major advantages both for the operating system such as Windows.  For Microsoft, it means that the operating system can support any hardware providing the manufacturers supply the small program required by Windows to talk to it.  That is what is on the disk when you buy a device like a webcam or a printer.  It contains the driver file required by Windows.  If Microsoft releases details earlier enough, the manufacturers of hardware can get their own drivers preinstalled with Windows making their devices automatically supported out of the box.

The advantage for the hardware manufacturers is that providing they can supply the small program as required, every Windows machine can use their device, expanding their market and sales.

But in terms of stability, separating driver files out of the operating system is a step forward, since it no longer needs to know anything about the hardware.  The driver deals with the hardware specific details, and the operating system just treats all drivers the same.

So why are there driver problems?

Drivers are special programs that are handled in a different way from user applications.  User applications are run in their own separate memory space so that if one crashes, it need not bring down all of the others.  Drivers do not work like that.

Instead, drivers are loaded into a stack, one on top of the other.  Whenever the operating system needs to talk to a piece of hardware, it passes data into the stack of drivers and each one checks to see if the data is relevant.  A printer driver will look to see if the packet of data is destined for the printer and if it is, it will collect the packet and handle it.  If it is not for the printer, it will pass it onto the next driver in the stack.

For this reason, all drivers need to be written to an exacting standard: an error in the driver code can have major implications not just for the device, but for the running of the computer itself.  On previous versions of Windows, it was not at all unusual to see the Blue Screen of Death, BSOD.  This was a text screen with a blue background produced when Windows encountered a crippling error and had to stop.  It would display arcane numbers and letters on the screen indicating what it thought was the source of the error.  Software developers could interpret these Stop Codes, and work out what piece of software had caused the problem.  For the average user, it was mystifying.

Most of the BSOD problems on Windows were caused by drivers that for some reason had misbehaved.  The hardware manufacturers sometimes blamed Microsoft for changing the specification of their drivers, and Microsoft often blamed the hardware manufacturers for failing to observe the requirements.  The user was left with the blue screen.

When an operating system evolves over time, there are updates, security fixes, additional features added, new versions of the separate files released.  All these things subtly affect the way drivers operate.  An example is where Windows is updated to prevent rogue code running.  Virus and malware writers are constantly looking for loopholes to exploit and drivers are excellent targets.  Many rootkits are made to look like drivers in order to get access to operating system resources.

Since they are loaded into a privileged space in memory, which gets at operating system resources, a virus writer will try to exploit loopholes in driver design to get their own code running in that space.  As a consequence, Microsoft issues security updates designed to close such loopholes.  But that might affect those driver files already released.  That printer you have been using for years may now have an installed driver which contains the loophole, and Windows no longer allows it to operate.  You have a driver problem.

If you do get a BSOD, a Blue Screen of Death, make sure you note down the Stop Error.  This is a number of the form 0x00000000, for example 0xC0000005 which is an access violation error indicating that some code was trying to access prohibited memory, or 0x0000008E which is a more generic error code.  Look out for any reference to a file of the type .sys which might indicate the device. You can use this to Google for more information.  Be aware though that diagnosing from the Stop code usually requires the skills of a systems or software engineer and access to memory dumps and analytical tools.  The average user won't be able to use the information for more than a pointer to the device with the problem.

What to do about driver problems

Whenever a driver problem is suspected, the first source of help should be the manufacturer of the hardware.  That means going to their site, and downloading the latest version of the driver for your product.  You will need to check that it is compatible with the version of the operating system you have (for example, XP, Vista, Windows 7), and specifically relates to your model of the hardware product.  Usually these downloads come equipped with an installation program to free you from the task of hunting through bits of Windows to find the Device Manager and manually having to install the driver yourself.  But it is possible that you will have to do exactly that - Windows offers a lot of help but occasionally you end up doing the work manually.

Nevertheless, you will sometimes find that there is no up-to-date driver because the manufacturer no longer supports your hardware - that's why it was cheap in the first place, because it's the end of a line.  But you may still be able to use a driver from a closely related model, particularly if it is one of a range of printers.  You may also find sites that offer working generic drivers.  Unfortunately it is a question of try it and see.

You should also check to ensure you do not have a virus infection.  Rootkits disguised as drivers can destabilise the driver stack and cause what looks like driver problems.  You should also enter your hardware details into Google with the driver problem to see if others have already solved the problem.  Almost always, someone has seen the error before and you can save yourself hours by using their experience.

It is possible that the updated operating system simply no longer supports your device.  This happened with a lot of scanners when Windows Vista came out.   Eventually some drivers became available, but by then many customers had already had to buy replacements.  Microsoft sees this sort of problem as the responsibility of the hardware manufacturer and they will generally provide some support, but if the product is nearing the end of its shelf life, they may no longer provide drivers.  Most printer and screen manufacturers are very good at continuing support.

Driver problems are unfortunately a fact of life in an industry where hardware changes rapidly and operating systems are constantly updated.  It's the price we pay for the flexibility we expect of our PCs and laptops.

Comments

No comments yet.

Submit a Comment
Members and Guests

Sign in or sign up and post using a hubpages account.



    Like this Hub?
    Please wait working