Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 43

Chapter 1

Overview of Operating
System
Introduction to operating system
• It is system software which manages, operates & communicates with
computer h/w &s/w.
• It provides resources (to complete execution of user program) &
services to user program.
• Without operating system, a computer is useless.
• Operating system acts as an interface or intermediary between user &
h/w of computer and also controls execution of application programs.
• It is also called as resource manager.
• Operating system allocates memory to user program as per need.
• 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
Computer System Structure
Computer system can be divided into four
components:
1.Hardware – provides basic computing
resources -CPU, memory, I/O devices
2.Operating system-- Controls and
coordinates use of hardware among
various applications and users
3.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
4.Users- People, machines, other
computers
Computer System-- operation
• I/O devices and the CPU can execute concurrently
• Each device controller is in charge of a particular device type
• Each device controller has a local buffer
• Each device controller type has an operating system device driver to manage it
• CPU moves data from/to main memory to/from local buffers
• I/O is from the device to local buffer of controller
• Device controller informs CPU that it has finished its operation by causing an
interrupt.
• Operating System sits idle and wait in case if there is no process to execute, no I/O
devices to offer service and there is no any user to whom response is to be given.
• And only just wait for something to happen.
• If abnormal condition arises in system during program execution, detected by CPU
is called trap.(software interrupt or exception e.g. division by zero).
Common Functions of Interrupts
• After receiving an interrupt, operating system carry out some housekeeping so that
it can resume its computation.
• Interrupt transfers control to the interrupt service routine generally, through the
interrupt vector or table, which contains the addresses of all the service routines.
• Interrupt handler is then executed & control of CPU is returned to code to
interrupt occurred.
• An operating system is interrupt driven.
Storage Structure
• Main memory – only large storage media that the CPU can access directly
• Random access
• volatile
• Secondary storage – extension of main memory that provides large nonvolatile
storage capacity.
• Hard Disk Drives (HDD) – rigid metal or glass platters covered with magnetic
recording material
• Disk surface is logically divided into tracks, which are subdivided into sectors
• The disk controller determines the logical interaction between the device and
the computer
• Non-volatile memory (NVM) devices– faster than hard disks, nonvolatile
• Various technologies
• Becoming more popular as capacity and performance increases, price drops
Storage Hierarchy
• Storage systems
organized in hierarchy
• Speed
• Cost
• Volatility
• Caching – copying
information into faster
storage system; main
memory can be viewed
as a cache for
secondary storage
• Device Driver for each
device controller to
manage I/O
• Provides uniform
interface between
controller and
kernel
How a Modern Computer Works
Operating System-- operations
• An operating system provides the environment within which programs are
executed.
• Internally, operating systems vary greatly, since they are organized along many
different lines.
• There are many commonalities, which we consider in this section.
• For a computer to start running, when it is powered up or rebooted—it needs to
have an initial program to run.
• This initial program, or bootstrap program, tends to be simple. it is stored within
the computer hardware in firmware. It initializes all aspects of the system, from
CPU registers to device controllers to memory contents.
• The bootstrap program must know how to load the operating system and how to
start executing that system.
• To accomplish this goal, the bootstrap program must locate the operating-system
kernel and load it into memory.
• Once the kernel is loaded and executing, it can start providing services to the
system and its users.
• Some services are provided outside of the kernel by system programs that are
loaded into memory at boot time to become system daemons, which run the entire
time the kernel is running.
Operating System-- operations
• If there are no processes to execute, no I/O devices to service, and no users to
whom to respond, an operating system waiting for something to happen (interrupt).
• Kernel interrupt driven (hardware and software)
• Hardware interrupt by one of the devices
• Software interrupt (exception or trap):
• Software error (e.g., division by zero)
• Request for operating system service – system call
• Other process problems include infinite loop, processes modifying each
other or the operating system
Dual Mode Operation
• Dual-mode operation allows OS to protect itself and other system components
• User mode ( memory & register access is restricted, CPU gets switched to
kernel mode while executing operating system code)and kernel mode (all
instructions are allowed to be executed & all registers are accessible).
• In booting of system h/w is in kernel mode, when OS is loaded & user application
start executing then is in user mode.
• Mode bit provided by hardware
• Provides ability to distinguish when system is running user code (1)or kernel
code(0).
• When a user is running  mode bit is “user”
• When kernel code is executing  mode bit is “kernel”
• How do we guarantee that user does not explicitly set the mode bit to “kernel”?
• System call changes mode to kernel, return from call resets it to user
• Some instructions designated as privileged, only executable in kernel mode
Timer
• Timer to prevent infinite loop (or process hogging resources)
• Timer is set to interrupt the computer after some time period
• Keep a counter that is decremented by the physical clock
• Operating system set the counter (privileged instruction)
• When counter zero generate an interrupt
• Set up before scheduling process to regain control or terminate program
that exceeds allotted time
Multiprogramming (Batch system)
• Aspect of operating systems is the ability to run
multiple programs at a time.
• Single user cannot always keep CPU and I/O devices
busy
• Multiprogramming increases CPU utilization &
organizes jobs (code and data) so CPU always has
one to execute
• A subset of total jobs in system is kept in memory
• One job selected and run via job scheduling
• When job has to wait (for I/O for example), OS
switches to another job
• In a multiprogrammed system, a program in execution
is termed a process.
Multitasking (Timesharing)
• It is a logical extension of Batch systems– the CPU switches jobs so frequently
that users can interact with each job while it is running, creating interactive
computing
• Response time should be < 1 second
• Each user has at least one program executing in memory  process
• If several jobs ready to run at the same time  CPU scheduling
• If processes don’t fit in memory, swapping moves them in and out to run
• Virtual memory allows execution of processes not completely in memory
Resource Management
• Operating system is a resource manager.
• Multiple users/applications can share the resources. The reasons is of sharing are:
1. The devices are expensive, so sharing saves the cost.
2. The data needs to be shared as well as needs to be communicated.
• Facing numerous and conflicting requests for resources, the OS must decide:
1. How to allocate them to specific programs (processes, jobs)?
2. How to protect applications from one another?
3. How to provide fair and efficient access to resources?
4. How to operate and control the various I/O devices?
• It needs to manage following:
1. Process Management
2. Memory Management
3. File-System Management
4. Mass-Storage Management
5. Cache Management
6. I/O System Management
Components of operating system
• Operating system consist of many components.
• Each component has its own set of defined i/p & o/p.
• Different components perform precise tasks to offer the overall
functionality of Operating system.

