Operating System Lecture-1(02-02-2010)
Download
Report
Transcript Operating System Lecture-1(02-02-2010)
Operating Systems
Mubeen Ahmed Warraich
MS Computer Systems Engineering
London, UK
MSc computer science
MAJU, ISB
[email protected]
OVER ALL INTRO TO COURSE
What Operating Systems Do
Computer-System Organization
Computer-System Architecture
Operating-System Structure
Operating-System Operations
Process Management
Memory Management
Storage Management
Protection and Security
Distributed Systems
Special-Purpose Systems
Computing Environments
OBJECTIVES
To provide a grand tour of the major operating
systems components
To provide coverage of basic computer system
organization
Recommended textbooks
•Operating Systems (4th edition).
William Stallings
Modern Operating
Systems. A Tanenbaum
3rd Edition
•Operating Systems: a modern
perspective (2nd edition). Gary
Nutt, Addison Wesley
Read books – course built on classic authoritative
textbook
Exam designed to test your understanding and
ability to apply it to new ideas
Some exam questions will introduce an idea
through technical questioning.
will ask you to explore an idea using what you’ve
learned
The book might have even covered that!
© DOC, Imperial College,
2006
THERE IS NO SPOON
WHAT IS AN OPERATING SYSTEM?
A
program that acts as an intermediary
between a user of a computer and the
computer hardware.
Operating system goals:
Execute user programs and make solving
user problems easier.
Make the computer system convenient to
use.
Use the computer hardware in an efficient
manner.
WHAT IS AN OPERATING SYSTEM? - 1
Word Processor
Spreadsheet
Accounting
Compilers
Editors
Command
Interpreter
Operating System
Application
Programs
Systems
Programs
Machine Language
Microprogramming
Physical Devices
Hardware
WHAT IS AN OPERATING SYSTEM? - 2
Physical Devices
Integrated circuits, cathode ray tubes, wire etc.
Word Processor
Spreadsheet
Accounting
Compilers
Editors
Command
Interpreter
Operating System
Application
Programs
Systems
Programs
Machine Language
Microprogramming
Physical Devices
Hardware
WHAT IS AN OPERATING SYSTEM? - 2
Microprogramming
Firmware
Provides basic operations that allow communication
with the physical devices
Normally in Read Only Memory (and that is why it is
called firmware)
Word
Processor
Spreadsheet
Accounting
Compilers
Editors
Command
Interpreter
Operating System
Applicatio
n
Programs
Systems
Programs
Machine Language
Microprogramming
Physical Devices
Hardwar
e
WHAT IS AN OPERATING SYSTEM? - 3
Machine Language
Defines the instruction set of the computer
Software but is considered as hardware
Word Processor
Spreadsheet
Accounting
Compilers
Editors
Command
Interpreter
Operating System
Application
Programs
Systems
Programs
Machine Language
Microprogramming
Physical Devices
Hardware
WHAT IS AN OPERATING SYSTEM? - 3
Operating System
Layer between the hardware and the software
Allows us to use the hardware in a user friendly way
Layer of abstraction
Word Processor
Spreadsheet
Accounting
Compilers
Editors
Command
Interpreter
Operating System
Application
Programs
Systems
Programs
Machine Language
Microprogramming
Physical Devices
Hardware
OTHER VIEWS OF AN OPERATING SYSTEM - 1
A Resource Manager
Operating System is seen as a way of providing the
users of the computer with the resources they need at
any given time.
Some resource requests may not be able to be met
(memory, CPU usage etc.) but the operating system
is able to deal with scheduling problems such as
these.
Other resources have a layer of abstraction placed
between them and the physical resource (e.g. a
printer).
OTHER VIEWS OF AN OPERATING SYSTEM - 2
Extended or Virtual Machine
The operating system is seen as a way of not having
to deal with the complexity of the hardware (e.g.
floppy disc controller).
HISTORY OF OPERATING SYSTEMS - 1
Charles
Babbage - Analytical Engine.
Attributed with designing the first digital computer
Never built the computer
No operating system.
•
Charles Babbage - 26th
December 1791 to 18th October
1871
HISTORY OF OPERATING SYSTEMS - 1
First
Generation (1945-1955)
Developed during the war
Vacuum Tubes
Many people were developing automatic calculating
machines
Filled entire rooms
No operating system
No programming languages
Had to physically wire the computer to carry out the
intended instructions
HISTORY OF OPERATING SYSTEMS - 2
Second Generation (1955-1965)
Transistors
More reliable
Became feasible to manufacture computers that could
be sold to customers
Job of computer operator invented
Batch jobs introduced in order to improve throughput
(via tapes)
Can be seen as the first operating system
HISTORY OF OPERATING SYSTEMS - 3
Third Generation (1965-1980)
Integrated Circuits as a replacement for transistors
IBM introduced its System/360 range and ICL
introduced its 1900 range
The start of multiprogramming which led to a need
for a more complex operating system – but no virtual
memory
Spooling – both input and output
Concept of time sharing introduced which allows
interactive working
Operating systems had to become a lot more complex
in order to deal with all these issues
HISTORY OF OPERATING SYSTEMS - 4
Fourth Generation (1980-present)
Large Scale Integration (LSI)
Led directly to the development of the personal
computer (PC)
One of the requirements for the original IBM PC was
an operating system - Bill Gates supplied MS-DOS
On non-Intel processors, the UNIX operating system
was also being used.
HISTORY OF OPERATING SYSTEMS - 7
Another View
First, Second and Third generation as before and for
same reasons
Fourth generation started in 1971 with the
introduction of LSI, then VLSI (Very Large Scale
Integration) and then ULSI (Ultra Large Scale
Integration)
Really, just arguing about when the PC revolution
started. Was it in the early 70’s when LSI first
became available? Or was it in 1980, when the IBM
PC was launched?
HISTORY OF OPERATING SYSTEMS - 5
Fifth Generation (Sometime in the future)
What
will constitute a
fifth generation
computer?
HISTORY OF OPERATING SYSTEMS - 5
Fifth Generation (Sometime in the future)
Computer generations were influenced by new
hardware (vacuum tubes, transistors, integrated
circuits and LSI).
Fifth generation may break with that tradition
One view is that a fifth generation computer will
interact with humans in a way that is natural to us
Computers will be able to reason in a way that
imitates humans
Being able to accept (and understand!) the spoken
word and carry out reasoning is complex, requiring
advances in software and maybe hardware
HISTORY OF OPERATING SYSTEMS - 6
Fifth Generation (Sometime in the future)
What
advances will
have to be made to allow
a fifth generation
computer to be realised?
HISTORY OF OPERATING SYSTEMS - 6
Fifth Generation (Sometime in the future)
Advances will be needed in AI
Maybe need parallel processing
Maybe a non-silicon computer
The first time a generation has not been motivated by
advances in hardware
COMPUTER SYSTEM STRUCTURE
Computer
system can be divided into four
components
Hardware – provides basic computing
resources
Operating system
Controls and 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
CPU, memory, I/O devices
Word processors, compilers, web browsers, database
systems, video games
Users
People, machines, other computers
FOUR COMPONENTS OF A COMPUTER SYSTEM
OPERATING SYSTEM AS
OS is a resource allocator
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
COMPUTER SYSTEM ORGANIZATION
Computer-system operation
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
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.
COMMON FUNCTIONS OF INTERRUPTS
Interrupt transfers control to the interrupt
service routine generally, through the interrupt
vector, which contains the addresses of all the
service routines.
Interrupt architecture must save the address of
the interrupted instruction.
Incoming interrupts are disabled while another
interrupt is being processed to prevent a lost
interrupt.
A trap is a software-generated interrupt caused
either by an error or a user request.
An operating system is interrupt driven.
INTERRUPT HANDLING
The operating system preserves the state of the
CPU by storing registers and the program
counter.
Determines which type of interrupt has occurred:
Separate segments of code determine what action
should be taken for each type of interrupt
INTERRUPT TIMELINE
DIRECT MEMORY ACCESS STRUCTURE
Used for high-speed I/O devices able to transmit
information at close to memory speeds.
Device controller transfers blocks of data from
buffer storage directly to main memory without
CPU intervention.
Only one interrupt is generated per block, rather
than the one interrupt per byte.
STORAGE STRUCTURE
Main memory – only large storage media that the
CPU can access directly.
Secondary storage – extension of main memory
that provides large nonvolatile storage capacity.
Magnetic disks – rigid metal or glass platters
covered with magnetic recording material
Disk surface is logically divided into tracks, which
are subdivided into sectors.
The disk controller determines the logical interaction
between the device and the computer.
STORAGE HIERARCHY
Storage systems organized in hierarchy.
Speed
Cost
Volatility
Caching – copying information into faster storage
system; main memory can be viewed as a last
cache for secondary storage.
STORAGE-DEVICE HIERARCHY
CACHING
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 is there
If it is, information used directly from the cache (fast)
If not, data copied to cache and used there
Cache smaller than storage being cached
Cache management important design problem
Cache size and replacement policy
PERFORMANCE OF VARIOUS LEVELS OF
STORAGE
Movement between levels of storage hierarchy
can be explicit or implicit
(CMOS) Complementary Metal Oxide Semiconductor
OPERATING SYSTEM STRUCTURE
Multiprogramming needed for efficiency
Single user cannot keep CPU and I/O devices busy at all times
Multiprogramming organizes jobs (code and data) so CPU always has
one to execute
A subset of total jobs in system is kept in memory
One job selected and run via job scheduling
When it has to wait (for I/O for example), OS switches to another job
Timesharing (multitasking) is logical extension in which CPU
switches jobs so frequently that users can interact with each job while it
is running, creating interactive computing
Response time should be < 1 second
Each user has at least one program executing in memory process
If several jobs ready to run at the same time CPU scheduling
If processes don’t fit in memory, swapping moves them in and out to
run
Virtual memory allows execution of processes not completely in
memory
MEMORY LAYOUT FOR MULTIPROGRAMMED
SYSTEM
THREE WAVES OF COMPUTING
THE FIRST WAVE!
•What did the first operating system look like?
1945 to 1955
• No operating system
• human operators
1956 to 1965
• Transistors and batch systems ,
• Clear distinction between designers, builders, operators,
programmers, and maintenance personnel,
• I/O channel,
• Read ahead / spooling,
• Interrupts/ exceptions,
• Minimal protection,
• Libraries / JCL
1965 to 1980
ICs and Multiprogramming,
System 360 and S/370 family of
computers,
Spooling (simultaneous peripheral
operation on-line),
Time sharing, On-line storage for
System programs,
User programs and data, Program
libraries,
Virtual memory,
Multiprocessor configurations
THE SECOND WAVE OF COMPUTING
1980-now
•Personal computers and workstations
•MS-DOS and Unix
•Massively parallel systems
•Pipelining
•Array processing / SIMD
•General multiprocessing / MIMD
•Symmetric multiprocessing / SMD
•Any process and any thread can run
on any available processor
•Computer networks (communication
aspect) -- network operating systems
•Distributed computing -- distributed
operating systems
© DOC, Imperial College,
2006
WHAT IS AN OS
A
program, C or C++
Loads
and runs other programs
Application
programs might wish to:
Draw on the screen
Interact via a keyboard, mouse etc
Access the hard disk (files)
Communicate with other application
programs
The
OS should provide a consistent way to do
this
Works on whatever hardware you have.
WHY ARE OSS FUN?
Make
application software
commodity
Abstraction
make programming
easier
Challenging
- security,
performance, reliability
Do
fancy things with programs
SO WHAT’S THE THIRD
WAVE?
UBIQUITOUS COMPUTING?
Involves many disciplines.
Inspired by the social scientists,
philosophers, and anthropologists
paradigm shift?
currently we expect the user
to find ways to use the
computer
however we currently do not
emphasise how the computer
can find its own way to serve
the user
focus on HCI
focus on security,
privacy big brother?
CURRENT TECHNOLOGY
DoCoMo
video phone
Best friend
Laptop
Mobile phone / PDA
Personal digital assistant
(PDA)
© DOC, Imperial College,
2006
Wearable or
luggable?
WEARABLE
LCD
Jacket
Designer
Gear
Fridge and
cupboards tracks
consumption and
reorder your
groceries
Your car computer
reminds you to pick
up your order on
the way home when
you are near the
supermarket.
© DOC, Imperial College,
2006
INTELLIGENT
ENVIRONMENT
INTELLIGENT ENVIRONMENT - 2
Lights, air conditioning, TV automatically switch on
and off when you enter or leave rooms
Sit on your favourite chair and TV switches on to the
program you usually watch at this time of the day
Use communicator/pda for phone, remote control, keys
payments, passport, health records, authenticator.
Route input from ‘virtual’ keyboard to nearest suitable
display.
Automatic detection of new items to control and
physical layout in a room or office, using computer
vision.
Thank You