Linux device Drivers -3:The layers
The Driver is just the part of the flow or the linkage from an application to the low-level access .
This linkage involves four parts
2)The Device file (usually created under /dev)
4)The Device Driver
4)The Hardware device and Low/level Device access
A Device may not always have a physical existance ex:/dev/null , a Device could just have a logical existance.For such a logical device the fourth part of the flow ,i.e the Hardware Device and Low/level Device access doesnt exist.
An explicit connection has to be established between adjacent layers(the 4 parts) of the flow to have an complete Application which could access the underlying hardware and get the job done.That is an explicit connection has to estalished b/w
A)The Application and the Device Device
-This is achieved by reading or writing into the device file under /dev.The application program could execute system calls to connect these two layers .
B)The Device file and The Device Driver
-This is achieved by registrations done by the device driver for the Major and Minor number s of the device .The device driver uses kernel space API’s to achieve this.
C)The Device Driver and The Hardware Device
-The Driver uses low-level kernel space API’s to achieve this .
For a Device like /dev/null which just has a logical existance the part C(The link b/w the Driver and the hardware device) of the connection doesnt exist.