0% found this document useful (0 votes)
10 views15 pages

Introduction to Operating Systems

Anyone looking to get into details of what an operating system is and how it came to be can start with this document. You can find in here what an operating system is, how it evolved over the years and how it runs

Uploaded by

stuckatsharda
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views15 pages

Introduction to Operating Systems

Anyone looking to get into details of what an operating system is and how it came to be can start with this document. You can find in here what an operating system is, how it evolved over the years and how it runs

Uploaded by

stuckatsharda
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Unit – 1(Introduction)

Definition:- Operating system is an integrated set of programs which are used to manage various resources
and overall operations of a computer system. It acts as an interface between user and computer hardware.

Objective:-
1. Convenience: O.S. makes a computer more convenient to use.
2. Efficiency: O.S. allows the computer system resources to be used in an efficient manner.
3. Ability to evolve: O.S. should be constructed in such a way as to permit the effective development, testing
and introduction of new system.

Components of Computer system: Computer system can be divided into five components.
1. Hardware
2. Operating system
3. Utility Programs
4. Application Program
5. Users
Hardware: (provides the basic computing resources)

I. Central Processing Unit (CPU)


II. Memory
III. I/O Devices

Operating System: Operating system controls and coordinates the use of H/W among the various application
programs for the various users.

Utility Programs: Help in creation, debugging and compilation of programs

Application Program: (i) Data base system (ii) Games and Business Programs

Users: Users submit their requests.

Operating System as user/computer Interface:-


End user views a computer system in terms of a set of applications. An application can be expressed in a
programming language and is developed by an application programmer. If one were to develop an application
program as a set of machine instructions that is completely responsible for controlling the computer hardware, one
would be faced with an overwhelmingly complex task. To ease this task, a set of system programs is provided.
Some of these programs are referred as utilities. These implement frequently used functions that assist in program
creation, management of files and control of I/O devices. A program will make use of these facilities in developing
an application and the application while it is running, will invoke the utilities to perform certain functions. The
most important system program is Operating System. The operating system masks the details of the hardware from
the programmers and provides the programmer with a convenient interface for using the system. It acts as a
mediator making it easier for the programmer and for application programs to access and use those facilities and
services.

End Programmer
User

OS
App Programs
Designer
Utilties
Operating System

Hardware

Layers and View of Computer System

Operating System Services:-


1. Program development: O.S. provides a variety of facilities and services such as editors and debuggers, to
assist the programmer in creating programs. These services are in the form utility programs that while not strictly
part of the core of O.S. are supplied with their O.S. and are referred to as application program development tools.
2. Program execution: A number of tasks need to be performed to execute a program. Instructions and data
must be loaded into main memory, I/O devices and files must be initialized and other resources must be prepared.
The Operating System handles these duties for the user.
3. Access to I/O devices: Each I/O device requires its own peculiar set of instructions or control signals for
operation. The OS provides a uniform interface that hides these details so that programmer can access such devices
using simple reads and writes.
4. Controlled access to files: In the case of files, for the OS, control must include a detailed understanding of
not only the nature of the I/O Device but also the structure of the data contained in the files on the storage medium.
Further in case of system with multiple users, the OS may provide protection mechanisms to control access the
files.
5. System access: In the case of a shared or public system, the OS controls access to the system as a whole
and to specific system resources. The access function must provide protection of resources and data from
unauthorized access and must resolve conflicts of resource contention.
6. Error detection and Response: A variety of errors can occur while computer system is running. These
include internal and external hardware errors, such as memory error or a device failure or malfunction and various
software errors such as arithmetic overflow, attempt to access forbidden memory location and inability of the OS to
grant the request of an application. In each case OS must provide a response that clears the error condition with the
least impact on running applications. The response may range from ending the program that caused the error to
retry the operation, to simply reporting the error to the application.
7. Accounting: A good OS will collect usage statistics for various resources and monitor performance
parameters such as response time. This information in useful in anticipating the need for future enhancement and in
tuning the system to improve performance. On multiuser system, information can be used for billing purposes.

Operating System as a resource manager


Computer system has many resources

I. H/W and S/W


