1. Dr. Ihab Sbeity
Info 212
Operating System I
Dr. Ihab Sbeity
Lebanese University – Faculty of Sciences I
2011-2012
2. Physical parts of a computer
Hardware
Info 212 - UL - Dr. Ihab Sbeity
3. Basic Hardware Elements
Basic Hardware Elements
Processor - traditionally controls the operation of
the computer and performs the data processing
function
Memory - Stores data and programs, typically
volatile (aka real or primary memory)
Info 212 - UL - Dr. Ihab Sbeity
volatile (aka real or primary memory)
I/O modules - move data between computer and
external environment (i.e. disks, network)
System Bus - communication among processors,
memory, and I/O modules
5. Processors
A processor is hardware that executes machine-language
CPU executes the instructions of a program
Coprocessor executes special-purpose instructions
Ex., graphics or audio coprocessors
Registers are high-speed memory located on processors
Info 212 - UL - Dr. Ihab Sbeity
Registers are high-speed memory located on processors
Data must be in registers before a processor can operate on it
Instruction length is the size of a machine-language instruction
Some processors support multiple instruction lengths
7. Clocks
Computer time is measured in cycles
One complete oscillation of an electrical signal
Provided by system clock generator
Processor speeds are measured in GHz (billions of cycles
per second)
per second)
Modern desktops execute at hundreds of megahertz or
several GHz
Info 212 - UL - Dr. Ihab Sbeity
8. Memory
The memory hierarchy is a scheme for categorizing memory
Fastest and most expensive at the top, slowest and least
expensive at the bottom
Registers L1 Cache
L2 Cache Main Memory
Secondary and tertiary storage (CDs, DVDs and floppy disks)
Main memory is the lowest data referenced directly by
processor
Volatile – loses its contents when the system loses power
10. Main Memory
Main memory consists of volatile random access memory
(RAM)
Processes can access data locations in any order
Common forms of RAM include:
dynamic RAM (DRAM) – requires refresh circuit
dynamic RAM (DRAM) – requires refresh circuit
static RAM (SRAM) – does not require refresh circuit
Info 212 - UL - Dr. Ihab Sbeity
11. Buses
A bus is a collection of traces
Traces are thin electrical connections that transport
information between hardware devices
A port is a bus that connects exactly two devices
An I/O channel is a bus shared by several devices to perform
An I/O channel is a bus shared by several devices to perform
I/O operations
Handle I/O independently of the system’s main processors
Info 212 - UL - Dr. Ihab Sbeity
13. Operating system (OS)
Definition
« the set of all programs allowing the user of the computer
system to make the best use of the machine’s resources in a
coherent and comfortable way »
Interface between the computer system users and the physical
machine
Physical parts
Machine language
Kernel
command Interpreter, compiler,
applications
(games, office tools, …)
MACHINE
OPERATING
SYSTEM
APPLICATIONS
Info 212 - UL - Dr. Ihab Sbeity
14. Operating system (OS)
Represents the interface users/machine:
Masks the hardware details from applications
The OS must handle these details
Controls the applications execution
By controlling periodically the CPU
Informs the CPU when to execute the programs
It must optimize the resources use to maximize the system
performance
Info 212 - UL - Dr. Ihab Sbeity
15. Abstract view of the OS components
Info 212 - UL - Dr. Ihab Sbeity
16. The Kernel
Insures Different types of services
management of the processor(s)
Loading and launching programs
Memory management (primary secondary)
Input/output management (peripherals)
Info 212 - UL - Dr. Ihab Sbeity
17. The principal OS (1/2)
Solaris/Linux
Built on Unix kernel
The best compromise : reliable, efficient, portable, evolutive
difficult to use for beginners
Linux distributions
Red Hat
Fedora
S.u.S.e
S.u.S.e
Debian
Mandrake..
MacOS
Less and less used because ofWindows
Very good ergonomically, reliable, stable
Has developed its own standards (even for the hardware)… has lost the
concurrence againstWindows (unless some advantages like digital photo)
Info 212 - UL - Dr. Ihab Sbeity
18. The principal OS (2/2)
Windows
The most known, user oriented (automatic configuration always
available), many kinds of tools (some are now standards), simplest
manipulation.
Less reliable even if some progress is done since
Win2000/XP,/Vista/7; bad security (virus, very few intrusions)
Win2000/XP,/Vista/7; bad security (virus, very few intrusions)
Less open, imposes most of the technological choices and restricts the
users in these choices.
Other systems reserved to big servers
VMS, GCOS, MVS and AS400 …
Info 212 - UL - Dr. Ihab Sbeity
19. History of OSs – first generation
Use Mode
The user writes the program in machine language
It reserves the machine for a fixed duration
The user then loads manually the program in memory
The machine executes
The machine executes
If the execution doesn’t match the user’s needs è
Step by step execution eventual modification
New trial until complete satisfaction or time out
Use mode totally inefficient
Info 212 - UL - Dr. Ihab Sbeity
20. Perforated cards
One line of data or program was coded by holes that
could be read by the machine
Info 212 - UL - Dr. Ihab Sbeity
21. Operator reading a set of perforated
cards
Info 212 - UL - Dr. Ihab Sbeity
22. History of OSs –second generation
Batch systems
Better hardware
transistors printed circuits
Appearance diversity of peripherals
perforated card readers
printers
magnetic devices (bandes, cards, …)
Info 212 - UL - Dr. Ihab Sbeity
23. Batch systems – How do work?
The first OS (late-50s)
The user submits a job to an operator
Program then data
The operator loads a set of jobs on the reading device
A program, the monitor (OS), manages the execution of each job
A program, the monitor (OS), manages the execution of each job
of the set
the monitor is always in memory and ready to execute
the users (compiler) of the monitor are loaded on need
Only one program in memory, programs are executed in
sequence
The output is normally on a file, printer, magnetic band…
Info 212 - UL - Dr. Ihab Sbeity
24. 3rd generation : Multiprogramming
batch
I/O operations are extremely slow (compared to other
instructions)
ex. a loop in a program may take abort 10 microseconds, while a disk
operation takes abort 10 milliseconds
It’s the difference between an hour and a month and a half!
even with a little bit of I/O, a program spends the majority of the time
waiting
even with a little bit of I/O, a program spends the majority of the time
waiting
So: poor CPU use when a program is in memory
Info 212 - UL - Dr. Ihab Sbeity
25. How does it work?
Multiprogramming
Many activities progress in parallel
– an activity holds the CPU until the next O/S
– manipulating the O/S operation ends by interruptions
26. Interruptions
To be able to execute other jobs when a job waits for an I/O
Memory protection : isolate the jobs
Hardware management
many jobs are ready to be executed asking for ressources:
Requirements for multiprogramming
many jobs are ready to be executed asking for ressources:
CPU, memory, I/O devices
Language for managing jobs execution : interface between
users and OS
before JCL (Job Control Language), now shell,command prompt
and others.
Info 212 - UL - Dr. Ihab Sbeity
27. Advantages and disadvantages
Advantages
Good management of ressources (CPU, memory, peripherales)
Good response time for short jobs
Disadvantages
Complexity of the hardware and the operating system
Sharing and protection of ressoruces
Info 212 - UL - Dr. Ihab Sbeity