Functions of operating system


1. Process management
2. Memory management
3. Storage Management
4. Device Management
5. Protection and Security
6. User Interface or Command Interpreter
7. Booting the Computer
8. Performs basic computer tasks
1. Process Management
• The process management activities involves:
1.To provide control access to shared resources like file, memory, I/O
and CPU.
2.Control the execution of user applications.
3.Creation, execution and deletion of user and system processes.
4.Resume a process execution or cancel it.
5.Scheduling of a process.
6.Synchronization, interprocess communication and deadlock handling
for process.

2. Memory Management
• The memory management activities handled by operating system are:
1.Allocation of memory to the processes
2.Free the memory from process after completion of execution
3.Reallocation of memory to a program after used block becomes free
4.Keep track of memory usage by the process.
3. Storage Management
1. File System Management: activities of operating system consist of:
• Creation and deletion of files and directories.
• Provide access to files and allocation of storage space for files.
• Maintain back-up of files.
• File Security.
2. Mass-storage Management:
• Free space management, storage allocation, Disk scheduling
3. Caching:

4. Device (I/O) Management


• The device management tasks includes:
1. To open, close and write device drivers,
2. Communicate, control and monitor the device driver.
5 Protection and Security
• Resources of system are protected by the operating system.
• User authentication, file attributes such as read,write, encryption and back-up of
data are used by operating system to give necessary protection.
 Protection – any mechanism for controlling access of processes or users to
resources defined by the OS
 Security – defense of the system against internal and external attacks
 Huge range, including denial-of-service, worms, viruses, identity theft, theft of

service
 Systems generally first distinguish among users, to determine who can do what
 User identities (user IDs, security IDs) include name and associated number,

one per user


 User ID then associated with all files, processes of that user to determine

access control
 Group identifier (group ID) allows set of users to be defined and controls

managed, then also associated with each process, file


 Privilege escalation allows user to change to effective ID with more rights
6. User Interface or Command Interpreter
• The role of operating system is to work as interface between the user and
hardware of the computer. This interface is provided by operating system
through set of commands or it is a Graphical User Interface (GUI)

7. Booting the Computer


• The process of starting or restarting the computer is known as booting.
• If computer is switched off completely and if turned on then it is called cold
booting.
• A warm booting is the process of using the operating system to restart the
computer.
8. Performs basic computer tasks
• The different peripheral devices such as the mouse, keyboard and printers
are managed by operating system. Most operating systems are plug and play
which means any device will automatically be detected and configured
without any user interference.
Evolution of Operating System
 First OS were developed in the early 1950s,it is not so powerful.
 The main aim of development of OS to minimize the idle time of system & to use