II. CPU Time
III. Memory Space
IV. File Storage Device
V. I/O Devices
Operating system acts as the manager of these resources and allocates them to specific program and users to perform
specific task and deallocates these resources when not required. A portion of OS is in main memory. This includes
the kernel or nucleus which contains most frequently used functions of OS and at a given time other of OS currently
in use. Remainder of memory contains user programs and data. the allocation of this resource(main memory) is
controlled jointly by OS and memory management hardware in the processor. The OS decides when an I/O device
can be used by a program in execution and controls access to and use of files. The processor itself is a resource and
OS must determine how much processor time is to be devoted to the execution of a particular user program

Evolution of Operating System-


1. Serial Processing
2. Simple Batch system
3. Multiprogrammed Batch system
4. Multi-tasking/Time Sharing system
5. Personal Computer system
6. Parallel system/Multiprocessor System
7. Multithreaded Systems
8. Distributed system
9. Real Time System
1. Serial processing:
Programs were submitted for execution in sequence, one at a time. Disadvantages were:

1.1 Scheduling: Users used to reserve computer time in advance. If errors occurred in programs then program
was returned to user. User had to correct errors and needed to reserve computer time again. If program
finished before reserved time, then remaining time was wasted.
1.2 Setup Time: Considerable time was required in setting up system. Programs were entered through card
reader machine. Tapes of required translators were loaded and unloaded. Same steps were needed to repeat
for all users.
2. Simple batch system:

In early ages of computers operating system was fairly simple. Its main task was to transfer control automatically
from one job to the next. To speed up processing jobs with similar needs were batched together and run through the
computer as a group. Thus, the programmers would leave their programs with the operators. The operators would
sort programs into batches with similar requirements and run each batch. The output from the each job would be
sent back to the appropriate programmers. A batch operating system normally reads a stream of separate job. Each
job had its own control cards that predefines what the job does. When the job is completed its output usually printed
on line printer. The main feature of a batch system is the lack of interaction between the user and the job while the
job is executing.

Note:The delay between the job submission and job completion is called Turnaround time.
In this execution environment the CPU is often ideal because of speed of mechanical I/O devices are slower than
electronic [Link] a slow CPU in the range of micro seconds can executes 1000 instructions per seconds and a
fast card reader on the other hand might reads 1200 cards/minutes.

To improve its performance, a technique SPOOLing(Simultaneous Peripheral Operation Online) was evolved. Input
cards of all jobs were read into disk. So when a program was executed input was given from disk rather than card
reader machine, thus made system faster. Similarly when the job requested the printer to output file that file was
copied into the system buffer and was written to the disk. When the job was completed the output was actually
printed on line printer from the disk. This form of processing was called SPOOLing.

Card Reader CPU Line Printer


Spooling

3-Multiprogrammed Batch Systems

OS

Job 1

Job 2

Job 3

Job 3

Multiprogramming- Multiprogramming is interleaved execution of two or more programs simultaneously.


Multiprogramming became possible with the technique of Spooling.

A pool of jobs on disk allows the operating system to select, which job to run next to increase CPU utilization.
When jobs come in directly on cards or even on magnetic tape, it is not possible to run job in a different order. Jobs
must be run sequentially or FCFS method. In a multiprogramming system, the OS simply switches to and executes
other jobs. When that job needs to wait, the CPU switched to another job and so [Link] long as there are always
some jobs to execute, CPU will never be idle.

Advantages of Multiprogrammed Batch System


1. Waiting time is very less.
2. Efficient use of memory and I/O devices.
3. Increased CPU utilization.
4. Higher throughput.

Idle State

Process P0

Process P1 ----------------Waiting Time------------------à

Mono programming

Process P0 _________ _ _ _ _ _ _ ____________ _ _ _ _ _ _ _


Process P1 _ _ _ _ _ _ __________ _ _ _ _ _ _ _ ____________

Multiprogramming

4-Time-Sharing System

Multiprogrammed Batch System provides an environment where the various system resources as CPU, Memory and
I/O devices are utilized efficiently.

Difficulties with the Batch System from the User Point of View --
User cannot interact with the job when it is executing, the user must setup the control cards to handle all possible
outcomes. In multiple jobs, subsequent steps may depend on the result of: -

1. The running of a program may depend on successful completion. It can be difficult to define completely
what to do in all cases.
2. Another difficulty, that programmer cannot modify a program as it executes.

Time Sharing or Multi Tasking is logical extension of multiprogramming. Multiple jobs are executed by the CPU
switching between them, but the switches occurs so frequently that the users may interact with each program while it
is running.

