KEMBAR78
OS - Unit I 1 | PDF | Operating System | Process (Computing)
0% found this document useful (0 votes)
218 views24 pages

OS - Unit I 1

Uploaded by

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

OS - Unit I 1

Uploaded by

gopabandhukamila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 24

Subject: Operating System

Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Definition of OS:
An Operating System (OS) is an interface between a computer user and
computer hardware. An operating system is a software which performs
all the basic tasks like file management, memory management, process
management, handling input and output, and controlling peripheral
devices such as disk drives and printers.

Computer System Structure


Computer system can be divided into four components:
l Hardware – provides basic computing resources
 CPU, memory, I/O devices
l Operating system
 Controls and coordinates use of hardware among various
applications and users
l Application programs – define the ways in which the system resources
are used to solve the computing problems of the users
 Word processors, compilers, web browsers, database systems,
video games
l Users
 People, machines, other computers

1|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Objectives of Operating System

• Making a computer system convenient to use in an efficient


manner
• To hide the details of the hardware resources from the users
• To provide users a convenient interface to use the computer
system.
• To act as an intermediary between the hardware and its users
and making it easier for the users to access and use other
resources.
• Manage the resources of a computer system.
• keep track of who is using which resource, granting resource
requests, according for resource using and mediating conflicting
requests from different programs and users.
• The efficient and fair sharing of resources among users and
programs.

Characteristics of Operating System


• Memory Management — It keeps tracks of primary memory i.e
what part of it are in use by whom, what part are not in use etc.
Allocates the memory when the process or program request it.
• Processor Management — Allocate the processor(CPU) to a
process. Deallocate processor when processor is no longer required.
• Device Management — Keep tracks of all devices. This is also called
I/O controller. Decides which process gets the device when and for
how much time.
• File Management — Allocates the resources. De-allocates the
resource. Decides who gets the resources.
• Security — By means of passwords & similar other techniques,
preventing unauthorized access to programs & data.
• Error-detecting aids — Production of dumps, traces, error
messages and other debugging and error-detecting methods.

2|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Operating System - Services


An Operating System provides services to both the users and to the programs. The services
are: -

• 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, 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).

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.
I/O operation means read or write operation with any file or any specific I/O device.

File system manipulation


• The OS gives the permission to the program for operation on file.
• Permission varies from read-only, read-write, denied and so on.
• It provides an interface to the user to create/delete files and directories, also
provides an interface to create the backup of file system.

Communication
• Two processes often require data to be transferred between them
• Both the processes can be on one computer or on different computers, but
are connected through a computer network.
• Communication may be implemented by two methods, either by Shared
Memory or by Message Passing.

3|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Error handling
• The OS constantly checks for possible errors.
• The OS takes an appropriate action to ensure correct and consistent
computing.

Resource Management
• The OS manages all kinds of resources using schedulers.
• CPU scheduling algorithms are used for better utilization of CPU.
Protection
• The OS ensures that all access to system resources is controlled.
• The OS ensures that external I/O devices are protected from invalid access
attempts.
• The OS provides authentication features for each user by means of
passwords.

Operating System Components


From the virtual machine point of view (also resource management)

These components reflect the services made available by the O.S.

1. Process Management
o Process is a program in execution --- numerous processes to choose
from in a multiprogrammed system,
o Process creation/deletion (bookkeeping)
o Process suspension/resumption (scheduling, system vs. user)
o Process synchronization
o Process communication
o Deadlock handling
2. Memory Management

o Maintain bookkeeping information


o Map processes to memory locations
o Allocate/deallocate memory space as requested/required

4|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

3. I/O Device Management

o Disk management functions such as free space management,


storage allocation, fragmentation removal, head scheduling
o Consistent, convenient software to I/O device interface through
buffering/caching, custom drivers for each device.

4. File System

Built on top of disk management

o File creation/deletion.
o Support for hierarchical file systems
o Update/retrieval operations: read, write, append, seek
o Mapping of files to secondary storage

5. Protection

Controlling access to the system

o Resources --- CPU cycles, memory, files, devices


