Professional Documents
Culture Documents
1.1Introduction
An operating system is a program that manages the computer hardware. It also provides a basis
for application programs and acts as an intermediary between a user of a computer and the computer
hardware.
Operating System
Computer Hardware
It is the first computer used to tackle many commercial and scientific applications.
It has the following systems.
1. Batch Systems
2. Multiprogrammed Systems
3. Time – Shared Systems.
1. Batch Systems:
1
1. card readers
2. tape drivers
The common output devices are:
1. Line printers
2. Tape drives
3. Card Punches
The user did not interact directly with the computer systems. Using I/O devices, the process of
user can interact with the computer system.
Example:
P1, P2, P3
Processes
If we execute each process one by one means, it takes more time to execute.
To speedup processing,
Programs are batched together and executed. The result sent back to the appropriate
programmer.
In this execution environment, CPU is often idle. Because, if any one process wants to
performs I/O operations, CPU sit idle. To overcome this difficulty Multiprogramming system can be
used.
Operating System
2. Multiprogrammed system:
Operating System
0
Job1
Job2
Job3
Job4 2
512k
1.4Multiprocessor Systems
3
2. Economy of scale
It saves more money because, it shares the resources between the processors.
3. Increased reliability
If functions can be distributed among several processors, then the failure of one
processor will not halt the system, only show it down
If we have ten processors, if one processor gets failed means, remaining 9
processor will take the responsibility of failed processor. thus the entire system runs only
10% slower speed than normal speed. This is called graceful degradation.
Systems designed for graceful degradation are also called fault tolerant.
It is used for detecting, diagnosing and correcting the failures.
It has two processor
1. primary
2. backup
Two copies are maintained in each processor. If one gets failed, other will take
responsibility of failed processor.
1. Symmetric Multiprocessing (SMP)
• Symmetric Multiprocessing, in which each processor runs a copy of
the OS and these communicate with one another as needed
2. Asymmetric Multiprocessing (ASMP)
• Asymmetric Multiprocessing acting as a Master – Slave relationship.
One acting as a client and other acting as a server. If one gets failed
means, other will take copy, it doesn’t perform the operations.
Memory
4
Instead, each processor has its own local memory. The processors communicate with one
another through various communication lines such as high speed lines or telephone lines.
It has four systems.
1. Computer Networks
2. Client – Server systems
3. Peer – to – Peer systems
4. Distributed operating systems.
1. Computer Networks
A network communication path between two or more systems. It depends on networking for
their functionality. Networks vary by the protocols used, the distance between nodes, and transport
media. It needs an interface device a network adapter.
It deals with
LAN Local Area Network
Computers within a room, floor or a building
WAN Wide Area Network
Usually links buildings, cities or countries.
MAN Metropolitan Area Network
It could link buildings within a city.
Server
5
In a Peer – to Peer systems, services can be provided by several nodes distributed throughout the
network.
In this, a node first join the network of peers, once a node has joined the network, it provides
services to requesting and response services are accomplished in following ways:
1. when a node joins network, it register its service and its centralized service on the network.
2. Client acting as a client must first discover what node provides a desired service by
broadcasting a request for the service to all other nodes in the network.
A network operating system that provides features such as file sharing across the network and
that includes communication schemes that allow different processes on different computers exchange
messages.
What are the project or applications are mapped with Real time applications can be referred as
Real time systems.
It has 2 types
1. Hard Real Time Systems
2. Soft Real Time Systems.
6
• Most advanced features of OS features absent too.
A bit, called mode bit and the hardware (means resources of the program) to indicate
current mode
User mode 1
Monitor mode 0
Bit checks whether task performs on behalf of OS or an behalf of the user.
At system boot time, the hardware starts in monitor mode. The operating system is then loaded
and starts user processes in user mode. Whenever trap/interrupt occurs, hardware switches from user
mode to monitor mode.
The lack of a hardware supported dual mode can cause serious shortcomings in the operating
system.
I/O protection:
7
To prevent users from performing illegal I/O are define all I/O instructions to be privileged
instructions. Thus users cannot issue I/O instruction directly, they must do it through the OS by means
of a system call.
.
1. trap to monitor read 2. perform I/O
. 3. return to user
system call n
User program
.
Memory protection
• To ensure correct operation, we must protect the interrupt vector from modification by a
user program.
• Two registers are used
1. Spooling
2. Buffering
• We can provide this protection by using two registers.
1. Base registers -> smallest legal physical memory address.
2. Limit register -> size of the range.
0
Monitor
256000
Job1
300040 300040 base register
Job2
420940
Job3 120900 Limit register
880000
Job4
10240000
8
The base and limit register can be loaded only by the operating system.
CPU Operation
Protectin cpu, by ensuring OS maintain control. We must prevent stuck from the user
program by using timer.
- A timer can be set to interrupt the computer after a specified period. The period
may be fixed / variable.
- maintains time and time slicing
Base + limit
Address yes no
CPU
>= <
no no
36000 > 35000 (yes) => 36000 < 37000 (yes) => fetches into memory
We can create a system as large and complex as an operating system only by partitioning it into
smaller pieces, each piece should be a well – defined portion of the system, with carefully defined
inputs, outputs and functions.
9
• File Memory Management
• Secondary storage Management
• Networking Management
• Protection Management
• Command – Interpreter System
Process Management
Here program is a passive entity, such as the contents of a file stored on disk, whereas process is
an active entity, with a program counter specifying the next instruction to execute. The execution of a
process must be sequential.
The operating system is responsible for the following activities in connection with process
management:
• Creating and deleting both user and system processes.
• Suspending and resuming processes.
• Providing mechanisms for process synchronization.
• Providing mechanisms for process communication.
• Providing mechanisms for deadlock handling.
The main memory is central to the operation of a modern computer system. Main memory is a
large array of words or bytes, ranging in size form hundreds of thousands to billions. Each word or
byte has its own address. Main memory is a repository of quickly accessible data shared by the CPU
and I/O devices.
Many different memory – management schemes are available, and the effectiveness of the
different algorithms depends on the particular situation.
The operating system is responsible for the following activities in connection with memory
management:
• Keeping track of which parts of memory are currently being used and by whom.
• Deciding which processes are to be loaded into memory when memory space becomes
available.
• Allocating and de allocating memory space as needed.
File Management
10
File management is one of the most visible components of operating systems. Computers can
store information on several different types of physical media. Magnetic tape, Magnetic disk and
optical disk are the most common media. Each of these media has its own characteristics and physical
organization. Each medium is controlled by a device, such as a disk drive or tape drive, that also has
unique characteristics. These properties include access speed, capacity, data transfer rate and access
method.
The operating system is responsible for the following activities in connection with file
management:
• Creating and deleting files
• Creating and deleting directories
• Supporting primitives for manipulating files and directories
• Mapping files onto secondary storage
• Backing up files on stable (nonvolatile) storage media.
I/O System Management
One of the purposes of an operating system is to hide the peculiarities of specific hardware
devices form the user.
The I/O subsystem consists of
• A memory – management component that includes buffering, caching and spooling.
• A general device – driver interface.
• Drivers for specific hardware devices.
The main purpose of a computer system is to execute programs. These programs, with the data
they access, must be in main memory, or primary storage, during execution.
The operating system is responsible for the following activities in connection wit disk
management:
• Free – space management
• Storage allocation
• Disk scheduling.
Networking
Distributed system is a collection of processors that do not share memory, peripheral devices, or a
clock.
Each processor has its own local memory and clock, and the processors communicate with one
another through various communication lines, such as high – speed buses or networks.
The processors in a distributed system vary in size and function. They may include small micro
processors, workstations, minicomputers and large, general – purpose computer systems.
Protection System
If a computer system has multiple users and allows the concurrent execution of multiple proceses,
then the various processes must be protected from one another’s activities.
11
Protection can improve reliability by detecting latent errors at the interfaces between component
subsystems. Early detection of interface errors can often prevent contamination of a healthy subsystem
by another subsystem that is malfunctioning.
One of the most important systems programs for an operating system is the command interpreter,
which is the interface between the user and the operating system.
Some of the operating systems include the command interpreter in the kernel.
When a new job is started in a batch system, or when a user logs on to a time – shared system, a
program that reads and interprets control statements is executed automatically.
This program is sometimes called the control – card interpreter or the command- line interpreter,
and is often known as the shell.
Its function is simple. To get the next command statement and execute it.
Handled systems includes personal Digital Assistants (PDAs) such as palm, pocket – pcs/ cellular
telephones.
The main challenge of this type system is to make limited size of the system.
So, it holds small amount of storage space. One approach for displaying the content in webpage in
web clipping where only a small subset of a web page is delivered and displayed on the handheld
device.
An operating system provides an environment for the execution of programs, one set of OS
services provides functions that are helpful to the user.
1. Program execution:
The system must be able to load a program into memory and run that program.
2. I/O Operations:
A running program may require I/O which may involve file or an I/O device.
3. File System manipulation:
Programs need to read and write files and directions. They also need to create and delete
then by name, search for a given file, and list file information.
4. Communications:
One process needs to communicate with another process by exchanging or passing
messages between them.
5. Error detection:
The OS constantly needs to be aware of possible error. Errors may be detected by OS in
the programs.
6. Resource Allocation:
When there are multiple users or multiple jobs running at the same time, resources must be
allocated to each of them. Different types of resources are managed by the OS.
12
OS allocates, what are the resources are required to execute the program which can be
done by OS.
7. Accounting:
• It maintains what are the resources are used for the program.
• Status of the program.
• Condition code (CC) of the program can be maintained by OS.
8. Protection and Security:
Protection involves ensuring that all access to system resources is controlled security of the
system from outsiders is also important.
- System call provide the interface between a process and the operating system. These calls
are available in assembly language instructions.
- Certain systems allow calls to be made directly from a higher level language program.
- To include function call. In terms of user defined program, contains two parts
1. Main program
2. function
Which is invoked by the call statement.
- The user can then use the mouse to select the source name, and a window can be opened for
the destination name to be specified. It require many I/O system calls.
- Once the two files names are obtained program must open the input file and create the
output file. Each operations require another system call if we are opening file means OS checks
whether the proper is existing / not. If the input file exists, we must create the output file. Each
requires system call.
- System calls over in different ways, depending on the computer use. Often, more inform is
required than simply the identity of the desired system call. The exact type and amount of
information vary according to the particular operating system and call.
- Three general methods are used to pass parameters to the operating system.
1. The simplest approach is to pass the parameters in registers.
2. In some cases, there may be more parameters in registers. Here paramentes are
and address of the block is passed as a parameter in a register.
3. Parameters stored in stack => PUSH approach.
Load address x
13
1. process control
2. file management
3. device management
4. information management
5. communications.
Process Control
A running program needs to be able to halt its execution either normally / abnormally.
A program in execution can be referred as process. Process can be controlled by detecting the
errors. Using following objectives process can be controlled.
1. end , abort
2. load, execute
3. create process, terminate process
4. get process attributes, set process attributes
5. wait for time
6. wait event, signal event
7. allocate and free memory.
end means, if the program is successfully completed. Abort means, if the program is not
successfully completed, then this program will be aborted.
at initial stage program will be loaded from main memory to buffer and executed.
getting attributes of the process such as,
• name of the process
• memory space
• speed execution of the process
• what are the resources are utilized.
Depends on this information it sets the attribute. If memory space needed for storing of
program, which can be allocated, if a program can be deleted from the secondary storage, free
space can be managed for the future use. Free memory
Process
Free memory
Command interpreter
Command interpreter
kernel
kernel
At system startup
Running a program
FIG: MS – DOS execution
14
At system startup, free memory, command interpreter and kernel is available because no process
is loaded.
During execution of a program, free memory, process, command interpreter and kernel is
available.
If we run more number of programs, structure looking like the following
Process D
Free memory
Process C
Interpreter
Process B
Kernel
File Management
File manipulation are performed.
They are
File creation
Deletion
Renaming a file
Modifying a file contents
Creating files and directories are performed.
Device Management
A program as it is running may need more resources. Additional resources are more money, more
clock, more I/O devices of the system has multiple users, we must first request the device, to ensure
exclusive use of it. After we finished the device, we should release the device.
Information Management
15
System maintaining the following information
1. system have a system call to return the current time and date.
2. other system call may return information about the system, such as the number of current
users, the version number of the OS, the amount of free memory or disk space and so on.
3. it also maintains get process attributes and sets process attributes.
Communication:
There are two common models for communication
1. message passing model
2. shared memory model
In message passing model, information is exchanged through an interprocess – communication
facility provided by the OS.
Before communication can take place, a condition must be opened. The name of the other
communicator must be known be it another process on the same CPU / Process on another
computer connected by a communications network.
Process A Process A
M
Shared memory
Process B M
Process B
Kernel M Kernel
In shared memory, processes use map memory system calls to gain access to regions of
memory owned other processes. They may then exchange information by reading and writing data in
the shared area. Process 1 / shares memory and process 2 shares memory.
System programs provide a convenient environment for program development and execution. It
can be divided into following categories.
1. File Management
These programs create, delete, copy, rename, print, dump, list and manipulate files and
directories.
2. Status Information
16
It deals with the amount of memory or disk space, numbers of users, date , time / similar status
information.
3. File Modification
Before modifying files, we should check whether the file is existing / not. If it is existing we
can modify the files, if not error occurs.
6. Communication
Each process should be communicated by passing messages. Since it is sharing the resources
between then.
In addition to system progress, most OS an supplied in the programs that are useful in solving
common problems or performing common problems.
Performing common operation
Such programs include web browsers, word processors and text formatters,
spreadsheets, database system – complier , plotting and statistical analysis packages and ganus.
These programs are known as system utilities or application programs.
Monolithic kernels (the ``big mess'' according to Tanenbaum) led to interest in more structured
operating systems, such as layering and better structuring. Look at Unix history and slide.
From there work began on taking functionality out of the kernels and making them much smaller--
``micro'' versions.
Microkernels
Look at organization in Figure 4.9 (Stallings). Layered operating system example is Xinu-- ``a small,
elegant operating system''.
Benefits of microkernels:
17
• reliability--smaller kernel makes its implementation likely to be more reliable. Also more well-
defined APIs.
• distributed system support--pieces can be on another machine.
• object-oriented operating system--architecture works in OO context.
Performance of such microkernels (Mach and Chorus) has been the concern. Approaches to improve
performance (co-location of services in the kernel) go against microkernel idea.
One such system is Mach, which was developed at CMU. Mach was used as the basis for work on
OSF/1, which was adopted by some companies such as Digital. The version of OSF/1 running on
Digital Alpha machines is currently known as Digital Unix.
Single-user, multitasking operating system designed to run on a variety of PCs and workstations.
Uses a modified microkernel architecture (Figure 2.13)--some system services are in the kernel for
performance reasons.
The server processes at the user level basically provide different interfaces. Most common is Win32
subsystem--in fact other user-level services must go through Win32 subsystem.
Virtualization can be used to run different applications that are each compatible with different
operating system (OS) versions on the same server. For example, an accounting system that requires
Windows NT Server 4.0 might be installed on a virtual machine with a Windows NT 4.0 OS, even if
the server on which the virtual machine is installed is running Windows 2000 Server. Virtualization
also might be used in a development environment to test applications on different OS’s. This brief
18
describes virtualization and alternative technologies, covers several volume licensing issues related to
virtual machines, and offers answers to FAQs.
Virtualization is one of several technologies that enable multiple applications and, in some
cases, multiple operating systems to function simultaneously on the same hardware. The main
alternatives to virtualization are workload management and partitioning. Each offers a solution to a
different set of customer needs.
Virtual machines offer maximum flexibility by giving system administrators a quick and easy
way to establish different OS environments on a single physical machine. The OS environments are
logically isolated from each other, but share many of the same hardware and software resources of the
server, including its processors. Consequently, a failure on any of these shared resources can affect
multiple virtual machines.
Examples of virtualization
Example 1: Customer migrates a legacy line-of-business (LOB) application from a 1-way server
running Windows NT 4.0 onto a 2-way server running Windows Server 2003 with a virtual machine
running Windows NT 4.0
19