SlideShare a Scribd company logo
DEVICE DRIVERS
www.vjece.blogspot.in
Embedded Daemons
VIJAY SELVA.G
Embedded Daemons
www.vjece.blogspot.in
LINUX DEVICE DRIVERS
• LDD are Essentially, a shared library of
privileged, Memory resident, low level
hardware handling routines
• LDD handle the peculiarities of the devices
they are managing
• In Short, Software that handles the all Physical
Device Hardware Controller’s is called Device
Driver.
Embedded Daemons
www.vjece.blogspot.in
What it is actually?
• Hiding Peculiarities of the systems hardware
devices from the Users is one of purpose of OS
– For Example : VFS (Virtual File System)
• Presents Uniform view of the mounted file system
irrespective of the underlying physical device
• Every physical device has its own hardware
Controller
– Keyboard, Mouse, serial ports  Super IO chips
– IDE Disks  IDE Controller
– SCSI Disks  SCSI Controller
Embedded Daemons
www.vjece.blogspot.in
CSR - Actions
• Each hardware controller has its own control &
status Registers
• The CSRs are used to start and stop the device, to
initialize it and to diagnose any problems with it.
Instead of putting code to manage the hardware
controllers in the system into every application,
the code is kept in the Linux kernel.
• The software that handles or manages a
hardware controller is known as a device driver
Embedded Daemons
www.vjece.blogspot.in
LDD Structure
Layer by Layer Structure Entire Flow of Application
Embedded Daemons
www.vjece.blogspot.in
Device Special Files
• All hardware devices look like regular files; they can be
opened, closed, read and written using the same,
standard, system calls that are used to manipulate files.
• Every device in the system is represented by a device
special file, for example the first IDE disk in the system
is represented by /dev/hda . For block (disk) and
character devices, these device special files are created
by the mknod command and they describe the device
using major and minor device numbers. Network
devices are also represented by device special files but
they are created by Linux as it finds and initializes the
network controllers in the system
Embedded Daemons
www.vjece.blogspot.in
Major & Minor Device Number
• Major Device Number
– All devices controlled by the same device driver have a
common major device number.
• Major Device Number
– Distinguishes between different devices and their
controllers,
• For example each partition on the primary IDE disk has a different
minor device number. So, /dev/hda2, the second partition of the
primary IDE disk has a major number of 3 and a minor number of
2.
• Linux maps the device special file passed in system calls (say to
mount a file system on a block device) to the device's device driver
using the major device number and a number of system tables, for
example the character device table, chrdevs .
Embedded Daemons
www.vjece.blogspot.in

More Related Content

What's hot

Kernel module programming
Kernel module programmingKernel module programming
Kernel module programmingVandana Salve
 
Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu Ahmed El-Arabawy
 
Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems Ahmed El-Arabawy
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingTushar B Kute
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and CompilationBud Siddhisena
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module ProgrammingSaurabh Bangad
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingStephan Cadene
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/CoreShay Cohen
 
Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land Ahmed El-Arabawy
 
Embedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandEmbedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandAhmed El-Arabawy
 
Linux internal
Linux internalLinux internal
Linux internalmcganesh
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running ModulesYourHelper1
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteTushar B Kute
 
Embedded Systems: Lecture 7: Lab 1: Preparing the Raspberry Pi
Embedded Systems: Lecture 7: Lab 1: Preparing the Raspberry PiEmbedded Systems: Lecture 7: Lab 1: Preparing the Raspberry Pi
Embedded Systems: Lecture 7: Lab 1: Preparing the Raspberry PiAhmed El-Arabawy
 
Introduction to Linux Kernel
Introduction to Linux KernelIntroduction to Linux Kernel
Introduction to Linux KernelStryker King
 
linux device driver
linux device driverlinux device driver
linux device driverRahul Batra
 

What's hot (20)

Kernel module programming
Kernel module programmingKernel module programming
Kernel module programming
 
Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu Course 101: Lecture 6: Installing Ubuntu
Course 101: Lecture 6: Installing Ubuntu
 
Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems Course 101: Lecture 2: Introduction to Operating Systems
Course 101: Lecture 2: Introduction to Operating Systems
 
Kernel modules
Kernel modulesKernel modules
Kernel modules
 
Part 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module ProgrammingPart 02 Linux Kernel Module Programming
Part 02 Linux Kernel Module Programming
 
Linux Device Driver’s
Linux Device Driver’sLinux Device Driver’s
Linux Device Driver’s
 
Kernel Configuration and Compilation
Kernel Configuration and CompilationKernel Configuration and Compilation
Kernel Configuration and Compilation
 
Kernel Module Programming
Kernel Module ProgrammingKernel Module Programming
Kernel Module Programming
 
Linux Kernel and Driver Development Training
Linux Kernel and Driver Development TrainingLinux Kernel and Driver Development Training
Linux Kernel and Driver Development Training
 
Basic Linux kernel
Basic Linux kernelBasic Linux kernel
Basic Linux kernel
 