o Users --- authentication, communication
o Mechanisms, not policies

6. Network Management

Often built on top of file system

o TCP/IP, IPX, IPng


o Connection/Routing strategies
o ``Circuit'' management --- circuit, message, packet switching
o Communication mechanism
o Data/Process migration

7. Network Services (Distributed Computing)


Built on top of networking

o Email, messaging (GroupWise)


o FTP
o gopher, www
o Distributed file systems --- NFS, AFS, LAN Manager
o Name service --- DNS, YP, NIS
o Replication --- gossip, ISIS
o Security --- kerberos
5|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

8. User Interface

o Character-Oriented shell --- sh, csh, command.com ( User replaceable)


o GUI --- X, Windows 95

Early Systems - bare machine (early 1950s) - First Generation


• Structure
o Large machines run from console
o Single user system o Programmer/User as operator
o Paper tape or punched cards
• Early Software
o Assemblers
o Loaders
o Linkers
o Libraries of common subroutines
o Compilers
o Device drivers
• Secure
• Inefficient use of expensive resources
o Low CPU utilization
o Significant amount of setup time

Types of Operating Systems


Batch operating system
The users of a batch operating system do not interact with the computer
directly. Each user prepares his job on an off-line device like punch cards
and submits it to the computer operator. To speed up processing, jobs
with similar needs are batched together and run as a group. The
programmers leave their programs with the operator and the operator
then sorts the programs with similar requirements into batches.

6|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Disadvantages −
• Lack of interaction between the user and the job.
• CPU is often idle, because the speed of the mechanical I/O
devices is slower than the CPU.
• Difficult to provide the desired priority.
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 Multiprogrammed Batch Systems and
Time-Sharing Systems is that in case of Multiprogrammed batch
systems, the objective is to maximize processor use, whereas in Time-
Sharing Systems, the objective is to minimize response time.
Advantages −

• Provides the advantage of quick response.


• Avoids duplication of software.
• Reduces CPU idle time.
Disadvantages −

• Problem of reliability.
• Question of security and integrity of user programs and data.
• Problem of data communication.
Distributed operating System
Distributed systems use multiple central processors to serve multiple
real-time applications and multiple users. Data processing jobs are
distributed among the processors accordingly.
The processors communicate with one another through various
communication lines (such as high-speed buses or telephone lines).
These are referred as loosely coupled systems or distributed systems.
Advantages-
• With resource sharing facility, a user at one site may be able to use
the resources available at another.

7|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

• 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.
• Reduction of the load on the host computer.

Disadvantages-
• These types of systems are not readily available as they are very
expensive. Not only that the underlying software is highly complex
and not understood well yet.

Network operating System


A Network Operating System runs on a server and provides the server
the capability to manage data, users, groups, security, applications, and
other networking functions. The primary purpose of the network operating
system is to allow shared file and printer access among multiple
computers in a network, typically a local area network (LAN), a private
network or to other networks.
Advantages −

• Centralized servers are highly stable.


• Security is server managed.
• Upgrades to new technologies and hardware can be easily
integrated into the system.
• Remote access to servers is possible from different locations and
types of systems.

Disadvantages −
• High cost of buying and running a server.
• Dependency on a central location for most operations.
• Regular maintenance and updates are required.

Real Time operating System


A real-time system is defined as a data processing system in which the
time interval required to process and respond to inputs is so small that it
controls the environment. The time taken by the system to respond to an
input and display of required updated information is termed as

8|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

the response time. So in this method, the response time is very less as
compared to online processing.
Real-time systems are used when there are rigid time requirements on
the operation of a processor or the flow of data and real-time systems
can be used as a control device in a dedicated application.
There are two types of real-time operating systems.
Hard real-time systems
Hard real-time systems guarantee that critical tasks complete on time. In
hard real-time systems, secondary storage is limited or missing and the
data is stored in ROM.
Soft real-time systems
Soft real-time systems are less restrictive. A critical real-time task gets
priority over other tasks and retains the priority until it completes. Soft
real-time systems have limited utility than hard real-time systems.

