UNIT-1 Introduction To Operating System: Computer Science and Engineering
UNIT-1 Introduction To Operating System: Computer Science and Engineering
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
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.
User ViewThe 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.
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”.
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.
…………….......
CPU 0 CPU 1 CPU n
Interconnected
PC System 1 PC System PC System3
22 Nodes 3
Shared
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
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
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.
Time sharing systems were developed to provide interactive use of a computer system at a
reasonable cost.
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.
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.
CPU
Time sharing system allows many users to share the computer system simultaneously.
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
User process
User mode
(mode bit=1)
User Process Executing Calls System call Return from system
call
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.
The operating system is responsible for the following activities in process management.
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
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.
The operating system is responsible for the following activities in mass storage
management.
Free-space management
Storage allocation
Disk management
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.
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.
Protection and security requires the system to be able to distinguish between all
users.
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.
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)
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.
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.
C1 C2 C3
. . .
C4 C5 C6
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.
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