2. Agenda for today
► Single-user systems
► Batch systems
► Multiprogram systems
► Time-sharing systems
► Distributed systems
► Real-time systems
► Mobile OS
► Interrupts, traps, and signals
► CPU, I/O, and memory protection Interactive
Lahore Garrison University
2
3. Single user systems
► Personal computers – computer system dedicated to a
single user.(many but 1 at a time)
► Interactive(Accepting input from a human. Interactive
computer systems are programs that allow users to enter
data or commands. Most popular programs, such as
word processors and spreadsheet applications, are
interactive.
► A non interactive program is one that, when started,
continues without requiring human contact. A compiler
is a non interactive program)
► User convenience and responsiveness.
Lahore Garrison University
3
4. Batch systems
► First Fundamental system.
► User operator
► Reduce setup time by batching similar jobs
► Automatic job sequencing – automatically transfers control from one job to another.
► Resident monitor :
► initial control in monitor
► control transfers to job
► when job completes
► control transfers back to monitor
Lahore Garrison University
4
7. Multiprogrammed systems
Sharing the processor, when two or more programs reside in memory at the same
time, is referred as multiprogramming
Multiprogramming increases CPU utilization by organizing jobs so that the CPU
always has one to execute.
Several jobs are kept in main memory at the same time, and the CPU is
multiplexed among them.
Multiprogramming operating systems monitor the state of all active programs and
system resources using memory management programs to ensures that the CPU
is never idle, unless there are no jobs to process.
Lahore Garrison University
7
8. Multiprogrammed Systems
Example: Two processes P1 and P2 with CPU and I/O
bursts of one time unit each
Lahore Garrison University
8
P1
P2
…
CPU
Burst
I/O
Burst
P1
P2
9. Os features needed for
Multiprogramming
► Spooling (Simultaneous Peripheral
Operation On-Line)(put job in
buffer)
► Memory management
► CPU scheduling
Lahore Garrison University
9
10. Time sharing systems
► A multi user and multi process system.
► An interactive system with multiprogramming
► To obtain a reasonable response time, jobs may have
to be swapped in and out of main memory.
► UNIX, Linux, Widows NT server, and Windows 2000
server
Lahore Garrison University
10
11. Distributed Operating System
Distributed systems use many central processors to serve multiple real-time applications and
users. As a result, data processing jobs are distributed between the processors.
It connects multiple computers via a single communication channel. Furthermore, each of these
systems has its own processor and memory.
Additionally, these CPUs communicate via high-speed buses or telephone lines. Individual
systems that communicate via a single channel are regarded as a single entity. They're also
known as loosely coupled systems.
12. Real Time systems
► 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 the response time
► A real-time operating system must have well-defined, fixed time constraints, otherwise the system
will fail such as controlling scientific experiments, medical imaging systems, industrial control
systems, and some display systems. Plane landing. Ventilators.
► Real-Time systems may be either hard or soft real-time.
Lahore Garrison University
12
13. Real Time systems
Hard real-time systems:
► Secondary storage limited are absent, data stored in short term memory, or
read-only memory (ROM).coz time is short
► No virtual memory—time cannot be “wasted” on translation of logical to
physical addresses.
► OS code structured for efficiency
► Plane landing systems, process control in nuclear power plants, ventilators, etc.
Lahore Garrison University
13
14. Real time systems (Cont..)
Soft real-time systems
► Output should be produced within the given time constraints but if it is not, the result is
not life threatening.
► Useful in applications (Live Video Streaming) requiring advanced operating-system
features
Mobile Communication
Music Playing Robots
Weather Station
Lahore Garrison University
14
15. Mobile OS
OS for smartphones, tablets, and PDA’s. It is a platform on which other applications can run
on mobile devices.
Examples of the Mobile OS: Android OS, ios, Symbian OS, and windows mobile OS
16. Interrupts
Interrupts are signals sent to the CPU by external devices, normally I/O devices. They tell the
CPU to stop its current activities and execute the appropriate part of the operating system
After the interrupt signal is sensed, the computer either resumes running the current program
or begins running another program.
An operating system usually has some code that is called an interrupt handler. The interrupt
handler prioritizes the interrupts and saves them in a queue if more than one is waiting to be
handled.
17. Interrupts, Traps and Signals
Interrupt---an event generated by a device in a computer to get attention of the CPU(from
hardware devices)
Trap—an event by the CPU itself as it executes a program
Signal—an event generated by a user
Lahore Garrison University
17
18. Interrupts, trap, signals
If you press any key(keyboard) or moving the
mouse…..Example of interrupt
Hardware may trigger an interrupt at any time by sending
a signal to the CPU usually by way of the system bus.
Software may trigger an interrupt by executing a special
operation called a system call
Lahore Garrison University
18
Answer
the Phone
.
.
.
Resume
19. Interrupts, trap, signals
► A process can generate a trap, for example, by dividing a number by zero.
► caused either by an error (division by zero or invalid memory access) or by a user request
for an operating system service.
► A user or a process may generate a signal (an interrupt to a process)
Lahore Garrison University
19
20. Interrupt handling
► In case of interrupt or trap, the CPU invokes a piece of code in the OS to service it,
known as interrupt service routine(ISR) or trap service routine(TSR)
► In case of signal, the process can take one of the three possible actions , default action
as defined by OS, ignore signal, or take a programmer specified action
Lahore Garrison University
20
21. Interrupt handling (Cont..)
► Interrupt transfers control to the interrupt service routine, generally, through the interrupt
vector, which contains addresses of all the interrupt service routines.
► Interrupt architecture must save the address of the instruction after the interrupted instruction
and the CPU state so that execution of the interrupted process may continue after the
interrupt has been serviced.
Lahore Garrison University
21
22. As we have time sharing system so multiple user may be there. Here comes
the issue of protection
One user may delete the files of others.
Or may overwrite program in memory
23. Hardware protection
► Dual-Mode Operation
► I/O Protection
► Memory Protection
► CPU Protection
Lahore Garrison University
23
24. Dual Mode Operation
► Sharing system resources requires operating system to ensure that an incorrect program
cannot cause other programs to execute incorrectly.
► Provide hardware support to differentiate between at least two modes of operations.
► User mode – execution done on behalf of a user.
► Monitor mode (also kernel mode or system mode) – execution done on
behalf of operating system.
Lahore Garrison University
24
25. Dual Mode Operation
► Mode bit added to computer hardware to indicate the current mode: monitor (0) or
user (1).
► When an interrupt or fault occurs hardware switches to monitor mode.
► Privileged instructions can be issued only in monitor mode.
Lahore Garrison University
25
monitor user
Interrupt/fault
set user mode
26. Reference
To cover this topics , different reference material has been used for consultation.
Operating systems concept by Abraham siberchatz edition 9
Tutorialspoint.com
Google.com
26
Lahore Garrison University
Editor's Notes
#4:Examples of Batch OS: payroll system, bank statements, data entry, etc.