Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

UNIT-1 Introduction To Operating System: Computer Science and Engineering

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Operating System:15CS43T 2020-21

UNIT-1
INTRODUCTION TO OPERATING SYSTEM
Introduction:

The operating system controls and coordinates the use of the hardware among the various
application programs for the various users.
OR
An operating System is a program that acts as an intermediary between a user of a
computer and the Computer hardware
Operating system goals:
 Execute user programs and make solving user problems easier.
 Make the computer system convenient to use.
 Use the computer hardware in an efficient manner

The following are the major functions of operating system


 Resource Management - Operating System allocates computer resources such as
CPU, main memory, secondary memory and input and output devices.
 Data Management - Operating system governs the input and output of the data
and their location, storage and retrieval.
 Task Management - OS prepares, schedules, controls, and monitors jobs
submitted for execution to ensure the most efficient processing.

1.1 What operating system do or operating system role in computer


A computer system can be divided into four components. These components are illustrated
in figure 1.1
1. Hardware
2. Application program or software
3. Operating system
4. The users

Computer Science and Engineering 1


Operating System:15CS43T 2020-21

Fig 1.1 Abstract view of the components of a computer system

1. Hardware The hardware device provides the basic computing resources for the
system. The hardware devices are CPU, memory and Input/output (I/O) devices.

2. Application Program It defines the ways in which these resources are used to solve
users computing problems. The application programs are word processors, compiler,
assemblers and database system.

3. Operating System The operating system controls and coordinates the use of the
hardware among the various application programs for the various users.

4. The Users (people, machines, other computers)

User ViewThe user’s view of the computer varies according to the interface being used.

System view From the Computer’s point of view, the operating system can be viewed
as a resource allocator—CPU time, memory space, file-storage space, I/O devices and
so on. So the operating system acts as the manager of these resources.

1.2 Computer system Architecture


The computer system has been divided into 3 model systems.

 Single Processor System


 Multiprocessor System
 Clustered System

1.2.1 Single-Processor System

In single-processor system, many systems use single processor or CPU. The CPU capable
of executing a general purpose instruction set. All systems also have other special-purpose
Computer Science and Engineering 2
Operating System:15CS43T 2020-21

processor in the form of device specific processors such as disk, keyboard, and graphics
controllers. The general-purpose processors are I/O processor. The operating system
cannot communicate with special-purpose processor.

“If there is only one general-purpose CPU, then the system is a single-
Processor system”.

1.2.2 Multiprocessor System


Systems have two or more processors and sharing the memory and peripheral devices
during communication. It is also known as parallel systems or tightly coupled systems.

Advantages of Multiprocessor System


1. Increased Throughput: The user can do the more work in less time by increasing
the number of processor.
2. Economy of Scale: The cost of multiprocessor system is less than the single-
processor system because the user can share peripherals, devices and storage
devices. All processor are storing the data in disk.
3. Increased Reliability: The failure of one processor among many processors will
not halt the system only it is shut down.

Types of Multiprocessor Systems:


There are two types of multiprocessor Systems
 Asymmetric Multiprocessing
 Symmetric Multiprocessing

In asymmetric multiprocessing, each processor is assigned a specific task. A master


processor controls the system, other processors either look to the master for instruction or
have predefined tasks. This scheme defines a “Master-Slave relationship”. The master
processor assigns or allocates work to the slave processors.

In symmetric multiprocessing, each processor performs all tasks within the operating
system. Symmetric multiprocessing means that all processors are peers. There is no
master-slave relationship exists between processors. The figure 1.2 illustrates the
Symmetric multiprocessing architecture.

Computer Science and Engineering 3


Operating System:15CS43T 2020-21

…………….......
CPU 0 CPU 1 CPU n

Common main memory


Fig 1.2 Symmetric Multiprocessing architecture

1.2.3 Clustered systems


