0% found this document useful (0 votes)
26 views

Lecture 1 - Chap - 1-2

Uploaded by

Teh Kai Ze
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)
26 views

Lecture 1 - Chap - 1-2

Uploaded by

Teh Kai Ze
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/ 49

UCCD 2103 Operating Systems

Lecture 1:
Introduction

1
Overview

Overview of Computer-System Organization & Architecture


Computer System Structure
Computer System Operation
What is an Operating Systems?
The Role of Operating Systems
Kernel
Evolution of Operating Systems
Process Management
Memory Management
Storage Management
Protection and Security
Scheduling and Resource Management
Different Architectural Approaches
Memory Hierarchy
Summary

2
Overview of COA
 One or more CPUs, device controllers connect through common bus
providing access to shared memory
 Concurrent execution of CPUs and devices competing for memory
cycles
Overview of COA

But putting together these


Main hardware does not mean it
will work automatically!
Memory You need software to
+ manage them....

+ = Computer hardware
Processor
Motherboard (bus and I/O)
+
Graphics
adapter
Overview of Computer System Structure

 Computer system can be divided into four components:


 Hardware – provides basic computing resources
 CPU, memory, I/O devices
 Operating system
 Controlsand coordinates use of hardware among
various applications and users
 Application programs – define the ways in which the
system resources are used to solve the computing
problems of the users
 Wordprocessors, compilers, web browsers, database
systems, video games
 Users
 People, machines, other computers
Overview of Computer System Structure
Computer-System Operation

 I/O devices and the CPU can execute concurrently


 Each device controller is in charge of a particular device
type
 Each device controller has a local buffer
 CPU moves data from/to main memory to/from local
buffers
 I/O is from the device to local buffer of controller
 Device controller informs CPU that it has finished its
operation by causing an interrupt
What is an OS?
 A program that controls the execution of application
programs
 An interface between applications and hardware
 Main objectives of an OS:
– Convenience
– Efficiency
– Ability to evolve
The Role of an OS

 OS is a resource manager
– Manages all resources
– Decides between conflicting requests for efficient and fair
resource use

 OS is a control program
– Controls execution of programs to prevent errors and
improper use of the computer
– Protect the system from incorrect or malicious programs
and users

9
OS as Resource Manager

10
The Role of an OS (Cont’d)

 Depends on the point of view


 Normal users want convenience, ease of use
– Don’t care about resource utilization
– Shouldn’t be aware whether there is other users using at the
concurrently
 But shared computer such as mainframe or minicomputer must
keep all users happy
 Users of dedicate systems such as workstations have dedicated
resources but frequently use shared resources from servers
 Handheld computers are resource relatively limited compared to
desktop, optimized for usability and battery life
 Some computers have little or no user interface, such as embedded
computers in devices and automobiles (ECU)

11
Kernel

 Fallacy: People always judge an OS from GUI point of view, which is


wrong. UI is only an application that comes with the OS.
 In fact, there is a lot of OS for embedded systems that does not have
any GUI at all.
 What we are interested in this course is the underlying software, which
is called kernel.
 “The one program running at all times on the computer” is the kernel.
Everything else is either a system program (ships with the operating
system) or an application program.

12
Computer Startup

 bootstrap program is loaded at power-up or reboot


– Typically stored in ROM or EPROM, generally known as firmware or
BIOS
– Initializes all aspects of system
– Loads operating system kernel by searching through secondary
drives
– Starts execution
Evolution of Operating Systems

It may be easier to understand the key


requirements of an OS by considering the
evolution of Operating Systems
Stage includes
Evolution of Operating Systems

 Operating systems will evolve over time


– Hardware upgrades plus new types of hardware
• e.g. support of multi-core systems through CPU scheduler, solid-state
disks optimization through I/O scheduler and file-system
– New services
• In response to user demand/the needs of system managers, the OS
expands to offer new services.
• e.g. if it is found to be difficult to maintain good performance for users
with existing tools, new measurement and control tools may be added to
the OS.
– Fixes
• Any OS has faults.
• These are discovered over the course of time and fixes are made (called
kernel patches).
• Of course, the fix may introduce new faults. ;-)
Serial Processing

No operating system


Machines run from a console with display lights,
toggle switches, input device, and printer
Problems include:
– Scheduling
– Setup time
Simple batch system

Early computers were extremely expensive


– Important to maximize processor utilization
Monitor
– Software that controls the sequence of events
– Batch jobs together
– Program returns control to monitor when finished
Uniprogramming

In batch system, processor must wait for I/O


instruction to complete before preceding

Not efficient; the batch system can make use of


the waiting time.
Multiprogramming

When one job needs to wait for I/O, the


processor can switch to the other (ready) job
Multiprogramming
Time Sharing Systems

Using multiprogramming to handle multiple


