Best Practices

April 30, 2009

Using DMA for the Block Itself

While reviewing the notes for another chapter of my book, I came across the following concept that I had written down about five years ago but had forgotten; DMAs are commonly used to transfer data into and out of a block, but what about using the DMA to read and […]
May 30, 2009

Programmers’ Wishlists for Hardware Engineers

While traipsing through the internet, I came across an article at Windows Hardware Developer Central titled, If every hardware engineer just understood that… In it, four Windows programmers discuss various ways hardware engineers could make software development and debugging easier. Here are the highlights: Steve Dispensa: Windows is not a […]
June 30, 2009

Product-Specific Details

It is well-understood that reusing the same code across multiple products is ideal. However, how can it be done when each product has different features, constants, and chips? Here are a few techniques I used to have one device driver support several HP LaserJet printers with different features, capabilities, and […]
July 31, 2009

More on Product-Specific Details

In the comments to last month’s article, there were some agreeing with me and some not. In further discussions with most of them, they said that 5 to 20% of their code is product-specific. Size was a factor – the larger the code base, the more they split product-specific code […]
September 30, 2009

The One and Only True Method – Really?

Over 20 years ago while working on my master’s degree in electrical engineering, I took a computer science class that required a term software project. At the time I had a Hewlett-Packard 9816 computer that ran HP’s Rocky Mountain Basic (RMB). This version of Basic was very powerful for its […]
October 31, 2009

Hardware and Firmware Ambassadors

As I look back over my years of attending project meetings, I remember that on many occasions there was someone attending our meetings who was not part of our team, but was there as a representative of some other team we had to work with. More specifically, in our printer […]
November 30, 2009

The Dangers of Read-Modify-Write

In registers containing several read/write configuration bits, a device driver often needs to change one bit without changing the others. One technique is for the device driver to keep a shadow copy of that register in its own data structures. The device driver modifies the desired bit in its copy, […]
December 31, 2009

Limited CPU Support for Read-Modify-Write Operations

In last month’s article, I discussed the dangers of read-modify-write operations when multiple device drivers access the same hardware registers, since basic firmware read-modify-write operations are not atomic. I also discussed how firmware techniques such as shadow copies and mutexes can be used to provide atomic read-modify-write operations, but only […]
January 30, 2010

Register Design Eliminates Read-Modify-Write Issues

In the last two articles (here and here,) I discussed the dangers of read-modify-write operations on registers that create exposure to collision and corruptions by firmware. I discussed certain firmware and CPU techniques that can reduce these dangers, but not completely eliminate them. As promised, this month I will discuss […]
February 27, 2010

Testing Device Drivers

I recently asked the owner of a device driver what type of information about the hardware settings does the device driver return to the application after each job. I was asking about one particular piece of information, a setting that the application tells the device driver to configure in the […]