CSC 504 - Lecture Series I - Revision oCT 31 2023
CSC 504 - Lecture Series I - Revision oCT 31 2023
BY
OLADEJI F.A.
DEPARTMENT OF COMPUTER SCIENCES
UNIVERSITY OF LAGOS
2023
COURSE CONTENTS
• Advanced concepts in process synchronization:
– distributed systems: architecture, theoretical foundation
– distributed file systems
– distributed coordination of processes
– mutual exclusion, deadlock
– agreement protocols
– distributed resource management- file systems, shared
memory, scheduling and mass storage
– Fault Tolerance and recovery
– Protection and security
Course materials
• Operating systems fundamentals by C.O. Uwadia, Oladeji F.A.,
Willams G. (at the bookshop)
• Abraham Silberschatz, Peter Baer Galvin, and Greg Gagne
(2013). Operating Systems Concepts, 7th Edition, John Wiley &
Sons Inc
• Jean Bacon & Tim Harris (2003), Operating Systems, Concurrent
and Distributed Software Design, Pearson Education Publishers.
• William Stallings (2005), Operating Systems, Internals & Design
principles, fifth edition, Pearson Hall.
• Gary Nutt (2003), Operating Systems, third edition. Addison
Wesley.
Course Grading System
• CA 30%
– Test (Every Week) 10%
– Group Assignment 10%
– Practical (individual) 10%
• EXAM 70%
– Multiple choice and theory
Mind this !!!!!!
• Absent from lecture is an offence
• Not participating in group work is an offence
• Late submission is an offence
• Ensure you are within the environment of
Internet of the University if you don’t have
data to connect e.g. science, senate,
GTB/Zenith or computer science library to gain
maximally.
Activity 1
• Divide yourselves to groups of 8
• Read the chapter 1 of the main text (already
sent to you) and let each group come up with
one page of summary of the chapter.
• Always list your group member as page 1 and
page 2 for the attempt to the summary
• Note that copying verbatim is a great offence
as it earns you zero
OS – an indispensable system program
• For booting after the BIOS run, loads residents
programs, hands over to users
• Depending on user’s operation, OS keeps track of how
much, who use, when, for what of these resources:
memory, processor (s), file, IO devices
• In case of contention among processes, OS releases
these resources and prevent illegal hanging of systems
• OS allows for evolution of both software and hardware
• OS relieves human of direct interaction with hardware
• Etc.
OS as a resource manager
• Process management module:-sees to process creation, process data structure
(PCB), state transitions, process interactions, scheduling and interrupt handling
• Memory management module:- process loading, swapping, memory
preparation, address resolution, enforce memory policy, coalescing,
• Device management module:-Accepts driver to install devices, keeps and
maintains the system bus, the multiple bus, sensitive to data transfer in/out
memories, observes a particular technique to manage I/Os,
setting/configuration of parameters etc
• File management systems- creation, organization of files, accessing of files,
deletion (ZAP), directories
• Network/Distributed management module: protocol setting, NIC setting,
browser loading, document transfer
• Concurrency management system:- inter-processor communications, reusable
devices, deadlock prevention, process synchronization etc.
Definitions
• OS is a suit of programs that manages the
computer systems- hardware, software
resources
• It acts as intermediary between the user,
application programs and the hardware
• An indispensable component of any computer
system
Resources
A View of Operating System Services
OS placement
Goals of OS
• OS has these objectives:
• Convenience: An OS makes a computer more
convenient to use.
• Efficient Resource usage: An OS allows the
computer system resources to be used in an
efficient manner.
• Ability to evolve: An OS should be constructed in
such a way as to permit the effective development,
testing, and introduction of new system functions
without interfering with service
– Resource allocation – When multiple users or
multiple jobs running concurrently, resources must be
allocated to each of them
• Many types of resources - Some (such as CPU cycles, main
memory, and file storage) may have special allocation code,
others (such as I/O devices) may have general request and release
code
• Accounting - To keep track of which users use how much and
what kinds of computer resources
• Protection and security - The owners of information stored in a
multiuser or networked computer system may want to control
use of that information, concurrent processes should not interfere
with each other
– Protection involves ensuring that all access to system resources is
controlled
– Security of the system from outsiders requires user authentication,
extends to defending external I/O devices from invalid access
attempts
– If a system is to be protected and secure, precautions must be
instituted throughout it. A chain is only as strong as its weakest link.
– Communications – Processes may exchange
information, on the same computer or between
computers over a network
• Communications may be via shared memory or through message
passing (packets moved by the OS)
– Error detection – OS needs to be constantly aware
of possible errors
• May occur in the CPU and memory hardware, in I/O devices, in user
program
• For each type of error, OS should take the appropriate action to
ensure correct and consistent computing
• Debugging facilities can greatly enhance the user’s and
programmer’s abilities to efficiently use the system
• I/O status information: Includes outstanding I/O requests, I/O devices (e.g., tape drives)
assigned to this process, a list of files in use by the process.
• Accounting information: May include the amount of processor time and clock
• time used, time limits
OS and a Process
• OS keeps track of a process by
– Getting it loaded to the RAM(Buffering)
– Deciding which process in the RAM is to have the
processor (scheduling or dispatching)
– While executing, OS monitors the PCB information about
the process
– Managing swapping/activating blocked processes
• OS monitors which process use the processor, for
how long and which resource is used by the process
Flow of a Created Process
Blocking of a Process
5-State model
Process States
• New: A process that has just been created but has not yet been
admitted to the RAM even though its process control block has
been created.
• Exit: A process that has been released from the pool of executable
processes by the OS, either because it halted or because it aborted
for some reason or completed
Interleaving of Processes
(1 processor many processes)
Five-state model extension
Reasons for process suspension
Operations on a Process
• Creation (spawning)
• Process scheduling or dispatching
• Swapping in and out of RAM and Virtual RAM
• Deletion /termination (kill or end process)- Task
management
• Process migration
• Process blocking/suspension
• Resuming/waking up a blocked/suspended process
• Change a process priority or address space
Reason for creating processes
Process Scheduling
• The choice of which process among ready processes for
execution is called process dispatching or scheduling
• Efficiency of the OS on this determines the utilization of
the processor, hence the performance
• The objectives of scheduling include:
– maximize the system throughput.
– be ‘fair’ to all users.
– provide tolerable response time for on-line users and turn
around time for batch users.
– degrade performance gracefully under heavy loading.
Dispatch approaches
• FIFO
– Follow order of arrival into the queue
– Favours long jobs : CPU-bound vs I/O-bound jobs
– It is not useful in a time sharing environment
because it cannot guarantee a good response time.
• Shortest Job First(SJF)
• Shortest Remaining Time (SRT)
• Round Robin (RR)
• Priority
– Static )non-preemptive
– Rate-based (preemptive)
OS -> MMM
• Multiple-partition allocation
– Degree of multiprogramming limited by number of partitions
– Variable-partition sizes for efficiency (sized to a given process’ needs)
– Hole – block of available memory; holes of various size are scattered throughout memory
– When a process arrives, it is allocated memory from a hole large enough to accom=modate it
– Process exiting frees its partition, adjacent free partitions combined
– Operating system maintains information about:
a) allocated partitions b) free partitions (hole)
Dynamic Storage-Allocation Problem