0% found this document useful (0 votes)
9 views33 pages

CSC204 - Chapter 3.1 (new 2023)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views33 pages

CSC204 - Chapter 3.1 (new 2023)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 33

CSC204

PRACTICAL APPROACH
OF OPERATING SYSTEM

Chapter 3: OS– System View


OVERVIEW
3.0 OS - System View
3.1 Process Management
3.1.1 Process Concepts
3.1.2 Single Tasking
3.1.3 Multitasking

3.2 Memory Management


3.2.1 Memory Hierarchy
3.2.2 Physical Memory
3.2.3 Virtual Memory
OVERVIEW
3.0 OS - User View
3.3 I/O Management
3.3.1 I/O System Organization
3.3.2 I/O Communication Techniques
3.3.3 Direct Memory Access
3.3.4 Buffering

3.4 OS Internal Protection and Security


3.4.1 User Authentication
3.4.2 Basic Resource Protection
3.1 PROCESSS
MANAGEMENT

3.1.1 Process Concepts


3.1.2 Single Tasking
3.1.3 Multitasking
3.1 PROCESS
MANAGEMENT
Process Concepts
3.1.1

What is a program ??
 Inactive @ passive entity, such as a file stored on
a disk.
 What is a program To an operating system, a
program/job/ task is a unit of work that has been
submitted by user.
 “Job” is usually associated with batch systems.
 “Task” is usually associated with multitasking
systems.
What is a process ??
 A process is a program in execution.
 Active entity, which requires a set of resources,
including a processor and special registers to
perform its function.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
A process includes :-
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
 2 types of process :-
O/S process = executes system
codes
User process = executes user codes

Operating System process - For example, when you open a program


on your computer, the operating system allocates memory to store
the program's instructions and data.
User process - Web Browser: A user process that allows users to
browse the internet, visit websites, and interact with web-based
applications.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
 Each process is represented in the OS by
a process control block (PCB) or task
control block.
 Each PCB is unique, there are no two
PCB’s alike
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
CPU scheduling information
includes a process priority, Identify the current state new,
pointers to scheduling queues ready, running, waiting,
or other scheduling terminated
Accounting information
parameters
includes the amount of CPU
Counter indicated the address and real time used, time
of next instructions to be limits, process numbers and
executed by this process etc.
Accumulators, index, stack
pointers, state info when
interrupt occurs.
Memory management
information, value of base &
limit registers, page tables,
segment tables used by O/S
I/O status information list of
I/O devices allocate for this
process. List of open files.

Process Control Block (PCB)


3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Process State
 As a process executes, it changes
state.
 The state of a process is defined in
part by the current activity of that
process.
 Only one process can be running on
any processor at any instant.
 However, many processes may be
ready and waiting for their turn to be
processed.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Process State includes: Example : Running State:
When a process is in the
running state, it means that it
is currently utilizing the CPU
and executing its instructions.
The operating system allocates
CPU time to the process,
allowing it to perform its tasks.
This is the state in which the
process is actively making
progress and executing its
code.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Diagram of Process State

Hold(New) Admitte Finished


d
Interrupt Exit

Ready Running
Job pool

Scheduler
I/O or dispatch
event I/O or
completio
Handled by Process event wait
Waiting
Scheduler n
Handled by Job Scheduler
difference between Process
scheduler and Job Scheduler
(illustration)

Job scheduler decides which job The process scheduler ensures


should be processed. It takes into that the each job is processed
account the computer resource smoothly by assigning computer
availability. The job scheduler's focus resource (allocation). It focuses
is on long-term planning and on short term planning breaking
optimizing the process workflow down each job into several task
rather than managing individual base on the availability of the
tasks. computer resources.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
 In a processing cycle, a process might