interactive jobs
Processor’s time is shared among multiple users
Multiple users simultaneously access the system
through terminals
Major Advances

Operating Systems are among the most


complex pieces of software ever developed
Major advances include:
– Processes
– Memory management
– Information protection and security
– Scheduling and resource management
– System
Process

Fundamental to the structure of OS’s


A process is:
– A program in execution
– An instance of a running program
– The entity that can be assigned to and executed on a
processor
– A unit of activity characterized by a single sequential
thread of execution, a current state, and an
associated set of system resources.
Causes of Errors when Designing System Software

Error in designing an OS are often subtle and


difficult to diagnose
Errors typically include:
– Improper synchronization
– Failed mutual exclusion
– Non-determinate program operation
– Deadlocks
Components of a Process

A process consists of
– An executable program
– Associated data needed by the program
– Execution context of the program (or “process state”)
The execution context contains all information
the operating system needs to manage the
process
Process Management
Memory Management

The OS has 5 principal storage management


responsibilities
– Process isolation
– Automatic allocation and management
– Support of modular programming
– Protection and access control
– Long-term storage
File System & Virtual Memory

File system implements long-term store


– with information stored in named objects, called files.
– The file is a convenient concept for the programmer
and is a useful unit of access control and protection
for the OS.

Virtual memory allows programs to address


memory from a logical point of view
– Without regard to the limits of physical memory
Virtual Memory
Virtual Memory Addressing
Information Protection and Security

The problem involves controlling access to


computer systems and the information stored in
them.
Main issues are:
– Availability
– Confidentiality
– Data integrity
– Authenticity
Scheduling and Resource Management

Key responsibility of an OS is managing


resources
Resource allocation policies must consider:
– Fairness
– Differential responsiveness
– Efficiency
Different Architectural Approaches

Various approaches have been tried, categories


include:
– Microkernel architecture
– Multithreading
– Symmetric multiprocessing
– Distributed operating systems
– Object-oriented design
Microkernel Architecture

Most early OS are a monolithic kernel


– Most OS functionality resides in the kernel.
A microkernel assigns only a few essential
functions to the kernel
– Address spaces
– Interprocess communication (IPC)
– Basic scheduling
Multithreading

Process is divided into threads that can run


concurrently
Thread
– Dispatchable unit of work
– executes sequentially and is interruptible
Process is a collection of one or more threads
Symmetric multiprocessing (SMP)

An SMP system is a stand-alone system that


has:
– Two or more similar processors of comparable
capability
– These processors share same main memory and I/O
facilities
– All processors can perform the same functions
The OS of an SMP schedules processes or
threads across all of the processors.
Symmetric Multiprocessing Architecture

Socket 0 Socket 1 Socket 2

bus

SMP Architecture
SMP OS Considerations
 In an SMP system, the kernel can execute on any
processor, and typically each
– processor does self-scheduling from the pool of available processes
or threads.
– The kernel can be constructed as multiple processes or multiple
threads, allowing
– Portions of the kernel to execute in parallel. The SMP approach
complicates the OS.
 Key design issues:
Chip Multi-Processor Architecture

Also known as Multi-Core chip


Combines two or more processors (cores) on a
single piece of silicon (die)
each core consists of all of the components of
an independent processor
In addition, multi-core chips also include L2
cache and in some cases L3 cache
Chip Multi-Processor Architecture

Socket 0

CMP: e.g. A Dual-Core Design within


a package/socket
Core i7 9x0 series (Nehalem)

 The L3 Cache is shared among 4 cores


AMD Ryzen 3000 series (Zen 2)

 One L3 Cache is shared among 4 cores but there are four L3 caches
covering a total of 16 physical cores
 Quick fix to avoid performance penalty due to threads migration across
different dies:
https://www.legitreviews.com/game-mode-might-boost-performance-on-amd-r
yzen-3900x-processors_213087
Heterogeneous multi-processor
 ARM’s big.LITTLE system: to which core should the OS migrate the
task? Performance vs power consumption.

Source: http://www.newelectronics.co.uk/electronics-technology/arms-big-little-systems-provide-more-processing-power-for-less-energy/43563/
Multiprogramming and Multiprocessing
Clustered Systems
Memory Hierarchy

Major constraints in memory


– amount
– speed
– expense
Memory must be able to keep up with the
processor
Cost of memory must be reasonable in relationship
to the other components
Memory Hierarchy

Going down the hierarchy:


– decreasing cost per bit
– increasing capacity
– increasing access time
– decreasing frequency of access
to the memory by the processor
Summary
OS evolves according to:

changes in software changes in hardware


requirement motivates the motivates the need of new
need of different hardware support in OS (kernel)

Trend of Evolution
user of Evolution
applications computer of OS
hardware
End of Lecture 1

You might also like