Time sharing systems were developed to provide interactive use of a computer system at a reasonable cost. A time
shared OS uses CPU scheduling and multiprogramming to provide each user with a small portion of a memory.

5. Personal Computer System

As hardware costs have decreased, it has become feasible to have a computer system dedicated to a single
[Link] types of computer systems are usually referred as a personal computer system. The I/O has changed to
monitors, keyboard and [Link] computers appear in 1970s. They are microcomputers that considerably
smaller and less expensive than the other [Link] operating system therefore were neither multi user nor multi
tasking. However the goal of these OS have changed with time instead of maximizing CPU and peripherals
utilization.

6-Parallel Systems/Multiprocessor Systems

Multiprocessor OS-

Most systems till two decades ago were single-processor systems i.e. they have only one main CPU. However Now
there is a trend towards multi processor [Link] systems have more than one processor in close
communication, sharing the computer bus, the clock and sometime memory and peripherals [Link] systems
are referred to as tightly coupled systems. There are several reasons for building such systems.

Execution of two or more programs or more than one instructions of same programs exactly simultaneously by more
than one processor is multiprocessing. Until recently virtually all single user personal computers and workstations
contained a single general purpose microprocessor. As demands for performance increase and as the cost of
microprocessors continues to drop, vendors have introduced computers with multiple microprocessors. To achieve
greater efficiency and reliability, one technique is to employ symmetric multiprocessing, a term that refers to
computer hardware architecture and and also to operating system that reflect that architecture.

Symmetric Multiprocessor System


1. A symmetric multiprocessor system has multiple processors, share same main memory,
I/O facilities interconnected by a communication bus and all processors can perform same functions.(hence
symmetric),

Advantages are improved performance, Availability and incremental growth, increases throughput.

An attractive feature of SMP is that of existence of multiple processors is transparent to the user. The OS takes care
of scheduling of threads or processes on individual processor and of synchronization among processes.

2. Asymmetric Multiprocessor System- In which each processor assigned a specific task. A master processor
controls the system and the other processors either look to the master for instruction or have predefined [Link]
scheme defines a master slave relationship. The master processor schedules and allocates work to the slave
processor.

Advantages

1. Increased throughput: by increasing the number of processors we get more work done in a shorter period of
time.
2. Less cost : Multiprocessor systems can also save money as compared to multiple single systems, because
the processor share peripherals and power supplies.
3. Sharing Resources: In several programs are to operate on the same set of data, it is cheaper to store those
data in one disk and to have all processors share them, rather than to have many computer with local disk
and many copies of data.
4. Increased reliability: If one processor fails, its load can be distributed properly among remaining
processors. Thus the failure of one processor will not halt the system, but rather will only slow it down.
If we have 10 Processor and 1 Processor fails, then the rest of the 9 processors pick up the share of the work of
the failed processor. Thus the entire system runs only 10% slower rather than failed together. Systems that are
designed for graceful degradation are also called fault tolerant system.

Running Blocked Running Blocked Running


P1

Blocked Running Blocked Running


P2

Blocked Running
P3

(Interleaving :Multiprogramming, one processor)

Running Blocked Running Blocked Running


P1

Running Blocked Running


P2

Blocked Running
P3

Interleaving and Overlapping(Multiprocessing: Two processors)


7-Multithread OS-
Multithreading is a technique in which a process executing an application is divided into threads that can run
concurrently.

Thread: A dispatchable unit of work, it includes a processor context(which include program counter and stack
pointer)and it own data area for a stack. A thread executes sequentially and is interruptible so that the processor can
execute another thread. A thread is a flow of execution through the process code,with its own program counter,
system registers and [Link] are a popular way to improve application performance through parallelism. A
thread is sometimes called a light weight process. Threads represent a software approach to improving
performance of operating system by reducing the over head thread is equivalent to a classical process. Each thread
belongs to exactly one process and no thread can exist outside a process. Each thread represents a separate flow of
control.
Process: A collection of one or more threads and associated system resources(memory containing both code and
data, open files and devices). By breaking a single application into multiple threads, the programmer has great
control over the modularity of application.

Multithreading is useful for applications that perform a number of essentially independent tasks that do not need to
be serialized. An example is database server that listens for and processes numerous client requests. With multiple
threads running within same process, switching back and forth among threads involves less processor overhead than
a major process switch between different processes.