LINUX Device Drivers
LINUX Device DriversLINUX Device Drivers
LINUX Device Drivers
 
Linux Internals - Kernel/Core
Linux Internals - Kernel/CoreLinux Internals - Kernel/Core
Linux Internals - Kernel/Core
 
Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land Course 101: Lecture 4: A Tour in RTOS Land
Course 101: Lecture 4: A Tour in RTOS Land
 
Embedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS LandEmbedded Systems: Lecture 5: A Tour in RTOS Land
Embedded Systems: Lecture 5: A Tour in RTOS Land
 
Linux internal
Linux internalLinux internal
Linux internal
 
Device Drivers and Running Modules
Device Drivers and Running ModulesDevice Drivers and Running Modules
Device Drivers and Running Modules
 
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B KuteUnit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
Unit 6 Operating System TEIT Savitribai Phule Pune University by Tushar B Kute
 
Embedded Systems: Lecture 7: Lab 1: Preparing the Raspberry Pi
Embedded Systems: Lecture 7: Lab 1: Preparing the Raspberry PiEmbedded Systems: Lecture 7: Lab 1: Preparing the Raspberry Pi
Embedded Systems: Lecture 7: Lab 1: Preparing the Raspberry Pi
 
Introduction to Linux Kernel
Introduction to Linux KernelIntroduction to Linux Kernel
Introduction to Linux Kernel
 
linux device driver
linux device driverlinux device driver
linux device driver
 

Viewers also liked

Linux kernel code
Linux kernel codeLinux kernel code
Linux kernel codeGanesh Naik
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StorySage Sharp
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiRaspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiMohamed Abdallah
 
Linux Kernel Introduction
Linux Kernel IntroductionLinux Kernel Introduction
Linux Kernel IntroductionSage Sharp
 
Performance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual MachinesPerformance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual MachinesSoheila Dehghanzadeh
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOKris Findlay
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linuxChih-Min Chao
 
Containers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesContainers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesShreyas MM
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwaredefinecareer
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016Chris Simmonds
 
Advanced Git
Advanced GitAdvanced Git
Advanced Gitsegv
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driverVandana Salve
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things InternalsOpersys inc.
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System CallsVandana Salve
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry PiLentin Joseph
 

Viewers also liked (18)

Linux kernel code
Linux kernel codeLinux kernel code
Linux kernel code
 
Breaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success StoryBreaking into Open Source and Linux: A USB 3.0 Success Story
Breaking into Open Source and Linux: A USB 3.0 Success Story
 
Raspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry PiRaspberry Pi - Lecture 6 Working on Raspberry Pi
Raspberry Pi - Lecture 6 Working on Raspberry Pi
 
Linux Kernel Introduction
Linux Kernel IntroductionLinux Kernel Introduction
Linux Kernel Introduction
 
Containers in the Cloud
Containers in the CloudContainers in the Cloud
Containers in the Cloud
 
Performance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual MachinesPerformance comparison between Linux Containers and Virtual Machines
Performance comparison between Linux Containers and Virtual Machines
 
Introduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIOIntroduction to Raspberry Pi and GPIO
Introduction to Raspberry Pi and GPIO
 
Device tree support on arm linux
Device tree support on arm linuxDevice tree support on arm linux
Device tree support on arm linux
 
Containers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to KubernetesContainers and Cloud: From LXC to Docker to Kubernetes
Containers and Cloud: From LXC to Docker to Kubernetes
 
Introduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmwareIntroduction to embedded linux device driver and firmware
Introduction to embedded linux device driver and firmware
 
Userspace drivers-2016
Userspace drivers-2016Userspace drivers-2016
Userspace drivers-2016
 
Advanced Git
Advanced GitAdvanced Git
Advanced Git
 
Introduction to char device driver
Introduction to char device driverIntroduction to char device driver
Introduction to char device driver
 
Android Things Internals
Android Things InternalsAndroid Things Internals
Android Things Internals
 
Introduction to System Calls
Introduction to System CallsIntroduction to System Calls
Introduction to System Calls
 
Exploring Raspberry Pi
Exploring Raspberry PiExploring Raspberry Pi
Exploring Raspberry Pi
 
Linux device drivers
Linux device drivers Linux device drivers
Linux device drivers
 
Kernel Programming
Kernel ProgrammingKernel Programming
Kernel Programming
 

Similar to Device drivers Introduction

Similar to Device drivers Introduction (20)

Ch07
Ch07Ch07
Ch07
 
Linux Device Driver,LDD,
Linux Device Driver,LDD,Linux Device Driver,LDD,
Linux Device Driver,LDD,
 
Ms dos
Ms dosMs dos
Ms dos
 
Introduction to Operating Systems.pptx
Introduction to Operating Systems.pptxIntroduction to Operating Systems.pptx
Introduction to Operating Systems.pptx
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Parts of a Computer ppt
Parts of a Computer pptParts of a Computer ppt
Parts of a Computer ppt
 
