RAID, IOMan, Buffer
RAID, IOMan, Buffer
RAID, IOMan, Buffer
The buffer is an area in the main memory used to store or hold the data temporarily. In other words,
buffer temporarily stores data transmitted from one place to another, either between two devices or
an application. The act of storing data temporarily in the buffer is called buffering.
In operating systems, buffering is a technique which is used to enhance the performance of I/O
operations of the system.
In a computer system, data is stored on several devices like hard discs, magnetic tapes, optical discs
and network devices. In the case, when a process requires to read or write data from one of these
storage devices, it has to wait while the device retrieves or stores the data. This waiting time could
be very high, especially for those devices which are slow or have a high latency.
This problem can be addressed by buffering. Buffering provides a temporary storage area, called
buffer. Buffer can store data before it is sent to or retrieved from the storage device.
Time at which In operation performed we can not perform Move operation
File Concept
A file is a named collection of related information that is recorded on secondary storage such as
magnetic disks, magnetic tapes and optical disks. In general, a file is a sequence of bits, bytes, lines or
records whose meaning is defined by the files creator and user.
Executable file
In an executable file, the binary code that is loaded in the memory for execution is stored. It
is stored in an exe type file.
Source file
The source file has subroutines and functions that are compiled later.
Text file
Image file
1. Only the user can edit the name they have assigned to a file.
2. A unique number tag is given to every file. It cannot be read by the user and is used
by the file system to identify the file.
3. The time, date, and user identification are maintained to access the information about
which date the file was created, edited, or last accessed.
4. The type of the file is easily identified.
5. The size of the file in bits, bytes, or Kilobytes.
6. Access control can be defined by the user, as to who can access the files to read,
write, edit or delete the information stored in them.
Directory
A directory is a container that is used to contain folders and files. It organizes files and folders in a
hierarchical manner.
Directory can be defined as the listing of the related files on the disk. The directory may store some
or the entire file attributes.
There are several logical structures of a directory, these are given below.
1) Single-level directory:
The single-level directory is the simplest directory structure. In it, all files are contained in
the same directory which makes it easy to support and understand.
2) Two-level directory:
As we have seen, a single level directory often leads to confusion of files names among
different users. The solution to this problem is to create a separate directory for each user.
Tree directory structure of operating system is most commonly used in our personal
computers. User can create files and subdirectories too, which was a disadvantage in the
previous directory structures.
4) Acyclic Graph Structure:
File in one directory can be accessed from multiple directories. In this way, the files could be shared
in between the users.
File access methods in OS are nothing but techniques to read data from the system's memory.
There are various ways in which we can access the files from the memory like:
• Sequential Access
• Direct/Relative Access, and
• Indexed Sequential Access.
1. Sequential Access
The operating system reads the file word by word in sequential access method of file
accessing.
A pointer is made, which first links to the file's base address. If the user wishes to read the
first word of the file, the pointer gives it to them and raises its value to the next word.
2. Direct (or Relative) Access
A Direct/Relative file access mechanism is mostly required with the database systems.
In the majority of the circumstances, we require filtered/specific data from the database, and
in such circumstances, sequential access might be highly inefficient.
The direct access mechanism requires the OS to perform some additional tasks but eventually
leads to much faster retrieval of records as compared to the sequential access.
The indexes, similar to a book's index (pointers), contain a link to various blocks present in
the memory.
This method is practically similar to the pointer to pointer concept in which we store an
address of a pointer variable containing address of some other variable/record in another
pointer variable.
Primary index blocks contain the links of the secondary inner blocks which contains links to
the data in the memory.
• Contiguous Allocation
• Linked Allocation
• Indexed Allocation
1. Contiguous Allocation
In this scheme, each file occupies a contiguous set of blocks on the disk.
In this scheme, each file is a linked list of disk blocks which need not be contiguous.
The directory entry contains a pointer to the starting and the ending file block. Each block
contains a pointer to the next block occupied by the file.
3. Indexed Allocation
In this scheme, a special block known as the Index block contains the pointers to all the
blocks occupied by a file.
File protection
File protection in an operating system refers to the various mechanisms and techniques used
to secure files from unauthorized access, alteration, or deletion
1. Delete
2. Append : To write new info at the end of the file
3. Execute : To load into memory
4. Read
5. Write
A list is created called the access-control list(ACL) which enlists the names of users and the
type of access granted to them.
However, it is very long as all the users need to be listed down. We have to know in advance
for all the user who are going to access Files
To resolve this situation and condense the length of access-control list, the following
classifications are used: