Professional Documents
Culture Documents
Lecture1 Introduction PDF
Lecture1 Introduction PDF
SSUET/QR/111
Operating System
(CE-303)
Introduction
Muhammad Rehan Rasheed
Assistant Professor, CED
Course Books
Text Book
Internet Sources
CE-303
OS - CE-303
Chapter # 1, Introduction
SSUET/QR/111
Hard Copy
Will not be provided
CE-303
Chapter 1: Introduction
CE-303
OS - CE-303
Chapter # 1, Introduction
SSUET/QR/111
Introduction
A program that controls some aspect of the
operation of a computer such as Operating System,
Compiler or utility program.
System Programming is the activity of programming
system software and deals with the peripheral
devices.
Primary distinctive characteristic of system
programming when compared to application
programming is that system programming requires a
greater degree of hardware awareness.
CE-303
CE-303
OS - CE-303
Chapter # 1, Introduction
SSUET/QR/111
Operating system
Controls and coordinates use of hardware among various applications
and users
Users
People, machines, other computers
CE-303
User
1
compiler
User
2
User
3
assembler
...
Text editor
User
n
Database
system
CE-303
OS - CE-303
Chapter # 1, Introduction
SSUET/QR/111
Control program
Controls execution of programs to prevent errors and improper use of
the computer.
OS - CE-303
10
Chapter # 1, Introduction
SSUET/QR/111
Transaction systems
Personal Computing Systems
Mobile Platforms, devices (of all sizes)
CE-303
11
CE-303
OS - CE-303
12
Chapter # 1, Introduction
SSUET/QR/111
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.
CE-303
13
CE-303
OS - CE-303
14
Chapter # 1, Introduction
SSUET/QR/111
Structure
Large machines run from console
Single user system
Programmer/User as operator
Early software
Secure execution
Inefficient use of expensive resources
Low CPU utilization, high setup time.
CE-303
15
Resident Monitor
Holds initial control, control transfers to job and then back to monitor.
Problem
Need to distinguish job from job and data from program.
CE-303
OS - CE-303
16
Chapter # 1, Introduction
SSUET/QR/111
Supervisor/Operator Control
Secure monitor that controls job processing
Special cards indicate what to do.
User program prevented from performing I/O
IBM 7094
Problems
Long turnaround time - up to 2 DAYS!!!
CE-303
17
Spooling
Use disk (random access device) as large storage for reading as many
input files as possible and storing output files until output devices are
ready to accept them.
Allows overlap - I/O of one job with computation of another.
Introduces notion of a job pool that allows OS choose next job to run so
as to increase CPU utilization.
CE-303
OS - CE-303
18
Chapter # 1, Introduction
SSUET/QR/111
I/O Structure
After I/O starts, control returns to user program only upon
I/O completion
Wait instruction idles the CPU until the next interrupt
Wait loop (contention for memory access)
At most one I/O request is outstanding at a time, no simultaneous I/O
processing
CE-303
19
CE-303
OS - CE-303
20
10
Chapter # 1, Introduction
SSUET/QR/111
Storage Structure
Main memory only large storage media that the CPU can
access directly
Random access
Typically volatile
CE-303
21
Storage-Device Hierarchy
CE-303
OS - CE-303
22
11
Chapter # 1, Introduction
SSUET/QR/111
Computer-System Architecture
Most systems use a single general-purpose processor (PDAs
through mainframes)
Most systems have special-purpose processors as well
Two types:
1. Asymmetric Multiprocessing
2. Symmetric Multiprocessing
CE-303
23
CE-303
OS - CE-303
24
12
Chapter # 1, Introduction
SSUET/QR/111
A Dual-Core Design
CE-303
25
Clustered Systems
Like multiprocessor systems, but multiple systems
working together
Usually sharing storage via a storage-area network (SAN)
Provides a high-availability service which survives failures
Asymmetric clustering has one machine in hot-standby mode
Symmetric clustering has multiple nodes running applications,
monitoring each other
CE-303
OS - CE-303
26
13
Chapter # 1, Introduction
SSUET/QR/111
Clustered Systems
CE-303
27
CE-303
OS - CE-303
28
14
Chapter # 1, Introduction
SSUET/QR/111
CE-303
29
Operating-System Operations
Interrupt driven by hardware
Software error or request creates exception or trap
Division by zero, request for operating system service
OS - CE-303
30
15
Chapter # 1, Introduction
SSUET/QR/111
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 needs resources to accomplish its task
CPU, memory, I/O, files
Initialization data
CE-303
31
CE-303
OS - CE-303
32
16
Chapter # 1, Introduction
SSUET/QR/111
Memory Management
All data in memory before and after processing
All instructions in memory in order to execute
Memory management determines what is in
memory when
Optimizing CPU utilization and computer response to users
33
Storage Management
OS provides uniform, logical view of information storage
Abstracts physical properties to logical storage unit - file
Each medium is controlled by device (i.e., disk drive, tape drive)
Varying properties include access speed, capacity, data-transfer
rate, access method (sequential or random)
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
CE-303
OS - CE-303
34
17
Chapter # 1, Introduction
SSUET/QR/111
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
Proper management is of central importance
Entire speed of computer operation hinges on disk subsystem
and its algorithms
OS activities
Free-space management
Storage allocation
Disk scheduling
35
I/O Subsystem
One purpose of OS is to hide peculiarities of
hardware devices from the user
I/O subsystem responsible for
Memory management of I/O including buffering (storing
data temporarily while it is being transferred), caching
(storing parts of data in faster storage for performance),
spooling (the overlapping of output of one job with input
of other jobs)
General device-driver interface
Drivers for specific hardware devices
CE-303
OS - CE-303
36
18
Chapter # 1, Introduction
SSUET/QR/111
CE-303
37
Distributed Computing
Collection of separate, possibly heterogeneous,
systems networked together
Network is a communications path
Local Area Network (LAN)
Wide Area Network (WAN)
Metropolitan Area Network (MAN)
CE-303
OS - CE-303
38
19
Chapter # 1, Introduction
SSUET/QR/111
Planet Lab
CE-303
39
Special-Purpose Systems
Real-time embedded systems most prevalent form of
computers
Vary considerable, special purpose, limited purpose OS,
real-time OS
Multimedia systems
Streams of data must be delivered according to time
restrictions
Handheld systems
PDAs, smart phones, limited CPU, memory, power
Reduced feature set OS, limited I/O
CE-303
OS - CE-303
40
20
Chapter # 1, Introduction
SSUET/QR/111
Real-time systems
Correct system function depends on timeliness
Feedback/control loops
Sensors and actuators
Hard real-time systems Failure if response time too long.
Secondary storage is limited
CE-303
41
Parallel Systems
Multiprocessor systems with more than one CPU
in close communication.
Improved Throughput, economical, increased
reliability.
Kinds:
Vector and pipelined
Symmetric and asymmetric multiprocessing
Distributed memory vs. shared memory
Programming models:
Tightly coupled vs. loosely coupled ,message-based vs. shared
variable
CE-303
OS - CE-303
42
21
Chapter # 1, Introduction
SSUET/QR/111
K-computer(Japan)
Tianhe-1(China)
43
System Calls
System calls provide the interface between a running program
and the operating system.
Typically written in a high-level language (C or C++)
Mostly accessed by programs via a high-level Application
Program Interface (API) rather than direct system call use
Three most common APIs are Win32 API for Windows, POSIX
API for POSIX-based systems (including virtually all versions of
UNIX, Linux, and Mac OS X), and Java API for the Java virtual
machine (JVM)
CE-303
OS - CE-303
44
22
Chapter # 1, Introduction
SSUET/QR/111
CE-303
45
CE-303
OS - CE-303
46
23
Chapter # 1, Introduction
SSUET/QR/111
CE-303
47
CE-303
OS - CE-303
48
24
Chapter # 1, Introduction
SSUET/QR/111
CE-303
49
end, abort
load, execute
create process, terminate process
get process attributes, set process attributes
wait for time
wait event, signal event
allocate and free memory
File management
CE-303
OS - CE-303
50
25
Chapter # 1, Introduction
SSUET/QR/111
Information maintenance
get time or date, set time or date
get system data, set system data
get and set process, file, or device attributes
Communications
CE-303
51
CE-303
OS - CE-303
52
26
Chapter # 1, Introduction
SSUET/QR/111
Example: MS-DOS
Single-tasking
Shell invoked when system booted
Simple method to run program
No process created
CE-303
53
MS-DOS execution
OS - CE-303
54
27
Chapter # 1, Introduction
SSUET/QR/111
CE-303
55
Layered Approach
The operating system is divided into a number of layers
(levels), each built on top of lower layers. The bottom layer
(layer 0), is the hardware; the highest (layer N) is the user
interface.
With modularity, layers are selected such that each uses
functions (operations) and services of only lower-level layers
CE-303
OS - CE-303
56
28
Chapter # 1, Introduction
SSUET/QR/111
CE-303
57
UNIX
UNIX limited by hardware functionality, the original UNIX
operating system had limited structuring. The UNIX OS
consists of two separable parts
Systems programs
The kernel
Consists of everything below the system-call interface and above the
physical hardware
Provides the file system, CPU scheduling, memory management, and
other operating-system functions; a large number of functions for one
level
CE-303
OS - CE-303
58
29
Chapter # 1, Introduction
SSUET/QR/111
CE-303
59
Summary of lecture
CE-303
OS - CE-303
60
30