SLM - Unit 12
SLM - Unit 12
12.1 Introduction
In the previous unit we have studied requirement analysis, software design
process, system development based on various models like waterfall model,
agile, spiral and V-model, software testing life cycle, various types of
software testing, software paradigms, programming methods and software
applications. In this unit, we will study the operating system basics such as
functions and the development of operating system, virtual memory,
operating system components, operating system services and operating
system security. The operating system has its own responsibilities to
perform fundamental tasks, such as receive input from the keyboard, send
output to the display screen, keep track of files and directories on the disk
and control peripheral devices such as disk drives and printers.
OS ensures that different programs and users running at the same time do
not interfere with each other and it provides a software platform on top of
which other programs (for example, application software) can run. These
responsibilities address the need to manage the computer hardware and the
application programs that use the hardware. It also focuses on providing an
interface between application software and hardware so that application
software can be efficiently developed.
Objectives:
After studying this unit, you should be able to:
define operating system
discuss various functions of an operating system
explain various methods for developing operating systems
discuss operating system virtual memory
list various components of operating system
describe operating system security
process and also deallocates the memory from the process. This also
defines that if a process gets completed, then it will deallocate the
memory from that process.
Input and Output Management: When, one or more programs are
being executed it co-ordinates different input and output devices.
File System Management: File system management is responsible for
the maintenance of a file system, in which the users are allowed to
create, delete, modify the files and also transfer of files from one storage
device to another.
Priority Management: Priority management determines and maintains
the order in which the jobs are to be executed in the computer system.
Error Detection: Error detection detects the error messages.
Command Execution: Command execution reads the commands and
instructions that are to be performed by the computer system.
Co-ordination: Co-ordinates with compilers, assemblers, utility
programs and other software to the various users of the computer
system.
Data Integrity: Operating system keeps programs and information in
such a manner that they do not interface with each other.
User Interface: In this, user interface provides easy communication
between the user and the computer system.
Self-Assessment Questions
1. ________ is the most important software which is responsible for
booting the computer.
2. Mention any two functions of the operating system.
3. ________ is responsible to create, delete, transfer and modify the files.
4. _____________ is accountable for allocating order of jobs that need to
be executed in the computer system.
Early Systems
Early computers were extremely large machines. There was no operating
system and the programs had to directly control all necessary hardware
components. The common input devices were card readers and tape drives.
The common output devices were line printers, tape drives, and punched
cards. The users of such systems did not interact directly with the computer.
The user prepared a job-which consisted of the program and some
information about the nature of the job (control cards) and submitted it to the
computer operator. The job would usually be in the form of punch cards. At
some later time (perhaps minutes, hours, or days), the output appeared.
The output consists of the result of the program, if there was any error in the
program the output was like a dump.
Simple Batch Systems
To speed up processing, jobs with similar needs were batched together and
were run through the computer as a group. Thus, the programmers would
leave their programs with the operator. The operator would sort programs
into batches with similar requirements and, as the computer became
available, would run each batch. The output from each job would be sent
back to the appropriate programmer. A batch operating system, thus,
normally reads a stream of separate jobs-(from a card reader, for example),
each with its own control cards that predefined what the job does. Figure
12.1 shows a memory layout for a simple batch system.
Operating System
the computer memory and then processing the job, the input is first read into
the disk. When the job is processed or executed, the input is read directly
from the disk. Similarly when a job is executed for printing, the output is
written into a buffer on the disk and actually printed later. This form of
processing is known as SPOOLING, SPOOL stands for Simultaneous
Peripheral Operation OnLine. SPOOLING uses the disk as a large buffer to
read input devices and for storing output until output devices are available to
accept them.
SPOOLING overlaps input and output of one job with the computation of
other jobs. For example, spooler may be reading the input of one job while
printing the output of another and executing a third job. Spooling increases
the performance of the system by allowing both a faster CPU and slower
input and output devices to work at higher operating rates.
Multi-Programmed Batch Systems
The operating system keeps several jobs in memory at a time. This set of
jobs is a subset of the jobs kept in the job pool. Job pool is the space that
contains multiple jobs. The operating system now has to choose from the
job pool, a job that is to be executed next. This increases CPU utilization.
Since the disk is a direct access device, jobs in the job pool may be
scheduled for execution in any order, not necessarily sequentially.
Job scheduling brings in the ability of multi-programming. A single user
cannot keep both CPU and I/O devices busy. Multiprogramming increases
CPU utilization by organizing jobs in such a manner that CPU always has a
job to execute.
When two or more programs are residing in memory at the same time, then
sharing the processor is referred to as multiprogramming. The idea of multi-
programming can be described as follows. A job pool on the disk consists of
a number of jobs that are ready to be executed. Subsets of these jobs
reside in memory during execution. The operating system picks and
executes one of the jobs in memory. When this job in execution needs an
I/O (Input Output) operation to complete, the CPU is idle. Instead of waiting
for the job to complete the I/O, the CPU switches to another job in memory.
When the previous job has completed the I/O, it joins the subset of jobs
waiting for the CPU. As long as there are jobs in memory waiting for the
CPU, the CPU is never idle. Choosing one out of several ready jobs in
memory for execution by the CPU is called CPU scheduling. Figure 12.2
shows a multi programmed batch system.
Operating system
Job 1
Job 2
Job 3
Job 4
Figure 12.2: Multi Programmed Batch System
Self-Assessment Questions
12. The technique of swapping items between the memory and storage is
knows as ___________.
13. What type of address is generated by the CPU?
14. ___________ is used to map the logical addresses to physical
addresses.
media are magnetic tape, magnetic disk and optical disk. Each of these
media has its own properties like speed, capacity, and data transfer rate
File management is responsible for the following activities:
Creation and deletion of files.
Creation and deletion of directories.
Support of primitives for manipulating files and directions.
Mapping of files onto secondary storage.
Backup of files on stable storage media.
4. Input Output (I/O) System Management
I/O system keeps status of I/O devices and is referred as I/O traffic
controller. The I/O subsystem consists of general device driver interface,
drivers for specific hardware devices and a memory management
component that includes buffering, caching and spooling. I/O subsystem
hides the peculiarities of specific hardware devices from the user. Only the
device driver knows the peculiarities of the specific device to which it is
assigned.
The I/O system consists of:
– Buffer-caching system
– General device-driver interface
– Drivers for specific hardware devices
5. Secondary Storage Management
Normally systems have numerous levels of storage, including primary
storage, secondary storage and cache storage. Instructions and data must
be placed in primary storage (RAM) or cache to be referenced by a running
program. Because main memory is too small to accommodate all
information, and information is lost when power is OFF, the computer
system must provide secondary storage to back up main memory.
Secondary storage consists of hard disks, CD and other media designed to
hold information.
Secondary storage management is responsible for the following activities:
Scheduling the requests for memory access.
Managing the free space available on the secondary-storage device.
Allocation of storage space when new files have to be written.
6. Networking
The computer systems communicate with one another through
communication lines called network. The communication-network design
must consider with different parameters while designing the networks such
as topology of network, type of network, communication protocols and
security.
7. Protection System
If a computer system has users and allows the concurrent execution of
processes, then various processes must be protected from one another's
activities. Protection refers to the mechanism for controlling the access of
resources (defined by computer system) by the processes. The major role
of protection in the computer system is to provide mechanisms to enforce
polices which govern by the system resources.
8. Command Interpreter System
A command interpreter is an interface between operating system and the
user. In UNIX and MS-DOS, operating system command interpreter is a
special program. When users login the first time or when a job is initiated,
operating system is included in the kernel. A control statement is processed
by the command interpreter. Command interpreter reads the statement,
analyses it and carries out the required action.
Self-Assessment Questions
15. Deadlock handling mechanism is provided by _________.
16. __________ is responsible for mapping of files onto secondary storage.
17. The processors communicate with one another through communication
lines called ____________.
conveniently run programs. The user does not have to worry about the
memory allocation or multitasking. These things are taken care of by the
operating systems. Running a program involves allocating and de-allocating
memory, as well as CPU scheduling in case of multi-process. These
functions cannot be given to the user-level programs. So user-level
programs cannot help the user to run programs independently without help
from operating systems.
2. Input Output Operations
Every program needs an input and produces an output. The operating
systems hide the details of hardware from the user for the input and output
operations. The operating system, by providing input output operations,
makes it convenient for the users to run programs.
3. File System Manipulation
The output of a program may need to be written into new files or input taken
from some files. The operating system provides this service. The user does
not have to worry about secondary storage management. User gives a
command for reading or writing to a file and sees his or her task
accomplished. Thus operating system makes it easier for user programs to
achieve their task.
This file system manipulation involves secondary storage management. The
speed of I/O that depends on secondary storage management is critical to
the speed of many programs and hence, the operating systems manage it,
rather than giving individual users the control of it.
4. Process Communication
To exchange information with each other, there are instances where
processes need to communicate. It may be between processes running on
the different computers or on the same computer. By providing this service,
the operating system relieves the user from the worry of passing messages
between processes. It can be done by the user programs, if the messages
need to be passed to processes on the other computers through a network.
The user program may be customized to the specifications of the hardware
through which the message transits and provides the service interface to the
operating system.
5. Error Handling
The operating system constantly needs to be aware of possible errors.
Errors may occur in the CPU and memory hardware, in I/O devices (such as
connection failure on a network, lack of paper in the printer) and in the user
program (such as arithmetic overflow, an attempt to access an illegal
memory location). For each type of error, the operating system should take
the appropriate action to ensure correct and consistent computing.
Self-Assessment Questions
18. Mention any two operating system services.
19. In error handling, an error may occur in the CPU, memory hardware,
I/O devices and in the user program. (True/False)
computer system without your knowledge. Viruses are very dangerous and
it can delete user files, modify user files and crash systems. As a user
accesses the information, the virus starts getting inserted in other files or
programs and can make the system unusable for the user.
‘Prevention is better than cure’- as the saying goes, there is no good cure
available after infection. One of the safest ways to prevent virus attacks is to
use legal copies of software. Also system needs to be protected against use
of unauthorized or unchecked hard disks.
Self-Assessment Questions
20. __________ is a process of verifying whether a person is authorized to
access the computer or not.
21. Viruses are very dangerous and it can delete user files, modify user
files and crash systems. (True/False)
12.9 Summary
Let’s recapitulate the important points in this unit:
An operating system or OS is a computer program that enables
computer hardware to communicate and operate with the computer
software.
The main function of an operating system is to control and use the
resources of a computer system.
Most operating systems perform different functions such as Process
Management, Memory Management, Input and Output Management,
File System Management, Priority Management, Error Detection,
Command Execution, Co-Ordination, Data-Integrity and User Interface.
Developmental stages of operating systems such as, Early Systems,
simple batch systems, Multiprogrammed Batch Systems, Time Sharing
Systems, Distributed Systems and Real-Time Operating System.
Virtual memory is a feature of an operating system that temporarily
transfers data from RAM to hard disk.
Operating system security means protecting the operating system from
viruses and unauthorized access.
12.11 Answers
Self-Assessment Questions
1. Operating System
2. Process Management and Memory Management
3. File System Management
4. Priority Management
5. Simultaneous Peripheral Operation OnLine.
6. SPOOLING
7. CPU scheduling
8. Multiprogramming
9. Multiprogramming
10. Distributed
11. Hard-Real Time System and Soft-Real Time System
12. Paging
13. Logical
14. Page table
15. Process management
16. File management
17. Network
18. Input Output Operations and Process Communication
19. True
20. Authentication
21. True
Terminal Questions
1. The most important type of system software is an operating system. An
operating system has three main responsibilities first one is, Perform
basic tasks, such as recognizing input from the keyboard, sending
output to the display screen, keeping track of files and directories on the
disk and controlling peripheral devices such as disk drives and printers.
(Refer to section 12.2)
2. Most operating systems perform the various functions such as Process
Management, Memory Management, Input and Output Management,
File System Management, Priority Management. (Refer to section 12.3)
3. There are different systems for development of operating systems such
as early systems, simple batch systems, multi-programmed batch
systems and many more. (Refer to section 12.4)
4. One of the features of an operating system is virtual memory, which
temporarily transfers pages from RAM to hard disk. (Refer to section
12.5)