Example of have to wait for computer resources, as it
computer resources:
waits, the process will be placed in a
1) CPU time/cycle
2) Memory (RAM) queue
3) Storage
Job queue - set of all processes in
devices
4) I/O devices the system, that are waiting to be
moved into memory.
Ready queue - set of all processes
residing in main memory, ready and
waiting to be executed by CPU.
Device @ I/O queue - set of
processes waiting for an I/O device
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
O/S control the selection of the process from one queue to another.
The selection of the process is carried out by a scheduler
Long Term Scheduler (Job Scheduler)
selects process to READY
Short Term Scheduler (Process @ CPU Scheduler)
selects process to RUNNING
Medium Term Scheduler
selects process waiting to READY
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Long Term Scheduler
 Also known as Job Scheduler.
 Selects processes from the job queue
and loads them into memory for
execution.
 Long-term scheduler is invoked very
infrequently and slow.
 The long-term scheduler controls the
degree of multiprogramming and a
good combination of I/O bound and
CPU bound processes.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Short Term Scheduler
 Also known as Process or CPU
Scheduler.
 Select from among the processes that
are ready to execute and allocates the
CPU to one of them.
 Short-term scheduler is invoked very
frequently and very fast.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Medium Term Scheduler
 The process will be swapped out from
memory and swapped back in later for
continuation.
 This swapping scheme is to reduce
the degree of multiprogramming and
balance the process mixture.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
Context Switch
 Happens when switching the CPU to another
process.
 Saving the state of the old process and
loading the saved state for new process.
3.1 PROCESS
MANAGEMENT
3.1.1 Process Concepts
 Process Manager performs job
scheduling, process scheduling and
interrupt management.
 In single-tasking, processor is busy only
when user is executing a job—at all other
times it is idle.
Processor management is simple.
 In multiprogramming environment,
processor must be allocated to each job
in a fair and efficient manner.
Requires scheduling policy and a
scheduling algorithm. Eg. FCFS, SJF,
3.1 PROCESS
MANAGEMENT
3.1.2 Single Tasking
 Only one program executed at a time
 Begins running a new program on a
computer system as soon as the
current program is completed.
 Example: Palm OS for Palm handheld
computers
 Single tasking is divided by 2 types of
processing:
Memory layout of
1) Sequential Processing
early computer
systems 2) Batch Processing
3.1 PROCESS MANAGEMENT..
Single task examples
3.1 PROCESS
MANAGEMENT
3.1.2 Single Tasking
Sequential Processing
 New programs or commands
cannot be started until the
preceding program or
command has completed.
 Will complete executing each
command before going on to
the next
 Example: when you enter
commands line by line.
3.1 PROCESS
MANAGEMENT
3.1.2 Single Tasking
Batch Processing
 Jobs or several user programs are
grouped into a batch and processed one
after another in a continuous stream.
 Not interactive so user cannot interact
with program while the program is
running.
 Example: The customer does not
receive a bill for each separate credit
card purchase but one monthly bill for
all of that month's purchases.
3.1 PROCESS
MANAGEMENT
3.1.2 Single Tasking
Batch Processing
3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
 Multi-tasking OS provides the ability to
run more than one program at once.
 Multi-tasking is divided by 2 types of
processing:
1) Multiprogramming
2) Time Sharing Systems
3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
Multiprogramming
 Batched and non-interactive
 Multiprogramming increases CPU
utilization by organizing jobs so that
the CPU always has one to execute
The operating system keeps several
jobs in memory simultaneously
It picks and begins to execute one of
the jobs in memory
3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
Multiprogramming
 Eventually, the job may have to wait
for some task to complete
 In a multiprogrammed system, the OS
switches to another job and executes
it
 The first job finishes waiting and gets
the CPU back
 As long as at least one job needs
to execute – the CPU is never idle
3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
Multiprogramming

Memory Layout for Multi-program System


3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
Time Sharing Systems
 Time sharing is a logical extension of
multiprogramming
 In time sharing systems, the CPU
executes multiple jobs by switching
among them, but the switches occur so
frequently that the users can interact
with each program while it is running
 It requires an interactive computer
system providing direct communication
between user and the system
3.1 PROCESS
MANAGEMENT
3.1.3 Multi-tasking
Time Sharing Systems

You might also like