Advantages –
• Priority Based Scheduling
• Abstracting Timing Information
• Maintainability/Extensibility
• Modularity
• Promotes Team Development
• Easier Testing

Disadvantages –
• Limited Tasks
• Use Heavy System resources
• Complex Algorithms
• Device driver and interrupt signals

Functions of an Operating System


1. Process management:- Process management helps OS to create and
delete processes. It also provides mechanisms for synchronization and
communication among processes.

2. Memory management:- Memory management module performs the task


of allocation and de-allocation of memory space to programs in need of
this resources.

9|Page
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

3. File management:- It manages all the file-related activities such as


organization storage, retrieval, naming, sharing, and protection of files.

4. Device Management: Device management keeps tracks of all devices.


This module also responsible for this task is known as the I/O controller. It
also performs the task of allocation and de-allocation of the devices.

5. I/O System Management: One of the main objects of any OS is to hide


the peculiarities of that hardware devices from the user.

6. Secondary-Storage Management: Systems have several levels of


storage which includes primary storage, secondary storage, and cache
storage. Instructions and data must be stored in primary storage or cache
so that a running program can reference it.

7. Security:- Security module protects the data and information of a


computer system against malware threat and authorized access.

8. Command interpretation: This module is interpreting commands given


by the and acting system resources to process that commands.

9. Networking: A distributed system is a group of processors which do not


share memory, hardware devices, or a clock. The processors
communicate with one another through the network.

10. Job accounting: Keeping track of time & resource used by various job
and users.

11. Communication management: Coordination and assignment of


compilers, interpreters, and another software resource of the various
users of the computer systems.

Storage Structure
A typical instruction execution cycle, as executed on a system with a Von-
Neumann architecture, first fetches an instruction from memory and stores
that instruction in the instruction registers.
The instruction is then decoded and may cause operands to be fetched from
memory and stored in some internal register. After the instruction on the
operands has been executed, the result may be stored back in memory.

10 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

The memory unit sees only a stream of memory addresses; it does not know
how they are generated. Main memory is usually too small to store all needed
programs and data permanently.
Thus, most computer system provides secondary storage as an extension of
main memory, which is able to store large quantities of data permanently. The
most common secondary storage device is a magnetic disk, which provides
storage for both programs and data.

register

cache

main memory

electronic disk
magnetic disk
optical disk
magnetic tapes
Storage device hierarchy

In the hierarchy shown above the storage systems above the electronic disk are
volatile where as those below are non-volatile.

An electronic disk can be designed to be either volatile or non-volatile. But


many electronic disks contain a hidden magnetic hard disk and a battery for
backup power. If external power is interrupted, the electronic disk controller
copies the data from RAM to the magnetic disk. When external power is restored
the controller copies back into the RAM.

Another form of electronic disk is Flash memory, which is popular in camera and
PDAs, which slower than DRAM but needs no power to return its contents.

11 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Input Output Structure


A general-purpose computer system consists of CPUs and multiple device
controllers that are connected through a common bus.
The device controller is responsible for moving the data between the
peripheral device that it controls and its local buffer storage.
To start an I/O operation, the device driver loads the appropriate register
within the device controller. The device controller, in turn, examines the
contents of these register to determine what action to take, such as “read a
character from the keyboard”.
The controller starts the transfer of data from the device to its local buffer.
Once the transfer of data is complete, the device controller informs the device
driver via an interrupt that it has finished its operation. The device driver then
returns control to the OS.
This form of interrupt driven I/O is fine for moving small amounts of data, but
for bulk data, DMA (Direct Memory Access) is used.

System Calls
System calls provide an interface to the services made available by an OS.
These calls are generally available as routines written in C and C++, although
certain low-level tasks may need to be written using assembly language
instruction.

How system calls are used?


Writing a simple program to read data from one file and copy them to another
file. The first input that the program will need is the names of the two files: the
input file and the output file.
By using an interactive program, the user can ask the name of the two files.
This approach requires a sequence of system calls, first to write a prompting
message on the screen and then to read from the keyboard the characters
define the two files.

