LINUX EXTENDED FILE SYSTEM

Historical development of the Extended File System

MLinux the first version based on the Minix file system.
After Linux has an advanced, Extended File System (Ext FS) was introduced. There are Some significant changes but still less than satisfactory performance. In 1994 the Second Extended Filesystem (Ext2) is introduced. Trust In Addition there are new features, Ext2 highly efficient, reliable and flexible so That the file system is the most widely Used Linux.

Linux Second Extended File System (Ext2FS)

For most users, and the common system administration tasks, files and directories Easier to Be Accepted as a tree structure. However computers Can not see it as a tree structure.
Each partition has its own file.
By imagining the Same file system, We Can form an idea about the tree structure of all systems, but not that simple. In a system file, the file represented by inode, a kind of a unique serial number Which contains information on the actual data That make up a file: the file belongs to Whom, and Nowhere The files are located on the hard disk.
Each partition has its own set of inodes, That on systems have many partitions, there Could be the Same Trust files with inode numbers.
Each inode describes a data structure on disk, save the properties of files, including the physical location of data files.
When the hard drive be prepared to accept data storage, usually During the initial system installation process or Pls adding extra disks to the existing system, a number of inodes per partition must be created. This amount will of some of the maximum number of files, of Various types (including directories, special files, links, etc. ..) Which Can Appear At The Same Time on a partition. In general 'there is one inode per 2 to 8 KB.
Mechanism of the Second Extended File System (Ext2FS)

Ext2fs using a mechanism similar to the BSD Fast File System (ffs) in allocating blocks of data from files, Which distinguishes are:
• In ffs, files are allocated to the disk in blocks of 8kB, and the blocks Were divided into fragments 1KB for storing small files or blocks are partially filled at the end of the file.
• ext2fs does not use fragment, the allocation in units Smaller.
The default block size is 1KB in ext2fs, although Also it supports the allocation of 2KB and 4KB.
• allocation on ext2fs is Designed to place the blocks in a logical point of view of the file to physical blocks on the disk, Thus the I / O requests for blocks on the disk Trust secagai single operation.

Second Extended File System Reliability Ext2FS

• The system administrator cans choose the optimal block size (from 1024 up to 4096 bytes), depending on the length of the average file, Pls help creating the file system.
• Administrators Can choose a lot of inodes in Each partition Pls help creating the file system.
• Strategies to minimize the security update from system crashes.
• Supports automatic consistency checking Pls booting.
• Support for immutable files (Files That Can not be modified) and append-only (a file contents Whose Can only be added at the end of the file).


Stored information in the inode
• Device Nowhere is the inode
• Fashion File
• Locking information
• The owner and group owner of the file.
• File type (regular, directory, etc.).
• The permissions on the file.
• Time-making, reading, and recent changes.
• Time change information in the inode.
• Number of links pointing to this file.
• The size of the file.
• The address indicates the actual location of data files.
One - That Is the only information not stored in the inode is the file name and directory.This information is stored in a special directory files.
By Comparing the file name and inode number, the system builds a tree structure cans That Can be understood by users.Users cans see the inode numbers using the-i option on the ls command. Each inode has a separate memory space on the disk.

[+/-] Read More...

Devices MANAGEMENT INPUT / OUTPUT


1. Classification of I / O devices
I / O devices Can be grouped by:
a. The nature of the data stream, Which consists of:
a.1 block-oriented devices.
That store, receive and send information as blocks
fixed-sized measuring 128 to 1024 bytes and has the address
separate, allowing the read or write blocks are
independent, Is Able to read or write arbitrary blocks without
past the other blocs. Example: disk, tape, CD ROM, optical disk.
A.2 flow character-oriented devices.
That is devices receive and send streams of characters without
form a block structure. Example: a terminal, line printer, paper tape,
perforated cards, network interface, mouse.
b. Communication Objectives, Which consists of:.
b.1 device readable by Humans.
Device Used to Communicate with Humans.
Example: VDT (video display terminal): monitor, keyboard, mouse.
b.2 device readable by a machine.
Device Used to Communicate with devices
electronics.
Example: Disk and tape, sensors, controllers.
B.3 communication devices.
Device Used for communication with remote devices.
Example: Modem.
Between Factors That differentiate devices:
The speed of data transmission   • (data rate).
  • Type of applications used.
