SlideShare une entreprise Scribd logo
1  sur  12
FILESYSTEM&
INPUTANDOUTPUT
Presented By
Mythili A
LINUX
FILE SYSTEM
INTRODUCTION
Linux file system is generally a built-in layer of a Linux operating system used to
handle the data management of the storage. Ithelps to arrangethe file on the disk
storage. It manages the file name, file size, creation date, and much more
information about a file.
The Linux file systemcontains the following sections:
1. The root directory (/)
2. A specific data storageformat(EXT3, EXT4, BTRFS, XFS and so on)
3. A partition or logical volume having a particular file system.
LINUXFILESYSTEMFEATURES
Specifying paths: Linux does not use the backslash () to separate the
components; it uses forward slash (/) as an alternative. For example, as in
Windows, the data may be stored in C: My DocumentsWork, whereas, in Linux,
it would be stored in /home/ My Document/ Work.
Partition, Directories, and Drives: Linux does not usedrive letters to organize
the drive as Windows does. In Linux, we cannot tell whether we are addressing a
partition, a network device, or an "ordinary" directory and a Drive.
Case Sensitivity: Linux file system is case sensitive. It distinguishes between
lowercaseand uppercasefile names. Such as,there is a differencebetween test.txt
and Test.txt in Linux. This rule is also applied for directories and Linux commands.
File Extensions: In Linux, a file may have the extension '.txt,' but it is not
necessary that a file should have a file extension. While working with Shell, it
creates some problems for the beginners to differentiate between files and
directories. If weuse the graphical file manager, it symbolizes thefiles and folders.
Hidden files: Linux distinguishes between standard files and hidden files, mostly
the configuration files are hidden in Linux OS. Usually, we don't need to access or
read the hidden files. The hidden files in Linux are represented by a dot (.) before
the file name (e.g., .ignore). To access the files, we need to change the view in the
file manager or need to usea specific command in the shell.
ROOT(/) DIRECTORY
The / in the instruction aboverefers to the rootdirectory. The rootdirectory is the
one fromwhich all other directories branch off from. When you run tree and tell it
to start with /, you will see the whole directory tree, all directories and all the
subdirectories in the whole system.
stay in your terminal window and run tree like this
tree -L 1 /
TYPESOFFILESYSTEM
Ext, Ext2, Ext3 and Ext4 file system
The file systemExt stands for Extended File System. Itwas primarily developed for
MINIXOS.TheExt file systemis an older version,and is no longer used dueto some
limitations.
Ext: an old one and no longer used due to limitations.
Ext2: the firstLinux file systemthat allows managing two terabytes of data.
Ext3: developed through Ext2; it is an upgraded version of Ext2 and contains
backward compatibility. The major drawback of Ext3 is that it does not support
servers becausethis file systemdoes not supportfile recovery and disk snapshot.
Ext4: file systemis the faster file systemamong all the Ext file systems. Itis a very
compatible option for the SSD (solid-state drive) disks, and it is the default file
systemin Linux distribution.
JFS File System
JFS stands for Journaled File System, and it is developed by IBM for AIX Unix. It is
an alternative to the Ext file system. It can also be used in place of Ext4, where
stability is needed with few resources. Itis a handy file systemwhen CPU power is
limited.
ReiserFS File System
ReiserFS is an alternative to the Ext3 file system. Ithas improved performanceand
advanced features. In the earlier time, the ReiserFS was used as the default file
system in SUSE Linux, but later it has changed some policies, so SUSE returned to
Ext3. This file system dynamically supports the file extension, but it has some
drawbacks in performance.
XFS File System
XFS file system was considered as high-speed JFS, which is developed for parallel
I/O processing. NASA still using this file system with its high storage server (300+
Terabyte server).
Btrfs File System
Btrfs stands for the B tree file system. Itis used for fault tolerance, repair system,
fun administration, extensive storageconfiguration, and more. Itis not a good suit
for the production system.
Swap File System
The swap file system is used for memory paging in Linux operating systemduring
the systemhibernation. A systemthat never goes in hibernate state is required to
have swap spaceequal to its RAM size.
INPUT AND OUTPUT
INTRODUCTION
To the user, the I/O systemin Linux looks much like that in any UNIX system. That
is, to the extent possible, all device drivers appear as normal files. A user can open
an access channelto a device in the sameway sheopens any other file-devices can
appear as objects within the file system.
The system administrator can create special files within a file systemthat contain
references to a specific device driver, and a user opening such a file will be able to
read from and write to the device referenced. By using the normal file-protection
system, which determines who can access which file, the administrator can set
access permissions for each device.
STRUCTURE
Linux splits all devices into three classes: block devices, character devices, and
network devices.
Fig 1. Device-Driver Block Structure
BLOCK DEVICE
Block devices provide the main interface to all disk devices in a system
or bloc devices allow random access, read only blocks of data and fixed
sized blocks of data.
Examples: Hard Disk, Floppy Disk, C D ROM and Flash Memory.
The work of request manager in block devices and separate list of
requests kept for each block device. The request is maintaining in sorted
order of increasing starting sector number when a request is accept for
processing by a block device driver, it’s not removed from the list. It is
removed after only the input output is complete.
In the block device there are two problems that may occurs
1. STARVATION:
- may be caused by error in a scheduling of work.
2. DEADLINES:
- for read request is 0.5 sec and for writing request is 5 sec.
Block device also maintains three queues
a) Sorted queue
b) Read queue
c) Write queue
CHARACTER DEVICES
All character devices deal with data one character at a time and process
them sequentially or serially only.
Examples: The Keyboard, Mouse or Touchpad and Printers, Etc.,
Any character- device drivers registered to the Linux kernel must also
register a set of functional that implement the file I/O operations that
the driver can handle.
The kernel performs almost no pre-processing of a file read or write
request to the device in question and lets the device deal with request.
(printers are character devices and after the kernel sends data to the
printer, the responsibility for that data passes to the printer the kernel
cannot backup and re-examine the data).
The exception to this rule is the special subset of character device drivers
that implement terminal devices.
The kernel maintains a standard interface to these drivers by means of a
set of tty_struct structures.
Each of these structures provide buffering and flow control on the data
stream from the terminal device and feeds those data to a line discipline.
A line discipline is an interpreter for the information from the terminal
device. the most common line discipline is the tty discipline.
tty discipline decides which process’s data should be attached or
detached from the terminal device.
NETWORKSTRUCTUREDEVICES
These are deal differently from block and character devices
Users cannot directly transfer data to network devices; instead, they
must communicate indirectly by opening a connection to the kernel’s
networking sub-system.
Networking in Linux kernel is implemented by three layers of drivers
1. The socket interfaces
2. Protocol drivers
3. Network device drivers
The Socket Interfaces
User applications perform all networking requests through the socket
interface. It looks like BSD socket layer, so that the program designed for
BSD socket can easily run-on Linux without any source code changes. BSD
socket is sufficient to represent network addresses for networking
protocols.
Protocol Devices
It is the second layer of software. When data arrives to this layer, it is
expected to have been tagged with an identifier specifying which
network protocol they contain.
Functions of protocol layer
a) Rewrite packets
b) Create new packets
c) Split or reassembling packets into fragments
d) Discard data
Network-device drivers
Communication between the layers of networking stack is performed by
passing single skbuff structures.
An skbuff is a set of pointers into a single continuous area of memory,
representing a buffer inside which network packets can be constructed.
The networking code either add or trim data from the end of packet.

