Module1 OS
Module1 OS
Module 1
Operating System - Introduction
• Operating System is a software, which makes a
programs.
A computer system can be divided roughly into 4
Components-
➢ Hardware
➢ OS
➢ System & Application programs
➢ Users.
User
System & Application Programs
Operating System
HARD WARE
Software
➢ System Software
➢ Application Software
System Software : Is used for satisfying system
needs.
• Processor management
– Assignment of processors to different tasks.
➢ It is slow
➢ Manual intervention is more
➢ Poor utilization of system resources
Batch processing
• Batch processing is the execution of a series
of identical non-interactive programs ("jobs") on
a computer without manual intervention.
• i.e. Executing a series of non-interactive jobs all
at one time.
• In Batch processing a series of identical non-
interactive jobs are grouped together as a batch
and the batch is executed all at once.
• batched jobs were executed automatically one
after another saving its time by performing the
activities (like loading of compiler) only for once.
• Requires the program, data and commands to be
submitted together in the form of a job.
• It resulted in improved system utilization due to reduced
turn around time(total time between submission of a
process and its completion).
• Batch monitor- memory resident portion of the
batch OS.
- reads ,interprets and execute commands.
Operating
System
(Batch
Monitor)
User Program
and Data
Batch processing
Advantages
• Very little user interaction
• Much improved system utilization.
Disadvantages
• Non-interactive environment - No interaction is
possible with the user while the program being
executed
• Low CPU utilization - CPU Sat idle during I/O
operations and transmission from one job to
another
• Off-line Debugging – cannot correct the errors at the
time it occurs
Multiprogramming
• Multiprogramming is a form of parallel
processing in which several programs are run at
the same time on a single processor.
• Multiprogramming is a feature of an OS which
allows running multiple programs simultaneously
on one CPU.
• Job Pool – all the jobs in the system are kept here
waiting for allocation to main memory
• Job Scheduling - Job scheduling schedules or
decides which process/jobs from job Pool will get
allocation to main memory.
• CPU Scheduling – it is the process by which
an Operating System decides which ready
process/jobs in the main memory get to use
the CPU.
• Multiprogramming is the first instance where
OS makes decisions for users
• Supports multitasking, Multi access , Multi
processing ,multiuser etc…
- Actually programs don’t run
simultaneously, but OS divides time for
each program according to priorities
- Sharing will be done by the OS according
to certain priorities
- Multiprogramming is a Basic form of
parallel processing
Memory Layout of Multiprogramming
Multi programming OS
Pgm-1
Pgm-2
P1 P2 P1 P2 P1 P2 P1 P2
Time
Multi programming
Advantages
• High CPU Utilization
• Support multiple user
• Efficient memory utilization
• More CPU throughput
Disadvantages
• Powerful memory management is required
• CPU Scheduling is must.
• User cannot interact with the job when it is being
executed
Time Sharing OS
➢ Time sharing is a logical extension of
multiprogramming.
➢ In Time sharing, Processor's(CPU) time is shared
among multiple users or tasks simultaneously
➢ Time slice is defined by the OS, for sharing CPU time
between processes.
➢ Time sharing provides sharing a computing
resource among many users by means of
multiprogramming and multi-tasking
➢ Here CPU executes multiple jobs and the user
can interact with each program(using keyboard
or mouse) while it is running.
➢ Here the user feels that the entire system is
dedicated to him/her as the switches occur
rapidly.
➢ A program loaded into memory and executing is
known as a process.
• Time sharing systems
– Need Good memory management and protection
User mode
User process System call Return from Mode bit=1
executing System call
Kernel
Monitor mode
Execute System call Mode bit=0
Timer
• There are chances that OS can stuck in an infinite loop and
never returns to the OS.
• To avoid this a Timer and clock is maintained.
• The timer interrupts after a specified time and checks the
sequence of events
• OS initializes the counter with the amount of allowable
execution time for a process and the timer is decremented
by 1 for every clock tick and when the timer value
becomes negative, the interrupt is sent to terminate the
program.
Operating system services
• User Interface – CLI, Batch , GUI
• Program execution – load,run, end
• I/O operations – I/O devices controlled by OS
• File system manipulation – files/dir manip, permissions
• Communication –shared memory & msg passing
• Error detection – aware of errors in h/w & user pgms
• Resource allocation – multiuser & multi job (cpu scheduling)
• Accounting – usage statistics(track of which user & how much)
• Protection – multi user env., secure using authentication
System call
• Provides the interface to the services made
available by an OS.
• Eg : system calls needed to read and copy from one
file to another.
• Can occur Either -directly or indirectly
• System call to library functions.
• Three general methods for parameter passing in
system call - register
- block
What is the purpose of system calls?