computer system in the most efficient and economic way.
 The primary goal of OS is to convenience for the user.
 Designers face many problems in design & implementation of OS
 The evolution of OS went through major phases.
Different types of OS are
i) Batch Operating system
ii) Multi programming system
iii) Multi Tasking system
iv) Time sharing system
v) Multi Processor system
vi) Distributed System
Vii) Clustered System
viii) Real Time System
Serial Processing
 Programmer interacted directly to computer hardware
 program loaded via punch card & card reader.
If error – light on, successful – output on printers
 Run one job at a time.
 problems – scheduling -- setup time
$END
Data for
program
$RUN
$LOAD

$FORTRAN
$JOB, 10,6610802, ETHAN MILLER
Batch Operating Systems

Batch monitor functions:


i) scheduling

ii) Memory Management


iii) Sharing and

 Uses a piece of software called ‘Batch Protection


Batch monitor responsible for :-
Monitor or supervisor‘ i) Accepting commands from system
 User submits the job on cards or tape to operator
computer operator. ii) Initiates the processing the batch
 operator batches the job together iii) sets up the processing of first job
sequentially and places the entire batch iv) After ending of first job next job
to BPS for use by monitor execution is started
 When job completes control back to the v) at the end of batch terminates the
monitor and monitor automatically batch and awaits initiation of next
begin loading the next program batch by operator.
Uniprogramming
 Processor must wait for I/O instruction to complete before preceding
Multi Programming
 To execute multiple jobs by single processor
 No. of jobs (processes) in memory , OS execute one of the job
 when current job waits for some reason then OS executes another job.
 CPU will never be idle to increase throughput, response time
 When one job needs to wait for I/O, the processor can switch to the other job.

Job 3
Job 2
Memory
partitions Job 1
Operating
system
Multi Programming
Multi Tasking
 Task means instance of a process and process means program in execution.
 A CPU handling multiple tasks at a time known as multitasking
 Multitasking is the ability to support two or more processes execution
simultaneously.
 Multitasking OS allows code and data of several processes to reside in memory .
 Multitasking OS resources are made continuously working.
 Time sharing principle used while multiple programs are executed.
 Multiple applications can be open in background and foreground.

Time Sharing
 Principle used by time sharing were CPU scheduling and multiprogramming to
handle multiple interactive jobs
 Processor’s time is shared among multiple users
 Multiple users simultaneously access the system through terminals
 Examples – Dartmouth , Multics , Unix etc.
Multiprocessor (Parallel) Systems
 Multiprocessor systems with more than one CPU in close communication.
 Tightly coupled system – processors share memory and a clock; communication
usually takes place through the shared memory.
 Advantages of parallel system:
 Increased throughput

 Economical Symmetric
 Increased reliability Multiprocessing
Architecture
 Symmetric multiprocessing (SMP)
 Each processor runs and identical copy of the operating system.

 Many processes can run at once without performance decrease.

 Most modern operating systems support SMP

 Asymmetric multiprocessing
 Each processor is assigned a specific task; master processor schedules and

allocated work to slave processors.


 More common in extremely large systems
Multiprocessor (Parallel) Systems
Distributed Systems
 Distribute the computation among several physical processors.
 Loosely coupled system – each processor has its own local memory; processors
communicate with one another through various communications lines, such as
high-speed buses or telephone lines.
 Example : Amoeba Operating System.
 Advantages of distributed systems.
 Resources Sharing, Computation speed up – load sharing, Reliability, Communications
 Requires networking infrastructure.
 Local area networks (LAN) or Wide area networks (WAN)
 May be either client-server or peer-to-peer systems.

General Structure of Client-Server


Clustered Systems
 Cluster architecture interconnects two or more computers using additional network
and software technology to make single virtual or logical server
 Opportunity to link together powerful UNIX system into even more powerful servers
 Multiples of each component present in cluster if anyone fail no issue for cluster.
 Clustering allows two or more systems to share storage.
 Provides high reliability.
 Asymmetric clustering: one server runs the application while other servers standby.
 Symmetric clustering: all N hosts are running the application.
Real-Time Systems
 Often used as a control device in a dedicated application such as controlling