Contenu connexe

Tendances

Inter process communication using Linux System Calls
Inter process communication using Linux System CallsInter process communication using Linux System Calls
Inter process communication using Linux System Calls
jyoti9vssut
 

Tendances (20)

Linux Initialization Process (1)
Linux Initialization Process (1)Linux Initialization Process (1)
Linux Initialization Process (1)
 
Signal Handling in Linux
Signal Handling in LinuxSignal Handling in Linux
Signal Handling in Linux
 
Linux Kernel - Virtual File System
Linux Kernel - Virtual File SystemLinux Kernel - Virtual File System
Linux Kernel - Virtual File System
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Linux Initialization Process (2)
Linux Initialization Process (2)Linux Initialization Process (2)
Linux Initialization Process (2)
 
Unix signals
Unix signalsUnix signals
Unix signals
 
Linux kernel
Linux kernelLinux kernel
Linux kernel
 
Linux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKBLinux Kernel Booting Process (1) - For NLKB
Linux Kernel Booting Process (1) - For NLKB
 
Linux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA'sLinux monitoring and Troubleshooting for DBA's
Linux monitoring and Troubleshooting for DBA's
 
Linux standard file system
Linux standard file systemLinux standard file system
Linux standard file system
 
Unix Operating System
Unix Operating SystemUnix Operating System
Unix Operating System
 