Distributive operating system
Distributive operating systemDistributive operating system
Distributive operating system
 
System software
System softwareSystem software
System software
 
Day 2 hardware & software
Day 2 hardware & softwareDay 2 hardware & software
Day 2 hardware & software
 
Linux io
Linux ioLinux io
Linux io
 
Device drivers by prabu m
Device drivers by prabu mDevice drivers by prabu m
Device drivers by prabu m
 
Ch07 system administration
Ch07 system administration Ch07 system administration
Ch07 system administration
 
computer software in Computer Fundamentals
computer software in Computer Fundamentalscomputer software in Computer Fundamentals
computer software in Computer Fundamentals
 
K04 software
K04 softwareK04 software
K04 software
 
Device drivers tsp
Device drivers tspDevice drivers tsp
Device drivers tsp
 
Computer software
Computer softwareComputer software
Computer software
 
Windows ce
Windows ceWindows ce
Windows ce
 
Notes for LX0-101 Linux
Notes for LX0-101 Linux Notes for LX0-101 Linux
Notes for LX0-101 Linux
 
Linux fundamentals Training
Linux fundamentals TrainingLinux fundamentals Training
Linux fundamentals Training
 
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENTDEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
DEVICE FILE AND INPUT OUTPUT SUBSYSTEMS MANAGEMENT
 

Recently uploaded

一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理eemet
 
Memory compiler tutorial – TSMC 40nm technology
Memory compiler tutorial – TSMC 40nm technologyMemory compiler tutorial – TSMC 40nm technology
Memory compiler tutorial – TSMC 40nm technologyAhmed Abdelazeem
 
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...Amil baba
 
F5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxF5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxArjunJain44
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理kywwoyk
 
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理kywwoyk
 

Recently uploaded (6)

一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
 
Memory compiler tutorial – TSMC 40nm technology
Memory compiler tutorial – TSMC 40nm technologyMemory compiler tutorial – TSMC 40nm technology
Memory compiler tutorial – TSMC 40nm technology
 
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
NO1 Uk Amil Baba In Lahore Kala Jadu In Lahore Best Amil In Lahore Amil In La...
 
F5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptxF5 LTM TROUBLESHOOTING Guide latest.pptx
F5 LTM TROUBLESHOOTING Guide latest.pptx
 
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
一比一原版SDSU毕业证圣地亚哥州立大学毕业证成绩单如何办理
 
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
一比一原版UVM毕业证佛蒙特大学毕业证成绩单如何办理
 

Device drivers Introduction

  • 1. DEVICE DRIVERS www.vjece.blogspot.in Embedded Daemons VIJAY SELVA.G Embedded Daemons www.vjece.blogspot.in
  • 2. LINUX DEVICE DRIVERS • LDD are Essentially, a shared library of privileged, Memory resident, low level hardware handling routines • LDD handle the peculiarities of the devices they are managing • In Short, Software that handles the all Physical Device Hardware Controller’s is called Device Driver. Embedded Daemons www.vjece.blogspot.in
  • 3. What it is actually? • Hiding Peculiarities of the systems hardware devices from the Users is one of purpose of OS – For Example : VFS (Virtual File System) • Presents Uniform view of the mounted file system irrespective of the underlying physical device • Every physical device has its own hardware Controller – Keyboard, Mouse, serial ports  Super IO chips – IDE Disks  IDE Controller – SCSI Disks  SCSI Controller Embedded Daemons www.vjece.blogspot.in
  • 4. CSR - Actions • Each hardware controller has its own control & status Registers • The CSRs are used to start and stop the device, to initialize it and to diagnose any problems with it. Instead of putting code to manage the hardware controllers in the system into every application, the code is kept in the Linux kernel. • The software that handles or manages a hardware controller is known as a device driver Embedded Daemons www.vjece.blogspot.in
  • 5. LDD Structure Layer by Layer Structure Entire Flow of Application Embedded Daemons www.vjece.blogspot.in
  • 6. Device Special Files • All hardware devices look like regular files; they can be opened, closed, read and written using the same, standard, system calls that are used to manipulate files. • Every device in the system is represented by a device special file, for example the first IDE disk in the system is represented by /dev/hda . For block (disk) and character devices, these device special files are created by the mknod command and they describe the device using major and minor device numbers. Network devices are also represented by device special files but they are created by Linux as it finds and initializes the network controllers in the system Embedded Daemons www.vjece.blogspot.in
  • 7. Major & Minor Device Number • Major Device Number – All devices controlled by the same device driver have a common major device number. • Major Device Number – Distinguishes between different devices and their controllers, • For example each partition on the primary IDE disk has a different minor device number. So, /dev/hda2, the second partition of the primary IDE disk has a major number of 3 and a minor number of 2. • Linux maps the device special file passed in system calls (say to mount a file system on a block device) to the device's device driver using the major device number and a number of system tables, for example the character device table, chrdevs . Embedded Daemons www.vjece.blogspot.in