Monday, February 8, 2016

Introduction to Device Driver

******************Introduction to Device Driver*******************

          The need for writing device driver is to write some value to the parallel port device. This value would appear as an electrical signal (+5 volts) on one of the pins of the parallel port connector.

          Location within a device are known as device register. These location can be read or write to by software programs.

          Device registers help the software program to transfer data to/from the device (data register), obtain status of the device (status register) and to control the behavior of the device (control register).

          Each device register has unique address. This address is usually known as port address.

         The data register is located at the address 0x378. By writing values in that data register one can produce corresponding electrical signals on the pins.

        A bit value of 1 produces a  +5 V on the corresponding pin and a bit value 0 produces a +0 V.

        A device driver is a piece of software that enable a  particular hardware device to function or work properly.

       A Device Driver instruct the hardware device to perform different operations.

       All externally or internally connected device  requires a Device Driver program for its working.

       Why do we require a separate piece of software for controlling the operations of a hardware device?

       In multitasking operating system environment, hardware device are a shared resource between all the running programs/applications.

       Allowing hardware access from application program can result in conflict if multiple programs try to access the same device at the same time.

      Each hardware device internally operates in  different way than another. 

     New hardware devices continues to evolve at a rapid rate. 

     So it is not practically to modify, recompile and then redistribute the OS code time and again to accommodate the functionality of new hardware devices.   

     By keeping the code for controlling hardware devices in a separate module the OS remains independent of any particular hardware device.

     Device Driver code becomes extension to the Operating System.
    
     The Device Driver program is a separate piece of program which is part of Operating System.

    The Operating System becomes dynamically extends by the use of Device Drivers and thereby manages to run new hardware without a need for recompilation of Operating System.

     Since Device Driver is part of of Operating System. So it is highly trusted and can do any operations normally not allowed from application programs.

     Not every Device Driver program controls a hardware device. 
For Example, a File System Driver(FSD) never interacts with any physical hardware.

      A FSD is responsible for handling file I/O requests from user application, converting that request to a low-level form (i.e. Cylinder, Head, Sector request ) and passing it to another driver.

      This another driver actually interacts with the physical storage device (HDD).

      File System Drivers responsibility is only managing the logical organization of a disk.

      File System Driver is required for different types of file systems like FAT, NTFS, CDFS etc.
---------------------------------------------------------------------------------

No comments:

Post a Comment

SYBSc (CS) Sem III : Data Structure Slip 14 Que - 2

  SAVITIBAI PHULE UNIVERSITY OF PUNE S. Y. B.Sc. (Computer Science) Semester III Practical Examination       SUBJECT: CS-233 Practical cours...