Threads have been successfully used in implementing network servers. They also provide a suitable foundation for
parallel execution of applications on shared memory multiprocessors.

8- Distributed Operating System: A recent trend in computer systems is to distribute computation among several
processors. In this type of systems, the processors do not share memory or a clock instead each has its own local
memory. A Distributed Operating System provides the illusion of a single memory space and single secondary
memory space plus other unified access facilities such as distributed file [Link] processors communicate with
each other through various communication lines, such as high-speed buses or telephone lines.

The Advantages
1. Resource sharing (remote access)- If a number of different sites are connected to one another, that a user at one
site may be able to use resources of another sites.

2. Computation speed up- If a particular computation can be partitioned into a number of sub-computations that can
run concurrently, then distributed system may allow us to distribute the computation among various sites, to run that
computation concurrently.

3. Reliability-If one site fails in a distributed system, the remaining site can potentially continue operating.
4- Communication- There are many instances in which programs needs to exchange data with one other. When
many sites connected to one another by a communication network, the processes at different site have the
opportunity to exchange information. Users may initiate file transfer or communicate with one another via e-mail. A
user can send mail to another user at the same site or at a different site. These systems are usually referred to as a
loosely couples systems or distributed system

The most recent innovation in operating system design is the use of object oriented technologies. Object Oriented
Design lends discipline to the process of adding modular extensions to a small kernel. At the OS level, an object
based structure enables programmers to customize an OS without disrupting system integrity. Object oriented also
eases the development of distributed tools and full-blown distributed OS.
9- Real Time System- RTS is a system in which correctness of the system depends not only on the logical result of
the computation, but also on the time at which results are produced. In RTS some tasks are real time tasks and have
a certain degree of urgency to them. Such tasks are attempting to control or react to events that take place in the
outside world. Because these events occur in real time a real time task must be able to keep up with the events with
which it is concerned. A deadline is always associated with such tasks where the deadline specifies either a start
time or a completion time.

RTS can be classified as hard RTS and soft RTS. A Hard RTS is one that must meet its deadline; otherwise it will
cause undesirable damage or a fatal error to the system. A soft RTS has a associated deadline that is desirable but
not mandatory; it still makes sense to schedule and complete the task even it has passed its deadline.

Characteristics of RTS-

1. Determinism- Concerned with how long an OS delays before acknowledging an interrupt. Delay should be
least.
2. Responsiveness- Concerned with how long after acknowledgment, it takes an OS to service the interrupt.
Delay should be least.
3. User Control-User control is much broader in a RTS than in ordinary OS. In a typical non RTS, the user
has either no control over scheduling decision or can provide broad guidance, such as grouping users into
more than one priority class. In a RTS it is essential to allow the user fine-grained control over task priority.
The users should be able to distinguish between hard and soft real time task and to specify relative
priorities with in each class. A RTS may also allow the user to specify such characteristics as the use of
paging or process swapping, what processes must always be resident in main memory, what disk transfer
algorithms are to be used, what rights the processes in various priority bands have and so on.
4. Reliability- Reliability is far more important for RTS than non RTS. A failure in non RTS may be solved
by simply rebooting the system. A processor failure in a multiprocessor on RTS may result in a reduced
level of service until the failed processor is repaired or replaced. But a RTS is responding to and controlling
events in real time. Loss or degradation of performance may have catastrophic consequences ranging from
financial loss to equipment damage and even loss of life.
5. Fail soft Operation- Characteristics that refers to the ability of a system to fail in such a way as to preserve
as much capability and data as possible

Operating System Structure-


As more and more features have been added to operating system and as underlying hardware become more
capable and versatile the size and complexity of operating system has grown. To manage there has been focus
over the years on the software structure of the operating systems. First modular programming was proposed but
later it was felt that even modular programming alone was not sufficient when size of OS becomes very large.
Then Concepts of hierarchical layers and information abstraction was proposed. We can view system as series of
layers. Each level performs a related subset of functions required of operating system. it relies on next lower layer
to perform more primitive functions and to conceal the details of those primitive functions. It provides services to
next higher layers. Ideally the levels should be defined so that changes in one level do not require changes in other
levels. In general lower layers deal with far shorter time scale. Some part of OS must interact directly with
hardware where events can have time scale as brief as few billionth of a second. The model consists of following
levels.