level of complexity   • in controls.
The amount   Units • transferred.
  • The representation or embodiment of the data.
error conditions.   •
2. Programming technique of I / O devices
There are three techniques, namely:
a. I / O programmed or poll system.
When the device I / O to handle the request, the device sets the status bits in
device status register. The device does not notify the processors, the task Pls
That has been done so always check the processor registers Should
periodically and perform actions based on the read status.
Device driver software (driver) dipemroses need to transfer data
to / from the controller. That communicates with drivers execute The command
controllers (adapters) on the device and wait Until the operation is done
finished devices.
Driver contains a set of instructions:

a.1 Control.
Serves to activate an external device and notify the Necessary
Performed. Example: magnetic tape unit was instructed to return to the position
early, moving to the next record, and so forth.
Testing a.2.
Function to check the status of hardware associated with device
I / O.
A.3 Reading / Writing
Function read / write for data transfer processor registers and Between
external devices.
The main problem I / O processor is programmed to wait wasted
operating and maintaining I / O. Other techniques are required to improve efficiency
processor.
b. I / O controlled interruptions.
Engineering I / O interruptions have a working mechanism led of the Mutation
  • Processor gives instructions to the device I / O and then Proceeds
doing other jobs.
The device I / O   • Interrupt request Pls will of the device is ready for the service
exchanging data with the processor.
We accept •   hardware interruption (WHO Told
The device is ready to transfer), processors execute immediate transfer
data.
Advantages:
Processor is not busy   • wait and keep devices on the I / O for
check the status of the device.
Weaknesses:
Rate of transfer   • of I / O limited speed testing and servicing operations
devices.
  • Processor tied tight in managing The transfer of I / O. A number of instructions
Should be Executed for Each Transfer I / O.

c. With DMA (direct memory access).
DMA transfer function frees the data processing done waiting
device I / O. When the processor wants to read or write data, processing
DMA controller ordered by sending the Following information:
The command of   • writing / reading.
Address the   • device I / O.
Early memory   • That location is written / read.
The number of word   • (byte) is written / read.
After sending the information to the DMA controller, processor cans
continue other work. Delegate processing operations I / O to DMA. DMA
Requested transfer all the data to / from memory directly without
through processing. When data transfer is complete, the DMA sends a signal interruption
to the processor. So That Involved the processor is only at the beginning and end of the transfer
data. Operating Transfers Between devices and main memory is
wholly separated from the processor and DMA interrupt only Pls
operation has been completed.
Advantages:
  • processing time savings.
  • Improved performance I / O.
