Operating System & File Management
Operating System & File Management
• Memory Management
• Processor Management
• Device Management
• File Management
• Security
• Control over system performance
• Job accounting
• Error detecting aids
2. Multiprogramming OS
In multiprogramming, the CPU is capable of running more than one program
concurrently. More than one programs can reside in the main memory at any
given time, however the processor is able to execute only one instruction at a
time. The, operating speed of the CPU is much faster than that of the I/O devices.
Therefore, when one program is busy with I/O operations, the CPU is able to
allocate time to other programs instead of remaining idle. Thus, a number of users
can share CPU time.
A number of programs can reside in the main memory of the computer system.
The place in memory where a program resides is known as partition. Depending
upon the operating system, the actual number of partitions in the memory and the
number of programs that can reside simultaneously is decided. Thus, in
multiprogramming it is possible to run a number of programs in much less time
than would be required to execute them one after the other.
Multiprogramming increases both the throughput and response time of the
computer system. However operating systems which can support
multiprogramming are required to have high memory capacity and at the same
time effective mechanism of protecting the memory.
3. Multiprocessing OS
In multiprocessing systems, two or more CPUs are connected together.
Therefore, it is possible to execute instructions from different programs at the
same time. Thus, more than one instruction can be executed simultaneously. The
idle time of the computer reduces, since there is not user intervention in between
jobs.
4. Time-sharing operating systems
Time-sharing is a technique which enables many people, located at various
terminals, to use a particular computer system at the same time. Time-sharing or
multitasking is a logical extension of multiprogramming. Processor's time which
is shared among multiple users simultaneously is termed as time-sharing.
The main difference between Multi-programmed Batch Systems and Time-
Sharing Systems is that in case of Multi-programmed batch systems, the
objective is to maximize processor use, whereas in Time-Sharing Systems, the
objective is to minimize response time.
Multiple jobs are executed by the CPU by switching between them, but the
switches occur so frequently. Thus, the user can receive an immediate response.
For example, in a transaction processing, the processor executes each user
program in a short burst or quantum of computation. That is, if n users are
present, then each user can get a time quantum. When the user submits the
command, the response time is in few seconds at most.
The operating system uses CPU scheduling and multiprogramming to provide
each user with a small portion of a time. Computer systems that were designed
primarily as batch systems have been modified to time-sharing systems.
Advantages of Timesharing operating systems are as follows −
• Problem of reliability.
• Question of security and integrity of user programs and data.
• Problem of data communication.
• With resource sharing facility, a user at one site may be able to use the
resources available at another.
• Speedup the exchange of data with one another via electronic mail.
• If one site fails in a distributed system, the remaining sites can potentially
continue operating.
• Better service to the customers.
• Reduction of the load on the host computer.
• Reduction of delays in data processing.
An Operating System provides services to both the users and to the programs.
• Program execution
• I/O operations
•File System manipulation
• Communication
• Error Detection
• Resource Allocation
• Protection
Program execution
Operating systems handle many kinds of activities from user programs to system
programs like printer spooler, name servers, file server, etc. Each of these
activities is encapsulated as a process.
A process includes the complete execution context (code to execute, data to
manipulate, registers, OS resources in use). Following are the major activities of
an operating system with respect to program management −
* Deadlock is a situation where a set of processes are blocked because each process is
holding a resource and waiting for another resource acquired by some other process (system
hanging situation).
I/O Operation
An I/O subsystem comprises of I/O devices and their corresponding driver
software. Drivers hide the peculiarities of specific hardware devices from the
users.
An Operating System manages the communication between user and device
drivers.
• I/O operation means read or write operation with any file or any specific
I/O device.
• Operating system provides the access to the required I/O device when
required.
File system manipulation
A file represents a collection of related information. Computers can store files
on the disk (secondary storage), for long-term storage purpose. Examples of
storage media include magnetic tape, magnetic disk and optical disk drives like
CD, DVD. Each of these media has its own properties like speed, capacity, data
transfer rate and data access methods.
A file system is normally organized into directories for easy navigation and
usage. These directories may contain files and other directions. Following are
the major activities of an operating system with respect to file management −
•Program needs to read a file or write a file. (different files like .doc, .txt,
.jpeg, .mp3 etc)
• The operating system gives the permission to the program for operation on
file.
• Permission varies from read-only, read-write, denied and so on.
• Operating System provides an interface to the user to create/delete files.
Protection
Considering a computer system having multiple users and concurrent execution
of multiple processes, the various processes must be protected from each other's
activities.
Protection refers to a mechanism or a way to control the access of programs,
processes, or users to the resources defined by a computer system. Following are
the major activities of an operating system with respect to protection −
File
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.
File Structure
A File Structure should be according to a required format that the operating
system can understand.
• A file has a certain defined structure according to its type.
➢ A text file is a sequence of characters organized into lines.
➢ A source file is a sequence of procedures and functions.
➢ An object file is a sequence of bytes organized into blocks that are
understandable by the machine.
• When operating system defines different file structures, it also contains the
code to support these file structure. Unix, MS-DOS support minimum
number of file structure.
File Type
File type refers to the ability of the operating system to distinguish different types
of file such as text files, source files and binary files etc. Many operating systems
support many types of files. Operating system like MS-DOS and UNIX have the
following types of files −
Ordinary files
Directory files
• These files contain list of file names and other information related to these
files. (.dir)
• Directory is a file system cataloguing structure which contains references
to other computer files, and possibly other directories. On many
computers, directories are known as folders
Special files
• Sequential access
• Direct/Random access
• Indexed sequential access
Sequential access
A sequential access is that in which the records are accessed in some sequence,
i.e., the information in the file is processed in order, one record after the other.
This access method is the most primitive one. Example: Compilers usually
access files in this fashion.
Direct/Random access
• Random access file organization provides, accessing the records directly.
• Each record has its own address on the file with by the help of which it can
be directly accessed for reading or writing.
• The records need not be in any sequence within the file and they need not
be in adjacent locations on the storage medium.
Indexed sequential access