Level 1: Consists of electronic circuits where objects that are dealt with are registers memory cells, and logic
gates. The operations defined on these objects are actions such as clearing a register or reading a memory location.
Level 2: The processor’s instruction set operations at this level are those allowed in machine language instruction
set, such a add, subtract load and store
Level 3: Add the concept of a procedure or subroutine, plus the call/return operation.
Level 4: introduces interrupts which cause the processor to save the current context and invoke an interrupt
handling routines.
these first four levels are not part of operating system but constitute the processor hardware. However some
elements of OS begin to appear at these levels such as interrupt handling routines. It is at level 5 we begin to reach
the OS proper and concept associated with multiprogramming begin to appear
Level 5: notion of a process as a program in execution is introduced at this level. Fundamental requirements on
the OS to support multiple processes include the ability to suspend and resume processes. This requires saving
hardware registers so the execution can be switched from one process to another.
Level 6: deals with secondary storage devices of the computer. function of positioning the R/W heads and actual
transfer of block of data occur. Level 6 relies on level 5 to schedule the operation and to notify the requesting
process of completion of an operation.
Level 7: creates a logical address space for processes. This level organizes the virtual address space into blocks
that can be moved between main memory and secondary memory using schemes of fixed size pages, variable size
segments and those using both.
Up to this point OS deals with resources of a single processor. Beginning with level 8 OS deals with external
objects such that peripheral devices, and networks and computers attached with networks.
Level 8: Deals with communication of information and messages between processes. Level 5 deals with primitive
signal mechanism that allowed for synchronization of processes, this level deals with richer sharing of
information. one of the most powerful tools for this purpose is pipe which is a logical channel for the flow of data
between processes.
Level 9: Supports the long term storage of named files. Here data at secondary storage devices are viewed in
terms of abstract, variable length entities in contrast to the hardware oriented view of secondary storage in terms
of tracks, sectors and fixed size blocks at level 6.
Level 10: Provides access to external devices using standardized interfaces.

Level Name Objects Example Operation


13 Shell User programming environment Statements in shell language
12 User Processes User processes Quit, Kill, Suspend, Resume
11 Directories Directories Create, Delete,
Attach,Detach, Serach, list
10 Devices External devices such as printers, Open, Close, Read, Write
display and keyboard
9 File Systems Files Create, destroy, Open ,
Close, Read. Write
8 Communications Pipe Create, destroy, Open ,
Close, Read. Write
7 Virtual Memory Segments, Pages Read, Write, Fetch
6 Local Secondary Store Block of data, devices channels Read, Write, Allocate, Free
5 Primitive Processes Primitive processes, Suspend, Resume, wait,
Semaphores, Monitors Signal
4 Interrupts Interrupt handling programs Invoke, Mask, Unmask,
Retry3
3 Procedures Procedures, Call Stack, Display Mark Stack, Call, Return
2 Instruction Set Evaluation Stack, Load, Store, Add, Subtract,
Microprogram Branch
1 Electronic Circuits Registers, Gates, Buses Clear, Transfer, Activate,
Complement
Figure 1: OS Design Hierarchy

Level 11: Maintains the association between external and internal identifiers of the system resources and objects.
External identifier is a name that can be employed by a application and internal identifier is an address or an
indicator used by lower level of OS to locate and control an object.
Level 12: All of information needed for management of processes is supported. This includes the virtual address
space of the processes, a list of objects and processes with which it may interact and the constraints of that
interaction, parameters passed to the processes on creation and other characteristics of the processes that might be
used by the OS to control the processes.
Level 13: Provides an interface to the OS for the user called shell, it separates the user from OS details and
presents the OS simply as a collection of services.

Developments leading to modern Operating Systems-


Most Operating Systems until recently had a large monolithic Kernel. Most of what is thought of as OS
functionality was provided these large kernels including scheduling, file systems, networking, device drivers,
memory management and more.
Typically a monolithic kernel is implemented as a single process with all elements sharing the same address
space.

(a)A microkernel Architecture assigns only a few essential functions to the kernel including address spaces,
interprocess communication and basic scheduling. Other OS services are provided by processes sometimes called
servers that run in user mode and treated like any other application by the microkernel. The microkernel approach
simplifies implementation, provides flexibility and is well suited to a distributed environment. Other advantages are
uniform interfaces, Extensibility, Portability, Reliability.

