SlideShare une entreprise Scribd logo
1  sur  16
By: Sagar Janagonda
Linux Input & Output
Contents
Introduction
What is Device Driver?
Block Structure of Device Driver
Linux Device Driver Classes
References
Introduction
The Input & Output in Linux looks much like it does in any
Unix.
All device drivers appear as a normal files.
Devices can appear as objects in the file system.
System administrator can create special files within a file
system that contains references to a device driver.
Administrator can also set permissions for each device.
Device Driver
Also called as software driver.
Computer program allowing higher-level computer
programs to interact with a device.
Communicates with the device through the computer
bus or communications subsystem to which the
hardware is connected.
Linux device drivers can be built either as parts of the
kernel or separately as loadable modules.
Device Driver Applications
Because of the diversity of modern hardware many
ways exist in which drivers can be used.
• Printers
• Video adapters
• Network cards
• Sound cards
• Scanners and digital cameras etc.
Linux device-oriented file system accesses disk storage
through two caches:
Data is stored in the page cache, which is unified with
the virtual memory system.
Metadata is stored in the buffer cache, a separate cache
indexed by the physical disk block.
Linux splits all devices into three classes:
Block devices allow random access to completely
independent, fixed size blocks of data.
Character devices include most other devices; they don’t
need to support the functionality of regular files.
Network devices are interfaced via the kernel’s
networking subsystem.
Device-Driver Block Structure
SCSI : Small Computer System Interface
Is a set of standards for physically connecting and
transferring data between computers and peripheral
devices.
TTY
Is a Unix Command that prints to standard output the name
of the terminal connected to standard input. The name of
the program comes from teletypewriter.
Line discipline is a layer in the terminal subsystem.
It processes the data it receives from the hardware driver.
Block Devices
Provide the main interface to all disk devices in a system.
Used to store file systems.
The block buffer cache serves two main purposes:
it acts as a pool of buffers for active I/O
Collection of data
it serves as a cache for completed I/O
Fast memory holding copy of data
The request manager manages the reading and writing of
buffer contents to and from a block device driver
e.g. disk drives, CD.
Character Devices
A device driver which does not offer random access to
fixed blocks of data.
A character device driver must register a set of functions
which implement the driver’s various file I/O operations.
The kernel performs almost no preprocessing of a file read
or write request to a character device, but simply passes on
the request to the device.
The main exception to this rule is the special subset of
character device drivers which implement terminal devices,
for which the kernel maintains a standard interface.
e.g. keyboards, mouse, serial ports
Character driver usage is done through the corresponding
character device file.
Linked through the virtual file system (VFS).
Application does the usual file operations on the character
device file.
Operations are translated to the corresponding functions in
the linked character device driver.
Those functions then do the final low-level access to the
actual device to achieve the desired results.
Network Devices
Network transaction is made through an interface.
Device that is able to exchange data with other hosts.
Network interface is in charge of sending and
receiving data packets.
Network driver handles packets.
Communication between the kernel and a network
device driver is completely different from that used
with char and block drivers.
Instead of read and write, the kernel calls functions
related to packet transmission.
References
Operating Systems by STEVEN HAND
Operating Systems by ABRAHAM SILBERSCHATZ
http://linuxjournal.com/article/2890
Thank You…!

Contenu connexe

Tendances

Tendances (20)

Linux Directory Structure
Linux Directory StructureLinux Directory Structure
Linux Directory Structure
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Windows File Systems
Windows File SystemsWindows File Systems
Windows File Systems
 
Andrew File System
Andrew File SystemAndrew File System
Andrew File System
 
File system hiearchy
File system hiearchyFile system hiearchy
File system hiearchy
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Basic commands of linux
Basic commands of linuxBasic commands of linux
Basic commands of linux
 
File Protection in Operating System
File Protection in Operating SystemFile Protection in Operating System
File Protection in Operating System
 
RAID
RAIDRAID
RAID
 
Linux security
Linux securityLinux security
Linux security
 
Introduction to File System
Introduction to File SystemIntroduction to File System
Introduction to File System
 
Vi editor
Vi editorVi editor
Vi editor
 
A Quick Introduction to Linux
A Quick Introduction to LinuxA Quick Introduction to Linux
A Quick Introduction to Linux
 
raid technology
raid technologyraid technology
raid technology
 
Corba
CorbaCorba
Corba
 
Linux Operating System
Linux Operating SystemLinux Operating System
Linux Operating System
 
Operating Systems - memory management
Operating Systems - memory managementOperating Systems - memory management
Operating Systems - memory management
 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
 
Analysis modelling
Analysis modellingAnalysis modelling
Analysis modelling
 
SSD Seminar Report
SSD Seminar ReportSSD Seminar Report
SSD Seminar Report
 

En vedette (12)

Input output in linux
Input output in linuxInput output in linux
Input output in linux
 
Memory management in Linux
Memory management in LinuxMemory management in Linux
Memory management in Linux
 
Ui disk & terminal drivers
Ui disk & terminal driversUi disk & terminal drivers
Ui disk & terminal drivers
 
Chap2 hdd1
Chap2 hdd1Chap2 hdd1
Chap2 hdd1
 
Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)Linux/DB Tuning (DevSumi2010, Japanese)
Linux/DB Tuning (DevSumi2010, Japanese)
 
Os
OsOs
Os
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Input output systems ppt - cs2411
Input output systems ppt - cs2411Input output systems ppt - cs2411
Input output systems ppt - cs2411
 
Chapter 13 - I/O Systems
Chapter 13 - I/O SystemsChapter 13 - I/O Systems
Chapter 13 - I/O Systems
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Device Drivers
Device DriversDevice Drivers
Device Drivers
 