A clustered system is composed two or more individual systems coupled together.The
clustered system provides “high-availability” service. The work will continue even if one
or more systems in the cluster fail.
Clustering can be structured “asymmetrically or symmetrically”. In asymmetric
clustering, one machine is in “hot-standby mode”, while the other is running the
application. The hot-standby mode means monitor the active server. If that server fails, the
hot-standby host becomes the active server.
In symmetric clustering, two or more machines are running the application and are
monitoring each other. It is more efficient. The fig 1.3 illustrate the clustered system

Interconnected
PC System 1 PC System PC System3
22 Nodes 3

Shared

Fig 1.3 Clustered System

1.3 Operating System Structure


1. Multiprogramming System
2. Time-Shared system
1.3.1 Multiprogramming System
Multiprogramming means several jobs are kept in main memory at the same time, and the
CPU is multiplexed among them.

The idea of multiprogramming system is that the operating system keeps several jobs
simultaneously in memory (illustrated in figure 1.4). This set of jobs is a subset of the job

Computer Science and Engineering 4


Operating System:15CS43T 2020-21

kept in the “Job pool”. The operating system picks and begins to execute one of the jobs
in the memory. The job may have to wait for some task such as I/O operations.

The multiprogramming system increases the CPU utilization by organizing the jobs. So
that CPU executes one job at a time.

Operating system

Job1

Job2

Job3

……………

Job n

Fig 1.4 Memory layout for multiprogramming system

Functions of Multiprogramming system:

1. Job Scheduling
Several jobs are stored in secondary memory in the form of job pool and there is no
enough empty space for all of them to be stored in main memory at the same time. The
operating system will decide how many jobs are to be multiprogramming at a time and
which of them are stored into main memory for execution.

2. CPU Scheduling
Several jobs are stored in main memory and are ready to be executed at the same time.
The operating system must determine which of them to take up for execution based on the
priority.

1.3.2 Time Shared System:


Time sharing is a logical extension of multi programming. In time sharing system, the
CPU executes multiple jobs by switching between them, but the switches occurs
frequently that the users may interact with each program while it is running.

Time sharing requires an interactive system, which provides direct communication


between the user and system. This type of interactive system is used when a short
“Response time” is required.

Computer Science and Engineering 5


Operating System:15CS43T 2020-21

Time sharing systems were developed to provide interactive use of a computer system at a
reasonable cost.

The time sharing system provides the following user services.

 On-Line file system


 Memory Management
 CPU Scheduling
 Job Synchronization
 Dead lock

The operating system makes the CPU to pick up next job for execution whenever the
current job being executed encounters one of the following situations.

 Job in waiting state


 Error in noticed
 Job is completed

In these situations, the multiprogramming system switches the CPU or processor to take
up another job for execution. The figure 1.5 illustrates the time sharing system.

User1 User2 User3

CPU

User4 User5 User6

Fig 1.5 Time shared system

Time sharing system allows many users to share the computer system simultaneously.

1.4 Operating System Operations


1.4.1 Dual Mode Operation
The operating system provides two modes for computer hardware to operate

 User mode
 Kernel Mode (also called as system, monitor mode or privileged mode)

A bit called the mode is added to the computer hardware to indicate the current mode.

 User mode is 1
 Kernel mode is 0

Computer Science and Engineering 6


Operating System:15CS43T 2020-21

User process
User mode
(mode bit=1)
User Process Executing Calls System call Return from system
call

Trap mode bit =0 Return mode bit =1


Kernel kernel mode
Execute system call (mode bit=0)

Figure 1.6 Transition from user to kernel mode.

At system boot time, the computer hardware starts in Kernel mode. The operating system
is then loaded and starts user process in “user mode”. Whenever a trap or interrupt
occurs, the hardware switches from user mode to Kernel mode (1 to 0). This dual mode
operation provides protecting the operating system. This is accomplished by designating
some of the machine instruction that may cause as “privileged instruction”. The
hardware allows privileged instruction to be executed in only Kernel Mode.