12 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Once the two files names are obtained the program must open the input file
and create the output file. Each of these operations requires system call.
If the input file already exists, is missing or is protected against access then a
system call is generated to print a message for abnormal termination.
If the output file already exists then a system call is generated, we may delete
or replace the existing file to store the new one.

Types of system calls


System calls can be grouped roughly into 5 major categories:
• Process control
• File manipulation
• Device management
• Information maintenance
• Communication

❖ Process Control
➢ End, abort
➢ Load, execute
➢ Create process, terminate process
➢ Get process attributes, set process attributes
➢ Wait for time
➢ Wait event, signal event
➢ Allocate and free memory
❖ File manipulation
➢ Create file, delete file
➢ Open, close
➢ Read, write, reposition
➢ Get file attributes, set file attributes
❖ Device management
➢ Request device, release device
➢ Read, write, reposition
➢ Get device attributes, set device attributes
➢ Logically attach or detach devices

13 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

❖ Information maintenance
➢ Get system time, set system time
➢ Get system date, set system date
➢ Get process, file or device attributes
➢ Set process, file or device attributes
❖ Communication
➢ Create, delete communication connection
➢ Send, receive message
➢ Transfer status information
➢ Attach or detach remote devices

System Programs
System program provide a convenient environment for program development
and execution. Some of them are simply user interfaces to system calls. Others
are considerably more complex.
They can be divided into these categories:
1. File management
These programs create, delete, copy, rename, print, list and generally
manipulate files and directories.

2. Status information
Some programs simply ask for the system for the date, time, amount of
available memory or disk space, number of users, or similar status
information.
3. File modification
Several text editors may be available to create and modify the content of
files stored on disk or other storage devices.

4. Programming language support


Compilers, assemblers, debuggers and interpreters for common program
language (such as C, C++, Java, Visual Basic and PERL) are often provided
to the user with the OS.

5. Program loading and execution

14 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Once a program is assembled or compiled, it must be loaded into


memory to be executed.

6. Communications
These programs provide the mechanism for creating virtual connections
among processes, users and computer systems. They allow users to send
messages to one another’s screen, to browse webpages, to send e-mail
messages to login remotely, onto transfer file from one machine to
another.

Virtual Machines
The fundamental idea behind a virtual machine is to abstract the h/w of a
single computer into several different execution environments, thereby
creating the illusion that each separate execution environment is running its
own private computer.
In this environment there is complete protection of the various system
resources. Each virtual machine is completely isolated from all other virtual
machines.
The virtual machine software can run in kernel mode. Since it is the OS it can
itself execute only in user mode.
Consider a scenario that a developer wants to test an application on Linux,
Free BSD and on Windows NT. One option is that we can use three different
system to install the OS individually and test the application distinctly. This
option is time consuming and is expensive as it requires individual systems for
each type of OS.
But we can accomplish the testing on a single physical computer by using
VMWare. In this case the programmer can test the application on a host OS
and on two guest OS with each system running as a separate virtual machine.

The Java Virtual Machine


Java is a popular Object-Oriented Programming language introduced by Sun
Microsystems in 1995.

15 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Java objects are specified with the class construct; a java program consists of
one or more classes. For each java class, the complier produces an
architecture-neutral bytecode output (.class) file that will run on any
implementation of the JVM.

System Design and Implementation


The design of the system will be affected by the choice of hardware and the
type of system.
The requirement can be divided into two types:
1) User goals
2) System goals
The User desires the following properties in a system: -
The system should be convenient to use easy to learn and to use
reliable, safe and fast.
The System goals must have the following properties: -
The system should be easy to design, create, maintain and operate. It
should be flexible, reliable error free and efficient.

OS Implementation
Once an OS is designed then it is implemented.
Traditionally OS have been written in assembly language but now they are
mostly written in High level language such as C or C++.
The advantage of using a high-level language for implementing OS are the
same as those occurred when the language is used for application programs.
The codes can be written faster and is easier to understand and debug.
It improves the compiler where the generated code for the OS by simple
recompilation.

16 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

The only disadvantage of implementing an OS in a higher-level language are