3. Evolution of functional I / O devices
Computer systems have increased the complexity and sophistication
components, Which is looking at the functions I / O as
Mutation
a. Control processor I / O devices directly.
Still Used today for simple devices are controlled That
That a microprocessor so intelligent devices.
b. Processor equipped controller I / O (I / O controller).
Processor using the I / O are programmed without interruption, Thus no need
attention to specific details of the interface devices.
c. Equipped with devices interruptions.
Processors do not need to Spend time waiting for the completion of the operation I / O,
thereby increasing in processing efficiency.
d. I / O controller directly control memory via DMA.
The controller cans move blocks of data to / from memory without involving the
processors except the beginning and end of the transfer.
e. Controlling I / O into a separate processors.
Central processing control. special order processor I / O for
execute the program I / O in the main memory. Processor I / O taking and
These instruction-execute instructions without the intervention of the central processor.
Possible to Specify the center line of activity of processing the I / O and only
Pls interrupted the entire line of instruction completed.
f. Controlling I / O have on their own local memory.
I / O devices Can be controlled with the involvement of the central processor
minimum.
This architecture to control communications with the terminals
interactive. Processor I / O takes over many tasks That involve
controlling terminal.
Evolution AIMS to minimize the involvement of the central processor, Thus
processor is not busy with the task of I / O and improve performance cans
system.
4. Management principles of I / O devices
There are two design goals of the I / O, namely:
a. Efficiency.
An Important aspect Because the operations of I / O often cause bottlenecks.
b. Generality (device independence).
Management I / O devices in Addition to simplicity and freedom associated with
errors, handles Also the devices is uniformly better than the way the process
both look Airways to manage the operating system and the operating device I / O.
Organized layered software. Bottom layer deals hide
hardware complexity for the upper layers. Upper layer
deal provides a good interface, clean, comfortable and uniform to
user.
Management issues I / O is:
a. Naming a uniform (uniform naming).
The name of the file or device is a string or integer, do not Depend on
devices altogether.
b. Error handling (error handling).
Generally, error handling is handled as close as possible to the device
hard.
c. Synchronous vs.. asynchronous transfer.
Most I / O is asynchronous. Start processing the transfer and neglect
to perform other work Until the interruption came. The program user is more
Easily be written if the operation I / O block oriented. After a read command, the program
Until then be automatically postponed the data available in the buffer.
d. Dedicated vs. sharable.
Some devices together Can be Used as a disk, but there are devices Also
That only a one user is allowed to wear at a one-time.
Example: printers.
5. Management hierarchy of I / O devices
Management hierarchy of I / O devices:
a. Interrupt handler.
Interruptions Should be hidden so as not to Appear the next routine.
Device drivers in blocked Pls the command I / O provided and wait for the interruption.
When interrupts occur, interrupt handling procedure worked so device drivers
blocked out of state.
b. Device drivers.
All code is placed in the device dependent device driver. Each device
drivers to handle one type (class) device and serves to receive requests

abstract device independent software and perform service thereon
demand.
Working mechanism of a device driver:
Translating   • abstract commands into concrete orders.
Having determined   • That Should be given the command to the controller, device drivers
began writing to the device controller registers.
After surgery is completed   • devices, device drivers to check the status of
That errors occur.
If run well, pass   • data to the device driver software device
independent.
The device driver   • reports the status of operations to the caller.
c. Device independent software.
AIMS to establish the functions of the I / O That applies to all devices and
Provide a uniform interface to the user-level software.
Other functions are Performed:
As a uniform   • interface for all device drivers.
The naming   • Of the devices.
devices.   Protection •
Provide the size of   • the block device to device are independent.
Perform buffering.   •
  • storage allocation on block devices.
The allocation and   • release of dedicated devices.
Reporting errors.   •
d. User-level software.
Most software I / O is available at the operating system. One small part
contains a linked libraries and user programs running on the outside
kernel. System calls the I / O is Generally made as library procedures.
Collection of library procedures in the I / O is part of the system I / O. Not all
software I / O-level users in the form of library procedures. Category
Important is the spooling system. Spooling is a special way of dealing with
I / O devices That must be dedicated to the multiprogramming system.

6th. Buffering I / O
Buffering is bumping softening demand access I / O,
thereby increasing in the efficiency and performance of the operating system.
There are a variety of buffering Airways, Among Others:
a. Single buffering.
Is the simplest technique. When the process Gave the order to
I / O devices, operating systems Provide the main memory buffer for the system
operation.
For block-oriented devices.
Transfers made to a buffered input system. When the transfer is complete, the process
move the blocks into the user space and IMMEDIATELY asked for another block.
This technique is Called reading ahead or Anticipation of potential future inputs. This technique is done
with the hope of the block will from be required. For many types of computing,
this Assumption is valid. Only in the final processing of the blocks Which are not readable
required.
Advantages:
Generally the approach increases the speed compared with no buffering.
Can process the user process blocks of data while the next block is
read. Can the operating system swaps out the process for input operations
located in system memory rather than the user process memory.
Weaknesses:
complicates the operating system   • Because it must record the granting of the buffer-buffer
system to process user.
The logic of swapping was   • Also Affected. When operating the I / O involves disk for
swapping, then create a queue of writing to disk That The Same
Used to swap out the process. To swaping the process and release
The main memory Until Can not be started the operation, I / O completion, in Which time
swapping to disk is not good to be Executed.
Similar output buffering input buffering. When transmitting data, more data
Had copied from user space to buffer the system. Sender process to be free
to continue execution at the next or swap to disk if Necessary.