(b)Multithread OS-
Multithreading is a technique in which a process executing an application is divided into threads that can run
concurrently.

Thread: A dispatchable unit of work, it includes a processor context(which include program counter and stack
pointer)and it own data area for a stack. A thread executes sequentially and is interruptible so that the processor can
execute another thread. A thread is a flow of execution through the process code, with its own program counter,
system registers and stack. Threads are a popular way to mprove application performance through parallelism. A
thread is sometimes called a light weight process. Threads represent a software approach to improving
performance of operating system by reducing the over head thread is equivalent to a classical process. Each thread
belongs to exactly one process and no thread can existoutside a process. Each thread represents a separate flow of
control.
Process: A collection of one or more threads and associated system resources(memory containing both code and
data, open files and devices). By breaking a single application into multiple threads, the programmer has great
control over the modularity of application.

Multithreading is useful for applications that perform a number of essentially independent tasks that do not need to
be serialized. An example is database server that listens for and processes numerous client requests. With multiple
threads running within same process, switching back and forth among threads involves less processor overhead than
a major process switch between different [Link] have been successfully used in implementing network
servers. They also provide a suitable foundation for parallel execution of applications on shared memory
multiprocessors.

( c) Parallel Systems/Multiprocessor Systems


Multiprocessor OS-

Most systems till two decades ago were single-processor systems i.e. they have only one main CPU. However Now
there is a trend towards multi processor [Link] systems have more than one processor in close
communication, sharing the computer bus, the clock and sometime memory and peripherals [Link] systems
are referred to as tightly coupled systems. There are several reasons for building such systems.

Execution of two or more programs or more than one instructions of same programs exactly simultaneously by more
than one processor is multiprocessing. Until recently virtually all single user personal computers and workstations
contained a single general purpose microprocessor. As demands for performance increase and as the cost of
microprocessors continues to drop, vendors have introduced computers with multiple microprocessors. To achieve
greater efficiency and reliability, one technique is to employ symmetric multiprocessing, a term that refers to
computer hardware architecture and and also to operating system that reflect that architecture.

Symmetric multiprocessor system has multiple processors, share same main memory, I/O facilities
interconnected by a communication bus and all processors can perform same functions.(hence symmetric),

Advantages are improved performance, Availability and incremental growth, increases throughput.

An attractive feature of SMP is that of existence of multiple processors is transparent to the user. The OS takes care
of scheduling of threads or processes on individual processor and of synchronization among processes.

Asymmetric Multiprocessor System is that in which each processor assigned a specific task. A master processor
controls the system and the other processors either look to the master for instruction or have predefined task. This
scheme defines a master slave relationship. The master processor schedules and allocates work to the slave
processor.

Advantages

i) Increased throughput: by increasing the number of processors we get more work done in a shorter
period of time.
ii) Less cost : Multiprocessor systems can also save money as compared to multiple single systems,
because the processor share peripherals and power supplies.
iii) Sharing Resources: In several programs are to operate on the same set of data, it is cheaper to store
those data in one disk and to have all processors share them, rather than to have many computer with
local disk and many copies of data.
iv) Increased reliability: If one processor fails, its load can be distributed properly among remaining
processors. Thus the failure of one processor will not halt the system, but rather will only slow it down.
If we have 10 Processor and 1 Processor fails, then the rest of the 9 processors pick up the share of the work of
the failed [Link] the entire system runs only 10% slower rather than failed [Link] that are
designed for graceful degradation are also called fault tolerant system.

Running Blocked Running Blocked Running


P1

Blocked Running Blocked Running


P2

Blocked Running
P3

(Interleaving :Multiprogramming, one processor)


Running Blocked Running Blocked Running
P1

Running Blocked Running


P2

Blocked Running
P3

Interleaving and Overlapping(Multiprocessing: Two processors)

(d)Distributed Operating System: A recent trend in computer systems is to distribute computation among several
processors. In this type of systems, the processors do not share memory or a clock instead each has its own local
memory. A Distributed Operating System provides the illusion of a single memory space and single secondary
memory space plus other unified access facilities such as distributed file [Link] processors communicate with
each other through various communication lines, such as high-speed buses or telephone lines. These systems are
usually referred to as a loosely couples systems or distributed system.