reduces speed and increase storage requirement. However, it is no longer a
major issue in modern computing.

Computer System Architecture


A computer system may be organized in a rough category of the number of
general-purpose processors used.

Single Processor System


Most systems use a single processor. They are used in PDAs, mainframe etc.
On a single processor system there is one main CPU capable of executing a
general-purpose instruction set, including instruction from user processes.
Almost all systems have their special purpose processors such as disk,
keyboard etc.

Multiprocessor System
It is also known as parallel system or tightly coupled system.
These systems have two or more processors enclosed communication sharing
the computer bus and sometimes the clock and memory and peripheral
devices.
The multiprocessor system has 3 main advantages: -
1) Increased throughput
2) Economy of scale
3) Increased reliability

Clustered System
Like multiprocessor systems, clustered systems gather together multiple CPUs
to accomplish computational work.
Clustered systems differ from multiprocessor systems. However, in that they
are composed of two or more individual system coupled together.

17 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

The generally accepted definition is that clustered systems share storage and
are closely linked via a LAN.

Computer System Operation


A computer system consists of one or more CPUs and a number of devices
controllers connected through a common bus that provide access to shared
memory.
The CPU and the device controllers can execute concurrently competing for
memory cycles.
For a computer start running an initial program is needed called boot strap
programming, generally stored by companies in EEPROM.
The bootstrap program loads the OS to start executing that systems by loading
OS kernel into the memory.
The occurrence of an event is usually signalled by an interrupt from either the
hardware or software. When the CPU is interrupted, is stops what it is doing
and immediately transfer execution to a fixed location.

OS Protection and Security


If a computer system has multiple users and allows the concurrent execution
of multiple processes, then access to data must be regulated.
Protection, then, is any mechanism for controlling the access of processes or
users to the resources defined by a computer system.
Protection can improve reliability by detecting latent errors at the interfaces
between component subsystems.
An unprotected resource cannot defend against use by an unauthorised or
incompetent use.
A system can have adequate protection but still be prone to failure and allow
inappropriate access.

18 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

It is the job of security to defend a system from external and internal attacks.
Such attacks spread across a huge range and include viruses and worms, denial
of service attacks (which use all of a system’s resources and so keep legitimate
users out of the system) identify theft, and theft of service (unauthorized use
of a system).

(Abstract view of the components of a computer system)

Operating System Structure


Many commercial systems do not have well defined structures frequently such
OS started as small, simple limited.
MS-DOS is an example of such a system.

19 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Layered Approach
With proper hardware support, OS can be broken into pieces, that are smaller
and more appropriate than those allowed by the original MS-DOS systems.
A system can be made modular in may ways. The layer approach is one
method in which the OS is broken up into a number of layers. The bottom layer
is the hardware and the highest layer is in the user interface.

Micro kernels
As the OS expanded, the kernel become large and difficult to manage, but an
OS was developed called MAC that modularized the kernel using the
microkernel approach.
The main function of the microkernel is to provide a communication facility
between the client program and the various services that are also running in
user space.
One benefit of the microkernel approach is ease of extending the operating
system.

Modules
Perhaps the best current methodology for operating system design involve
using object-oriented program technique to create a modular kernel. Here the
kernel has a set of cores of components and dynamically links in additional
services either during boot time or during run time.
Ex: -
Solaris OS structure shown in fig is organized around a core kernel with 7 types
of loadable kernel modules.

20 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

7 2

Core
Solaris
6 kernel 3

5 4

1. Scheduling classes
2. File systems
3. Loadable system calls
4. Executable formats
5. Streams modules
6. Miscellaneous
7. Device and bus drivers

User Operating System Interface


There are two fundamental approaches for users to interface the OS.
1. Command Line Interface/Character User Interface
It is the command interpreter which is included in the kernel of some OS
other such as windows XP and Unix treat the command Interpreter as a
special program that is running when a job is initiated or when a user logs
on.
On the systems with multiple command interpreter to choose from the
interpreters are known as shells.

21 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

