Unit-1Overview of Operating System
Unit-1Overview of Operating System
Definition:
An operating system is a program that acts as an interface between the user and the computer
hardware and controls the execution of all kinds of programs.
1
➢ Device / Resource Management – Managing devices and resources and allowing
the users to share the resources
➢ Program Management:
• The term process refers here to program code that has been loaded into a
computer's memory so that it can be executed by the central processing
unit (CPU).
• In a multiprogramming system, there will be a number of competing processes.
The operating system must ensure that each process gets a fair share of the CPU's
time.
• Before a program can be executed, at least part of the program's executable code
must be loaded into memory as a process. The operating system must then
determine when the CPU can be made available to the process, and for how long.
Once a process controls the CPU, its instructions will be executed until its allotted
time expires, or until it terminates, or until it requests an input or output operation.
• In the latter case, the operating system will service the I/O request and suspend the
execution of the process until the I/O request has been satisfied, and the CPU is
once more available (on suspension of one process, the CPU is made available to
the next waiting process).
➢ Following are the major activities of an operating system with respect to program
management −
2
➢ Resource Management
• Operating system is a resource allocator.
• Resource management is the dynamic allocation and de-allocation by an operating
system of processor cores, memory pages, and various types of bandwidth to
processes that compete for those resources.
❖ Protection
• The processes in an operating system must be protected from one another's
activities.
• To provide such protection, we can use various mechanisms to ensure that only
processes that have gained proper authorization from the operating system can
operate on the files, memory segments, CPU, and other resources of a system.
• Protection refers to a mechanism for controlling the access of programs, processes,
or users to the resources defined by a computer system.
➢ User View
The user view depends on the system interface that is used by the users. The
different types of user view experiences can be explained as follows:
3
• If the user is using a personal computer, the operating system is largely designed to
make the interaction easy. Some attention is also paid to the performance of the
system, but there is no need for the operating system to worry about resource
utilization.
• If the user is using a system connected to a mainframe or a minicomputer, the
operating system is largely concerned with resource utilization. This is because
there may be multiple terminals connected to the mainframe and the operating
system makes sure that all the resources such as CPU,memory, I/O devices etc. are
divided uniformly between them.
• If the user is sitting on a workstation connected to other workstations through
networks, then the operating system needs to focus on both individual usage of
resources and sharing though the network. This happens because the workstation
exclusively uses its own resources but it also needs to share files etc. with other
workstations across the network.
• If the user is using a handheld computer such as a mobile, then the operating system
handles the usability of the device including a few remote operations. The battery
level of the device is also taken into account.
➢ System View:
According to the computer system, the operating system is the bridge between
applications and hardware. It is most intimate with the hardware and is used to
control it as required.
The different types of system view for operating system can be explained as
follows:
• The system views the operating system as a resource allocator. There are many
resources such as CPU time, memory space, file storage space, I/O devices etc. that
are required by processes for execution. It is the duty of the operating system to
allocate these resources to the processes so that the computer system can run as
smoothly as possible.
• The operating system can also work as a control program. It manages all the
processes and I/O devices so that the computer system works smoothly and there
are no errors.
• Operating systems can also be viewed as a way to make using hardware easier.
4
An operating system can also be considered as a program running at all times in the
background of a computer system (known as the kernel) and handling all the
application programs.
• The users of 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
by the operator.
• Thus, the programmers leave their programs with the operator. The operator then sorts
programs into batches with similar requirements.
• The OS was simple, its major task was to transfer control from one job to the next. The
job was submitted to the computer operator in form of punch cards. At some later time
the output appeared.
Drawbacks:
➢ Multiprogramming
• Multiprogramming is a technique in which two or more programs reside in
memory at the same time.
• Multiprogramming increases CPU utilization.
• It ensures that the CPU always has one job to execute.
5
• Following figure shows the memory layout for a multiprogramming system:
Advantages
1. High and efficient use of CPU.
1. User feels that many programs are allotted with the CPU.
Disadvantages
1. CPU scheduling is required.
2. To accommodate many programs at a time memory management is required.
➢ Multitasking:
• It is a technique in which multiple jobs are executed by the CPU simultaneously.
• This is done by switching between the jobs.
6
• Switches occur so frequently that the users may interact with each program while it is
running.
• Operating system does the following activities related to multitasking:
• The user gives instructions to the programs and receives an immediate response.
• Operating system handles multiple operations at a time.
• These systems are also called as Time-sharing systems.
• As the system switches CPU rapidly from one user/program to the next, each user is
given the impression that he/she has his/her own CPU, whereas actually one CPU is
being shared among many users.
Advantages
1. Increases the productivity i.e. more jobs are done in less time.
2. Enables to share the data between different applications.
3. Enables to switch between applications instantly.
Disadvantages
1. Complex OS is required.
2. Large main memory is required.
7
• Operating system uses CPU scheduling and multiprogramming to provide each user
with a small portion of a time.
• In above figure the user 5 is active but user 1, user 2, user 3, and user 4 are in waiting
state whereas user 6 is in ready status.
• As soon as the time slice of user 5 is completed, the control moves on to the next
ready user i.e. user 6. In this state user 2, user 3, user 4, and user 5 are in waiting state
and user 1 is in ready state. The process continues in the same way and so on.
Advantages
Disadvantages
• Problem of reliability.
• Question of security and integrity of user programs and data.
• Problem of data communication.
➢ Multiprocessor Systems:
• Multiprocessor Operating System refers to the use of two or more central processing
units (CPU) within a single computer system. These multiple CPUs are in a close
communication sharing the computer bus, memory and other peripheral devices. These
systems are referred as tightly coupled systems.
8
Types of Multiprocessor system
➢ Asymmetric multiprocessing
• In asymmetric systems, each processor is given a predefined task. There is a master
processor that gives instruction to all the other processors.
• Asymmetric multiprocessor system contains a master slave relationship.
Advantages
• Increased throughput
• Economical
• Increased reliability
• Graceful degradation
Disadvantages
• Increased Expense
• Complicated Operating System Required
• Large Main Memory Required
9
• Distributed systems use multiple central processors to serve multiple real time application
and multiple users.
• Data processing jobs are distributed among the processors accordingly to which one can
perform each job most efficiently.
• 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.
• Processors in a distributed system may vary in size and function.
• These processors are referred as sites, nodes, and computers and so on.
Advantages
10
➢ Clustered systems
• The clustered systems are created by two or more individual computer systems
merged together.
• Basically, they have independent computer systems with a common storage and
the systems work together.
• Each node in the clustered systems contains the cluster software. This software
monitors the cluster system and makes sure it is working as required.
• If any one of the nodes in the clustered system fail, then the rest of the nodes take
control of its storage and resources and try to restart.
• In this system, one of the nodes in the clustered system is in hot standby mode and
all the others run the required applications.
• The hot standby node continuously monitors the server and if it fails, the hot
standby node takes its place.
• In symmetric clustering system two or more nodes all run applications as well as
monitor each other.
11
Advantages are:
1) High reliability
2) Asymmetric clustering: One server runs the applications while other server is a
standby server.
3) Symmetric clustering: All N number of hosts are running the applications.
• 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 response time.
• Real-time systems can be used as a control device in a dedicated application.
• Real-time operating system has well-defined, fixed time constraints otherwise system
will fail.
• For example Scientific experiments, medical imaging systems, industrial control systems,
weapon systems, robots, and home-appliance controllers, Air traffic control system etc.
12
• Mobile operating systems combine features of a personal computer operating system with
other features useful for mobile or handheld use; usually including, and most of the
following considered essential in modern mobile systems; a wireless inbuilt modem and
SIM tray for telephony and data connection, a touchscreen, cellular, Bluetooth, Wi-Fi
Protected Access, Wi-Fi, Global Positioning System (GPS) mobile navigation, video-
and single-frame picture cameras, speech recognition, voice recorder, music player, near
field communication, and infrared blaster.
➢ Android OS
• The android is an open source operating system means that it’s free and any one can use
it. The android has got millions of apps available that can help you managing your life
one or other way and it is available in low cost in market at that reasons android is very
popular.
• Android operating system is a stack of software components which is roughly divided
into five sections and four main layers as shown below in the architecture diagram.
❖ Linux Kernel:
❖ Libraries:
On top of Linux kernel there is a set of libraries including open-source Web browser
engine WebKit, well known library libc, SQLite database which is a useful repository for
storage and sharing of application data, libraries to play and record audio and video, SSL
libraries responsible for Internet security etc.
❖ Android Runtime:
• This is the third section of the architecture and available on the second layer from the
bottom. This section provides a key component called Dalvik Virtual Machine which is a
kind of Java Virtual Machine specially designed and optimized for Android.
• The Dalvik VM makes use of Linux core features like memory management and multi-
threading, which is intrinsic in the Java language. The Dalvik VM enables every Android
application to run in its own process, with its own instance of the Dalvik virtual machine.
• The Android runtime also provides a set of core libraries which enable Android
application developers to write Android applications using standard Java programming
language.
❖ Application Framework:
The Application Framework layer provides many higher-level services to applications in
the form of Java classes. Application developers are allowed to make use of these
services in their applications.
The Android framework includes the following key services −
• Activity Manager − Controls all aspects of the application lifecycle and activity stack.
• Content Providers − Allows applications to publish and share data with other
applications.
• Resource Manager − Provides access to non-code embedded resources such as strings,
color settings and user interface layouts.
• Notifications Manager − Allows applications to display alerts and notifications to the
user.
• View System − An extensible set of views used to create application user interfaces.
❖ Applications:
• You will find all the Android application at the top layer. You will write your application
to be installed on this layer only. Examples of such applications are Contacts Books,
Browser, and Games etc.
14
➢ IOS
• First released in 2007, iOS is written in multiple languages and only runs on the
company’s products such as iPhones, iPads, and iPods.
• After Android, iOS is the most used mobile OS on Earth, available in 40 different
languages. It is written in C, C++, Objective-C and Swift. The OS is closed source
instead of open source and it is based on the Macintosh OS X.
• The iOS user interface is based upon direct manipulation, using multi-touch gestures.
Interface control elements consist of sliders, switches, and buttons.
• Interaction with the OS includes gestures such as swipe, tap, pinch, and reverse pinch, all
of which have specific definitions within the context of the iOS operating system and its
multi-touch interface.
• Internal accelerometers are used by some applications to respond to shaking the device
(one common result is the undo command) or rotating it in three dimensions (one
common result is switching between portrait and landscape mode).
• Apple has been significantly praised for incorporating accessibility functions into iOS,
enabling users with vision and hearing disabilities to properly use its products.
15
• The COMMAND.COM is a command interpreter which accepts commands issued
through the keyboard, or other input device, and carries them out according to the
commands definition
➢ UNIX
• UNIX was originally developed in 1969 by a group of AT&T employees Ken
Thompson, Dennis Ritchie, Douglas McIlroy, and Joe Ossanna at Bell Labs.
• There are various UNIX variants available in the market. Solaris UNIX, AIX, HP UNIX
and BSD are a few examples. Linux is also a flavor of UNIX which is freely available.
• The UNIX operating system is a set of programs that act as a link between the computer
and the user.
• The computer program that allocates the system resources and coordinates all the details
of the computer's internals is called the operating system or the kernel.
• Users communicate with the kernel through a program known as the shell. The shell is a
command line interpreter; it translates commands entered by the user and converts them
into a language that is understood by the kernel.
• Several people can use a UNIX computer at the same time; hence UNIX is called a
multiuser system.
• A user can also run multiple programs at the same time; hence UNIX is a multitasking
environment.
❖ Here is a basic block diagram of a Unix system
16
• Kernel − The kernel is the heart of the operating system. It interacts with the hardware
and most of the tasks like memory management, task scheduling and file management.
• Shell − The shell is the utility that processes your requests. When you type in a
command at your terminal, the shell interprets the command and calls the program that
you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell and
Korn Shell are the most famous shells which are available with most of the Unix
variants.
• Commands and Utilities − There are various commands and utilities which you can
make use of in your day to day activities. cp, mv, cat and grep, etc. are few examples of
commands and utilities. There are over 250 standard commands plus numerous others
provided through 3rd party software. All the commands come along with various
options.
• Files and Directories − All the data of UNIX is organized into files. All files are then
organized into directories. These directories are further organized into a tree-like
structure called the filesystem.
17
GUI Based OS
• Windows is the name of an operating system that was written by Microsoft from their
first release named Windows 1.0 in 1985 up to their latest release named Windows 10 in
2015.
• Unlike Linux or Mac OS X, Windows is not built on UNIX; rather Windows is built on 2
different bases depending on the version of Windows you’re using:
a) Windows 1.0, 2.0, 3.1, 3.11, 95, 98, and ME run on MS-DOS
b) Windows NT, 2000, XP, Vista, 7, 8, 8.1, 10, and CE run on NT
• MS-DOS was Microsoft’s disk operating system (DOS) released in 1981 and is a
command-line interface (CLI) operating system. MS-DOS would serve as the base of
every 16-bit version of Windows.
• NT was Microsoft’s introduction to 32-bit operating systems back in 1993 and currently
serves as the base of all 32-bit and 64-bit versions of Windows.
• As an operating system, Windows 10 and Windows 7 currently hold the largest
percentage of the market share as of 2017.
• Windows is designed to run on standard x86 hardware, such as Intel and
AMD processors. Therefore, it can be installed on multiple brands of hardware, such as
Dell, HP, and Sony computers, as well as home-built PCs. Windows 10 also
includes touchscreen features, that allow the operating system to run on certain tablets
and computers with touchscreen displays.
• Aside from window operating system designed for personal computers (PCs) and laptops,
Microsoft has also developed operating system for services, handheld devices and mobile
phones.
1. Window CE (November 2006) it is designed for small devices such as PDAs for
handheld computing devices.
2. Windows mobile (April 2000) designed for smart phones and mobile devices.
3. Windows phone 7-10 (November 2010) or win phone 7 designed for smart phones and
Mobile devices but targeted more to the consumer market than enterprises market.
18
➢ Linux operating system
• Linux is one of popular version of UNIX operating System. It is open source as its
source code is freely available. It is free to use. Linux was designed considering
UNIX compatibility. Its functionality list is quite similar to that of UNIX.
• From smart phones to cars, supercomputers and home appliances, the Linux
operating system is everywhere.
• Linux. It’s been around since the mid ‘90s, and has since reached a user-base that
spans industries and continents.
• But before Linux became the platform to run desktops, servers, and embedded
systems across the globe, it was (and still is) one of the most reliable, secure, and
worry-free operating systems available.
Multitasking Multiprogramming
• Process of executing multiples • Process of executing multiple
tasks at a time programs at a time
20
Difference between Android and IOS
Android IOS
File transfer Easier than iOS. Using USB port More difficult. Media files can be
and Android File Transfer transferred using iTunes desktop
desktop app. Photos can be app. Photos can be transferred out
transferred via USB without via USB without apps.
apps.
App store , Google Play Store – 1,000,000+ Apple App Store – 1,000,000+
apps. apps.
Video chat Google Duo and other 3rd party FaceTime (Apple devices only)
apps and other 3rd party apps
21
Difference between CLI and GUI
CLI GUI
1.
CLI is difficult to use. Whereas it is easy to use.
2.
It consumes low memory. While consumes more memory.
22
(WIN14)
1. Batch operating system
2. Explain Real time OS with the help of diagram. List its type.
3. Describe function of OS in detail.
(SUM15)
1. Explain time sharing operating system.
2. Explain batch operating system.
3. Explain the working of clustered operating system.
(WIN15)
1. List different types of operating systems. Explain advantages of multiprocessor system
2. What is clustered system? Explain it.
3. What is real time system? Explain its types.
4. List any four functions of operating system.
(SUM-16)
1. List any four functions of operating system.
2. Describe real time operating system in brief.
(WIN-16)
1. Define real time operating system. Explain with the help of example.
2. Describe Distributed Operating system.
(SUM-17)
(WIN-18)
1. List any four services provided by operating system.
2. Differentiate between multitasking and multiprogramming.
3. Describe real time system and state any two example of its application.
(SUM-19)
1. Explain real time operating system. Explain its types.
2. Describe multiprocessor operating system with its two advantages.
3. Explain any six services of operating system.
23