Professional Documents
Culture Documents
Chapter 1 Lecture 1,2,3,4
Chapter 1 Lecture 1,2,3,4
Multiprocessor Systems
Multiprocessor Systems: Have two (or more) processors, each with
a single-core CPU. Example from mobile devices to servers.
Multiprocessors systems growing in use and importance:
•Also known as parallel systems, tightly-coupled systems.
Advantages of Multiprocessor Systems
1.Increased throughput: By increasing the number of processors, we
expect to get more work done in less time (i.e. gets more jobs done).
2.Economy of scale: Multiprocessor systems can cost less than
equivalent multiple single-processor systems, because they can share
peripherals, mass storage, and power supplies.
3.Increased reliability: graceful degradation or fault tolerance (i.e. the
failure of one processor will not halt the whole system).
Two Types of Multiprocessor Systems:
Asymmetric Multiprocessing: each processor is assigned a specific
task.
•A master–slave relationship.
•A master processor controls the system: schedules and allocates work
to the slave processors.
Symmetric Multiprocessing (SMP): each processor performs all tasks
(including OS functions and user processes).
•The most common systems.
•All processors are peers; no master–slave relationship exists between
processors.
Each CPU processor has its own set of registers and a private or local
cache.
All processors share physical memory over the system bus.
Clustered Systems
Like multiprocessor systems, but multiple systems working together:
•A cluster consists of several computer systems (nodes) connected via
a network; each node is typically a multicore system.
•These systems are considered loosely coupled.
•Some clusters are for high-performance computing (HPC)
Usually sharing storage via a storage-area network (SAN).
Some clustered systems have distributed lock manager (DLM) to
avoid conflicting operations.
Advantages of Clustered Systems
Provides a high-availability service which survives failures.
•The service will continue even if one or more systems in the cluster fail.
High availability provides increased reliability, which is crucial in many
applications.
•Asymmetric clustering.
One machine is in hot-standby mode while the other is running the
applications.
•Symmetric clustering.
Two or more hosts (nodes) are running applications and are monitoring
each other.
Computer System Operations
For a computer to start running-for instance, when it is powered up or
rebooted, it needs to have an initial program to run.
This initial program, or bootstrap program. (Very simple program)
•It is stored in read-only memory (ROM) or electrically erasable
programmable read-only memory (EEPROM), the computer hardware.
•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 to start executing that system.
•To accomplish this goal, the bootstrap program must locate and load
into memory the operating system kernel.
Kernel is interrupt driven (i.e. hardware and software interrupts):
•Hardware interrupt by one of the devices.
•Software interrupt (exception or trap):
Software error (e.g. division by zero or invalid memory access).
Request for operating system service – system call.
Dual-mode Operation
Dual-mode operation allows OS to protect itself and other system
components: User mode and kernel mode (also called supervisor
mode, system mode, or privileged mode).
Mode bit provided by hardware:
•Provides ability to distinguish when system is running user code or
kernel code.
•When a user code is running mode bit = 1 is “user”.
•When a kernel code is executing mode bit = 0 is “kernel”.
A user application requests a service from the operating system via a
system call.
Some instructions designated as privileged, only executable in kernel
mode.
Timer
We must ensure that the operating system maintains control over the
CPU.
To accomplish this goal, we can use a timer.
Before turning over control to the user, the operating system ensures
that the timer is set to interrupt.
If the timer interrupts, control transfers automatically to the operating
system.
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.
When counter zero generate an interrupt.
Review: Different Types of Interrupts
I/O completion interrupt
Timer interrupt
Exception
System call
Process Management
A process is a program in execution. It is a unit of work within the
system.
•Program is a passive entity.
•Process is an active entity.
Process termination requires reclaim of any reusable resources.
Single-threaded process has one program counter specifying location
of next instruction to execute.
Multi-threaded process has one program counter per thread.
Process Management Activities
•Creating and deleting both user and system processes.
•Scheduling processes and threads on the CPUs.
•Suspending and resuming processes.
•Providing mechanisms for process synchronization.
•Providing mechanisms for process communication.
•Providing mechanisms for deadlock handling.
Memory Management
To execute a program:
•All (or part) of the instructions must be in memory.
•All (or part) of the data that is needed by the program must be in
memory.
Memory management determines what is in memory and when.
the program terminates, its memory space is declared available, and
the next program can be loaded and executed.
Memory Management Activities
•Keeping track of which parts of memory are currently being used and
which process is using them.
•Deciding which processes (or parts of processes) and data to move
into and out of memory.
•Allocating and deallocating memory space as needed.
File-system Management
•Abstracts physical properties to logical storage unit - file.
File-System management:
•Files usually organized into directories.
•Access control on most systems to determine who can access what
•OS activities include:
Creating and deleting files and directories.
Primitives to manipulate files and directories.
Mapping files onto secondary storage.
Backup files onto stable (non-volatile) storage media.
With my Best wishes 2022 Eng Ihap EL-Galaly 01062665758 12
Mass-Storage Management
Usually disks used to store data that does not fit in main memory or
data that must be kept for a “long” period of time.
Entire speed of computer operation hinges on disk subsystem and its
algorithms.
OS activities:
•Mounting and unmounting
•Free-space management
•Storage allocation
•Disk scheduling
•Partitioning
•Protection
Mounting a file system is making the file system available for use by
the system and its users.
Cache Management
Caching is an important principle, performed at many levels in a
computer (in hardware, operating system, software).
Information in use copied from slower to faster storage temporarily.
Faster storage (cache) checked first to determine if information
Movement between levels of storage hierarchy can be explicit or
implicit.