For e.g. Unix and Linux systems have several shells available such as
• BOURNESHELL
• CSHELL
2. Graphical User Interface
A GUI provides a mouse-based windows and a menu system as an interface.
It provides a Desktop metaphor where the mouse is moved to position its
pointer on images on icons on the screen (Desktop) that represents
programmes, files, directories and system functions.

Multiprogramming
A computer running more than one process at a time is known as
multiprogramming.
In the modern computer system, several concurrent application processes
want to execute. It is the responsibility of OS to manage them.
These processes are also known as Jobs, now the main memory is too small to
accommodate all of these jobs into it, thus these processes are initially kept in
Jobpool. Selects one Job out of these waiting Jobs, brings it from the Jobpool
to the main memory and start executing it.
The processor executes one job until it is interrupted by some external factors.

Multiprocessing
Multiprocessing is the use of two or more CPUs in a single computer system.
The term also refers to the ability of a system to support more than one
processor within a single computer system.
These multiprocessors can be executed at a time. Share the computer Bus
sometimes the clock memory and peripheral devices.

22 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Multitasking
It is a logical extension of multiprogramming. The major way in which
multitasking differs from multiprogramming is that multiprogramming works
solely on the concept of context switching where as multitasking is based on
time sharing along side the concept of context switching.
The CPU makes the process to share time slices between them and execute
accordingly as soon as quantum timing of one process expires another process
begins its execution.

Multithreading
A thread is the basic unit of CPU utilization. Multithreading is an execution
model that allow a single process to have multiple code segment running
concurrently within the context of that process.
Multithreading is the ability of a process to manage its use by more than one
user at a time and to manage multiple requests by the same user without
having to have multiple copies of the program.

Multiprocessor system
Multiprocessing is the use of two or more central processing units (CPUs)
within a single computer system. The term also refers to the ability of a system
to support more than one processor and/or the ability to allocate tasks
between them.[1] There are many variations on this basic theme, and the
definition of multiprocessing can vary with context, mostly as a function of
how CPUs are defined.

Advantage:
1.increase throughput
2.Economy of scale
3. Increased reliability

Disadvantage:
1) If one processor fails then it will affect in the speed
2) multiprocessor systems are expensive
3) complex OS is required
4) large main memory required.

23 | P a g e
Contact: 7008443534, 9090042626
Subject: Operating System
Created By: Asst. Prof. SK ABDUL ISRAR College: ABA, BLS

Difference Between Symmetric and Asymmetric


Multiprocessing

Asymmetric Multiprocessing Symmetric Multiprocessing


In asymmetric multiprocessing, the In symmetric multiprocessing,
processors are not treated equally. all the processors are treated
equally.
Tasks of the operating system are Tasks of the operating system
done by master processor. are done individual processor
No Communication between All processors communicate
Processors as they are controlled with another processor by a
by the master processor. shared memory.
In asymmetric multiprocessing, In symmetric multiprocessing,
process are master-slave. the process is taken from the
ready queue.
Asymmetric multiprocessing Symmetric multiprocessing
systems are cheaper. systems are costlier.
Asymmetric multiprocessing Symmetric multiprocessing
systems are easier to design systems are complex to design

Q) When caches are useful? What problems do they solve? What problems do they
cause? If a cache can be made as large as the device for which it is caching why not
make it that large and eliminate the device?

Two reasons why they are useful:


1. Cache is a relatively fast memory, so getting some data fromcache is faster than getting it
from main or secondary memory.
2. Caches are particulary useful when two or more components need to exchange data-
transfer speeds are much faster, so the component receiving data from some other
component does not have to wait as long as it would have to if we didn’t use caches. Notice
that this means that caches improve the efficiency of the whole system.
The main problems caused by caches are inconsistency (When data is changed in the main
memory or in the memory of some compoenet, the data in caches must also be updated)
and cache misses (if the data is not in the cache we lost the time for checking if the data is
locted in the cache, and we lose some additional time to transfer the data to the cache).
The main problem we will get by making cache as large as the device for which it is caching,
is that, the faster memories are more expensive. Therefore, such enormous cache wouldn’t
be affordable.

24 | P a g e
Contact: 7008443534, 9090042626

You might also like