For the flow character-oriented devices.
Single buffering Can be implemented with two modes, namely:
o Mode line at a time.
Suitable for roll-mode terminals (dumb terminals or terminal scrolling).
User input is one line per time to enter the final mark
line. Also similar is the output terminal, is one line per times.
Examples of this mode is the printer.
Buffer Used to store a single row. User Process
suspended for the input, waiting for the arrival of one line in full.
For output, the user puts the output on one line
buffer and continue processing. The process need not suspend unless
The second line is sent before the buffer is emptied.
o Mode byte at a time.
This operation is suitable to form a terminal mode, typing is Nowhere Each
Important and other peripherals for Poor 'sensors and controllers.
b. Double buffering.
Improvement Can be made with the two buffers Can be transferred system. Process
to / from one buffer while the operating system of emptying (or filling)
another buffer. This technique is Called double buffering or buffer swapping.
Double buffering ensures the process does not wait for the operation of the I / O. Increase this
must be paid with increased complexity. For a flow-oriented
characters, double buffering mode has a two alternatives, namely:
o Mode line at a time.
User processes do not need to wait for I / O unless the process as soon as possible
clear the double buffer.
o Mode byte at a time.
Double buffer excellence means not giving up a single buffer.
Double buffering follow the producer-consumer model.
c. Circular buffering.
Should soften the Flow of Data Between I / O devices and processes. If
performance of certain processes to be our focus, We want the operations of I / O
follow the process. Double buffering is not sufficient if the process of doing
operations I / O successive fast. Problems Can often be avoided premises
using more than two buffers.
When more than two buffers are Used, the collection buffer referenced Itself
Circulate as a buffer. Each individual buffer is one unit in the circular buffer.
 Computer hardware and disk performance parameters
Disks are organized into the cylinders with Each surface there
Vertically Stacked heads. Track is divided into sectors.
The time required to read and write disk is Affected by:
o Time search (seek time).
Were dominant. The time it takes to get to
track the target position, is: S = Sc + ins, Nowhere:
Sc: Is the time of the initial ignition (initial startup time).
d: is the time to move the inter-Between tracks.
i: is the Distance (In The Space Between the size of the tracks).
For the nearest track, Sc + d S1 = Smaller than the time required
to facilitate the calculation of the one-lap Used. For s average,
namely:
j-1
The pdi,   S =
i = 1
Si: Is the travel time for the distance to-1.
Pdi: Is the probability of traveling a distance to-1.
Average seek time is usually informed by the manufacturer.
o Time of rotation (Rotational latency).
Time needed access Mechanisms achieve the desired block.
The formula for r is:
R = 1 / 2 * ((60 * 1000), / rpm).

