All about programming in GNU/LINUX

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
1)The Application
2)The Device file (usually created under /dev)
4)The Device Driver
4)The Hardware device and Low/level Device access

Image

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.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s