Timer:
A timer is used to prevent a user program from getting stuck in infinite loop or never
calling system services and never returning control to the operating system. A timer can be
set to interrupt the computer after a specified period.

1.5 Process Management


A process is the unit of work in a system, a system consists of processes. The processes
may be either system process or user processes. The system process executes system code.
The user processes executes user code.

The operating system is responsible for the following activities in process management.

 Creating and deleting both user and system processes.


 Suspending and resuming processes.
 Providing mechanism for process synchronization
 Providing mechanism for deadlock handling

1.6 Memory Management


The main memory is the storage device that the CPU is able to address and access directly.

To improve both the utilization of CPU and the speed of the computer response to the
users, the user must keep several programs in memory.
Computer Science and Engineering 7
Operating System:15CS43T 2020-21

The operating system is responsible for the following activities in memory


management.
 Keep track of which parts of memory are currently being used and by whom.
 Decide which processes are to be loaded into memory when memory space
becomes available.
 Allocate and de-allocates memory space as needed.

1.7 Storage Management


 File-System Management
 Mass-Storage Management
 Caching
 I/O System

File-System Management:
File management is one of the most visible components of an operating system. A file is a
collection of related information defines by its creator. Commonly file represents
programs and data (both source and object forms).

The operating system is responsible for the following activities in file management.
 Creating and deleting files.
 Creating and deleting directives
 Supporting primitive for manipulating files and directives
 Mapping files onto secondary storage.
 Back up files on stable (non-volatile) storage media.

Mass Storage Management:


It is used as a backup to main memory and most modern computer system use disk as
secondary storage.

The operating system is responsible for the following activities in mass storage
management.

 Free-space management

 Storage allocation

 Disk management

 Allocation and de allocation

Computer Science and Engineering 8


Operating System:15CS43T 2020-21

Caching:

The speed of main memory is much slower than the CPU, Hence the CPU will have to
wait to send or receive data from the main memory. Therefore lot of CPU time is wasted.
In order to avoid the CPU operating at lower speed, Cache memory is currently and most
frequently used by the CPU. The figure 1.7 cache memory location

The cache memory is located between the CPU and main memory.

Main Memory Cache CPU

Fig 1.7 cache memory

The processor does not need to know explicitly about the existence of the cache. It simply
issues “read and write” requests using addresses that refer to locations in the memory.
The cache control circuit determines whether the requested word currently exists in the
cache. It’s having two operations.

1. Read Operation
2. Write Operation
I/O System:
I/O subsystem consists of several components
 Memory-management component that includes buffering, caching and
spooling.

 A general device-driver interface.


 Drivers for specific hardware devices.
1.8 Protection and Security
Protection is a mechanism for controlling the access of process to the resources defined by
a computer system.

 Protection can be improving reliability by detecting errors at the interface between


components of system.
 Protection is an “Internal Problem” the data stored in the computer system must
be protected from unauthorized access.
 Security mechanism should provide security to the “External and Internal
attacks”. The attacks may be viruses, worms and refusing access to authorized
users.

Computer Science and Engineering 9


Operating System:15CS43T 2020-21

 Protection and security requires the system to be able to distinguish between all
users.

1.9 Distributed System


Distributed system is a collection of heterogeneous computer systems that are networked
to the access the shared resources.It increases the computation speed, functionality, data
availability and reliability because of accessing the shared resources.

The functionalities of distributed system is depends on the networks (LAN, WAN, MAN).
A “Network operating system” is an operating system that provides features like file
sharing across the network and exchanging the messages between different computers.

A computer running a “Network operating system” that acts autonomously from all
other computers on the network. “A distributed operating system provides a less
autonomous environment”. It provides an illusion to the end-user such that the entire
network is working like a single system.

Advantages of distributed systems:


 Resources Sharing
 Computation speed up – load sharing
 Reliability
 Communications
1.10 Special Purpose System
Special-purpose systems are designed to meet specific computing application.
Types of Special Purpose System
1. Real-time Embedded system
2. Multimedia system
3. Hand-held system
1. Real-time Embedded system
 Embedded systems always run “real-time operating system”. The real-time