Advantages
1. Resource sharing (remote access)--If a number of different sites are connected to one another, that a user at one
site may be able to use resources of another sites.

2. Computation speed up- If a particular computation can be partitioned into a number of sub-computations that can
run concurrently, then distributed system may allow us to distribute the computation among various sites, to run that
computation concurrently.

[Link]- If one site fails in a distributed system, the remaining site can potentially continue operating.

4. Communication- There are many instances in which programs needs to exchange data with one other. When many
sites connected to one another by a communication network, the processes at different site have the opportunity to
exchange information. Users may initiate file transfer or communicate with one another via e-mail. A user can send
mail to another user at the same site or at a different site.
(e) Real Time System- RTS is a system in which correctness of the system depends not only on the logical result of
the computation, but also on the time at which results are produced. In RTS some tasks are real time tasks and have
a certain degree of urgency to them. Such tasks are attempting to control or react to events that take place in the
outside world. Because these events occur in real time a real time task must be able to keep up with the events with
which it is concerned. A deadline is always associated with such tasks where the deadline specifies either a start
time or a completion time.

RTS can be classified as hard RTS and soft RTS. A Hard RTS is one that must meet its deadline; otherwise it will
cause undesirable damage or a fatal error to the system. A soft RTS has a associated deadline that is desirable but
not mandatory; it still makes sense to schedule and complete the task even it has passed its deadline.

Characteristics of RTS-

i) Determinism- Concerned with how long an OS delays before acknowledging an interrupt. Delay should be
least.
ii) Responsiveness- Concerned with how long after acknowledgment, it takes an OS to service the interrupt.
Delay should be least.
iii) User Control-User control is much broader in a RTS than in ordinary OS. In a typical non RTS, the user has
either no control over scheduling decision or can provide broad guidance, such as grouping users into more
than one priority class. In a RTS it is essential to allow the user fine-grained control over task priority. The
users should be able to distinguish between hard and soft real time task and to specify relative priorities with
in each class. A RTS may also allow the user to specify such characteristics as the use of paging or process
swapping, what processes must always be resident in main memory, what disk transfer algorithms are to be
used, what rights the processes in various priority bands have and so on.
iv) Reliability- Reliability is far more important for RTS than non RTS. A failure in non RTS may be solved by
simply rebooting the system. A processor failure in a multiprocessor on RTS may result in a reduced level of
service until the failed processor is repaired or replaced. But a RTS is responding to and controlling events
in real time. Loss or degradation of performance may have catastrophic consequences ranging from financial
loss to equipment damage and even loss of life.
v) Fail soft Operation- Characteristics that refers to the ability of a system to fail in such a way as to preserve as
much capability and data as possible.

The most recent innovation in operating system design is the use of object oriented technologies. Object
Oriented Design lends discipline to the process of adding modular extensions to a small kernel. At the OS
level, an object based structure enables programmers to customize an OS without disrupting system
integrity. Object oriented also eases the development of distributed tools and full-blown distributed OS

System components/Functions of Operating system:-


We can create a large and complex system only by partitioning it into smaller pieces. Each of these pieces should be
well- defined portion of the system, with defined inputs, outputs and function. Main OS components are:

1. Process Management- OS is responsible for the following activities in connection with process management

i) Creating and deleting both user and system processes


ii) Process scheduling and Dispatching
iii) Suspending and resuming processes
iv) Process Switching
v) Providing mechanism for process synchronization and interprocess communication
vi) Management of Process Control Block
vii) Providing mechanism for deadlock handling

2. Memory Management- The OS is responsible for the following activities in connection with memory
management

i) Keeping track of which parts of memory are currently being used and by whom
ii) Deciding which processes are to be loaded into memory when memory space becomes available
iii) Allocating and deallocating memory space as needed.
iv) Page and Segment management

3. File Management- The OS is responsible for following activities in connection with File management
i) Creation and deletion of files
ii) Creation deletion of directories
iii) Supporting primitives for manipulating files and directories
iv) Mapping files onto secondary storage
v ) Backing up files on stable storage media
4. I/O Management- One of the purposes of the OS is to hide the peculiarity of specific hardware device from
the user. The I/O subsystem consists of
i) A memory management component that includes buffering, caching and spooling.
ii) A general device driver interface
iii) Drivers for specific hardware devices
iv) Allocation to I/O channel and devices to processes

