Sunday, November 6, 2011

Summary of Interaction With Hardware on C programming language

(a) Hardware interaction can happen in two ways: (1) When the user interacts with the hardware and the program reacts to it. (2) When the program interacts with the hardware without any user intervention.

(b) In DOS when the user interacts with the hardware an ISR gets called which interacts with the hardware. In Windows the same thing is done by the device driver’s ISR.

(c) In DOS when the program has to interact with the hardware it can do so by using library functions, DOS/BIOS routines or by directly interacting with the hardware. In Windows the same thing can be done by using API functions.

(d) Under Windows to gain finer control over the hardware we are required to write a device driver program.
 
(e) Interaction with the any device can be done using API functions like CreateFile( ), ReadFile( ), WriteFile( ) and CloseHandle( ).

(f) Different strings have to be passed to the CreateFile( ) functions for interacting with different devices.

(g)Windows provides a powerful mechanism called hooks that can alter the flow of messages before they reach the application.

(h) Windows hook procedures should be written in a DLL since they work on a system wide basis.

(i) Windows hooks can be put to many good uses

No comments:

Post a Comment