Rpm or the number of rounds a minute, usually informed by the manufacturer.
o Transfer time (t).
Depending on the rotation speeds and recording density. Transfer rate (t)
is instantaneous data transfer rate, this data is provided by the manufacturer. Then
cans be calculated:
> Transfer time per record (TR, record transfer time).
TR (time to transfer records with a record length, R), namely:
TR = R / t.
> Transfer time per block (btt).
Bit (block transfer time, the time required to transfer one block),
namely: = btt B / t.
> Bulk transfer time (t ').
In the case of reading / writing the sequence of it must be
through the gaps and regions rather than data. At the end of Each cylinder, seek
During occur and will of the seek time, no data is transferred.
For the purposes defined bulk transfer time (t '), namely:
t '= (R )/((( R + W) / t) + s')
Nowhere:
R: Is the size of the record.
W: That is a space disiakan.
s': Is the seek time for the sequence.
t: Is the transfer mode.
 disk scheduling algorithm
In multiprogramming systems, many processes make requests That
read and write record record-disk. Making processes requests
faster than That Can be served by the disk, forming a queue
disk service request. Disk scheduling is Necessary in order to obtain performance
optimal.
There are two types of disk scheduling, namely:
1. Seek optimization.
2. Optimization of rotation (Rotational latency).
Because the seek time is higher than a one-time order of rotation, then
most scheduling algorithms to minimize seek to concentrate
or collection of disk queue service requests. Minimize latency
usually a small impact on the performance of the entire system.
Disk scheduling involves the examination of the requests
has not served to determine the most efficient way to serve requests.
Disk scheduler to examine The Relationship Between position requests.
Rearranged the request queue so requests
be served with a minimum of mechanical movement.
Several disk scheduling criteria, namely:
throughput,   • Which is trying to maximize.
  • The average response time, minimum value is sought.
  • Variance response time, cultivated a minimum.
Several disk scheduling algorithms, Among Others:
First come first   • serve (FCFS).
Driver disk in order to serve one request arrival,
is a fair method. When the demand rate is very heavy, can FCFS
Produce very long waiting time. FCFS with, very little
seek time optimization efforts. FCFS Can Cause a lot of time to
seek cylinders most of the outermost cylinders.
When requests are distributed uniformly on the surfaces
disk, scheduling, FCFS seek to Produce a random pattern. FCFS
ignores the connectivity Between the demands of the position Which
waiting in the queue. FCFS does not make the effort to seek a pattern optimization. FCFS
Pls acceptable it loads the disk is still mild, but once the load grows
tend boring device and causing the response times Bigger.
Shortest seek first   • (SSF).
These algorithms seek to serve the demand of the track Nowhere the nearest track head
located.
Disadvantages: Will Be disk arms stuck in the middle of the disk. Demand in the region
Extreme (edge) Until the wait will of the statistical fluctuations caused no

'there is a demand for the middle tracks. There is a conflict Between minimizing time
stairs with fairness (fair).
Elevator (SCAN).   •
Ie head moving in the direction of Same Until there is' No demand in this direction, then
U-turn. Additional bits needed to record the direction of head motion.
Kindness: the limit on the amount of motion is fixed, two times the number of cylinders.
•   modified Elevator (C-SCAN).
Sleeve head just moves the Same direction, Each time the cylinders reaches the highest
will of the head then move into the cylinder and then continue to head lower
moving direction. There are controllers That Can learn on the track he Nowhere
acres, with this optimization-May be possible to find sectors That existed at
These tracks.
The N-step scan.   •
Disk arm moves back and forth like a SCAN algorithm, but with
That all requests arrived During the sweep in one direction Were collected
first and rearranged so That optimal service During the sweep behind.
Exchenbach scheme.   •
Circular disk arm movements, Standard and Poor 'C-SCAN, but with Some
Important Exceptions to Every cylinder served by exactly one good track information
or not there is demand for that cylinder. Requests
prepared for service in the cylinder position to obtain advantages
The rotation (in order to apply optimization rotation), but if there are two
That request with the sectors overlap in one cylinder, only one
demand is served on one occasion.
 Handling of disk operating problems
Some types of errors During the disk operation is categorized Mutation
o Programming error.
Due to programming errors. Driver ordered to find tracks,
read sectors, using a head or a transfer to or from memory

Which did not exist. Typically Each controller so it does not check parameters
perform an invalid operation. Should this mistake never have existed.
o Transient checksum error.
Errors caused by dust Between the head with the disk surface.
To eliminate These errors will from several repeated operations
on disk.
o Permanent checksum error.
Errors caused by damage to the disk.
o Seek error.
The error has been addressed by calibrating the disk to function
back.
o Controller error.
The error has been addressed with a switch controller That is wrong with
The new controller.
o Track at time caching.
Controller has a memory for storing information Which he tracks
located, request the reading block movement tracks Performed without
mechanical.
b. Clock
Hardware clocks.
Computers equipped with a RTC (real time clock). Clock-type devices, consisting
from:
  • Clock generated impulse voltage.
Clock in interrupting 50-60 interrupts per second in accordance with the electrical frequency.
  • programmable interval timer (PIT).
This consists of crystal oscilator clock, counter, and a holding register.
Two benefits of PIT, namely:
•   Having high accuracy.
The frequency of interruptions   • Can be managed by software.
With crystal oscilator 2 MHz, using 16-bit holding register,
interruptions occur That Can be set Between 1 ms to 65 536 ms.
PIT is Used as:
Time system.   •
  • Generator rated band.
The countdown   • event.
Generator music.  •
And a variety of applications  • Require That timing.
When Used to generate the timing of interruptions PIT
periodically. PIT works with an external pulse counting given crystal
oscilator. PIT Output In The form Of pulses to be directly to passed
IRQm (interrupt request), causing interruption to the processor. Period
Time Between two consecutive timer interrupts Can be programmed with
Enter a value into a holding register.
Following the interruption interval has the formula:
Interval = (clock period) x (the value of the holding registers).
Example:
Every desired timing interval of 10 ms.
Oscilator crystal frequency is 2 MHz.
What is the value That must be inserted into a holding register?
Calculation:
Clock period = 1 / (2x106) = 0.5 x 10-6 = 0.5 mms.
The value That Should be given to holding register = (10x10-3) / (0.5x10-6) = 20x103.
In order to PIT cause interruptions to the time interval of 10 ms, then holding
register set with the value of 20 000.
PIT programming methods.
There are two modes of programming PIT, namely:
1. One shot mode.
Every time The PIT is initialized then copied into The registers holding values
counter. Each crystal oscilator lowered counter pulse occurs.
When the counter value of 0, PIT makes interruptions to the process and to stop.
PIT wait explicitly initialized by software. This mode
just to Produce one single event, the clock is required Pls
activated based on events.
2. Square wave mode.
The counter reaches 0 after then cause an interruption to The processor.
Holding registers are automatically copied to the counter and the whole process
Until infinity is repeated. This period is Called the clock ticks. This mode
to generate events periodically interrupt timer,
done automatically without involving the processor (software for
re-initialization). Usually the chip contains two or three independent PIT
has a lot of programming options (Standard and Poor 'counting upwards,
Extinction interruptions, etc.).
 clock software
Some disystem clock operating function, the Among other Things:
1. Managing time and date (real time).
The technique is to counter increased Every clock tick occurs.
This technique is problematic Because of the limited number of counter bits.
Sized 32-bit counter overflows after two years will of the clock rate Pls his
60Hz valued at, the solution is:
64-bit •   Using counters.
Time is counted in   • seconds rather than the clock tick.
calculated relative   • Pls help to the time the computer is turned on.
2. Prevent the process running more than a set time.
Each time the process starts, the scheduler initialization counters in the count clock
Ticks. Every-time There was a clock ticks, the counter is lowered. When the counter
reaches 0 then the scheduler switches the processor to other processes.
3. Calculating processor usage (CPU).
If desired Computation is done with high accuracy
using a second timer. The second timer is separate from the system timer
play. Once the Process Begins, the timer is activated, the process stops then Pls
timer is read. The timer shows the length of time That has been Used in the process.
Low accuracy Can be obtained by managing a pointer to a table of process
and a global counter.
4. Handle system calls made by the alarm user.
Simulate a lot of clock with a list of all requests
clock, sorted by time. It is a number of clock ticks after the signal
previous process.
5. Working on profiling, monitoring and statistics gathering.
To create computer activity statistics.
c. RAM Disk.
Which is a disk device is simulated in the Random access memory (RAM).
RAM disk completely eliminates the time delay caused by the movement and
mechanically in the seek and rotation. Used for applications requiring
high disk performance. Block device has two commands, ie read
and writing blocks. Normally, the blocks are stored on the disk rotating
Require a physical mechanism.
The idea is to mimic the device by allocating the first one
the main memory to store blocks of data.
Advantages:
Accessing high speed for a moment (no time delay seek
and Rotational latency), are excellent for storing programs or data
frequently accessed. The main memory is divided into n blocks of equal size, depending
much memory is allocated. When a RAM disk driver for receiving
command reads or writes a block, drivers Nowhere live count
Nowhere memory location the blocks are then read or write.

[+/-] Read More...

Template by : kendhin x-template.blogspot.com