5. Secondary storage Management- The OS is responsible for the following activities in connection with Disk
management
i) Free space management
ii) Storage allocation
iii) Disk scheduling
6. Networking— A Distributed Operating System provides the illusion of a single memory space and single
secondary memory space plus other unified access facilities such as distributed file system. OS usually generalize
network access as a form of file access with details of networking being contained in network interface’s device
driver. The protocols that create a distributed system can have great effect on that system’s utility and popularity.
The innovation of WWW was to create a new access method for information sharing. it improved on the existing
FTP and NFS by removing the need for a user to log in he is allowed to use a remote resource.
7. Protection System- Protection is any mechanism for controlling the access of programs, processes, or users
to the resources defined by a computer system. Protection mechanism ensures that the files, memory segments,
CPU and other resources can be operated on by only those resources that have gained proper authorization from the
OS.
8. Command-Interpreter System- Command Interpreter is the interface between user and the OS. Some OS
include the command Interpreter in the kernel. Other OS such as MS-DOS and UNIX treat the command
interpreter as a special program that is running when a job is initiated or when a user first logs on.

System Calls- S.C. provide the interface between process and the OS. These calls are generally available as
assembly language instructions and they are usually listed in the various manuals used by the assembly language
programs.
Certain systems allow system calls to be made directly from a higher level language program in which case the
calls normally resemble predefined function or subroutine calls. They may generate call to a special run time
routine that makes the system call or system call may be generated directly in –line. Several languages such as
C/C++ have been defined to replace assembly language for system programming. These allow system calls to be
made directly. For example UNIX system calls may be invoked directly from C/C++ program. System calls for
modern Windows platform are part of Win32 API, which is available for use by all the compilers written for
Microsoft Windows.
For example in C/C++ while dealing with files we use read (), write () to read from and write into files. These
functions result in calls to corresponding read () and write () systems calls relieving users from details of managing
files.

Reentrant Kernel- A useful concept, particularly in a system that supports multiple users at the same time
is that of reentrant procedure. A reentrant procedure is one in which a single copy of program code can be shared
by multiple users during the same period of time. Reentrancy has two concepts: The program code cannot modify
itself and local data for each user must be stored separately. A reentrant procedure can be interrupted and called by
an interrupting program and still execute correctly upon return to the procedure. In shared system reentrancy allows
more efficient use of main memory: One copy of program code is kept in main memory but more than one
application can call the procedure Thus a reentrant procedure must have a permanent part( the instruction that
makes up the procedure) and a temporary part ( a pointer back to the calling program as well as memory for local
variables used by the program). Each execution instance called an activation of a procedure will execute the code in
the permanent part but must have its own copy of local variables and parameters. The temporary part associated
with a particular activation is referred to as an activation record. The most convenient way to support reentrant
procedures is by means of a stack. When an reentrant procedure is called, the activation record of the procedure can
be stored on stack. Thus activation record becomes part of the stack frame that is created on procedure call. For
example a procedure to take input from keyboard and pass it to processor may be shared concurrently by several
running processes. Each process share it but has separate data area .
The Kernels which support reentrant procedures are called Reentrant kernels

Modes of execution-Most processors support two modes of execution. Certain instructions can only be
executed in more-privileged mode. These would include reading or altering a control register, program status word,
primitive I/O instructions and instructions related to memory management.. In addition certain regions of memory
can only be accessed in the more-privileged mode. The more-privileged mode is called kernel mode/system
mode/control mode. The less-privileged mode is often referred to as the user mode, because user programs
typically would execute in this mode. In this mode, privileged instructions cannot be executed. So less privileged
mode restrict user processes to access forbidden area in system.

Offline, Online and Real Time Processing-

Offine- Here user interaction is almost nil. User submit data and processing is done at some convenient time
later on. Batch systems are example of offline processing.

Online-Most of systems now are online systems. Here user can interact with system instantly. A C program
running on PC asking for input is online processing. Web search is online.

RTS- Defense system In RTS a time deadline is associated. Generally some event happening outside of system
affect the processing of system.

Kernel- A portion of OS is always in main memory. This include kernel or nucleus, which contains the most
frequently used functions in the OS and at given time other portion of OS currently in use. The rest of OS resides on
secondary storage media which can be swapped in by kernel when needed.

You might also like