Linux File System
Linux File SystemLinux File System
Linux File System
 

Similaire à Linux io

Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Linux internal
Linux internalLinux internal
Linux internal
mcganesh
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
mcganesh
 
Solid-State diskA solid-state drive also known as a solid-state di.pdf
Solid-State diskA solid-state drive also known as a solid-state di.pdfSolid-State diskA solid-state drive also known as a solid-state di.pdf
Solid-State diskA solid-state drive also known as a solid-state di.pdf
saahinmanpam
 
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
definecareer
 
English Technical Glossary
English Technical GlossaryEnglish Technical Glossary
English Technical Glossary
ana maria
 
Technical language
Technical languageTechnical language
Technical language
ana maria
 

Similaire à Linux io (20)

Driver Programming Report
Driver Programming ReportDriver Programming Report
Driver Programming Report
 
Ch07 system administration
Ch07 system administration Ch07 system administration
Ch07 system administration
 
Linux Device Driver,LDD,
Linux Device Driver,LDD,Linux Device Driver,LDD,
Linux Device Driver,LDD,
 
linux device driver
linux device driverlinux device driver
linux device driver
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Linux internal
Linux internalLinux internal
Linux internal
 
Linux architecture
Linux architectureLinux architecture
Linux architecture
 
Device drivers and their applications
Device drivers and their applicationsDevice drivers and their applications
Device drivers and their applications
 
Linux fundamentals Training
Linux fundamentals TrainingLinux fundamentals Training
Linux fundamentals Training
 
linux kernel overview 2013
linux kernel overview 2013linux kernel overview 2013
linux kernel overview 2013
 
Solid-State diskA solid-state drive also known as a solid-state di.pdf
Solid-State diskA solid-state drive also known as a solid-state di.pdfSolid-State diskA solid-state drive also known as a solid-state di.pdf
Solid-State diskA solid-state drive also known as a solid-state di.pdf
 
Introduction to computer
Introduction to computerIntroduction to computer
Introduction to computer
 
Network operating systems
Network operating systemsNetwork operating systems
Network operating systems
 
Essential Knowledge of Computers.pptx
Essential Knowledge of Computers.pptxEssential Knowledge of Computers.pptx
Essential Knowledge of Computers.pptx
 
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
 
Ch02
Ch02Ch02
Ch02
 
DICTIONARY
DICTIONARYDICTIONARY
DICTIONARY
 
Device drivers tsp
Device drivers tspDevice drivers tsp
Device drivers tsp
 
English Technical Glossary
English Technical GlossaryEnglish Technical Glossary
English Technical Glossary
 
Technical language
Technical languageTechnical language
Technical language
 

Dernier

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Linux io

  • 1. By: Sagar Janagonda Linux Input & Output
  • 2. Contents Introduction What is Device Driver? Block Structure of Device Driver Linux Device Driver Classes References
  • 3. Introduction The Input & Output in Linux looks much like it does in any Unix. All device drivers appear as a normal files. Devices can appear as objects in the file system. System administrator can create special files within a file system that contains references to a device driver. Administrator can also set permissions for each device.
  • 4. Device Driver Also called as software driver. Computer program allowing higher-level computer programs to interact with a device. Communicates with the device through the computer bus or communications subsystem to which the hardware is connected. Linux device drivers can be built either as parts of the kernel or separately as loadable modules.
  • 5. Device Driver Applications Because of the diversity of modern hardware many ways exist in which drivers can be used. • Printers • Video adapters • Network cards • Sound cards • Scanners and digital cameras etc.
  • 6. Linux device-oriented file system accesses disk storage through two caches: Data is stored in the page cache, which is unified with the virtual memory system. Metadata is stored in the buffer cache, a separate cache indexed by the physical disk block.
  • 7. Linux splits all devices into three classes: Block devices allow random access to completely independent, fixed size blocks of data. Character devices include most other devices; they don’t need to support the functionality of regular files. Network devices are interfaced via the kernel’s networking subsystem.
  • 9. SCSI : Small Computer System Interface Is a set of standards for physically connecting and transferring data between computers and peripheral devices. TTY Is a Unix Command that prints to standard output the name of the terminal connected to standard input. The name of the program comes from teletypewriter. Line discipline is a layer in the terminal subsystem. It processes the data it receives from the hardware driver.
  • 10. Block Devices Provide the main interface to all disk devices in a system. Used to store file systems. The block buffer cache serves two main purposes: it acts as a pool of buffers for active I/O Collection of data it serves as a cache for completed I/O Fast memory holding copy of data The request manager manages the reading and writing of buffer contents to and from a block device driver e.g. disk drives, CD.
  • 11. Character Devices A device driver which does not offer random access to fixed blocks of data. A character device driver must register a set of functions which implement the driver’s various file I/O operations. The kernel performs almost no preprocessing of a file read or write request to a character device, but simply passes on the request to the device. The main exception to this rule is the special subset of character device drivers which implement terminal devices, for which the kernel maintains a standard interface. e.g. keyboards, mouse, serial ports
  • 12.
  • 13. Character driver usage is done through the corresponding character device file. Linked through the virtual file system (VFS). Application does the usual file operations on the character device file. Operations are translated to the corresponding functions in the linked character device driver. Those functions then do the final low-level access to the actual device to achieve the desired results.
  • 14. Network Devices Network transaction is made through an interface. Device that is able to exchange data with other hosts. Network interface is in charge of sending and receiving data packets. Network driver handles packets. Communication between the kernel and a network device driver is completely different from that used with char and block drivers. Instead of read and write, the kernel calls functions related to packet transmission.
  • 15. References Operating Systems by STEVEN HAND Operating Systems by ABRAHAM SILBERSCHATZ http://linuxjournal.com/article/2890