scientific experiments, medical imaging systems, industrial control systems, and
some display systems.
 Well-defined fixed-time constraints.
 Real-Time systems may be either hard or soft real-time.
 Examples: Real time O.S. are Lynx, MTOS, QNX, RTX, pSOS
 Hard real-time:
 Guarantees that typical task completes on time
 All delays in the system be bounded.

 Soft real-time
 Less restrictive type , critical real time task get priority over other tasks.
 Application of RTOS :Preemptive multitasking design paradigm , application
portability , System level debug and analysis tools , most efficient use of CPU
resources.
 Examples :- Nuclear power plant control, Industrial manufacturing control,
Medical monitoring, Weapon delivery systems, Space navigation and guidance
Mobile Operating System
 It controls Smartphone mobile devices ,PDA’s , tablet PC & Information appliances
 Mobile OS are -
 Android OS
 Windows OS
 iOS
 Symbian
 Android OS -
 Developed by Google
 Modified version of Linux Kernel & Open source software's for touchscreen
 Application developed in JAVA lang. using Android software development kit
 Once Application developed it packaged easily and sold out through Google

Play, SlideME, Opera Mobile store, Mobango, F-droid & amazon appstore
 UI is touch inputs like swiping, tapping, pinching reverse pinching etc.
Mobile Operating System

Windows OS -
 Developed by Microsoft
 Internet Explorer mobile is the default browser for windows mobile
 It contains office mobile -a suit of mobile version of Microsoft office

iOS -
 Developed by Apple exclusively for its hardware
 iPhone, ipad, ipod Touch contains iOS
 Second most popular after Android
 Interaction with OS include swipe, tap, pinch reverse pinching etc.

Symbian OS -
 Developed by Symbian Ltd. But currently maintained by Nokia ( Microsoft )
 It has graphics tool kit known as AVKON
 It is the first mobile platform to make use of Webkit browser. Some older symbian os have opera browser as
the default browser
 Most applications are written in c++
 Symbian devices can be programmed using Python,Java ME, Flash Lite,.Net etc
Mobile Operating System
Mobile Operating System
Operating-System Services

User view :-
The user’s view of the computer varies according to the interface being used.

The goal is to maximize the work (or play) that the user is performing. Operating

system is designed for ease of use, performance and security and resource utilization—
how various hardware and software resources are shared.
Operating System Views
System View :-
 operating system is the program most involved with hardware. We can view an
operating system as a resource allocator.
A computer system has many resources that required to solve a problem: CPU

time, memory space, storage space, I/O devices, and so on.


 It allocate resources (software and hardware) of the computer system and

manage them efficiently.

A slightly different view of an operating system emphasizes the need to control


the various I/O devices and user programs.
A control program manages the execution of user programs to prevent errors

and improper use of the computer. Controls execution of user programs and
operation of I/O devices.
User and Operating-System Interface
 Command Line Interface based OS
 command-line interface, or command interpreter, that allows users to
directly enter commands to be performed by the operating system
 Graphical User Interface based OS
 allow users to interface with the operating system via a graphical user
interface, or GUI.
Command Line Interface
 Most operating systems, including Linux, UNIX, and Windows, treat the command
interpreter as a special program that is running when a process is initiated or when
a user first logs on (on interactive systems).
 On systems with multiple command interpreters to choose from, the interpreters are
known as shells.
 For example, on UNIX and Linux systems, a user may choose among several
different shells, including the C shell, Bourne-Again shell, Korn shell, and others.
 The main function of the command interpreter is to get and execute the next user-
specified command.
 Many of the commands given at this level manipulate files: create, delete, list, print,
copy, execute, and so on.
 The various shells available on UNIX systems operate in this way.
 the command interpreter itself contains the code to execute the command
 operating systems —implements most commands through system programs.
 Example: DOS, UNIX
Graphical User Interface
 Rather than entering commands directly via a command-line interface, users
employ a mouse-based window and-menu system characterized by a desktop
metaphor.
 The user moves the mouse to position its pointer on images, or icons, on the screen
(the desktop) that represent programs, files, directories, and system functions.
 Depending on the mouse pointer’s location, clicking a button on the mouse can
invoke a program, select a file or directory—known as a folder—or pull down a
menu that contains commands.
 Touch-Screen Interface
 Because a either a command-line interface or a mouse-and-keyboard system is
impractical for most mobile systems, smartphones and handheld tablet computers
typically use a touch-screen interface.
 Here, users interact by making gestures on the touch screen—for example, pressing
and swiping fingers across the screen.
 Although earlier smartphones included a physical keyboard, most smartphones and
tablets now simulate a keyboard on the touch screen
 Example: Windows, Linux
Difference bet. CLI & GUI
Difference bet. CLI & GUI

You might also like