You are here:

C++/Help with driver programming



 I have to write an application that will monitor the hard disk and do some work when there is an activity on the hard disk (read or write). My problem is that I don't know how to listen the system bus, or how to "catch" the events for reading and writing on hard disk. I am using C and compile with DDK.
 Can you help me, or indicate someone else who may know the answer to this question?

Thank you very much!


You're getting into a part of programming that very very few programmers need to do - usually programmers working for a company doing very special tasks.  You won't easily find programmers who've done this kind of work.  And because what you want is directly coupled to the operating system, you'll have to find experts of the OS.  Another difficulty is that what you want to do may be available only internally to the developers of the OS or under license (for example from Microsoft).  You don't mention that this is for Windows.  Assuming it is, look to the Microsoft usenet (user groups) for information and hope someone can tell you if this information is available, and if so, where.  Since I don't know of a DDK for Linux, I don't think you mean Linux, but if you do, of course the source code is available and with some study, you might find you can hook the hard disk drivers at some level.

Sorry I can't really answer this - I've never had to do a device driver.  What you want is even more specific in that you want to access data coming in and out of the driver.  I think you have to find the source code for a hard disk to do what you want.  If you write one, it won't be signed by Microsoft and potentially because it's for a hard disk it won't be accepted during installation.



All Answers

Answers by Expert:

Ask Experts


Bill A


I can answer questions about C++, programming algorithms, Windows programming in MFC (which is C++). I cannot answer questions about STL (templates) and I have no experience with Linux. I do enjoy reviewing code and critiquing it or finding problems in it. I will also gladly show better algorithms or methods if you want to take advantage of that.


I've developed a commercial embedded C compiler/assembler and IDE with debugger toolset, of which the IDE and debugger are written in C++. I work in the industry writing high tech embedded programs and Windows programs to communicate with the embedded devices.

Book: Embedded Systems Design using the Rabbit 3000 Microprocessor Authored Chapter 10 in its entirety.

BS Computer Engineering

©2016 All rights reserved.