system is used when rigid time requirements (precise timing requirement) are
placed in operation of a processor.
 The real-time computer systems are loaded with real-time operating system
(RTOS).

Computer Science and Engineering 10


Operating System:15CS43T 2020-21

 A real-time system has well-defined and fixed time constraints. A real-time system
functions correctly only if it returns the correct result within its time constraints.
 The real-time system is to ensure a guaranteed response-time to external events of
critical application.
 The real-time system, in which, the system is required to perform its task within
the time restraints of some process or simultaneously with the system.

2. Multimedia Systems
 Multimedia system like media centre, multimedia personal computer enables the
end users to make use of many different media simultaneously.
 The multimedia data consists of audios, videos, images. The user can transmit
multimedia data by using multimedia system.
 The multimedia application includes DVD movies, Video conferencing, live
webcasts etc.
 Operating system being developed must support multimedia data such as sound
file, video file format (MP3, MPEG, etc)

3. Hand Held System


 The handheld system includes personal digital assistance (PDAs) devices. These
devices are cellular telephones, pocket PC.
 These devices using special-purpose embedded operating system
 The size of handheld system is 2-3 inches wide screen and storage size is 512kb
and 12MB.

1.11 Computing Environment


 Traditional Computing
 Client-Server Computing
 Peer to Peer Computing
 Web based Computing

1.11.1 Traditional Computing


Traditional computing environments like office environment, computer (pc) are connected
to LAN with server providing file sharing and printer sharing services. It also provides
“Remote Access” option in computer as well as laptop.

1.11.2 Client-Server Computing


The below figure 1.8 illustrate the client-server computing.
Computer Science and Engineering 11
Operating System:15CS43T 2020-21

Client 1 Client 2 Client 3 …… Client n

Server
Fig 1.8 Client server computing
In client-server system, one computer acts as server system to server or to handle requests
raised by one or more clients. This arrangement is called client-server system.

The server can be classified into two systems


1. Computer server
2. File server
1. Computer server: The client send request and server accepts the request and executes
the request and sends back result to client.

2. File server: This provides a file-system interface. The client can create, update, read
and delete file. A file server is a computer responsible for the central storage and
management of data files so that other computers on the same network can access the files.
A file server allows users to share information over a network without having to
physically transfer files by floppy diskette or some other external storage device.

1.11.3 Peer to Peer Computing


In this model, all computers within the network are considered as peers and each computer
may act as either a client or server depending on whether it is requesting or providing
service. The figure 1.9 illustrates the peer to peer network.

C1 C2 C3

. . .

C4 C5 C6

Fig 1.9 Peer to Peer network

Computer Science and Engineering 12


Operating System:15CS43T 2020-21

When computer joins a network, it registers its service with centralized look up service on
the network.The advantage of peer to peer computing over client-server system is that, all
computers provides services or response and distributed throughout the network.

1.11.4 Web based Computing


Web based computing in terms of browsing the internet, e-mail, chatting, the web
information can display by using browser.The implementation of web-based computing
has using new device called “load balancers”, which distribute network connections
between servers.

1.12 Open Source Operating System


It means distributing the operating system freely or distributing of source code of
operating system rather than only compiled binary executable code as in case of closed
source distribution approach. The most freely distributed operating system is
“Linux”.The Microsoft windows OS (95/98/2000/XP/Vista/Windows7) are closed-source
distribution to customers.

References:

[1] Operating System Principles – Abraham Silberschatz, Peter Baer Galvin, Greg
Gagne, 8th edition, Wiley-India.
[2 ] Operating Systems, I. Chandra Mohan, PHI, 2013
[3 ] http://www.tutorialspoint.com/operating_system/
[4] http://courses.cs.vt.edu/~csonline/OS/Lessons/index.html
[5] http://www.nptel.ac.in

Computer Science and Engineering 13

You might also like