Useful documents for engineering students of CSE, and specially for students of aryabhatta knowledge university, Bihar (A.K.U. Bihar). It covers following topics, File concept, access methods, directory structure
File system and IOCS
Files and file organization
Fundamentals of file organizations
Directory structures
File protection
Interface between file system and IOCS
Allocation of disk space
Implementation of file access
Useful documents for engineering students of CSE, and specially for students of aryabhatta knowledge university, Bihar (A.K.U. Bihar). It covers following topics, File concept, access methods, directory structure
File system and IOCS
Files and file organization
Fundamentals of file organizations
Directory structures
File protection
Interface between file system and IOCS
Allocation of disk space
Implementation of file access
File system in operating system e learningLavanya Sharma
This Module covers the basic of file system, its types, accessing methods, security and architecture of Unix operating system. This study material is very useful for UG and PG students of Engineering colleges and University where this course is in their Syllabus.
Definition
File Structure
Directory Structure: Single level, Two-level, Tree-structured , Acyclic graph, General graph.
File Type and operations
Major functions of OS in respect of File system
File Access Mechanisms and Space Allocation
Security and Protection
Program and system Threats
LINUX OPERATING SYSTEM: Architecture and basic commands
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
File system in operating system e learningLavanya Sharma
This Module covers the basic of file system, its types, accessing methods, security and architecture of Unix operating system. This study material is very useful for UG and PG students of Engineering colleges and University where this course is in their Syllabus.
Definition
File Structure
Directory Structure: Single level, Two-level, Tree-structured , Acyclic graph, General graph.
File Type and operations
Major functions of OS in respect of File system
File Access Mechanisms and Space Allocation
Security and Protection
Program and system Threats
LINUX OPERATING SYSTEM: Architecture and basic commands
Hybrid optimization of pumped hydro system and solar- Engr. Abdul-Azeez.pdffxintegritypublishin
Advancements in technology unveil a myriad of electrical and electronic breakthroughs geared towards efficiently harnessing limited resources to meet human energy demands. The optimization of hybrid solar PV panels and pumped hydro energy supply systems plays a pivotal role in utilizing natural resources effectively. This initiative not only benefits humanity but also fosters environmental sustainability. The study investigated the design optimization of these hybrid systems, focusing on understanding solar radiation patterns, identifying geographical influences on solar radiation, formulating a mathematical model for system optimization, and determining the optimal configuration of PV panels and pumped hydro storage. Through a comparative analysis approach and eight weeks of data collection, the study addressed key research questions related to solar radiation patterns and optimal system design. The findings highlighted regions with heightened solar radiation levels, showcasing substantial potential for power generation and emphasizing the system's efficiency. Optimizing system design significantly boosted power generation, promoted renewable energy utilization, and enhanced energy storage capacity. The study underscored the benefits of optimizing hybrid solar PV panels and pumped hydro energy supply systems for sustainable energy usage. Optimizing the design of solar PV panels and pumped hydro energy supply systems as examined across diverse climatic conditions in a developing country, not only enhances power generation but also improves the integration of renewable energy sources and boosts energy storage capacities, particularly beneficial for less economically prosperous regions. Additionally, the study provides valuable insights for advancing energy research in economically viable areas. Recommendations included conducting site-specific assessments, utilizing advanced modeling tools, implementing regular maintenance protocols, and enhancing communication among system components.
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSveerababupersonal22
It consists of cw radar and fmcw radar ,range measurement,if amplifier and fmcw altimeterThe CW radar operates using continuous wave transmission, while the FMCW radar employs frequency-modulated continuous wave technology. Range measurement is a crucial aspect of radar systems, providing information about the distance to a target. The IF amplifier plays a key role in signal processing, amplifying intermediate frequency signals for further analysis. The FMCW altimeter utilizes frequency-modulated continuous wave technology to accurately measure altitude above a reference point.
Sachpazis:Terzaghi Bearing Capacity Estimation in simple terms with Calculati...Dr.Costas Sachpazis
Terzaghi's soil bearing capacity theory, developed by Karl Terzaghi, is a fundamental principle in geotechnical engineering used to determine the bearing capacity of shallow foundations. This theory provides a method to calculate the ultimate bearing capacity of soil, which is the maximum load per unit area that the soil can support without undergoing shear failure. The Calculation HTML Code included.
Using recycled concrete aggregates (RCA) for pavements is crucial to achieving sustainability. Implementing RCA for new pavement can minimize carbon footprint, conserve natural resources, reduce harmful emissions, and lower life cycle costs. Compared to natural aggregate (NA), RCA pavement has fewer comprehensive studies and sustainability assessments.
Hierarchical Digital Twin of a Naval Power SystemKerry Sado
A hierarchical digital twin of a Naval DC power system has been developed and experimentally verified. Similar to other state-of-the-art digital twins, this technology creates a digital replica of the physical system executed in real-time or faster, which can modify hardware controls. However, its advantage stems from distributing computational efforts by utilizing a hierarchical structure composed of lower-level digital twin blocks and a higher-level system digital twin. Each digital twin block is associated with a physical subsystem of the hardware and communicates with a singular system digital twin, which creates a system-level response. By extracting information from each level of the hierarchy, power system controls of the hardware were reconfigured autonomously. This hierarchical digital twin development offers several advantages over other digital twins, particularly in the field of naval power systems. The hierarchical structure allows for greater computational efficiency and scalability while the ability to autonomously reconfigure hardware controls offers increased flexibility and responsiveness. The hierarchical decomposition and models utilized were well aligned with the physical twin, as indicated by the maximum deviations between the developed digital twin hierarchy and the hardware.
We have compiled the most important slides from each speaker's presentation. This year’s compilation, available for free, captures the key insights and contributions shared during the DfMAy 2024 conference.
Final project report on grocery store management system..pdfKamal Acharya
In today’s fast-changing business environment, it’s extremely important to be able to respond to client needs in the most effective and timely manner. If your customers wish to see your business online and have instant access to your products or services.
Online Grocery Store is an e-commerce website, which retails various grocery products. This project allows viewing various products available enables registered users to purchase desired products instantly using Paytm, UPI payment processor (Instant Pay) and also can place order by using Cash on Delivery (Pay Later) option. This project provides an easy access to Administrators and Managers to view orders placed using Pay Later and Instant Pay options.
In order to develop an e-commerce website, a number of Technologies must be studied and understood. These include multi-tiered architecture, server and client-side scripting techniques, implementation technologies, programming language (such as PHP, HTML, CSS, JavaScript) and MySQL relational databases. This is a project with the objective to develop a basic website where a consumer is provided with a shopping cart website and also to know about the technologies used to develop such a website.
This document will discuss each of the underlying technologies to create and implement an e- commerce website.
1. 1
Year & Sem – III year & V Sem
Subject – Operating System
Topic : File Management (UNIT 4)
Presented by – Dr. Nilam Choudhary, Associate Professor, CSE
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
JAIPUR ENGINEERING COLLEGE AND RESEARCH CENTRE
1
2. 1
Believe it or Not
2
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
6. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Cont..
6
What is File System?
A file is a collection of correlated information which is recorded on secondary or non-
volatile storage like magnetic disks, optical disks, and tapes. It is a method of data
collection that is used as a medium for giving input and receiving output from that
program.
In general, a file is a sequence of bits, bytes, or records whose meaning is defined by the
file creator and user. Every File has a logical location where they are located for storage
and retrieval.
7. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 7
Objective of File management System
Here are the main objectives of the file management system:
It provides I/O support for a variety of storage device types.
Minimizes the chances of lost or destroyed data
Helps OS to standardized I/O interface routines for user processes.
It provides I/O support for multiple users in a multiuser systems environment.
8. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 8
Properties of a File System
Here, are important properties of a file system:
Files are stored on disk or other storage and do not disappear when a user logs off.
Files have names and are associated with access permission that permits controlled
sharing.
Files could be arranged or more complex structures to reflect the relationship between
them.
9. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 9
File structure
A File Structure needs to be predefined format in such a way that an operating system
understands . It has an exclusively defined structure, which is based on its type.
Three types of files structure in OS:
A text file: It is a series of characters that is organized in lines.
An object file: It is a series of bytes that is organized into blocks.
A source file: It is a series of functions and processes.
10. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 10
File Attributes
A file has a name and data. Moreover, it also stores meta information like file creation date
and time, current size, last modified date, etc. All this information is called the attributes of a
file system.
Here, are some important File attributes used in OS:
Name: It is the only information stored in a human-readable form.
Identifier: Every file is identified by a unique tag number within a file system known as an
identifier.
Location: Points to file location on device.
Type: This attribute is required for systems that support various types of files.
Size. Attribute used to display the current file size.
Protection. This attribute assigns and controls the access rights of reading, writing, and
executing the file.
Time, date and security: It is used for protection, security, and also used for monitoring
11. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
File Type
11
It refers to the ability of the operating system to differentiate various types of files like
text files, binary, and source files. However, Operating systems like MS_DOS and UNIX
has the following type of files:
Character Special File
It is a hardware file that reads or writes data character by character, like mouse, printer,
and more.
Ordinary files
These types of files stores user information.
It may be text, executable programs, and databases.
It allows the user to perform operations like add, delete, and modify.
Directory Files
Directory contains files and other related information about those files. Its basically a
folder to hold and organize multiple files.
Special Files
These files are also called device files. It represents physical devices like printers, disks,
networks, flash drive, etc.
12. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Functions of File
12
Create file, find space on disk, and make an entry in the directory.
Write to file, requires positioning within the file
Read from file involves positioning within the file
Delete directory entry, regain disk space.
Reposition: move read/write position.
13. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Commonly used terms in File systems
13
Field:
This element stores a single value, which can be static or variable length.
DATABASE:
Collection of related data is called a database. Relationships among elements of data
are explicit.
FILES:
Files is the collection of similar record which is treated as a single entity.
RECORD:
A Record type is a complex data type that allows the programmer to create a new data
type with the desired column structure. Its groups one or more columns to form a new
data type. These columns will have their own names and data type.
14. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
File Access Methods
14
File access is a process that determines the way that files are accessed and read into
memory. Generally, a single access method is always supported by operating systems.
Though there are some operating system which also supports multiple access methods.
Three file access methods are:
Sequential access
Direct random access
Index sequential access
Sequential Access
In this type of file access method, records are accessed in a certain pre-defined
sequence. In the sequential access method, information stored in the file is also
processed one by one. Most compilers access files using this access method.
15. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Cont..
15
Random Access
The random access method is also called direct random access. This method
allow accessing the record directly. Each record has its own address on which
can be directly accessed for reading and writing.
Sequential Access
This type of accessing method is based on simple sequential access. In this
access method, an index is built for every file, with a direct pointer to different
memory blocks. In this method, the Index is searched sequentially, and its pointer
can access the file directly. Multiple levels of indexing can be used to offer
greater efficiency in access. It also reduces the time needed to access a single
record.
16. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Space Allocation
16
In the Operating system, files are always allocated disk spaces.
Three types of space allocation methods are:
Linked Allocation
Indexed Allocation
Contiguous Allocation
Contiguous Allocation
In this method,
Every file users a contiguous address space on memory.
Here, the OS assigns disk address is in linear order.
In the contiguous allocation method, external fragmentation is the biggest issue.
17. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Cont..
17
Linked Allocation
In this method,
Every file includes a list of links.
The directory contains a link or pointer in the first block of a file.
With this method, there is no external fragmentation
This File allocation method is used for sequential access files.
This method is not ideal for a direct access file.
Indexed Allocation
In this method,
Directory comprises the addresses of index blocks of the specific files.
An index block is created, having all the pointers for specific files.
All files should have individual index blocks to store the addresses for disk
space.
18. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 18
File Directories
A single directory may or may not contain multiple
files. It can also have sub-directories inside the
main directory. Information about files is
maintained by Directories. In Windows OS, it is
called folders.
Following is the information which is maintained in a directory:
•Name The name which is displayed to the user.
•Type: Type of the directory.
•Position: Current next-read/write pointers.
•Location: Location on the device where the file header is stored.
•Size : Number of bytes, block, and words in the file.
•Protection: Access control on read/write/execute/delete.
•Usage: Time of creation, access, modification
20. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 20
Summary
•A file is a collection of correlated information which is recorded on secondary or non-
volatile storage like magnetic disks, optical disks, and tapes.
•It provides I/O support for a variety of storage device types.
•Files are stored on disk or other storage and do not disappear when a user logs off.
•A File Structure needs to be predefined format in such a way that an operating system
understands it.
•File type refers to the ability of the operating system to differentiate different types of files
like text files, binary, and source files.
•Create find space on disk and make an entry in the directory.
•Indexed Sequential Access method is based on simple sequential access
•In Sequential Access method records are accessed in a certain pre-defined sequence
•The random access method is also called direct random access
•Three types of space allocation methods are:
• Linked Allocation
• Indexed Allocation
• Contiguous Allocation
•Information about files is maintained by Directories
21. 1
File Directory
21
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Collection of files is a file directory. The directory contains information about the files,
including attributes, location and ownership. Much of this information, especially that is
concerned with storage, is managed by the operating system. The directory is itself a file,
accessible by various file management routines.
Information contained in a device directory are:
Name
Type
Address
Current length
Maximum length
Date last accessed
Date last updated
Owner id
Protection information
22. 1
Cont..
22
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Operation performed on directory are:
Search for a file
Create a file
Delete a file
List a directory
Rename a file
Traverse the file system
Advantages of maintaining directories are:
Efficiency: A file can be located more quickly.
Naming: It becomes convenient for users as two users can have same name for
different files or may have different name for same file.
Grouping: Logical grouping of files can be done by properties e.g. all java programs,
all games etc.
23. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 23
Structures of Directory in Operating System
A directory is a container that is used to contain folders and file. It organizes files and
folders into a hierarchical manner.
24. 1
Cont..
24
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
SINGLE-LEVEL DIRECTORY
In this a single directory is maintained for all the users.
Naming problem: Users cannot have same name for two files.
Grouping problem: Users cannot group files according to their need.
25. 1
Cont..
25
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Single-level directory –
Single level directory is simplest directory structure.In it all files are contained in same
directory which make it easy to support and understand.A single level directory has a
significant limitation, however, when the number of files increases or when the system
has more than one user. Since all the files are in the same directory, they must have the
unique name . if two users call their dataset test, then the unique name rule violated.
Advantages:
Since it is a single directory, so its implementation is very easy.
If the files are smaller in size, searching will become faster.
The operations like file creation, searching, deletion, updating are very easy in such a
directory structure.
Disadvantages:
There may chance of name collision because two files can not have the same name.
Searching will become time taking if the directory is large.
In this can not group the same type of files together.
26. 1
Cont..
26
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
TWO-LEVEL DIRECTORY
In this separate directories for each user is maintained.
Path name: Due to two levels there is a path name for every file to locate that file.
Now, we can have same file name for different user.
Searching is efficient in this method.
27. 1
Cont..
27
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
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.In the two-level directory structure, each user has there own user files directory
(UFD). The UFDs has similar structures, but each lists only the files of a single user.
system’s master file directory (MFD) is searches whenever a new user id=s logged in.
The MFD is indexed by username or account number, and each entry points to the UFD
for that user.
28. 1
Cont..
28
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Advantages:
We can give full path like /User-name/directory-name/.
Different users can have same directory as well as file name.
Searching of files become more easy due to path name and user-grouping.
Disadvantages:
A user is not allowed to share files with other users.
Still it not very scalable, two files of the same type cannot be grouped together in the
same user.
29. 1
Cont..
29
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
TREE-STRUCTURED DIRECTORY :
Directory is maintained in the form of a tree.
Searching is efficient and also there is grouping capability.
We have absolute or relative path name for a file.
30. 1
Cont..
30
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
TREE-STRUCTURED DIRECTORY :
Once we have seen a two-level directory as a tree of height 2, the natural generalization
is to extend the directory structure to a tree of arbitrary height.
This generalization allows the user to create there own subdirectories and to organize
on their files accordingly.
31. 1
Cont..
31
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
TREE-STRUCTURED DIRECTORY :
A tree structure is the most common directory structure. The tree has a root directory,
and every file in the system have a unique path.
Advantages:
Very generalize, since full path name can be given.
Very scalable, the probability of name collision is less.
Searching becomes very easy, we can use both absolute path as well as relative.
Disadvantages:
Every file does not fit into the hierarchical model, files may be saved into multiple
directories.
We can not share files.
It is inefficient, because accessing a file may go under multiple directories.
32. 1
Acyclic graph directory –
32
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
An acyclic graph is a graph with no cycle and allows to share
subdirectories and files. The same file or subdirectories may
be in two different directories. It is a natural generalization of
the tree-structured directory.It is used in the situation like
when two programmers are working on a joint project and
they need to access files.
The associated files are stored in a subdirectory, separating
them from other projects and files of other programmers,
since they are working on a joint project so they want the
subdirectories to be into their own directories. The common
subdirectories should be shared. So here we use Acyclic
directories.
It is the point to note that shared file is not the same as copy
file . If any programmer makes some changes in the
subdirectory it will reflect in both subdirectories.
33. 1
Acyclic graph directory –
33
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Advantages:
We can share files.
Searching is easy due to different-different paths.
Disadvantages:
We share the files via linking, in case of deleting it may
create the problem,
If the link is softlink then after deleting the file we left with a
dangling pointer.
In case of hardlink, to delete a file we have to delete all the
reference associated with it.
34. 1
General graph directory structure –
34
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
In general graph directory structure, cycles
are allowed within a directory structure where
multiple directories can be derived from more
than one parent directory.
The main problem with this kind of directory
structure is to calculate total size or space
that has been taken by the files and
directories.
Advantages:
It allows cycles.
It is more flexible than other directories
structure.
Disadvantages:
It is more costly than others.
It needs garbage collection.
35. 1
FILE ALLOCATION METHODS
35
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
The allocation methods define how the files are stored in the disk blocks. There are
three main disk space or file allocation methods.
Contiguous Allocation
Linked Allocation
Indexed Allocation
The main idea behind these methods is to provide:
Efficient disk space utilization.
Fast access to the file blocks.
All the three methods have their own advantages and disadvantages as discussed
36. 1
FILE ALLOCATION METHODS
36
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Continuous Allocation: A single continuous set
of blocks is allocated to a file at the time of file
creation. Thus, this is a pre-allocation strategy,
using variable size portions. The file allocation
table needs just a single entry for each file,
showing the starting block and the length of the
file.
This method is best from the point of view of the
individual sequential file. Multiple blocks can be
read in at a time to improve I/O performance for
sequential processing. It is also easy to retrieve a
single block. For example, if a file starts at block
b, and the ith block of the file is wanted, its
location on secondary storage is simply b+i-1.
37. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Cont..
37
The directory entry for a file with contiguous allocation contains
Address of starting block
Length of the allocated portion.
Advantages:
Both the Sequential and Direct Accesses are supported by this.
For direct access, the address of the kth block of the file which starts at block b can easily
be obtained as (b+k).
This is extremely fast since the number of seeks are minimal because of contiguous
allocation of file blocks.
38. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
Cont..
38
Disadvantage
External fragmentation will occur, making it difficult to find contiguous blocks of space of
sufficient length.
Compaction algorithm will be necessary to free up additional space on disk.
Also, with pre-allocation, it is necessary to declare the size of the file at the time of
creation.
39. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 39
Linked Allocation(Non-contiguous allocation) :
Allocation is on an individual block basis. Each
block contains a pointer to the next block in the
chain. Again the file table needs just a single
entry for each file, showing the starting block
and the length of the file. Although pre-
allocation is possible, it is more common simply
to allocate blocks as needed. Any free block can
be added to the chain. The blocks need not be
continuous. Increase in file size is always
possible if free disk block is available. There is
no external fragmentation because only one
block at a time is needed but there can be
internal fragmentation but it exists only in the
last disk block of file.
40. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 40
Linked Allocation(Non-contiguous allocation) :
Advantages:
This is very flexible in terms of file size. File size can be increased easily since the system
does not have to look for a contiguous chunk of memory.
This method does not suffer from external fragmentation. This makes it relatively better in
terms of memory utilization.
Disadvantages:
Because the file blocks are distributed randomly on the disk, a large number of seeks are
needed to access every block individually. This makes linked allocation slower.
It does not support random or direct access. We can not directly access the blocks of a file.
A block k of a file can be accessed by traversing k blocks sequentially (sequential access )
from the starting block of the file via block pointers.
Pointers required in the linked allocation incur some extra overhead.
Internal fragmentation exists in last disk block of file.
There is an overhead of maintaining the pointer in every disk block.
If the pointer of any disk block is lost, the file will be truncated.
It supports only the sequencial access of files.
41. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 41
Indexed Allocation
It addresses many of the problems of contiguous
and chained allocation. In this case, the file
allocation table contains a separate one-level
index for each file.
The index has one entry for each block allocated
to the file. Allocation may be on the basis of
fixed-size blocks or variable-sized blocks.
Allocation by blocks eliminates external
fragmentation, whereas allocation by variable-
size blocks improves locality. This allocation
technique supports both sequential and direct
access to the file and thus is the most popular
form of file allocation.
42. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 42
Indexed Allocation
Advantages:
This supports direct access to the blocks occupied by the file and therefore provides fast
access to the file blocks.
It overcomes the problem of external fragmentation.
Disadvantages:
The pointer overhead for indexed allocation is greater than linked allocation.
For very small files, say files that expand only 2-3 blocks, the indexed allocation would
keep one entire block (index block) for the pointers which is inefficient in terms of memory
utilization. However, in linked allocation we lose the space of only 1 pointer per block.
43. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 43
Cont..
For files that are very large, single index block may not be able to hold all the pointers.
Following mechanisms can be used to resolve this:
Linked scheme: This scheme links two or more index blocks together for holding the
pointers. Every index block would then contain a pointer or the address to the next index
block.
Multilevel index: In this policy, a first level index block is used to point to the second
level index blocks which inturn points to the disk blocks occupied by the file. This can be
extended to 3 or more levels depending on the maximum file size.
Combined Scheme: In this scheme, a special block called the Inode (information
Node) contains all the information about the file such as the name, size, authority, etc
and the remaining space of Inode is used to store the Disk Block addresses which
contain the actual file
44. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 44
Disk Free Space Management
Just as the space that is allocated to files must be managed ,so the space that is not
currently allocated to any file must be managed. To perform any of the file allocation
techniques,it is necessary to know what blocks on the disk are available. Thus we need a
disk allocation table in addition to a file allocation table.The following are the approaches
used for free space management.
Bit Tables : This method uses a vector containing one bit for each block on the disk. Each
entry for a 0 corresponds to a free block and each 1 corresponds to a block in use.
For example: 00011010111100110001In this vector every bit correspond to a particular
block and 0 implies that, that particular block is free and 1 implies that the block is already
occupied. A bit table has the advantage that it is relatively easy to find one or a contiguous
group of free blocks.
Advantages
a bit table works well with any of the file allocation methods.
Another advantage is that it is as small as possible.
45. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR 45
Disk Free Space Management
Free Block List : In this method, each block is assigned a number sequentially and the list
of the numbers of all free blocks is maintained in a reserved block of the disk.
46. 1
Dr. Nilam Choudhary ,CSE, JECRC, JAIPUR
REFERENCES
46
Text/Reference Books:
1. A. Silberschatz and Peter B Galvin: Operating System Principals, Wiley India
Pvt. Ltd.
2. Achyut S Godbole: Operating Systems, Tata McGraw Hill
3. Tanenbaum: Modern Operating System, Prentice Hall.
4. DM Dhamdhere: Operating Systems – A Concepts Based Approach, Tata
McGraw Hill 5.
5. Charles Crowly: Operating System A Design – Oriented Approach, Tata
McGraw Hill.