Inter process communication using Linux System Calls
Inter process communication using Linux System CallsInter process communication using Linux System Calls
Inter process communication using Linux System Calls
 
Embedded linux network device driver development
Embedded linux network device driver developmentEmbedded linux network device driver development
Embedded linux network device driver development
 
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
Kernel Recipes 2015: Linux Kernel IO subsystem - How it works and how can I s...
 
Introduction to Modern U-Boot
Introduction to Modern U-BootIntroduction to Modern U-Boot
Introduction to Modern U-Boot
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
Linux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver OverviewLinux Kernel MMC Storage driver Overview
Linux Kernel MMC Storage driver Overview
 
Linux file system
Linux file systemLinux file system
Linux file system
 
Ext filesystem4
Ext filesystem4Ext filesystem4
Ext filesystem4
 
System Booting Process overview
System Booting Process overviewSystem Booting Process overview
System Booting Process overview
 

Similaire à linux file sysytem& input and output

Distributed File System
Distributed File SystemDistributed File System
Distributed File System
Ntu
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
C.U
 
Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)
Rudhramoorthi Andiappan
 

Similaire à linux file sysytem& input and output (20)

Linux File System.docx
Linux File System.docxLinux File System.docx
Linux File System.docx
 
The Storage Systems
The Storage Systems The Storage Systems
The Storage Systems
 
Operating System
Operating SystemOperating System
Operating System
 
Os
OsOs
Os
 
Distributed File System
Distributed File SystemDistributed File System
Distributed File System
 
Root file system
Root file systemRoot file system
Root file system
 
File systemimplementationfinal
File systemimplementationfinalFile systemimplementationfinal
File systemimplementationfinal
 
OSCh12
OSCh12OSCh12
OSCh12
 
Ch12 OS
Ch12 OSCh12 OS
Ch12 OS
 
OS_Ch12
OS_Ch12OS_Ch12
OS_Ch12
 
I/O System and Case study
I/O System and Case studyI/O System and Case study
I/O System and Case study
 
Files and directories in Linux 6
Files and directories  in Linux 6Files and directories  in Linux 6
Files and directories in Linux 6
 
Linux file system
Linux file systemLinux file system
Linux file system
 
linuxfilesystem-180727181106 (1).pdf
linuxfilesystem-180727181106 (1).pdflinuxfilesystem-180727181106 (1).pdf
linuxfilesystem-180727181106 (1).pdf
 
Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)Do journaling filesystems guarantee against corruption after a power failure (1)
Do journaling filesystems guarantee against corruption after a power failure (1)
 
File system
File systemFile system
File system
 
File system
File systemFile system
File system
 
Unix1
Unix1Unix1
Unix1
 
Case study operating systems
Case study operating systemsCase study operating systems
Case study operating systems
 
Operating Systems - Implementing File Systems
Operating Systems - Implementing File SystemsOperating Systems - Implementing File Systems
Operating Systems - Implementing File Systems
 

Dernier

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 

Dernier (20)

%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
What Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the SituationWhat Goes Wrong with Language Definitions and How to Improve the Situation
What Goes Wrong with Language Definitions and How to Improve the Situation
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Artyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptxArtyushina_Guest lecture_YorkU CS May 2024.pptx
Artyushina_Guest lecture_YorkU CS May 2024.pptx
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 

linux file sysytem& input and output

  • 2. FILE SYSTEM INTRODUCTION Linux file system is generally a built-in layer of a Linux operating system used to handle the data management of the storage. Ithelps to arrangethe file on the disk storage. It manages the file name, file size, creation date, and much more information about a file. The Linux file systemcontains the following sections: 1. The root directory (/) 2. A specific data storageformat(EXT3, EXT4, BTRFS, XFS and so on) 3. A partition or logical volume having a particular file system. LINUXFILESYSTEMFEATURES Specifying paths: Linux does not use the backslash () to separate the components; it uses forward slash (/) as an alternative. For example, as in Windows, the data may be stored in C: My DocumentsWork, whereas, in Linux, it would be stored in /home/ My Document/ Work. Partition, Directories, and Drives: Linux does not usedrive letters to organize the drive as Windows does. In Linux, we cannot tell whether we are addressing a partition, a network device, or an "ordinary" directory and a Drive. Case Sensitivity: Linux file system is case sensitive. It distinguishes between lowercaseand uppercasefile names. Such as,there is a differencebetween test.txt and Test.txt in Linux. This rule is also applied for directories and Linux commands.
  • 3. File Extensions: In Linux, a file may have the extension '.txt,' but it is not necessary that a file should have a file extension. While working with Shell, it creates some problems for the beginners to differentiate between files and directories. If weuse the graphical file manager, it symbolizes thefiles and folders. Hidden files: Linux distinguishes between standard files and hidden files, mostly the configuration files are hidden in Linux OS. Usually, we don't need to access or read the hidden files. The hidden files in Linux are represented by a dot (.) before the file name (e.g., .ignore). To access the files, we need to change the view in the file manager or need to usea specific command in the shell. ROOT(/) DIRECTORY
  • 4. The / in the instruction aboverefers to the rootdirectory. The rootdirectory is the one fromwhich all other directories branch off from. When you run tree and tell it to start with /, you will see the whole directory tree, all directories and all the subdirectories in the whole system. stay in your terminal window and run tree like this tree -L 1 /
  • 5. TYPESOFFILESYSTEM Ext, Ext2, Ext3 and Ext4 file system The file systemExt stands for Extended File System. Itwas primarily developed for MINIXOS.TheExt file systemis an older version,and is no longer used dueto some limitations. Ext: an old one and no longer used due to limitations. Ext2: the firstLinux file systemthat allows managing two terabytes of data. Ext3: developed through Ext2; it is an upgraded version of Ext2 and contains backward compatibility. The major drawback of Ext3 is that it does not support servers becausethis file systemdoes not supportfile recovery and disk snapshot.
  • 6. Ext4: file systemis the faster file systemamong all the Ext file systems. Itis a very compatible option for the SSD (solid-state drive) disks, and it is the default file systemin Linux distribution. JFS File System JFS stands for Journaled File System, and it is developed by IBM for AIX Unix. It is an alternative to the Ext file system. It can also be used in place of Ext4, where stability is needed with few resources. Itis a handy file systemwhen CPU power is limited. ReiserFS File System ReiserFS is an alternative to the Ext3 file system. Ithas improved performanceand advanced features. In the earlier time, the ReiserFS was used as the default file system in SUSE Linux, but later it has changed some policies, so SUSE returned to Ext3. This file system dynamically supports the file extension, but it has some drawbacks in performance. XFS File System XFS file system was considered as high-speed JFS, which is developed for parallel I/O processing. NASA still using this file system with its high storage server (300+ Terabyte server). Btrfs File System Btrfs stands for the B tree file system. Itis used for fault tolerance, repair system, fun administration, extensive storageconfiguration, and more. Itis not a good suit for the production system.
  • 7. Swap File System The swap file system is used for memory paging in Linux operating systemduring the systemhibernation. A systemthat never goes in hibernate state is required to have swap spaceequal to its RAM size.
  • 8. INPUT AND OUTPUT INTRODUCTION To the user, the I/O systemin Linux looks much like that in any UNIX system. That is, to the extent possible, all device drivers appear as normal files. A user can open an access channelto a device in the sameway sheopens any other file-devices can appear as objects within the file system. The system administrator can create special files within a file systemthat contain references to a specific device driver, and a user opening such a file will be able to read from and write to the device referenced. By using the normal file-protection system, which determines who can access which file, the administrator can set access permissions for each device. STRUCTURE Linux splits all devices into three classes: block devices, character devices, and network devices. Fig 1. Device-Driver Block Structure
  • 9. BLOCK DEVICE Block devices provide the main interface to all disk devices in a system or bloc devices allow random access, read only blocks of data and fixed sized blocks of data. Examples: Hard Disk, Floppy Disk, C D ROM and Flash Memory. The work of request manager in block devices and separate list of requests kept for each block device. The request is maintaining in sorted order of increasing starting sector number when a request is accept for processing by a block device driver, it’s not removed from the list. It is removed after only the input output is complete. In the block device there are two problems that may occurs 1. STARVATION: - may be caused by error in a scheduling of work. 2. DEADLINES: - for read request is 0.5 sec and for writing request is 5 sec. Block device also maintains three queues a) Sorted queue b) Read queue c) Write queue
  • 10. CHARACTER DEVICES All character devices deal with data one character at a time and process them sequentially or serially only. Examples: The Keyboard, Mouse or Touchpad and Printers, Etc., Any character- device drivers registered to the Linux kernel must also register a set of functional that implement the file I/O operations that the driver can handle. The kernel performs almost no pre-processing of a file read or write request to the device in question and lets the device deal with request. (printers are character devices and after the kernel sends data to the printer, the responsibility for that data passes to the printer the kernel cannot backup and re-examine the data). The exception to this rule is the special subset of character device drivers that implement terminal devices. The kernel maintains a standard interface to these drivers by means of a set of tty_struct structures. Each of these structures provide buffering and flow control on the data stream from the terminal device and feeds those data to a line discipline. A line discipline is an interpreter for the information from the terminal device. the most common line discipline is the tty discipline.
  • 11. tty discipline decides which process’s data should be attached or detached from the terminal device. NETWORKSTRUCTUREDEVICES These are deal differently from block and character devices Users cannot directly transfer data to network devices; instead, they must communicate indirectly by opening a connection to the kernel’s networking sub-system. Networking in Linux kernel is implemented by three layers of drivers 1. The socket interfaces 2. Protocol drivers 3. Network device drivers The Socket Interfaces User applications perform all networking requests through the socket interface. It looks like BSD socket layer, so that the program designed for BSD socket can easily run-on Linux without any source code changes. BSD socket is sufficient to represent network addresses for networking protocols. Protocol Devices
  • 12. It is the second layer of software. When data arrives to this layer, it is expected to have been tagged with an identifier specifying which network protocol they contain. Functions of protocol layer a) Rewrite packets b) Create new packets c) Split or reassembling packets into fragments d) Discard data Network-device drivers Communication between the layers of networking stack is performed by passing single skbuff structures. An skbuff is a set of pointers into a single continuous area of memory, representing a buffer inside which network packets can be constructed. The networking code either add or trim data from the end of packet.