1
CSE451 Introduction to Operating Systems
Spring 2007
Module 1
Course Introduction
Gary Kimura & Mark Zbikowski
March 26, 2007
2
Today
• Class details
• CSE451 educational objectives
• A quick look at what is an operating system & some
history
• The class web page (http://www.cs.washington.edu/451) is
up and running
– Class information
– Lecture notes
– Project and homework assignments
– Helpful hints and other pointers
– Email discussion
3
Class details
• Instructors:
– Gary Kimura (garyki at cs dot washington dot edu)
– Mark Zbikowski (mzbik at cs dot washington dot edu)
• TAs:
– Ben Lerner (blerner at cs dot washington dot edu)
– Gabriel Maganis (gym at cs dot washington dot edu)
• Our background
• Please ask questions during class and make the lectures
interactive
• Class size
4
Grading (subject to adjustment)
• 15% Homework
– Approximately 8 assignments
– One week from when the assignment is handed out to when it it due
• 50% Exams
– One midterm (20%) (tentatively May 2)
– Final (30%)
• 30% Projects
– Tentatively 4 projects
– At least two weeks to finish each project
• 5% Other
5
Tentative class outline
• Silberschatz, et.al., Operating System Concepts (7th
Edition)
– OS Overview (Chapters 1 and 2)
– Process Management (Chapters 3, 4, 5, 6 and 7)
– Memory Management (Chapter 8 and 9)
– Storage Management and I/O (Chapters 10, 11, 12 and 13)
– Security (Chapters 14 and 15)
– Linking and Loading
6
Your job for week #1
• Readings in Silberschatz
– Chapter 1 (Monday lecture),
– Chapter 2 (Wednesday lecture)
• Homework #1
– Out: Today Monday March 26, 2007
– Due: Next Monday April 4, 2007 in class
– See handout and the class web page
• Project #0 will be discussed Thursday
• Brush up on “C” and binary/octal/hexadecimal
7
CSE 451 Education objectives
• Two views of an OS
– The OS user’s (i.e., application programmers) view
– The OS implementer’s view
• In this class we will learn:
– What are the major parts of an O.S.
– How is the O.S. and each sub-part structured
– What are the important common interfaces
– What are the important policies
– What algorithms are typically used
• We will do this through reading, lectures, and a project.
• You will need to keep up with all three of these.
8
What is an Operating System?
• The average computer user has trouble understanding this
question
• Note card exercise
– On the blank side of the note card write in one sentence your own
definition of an operating system
– On the lined side of the card write three things you would like this
class to cover
9
What is an Operating System?
• An operating system (OS) is:
– a software layer to abstract away and manage details of hardware
resources
– a set of utilities to simplify application development
– “all the code you didn’t write” in order to implement your
application
Applications
OS
Hardware
10
DOS
What is Windows?
Application
© John DeTreville, Microsoft Corp.
11
DOS
What is Windows?
Windows
Installer
COM
Printing
TCP/IP
Browser
…
File system
…
…
Application
Application
© John DeTreville, Microsoft Corp.
12
Internet
What is .NET?
Application
© John DeTreville, Microsoft Corp.
13
magic
magic
Internet
What is .NET?
.NET
Device
independence
XML
Identity
& security
Asynchrony
Extensibility
…
…
Application
eBay FedEx
Bank
© John DeTreville, Microsoft Corp.
14
What’s in an OS?
Machine Dependent
Services
Interrupts, Cache, Physical Memory, TLB, Hardware Devices
Generic I/O
File System
Memory Management
Process Management
Virtual Memory
Networking
Naming Access Control
Windowing & graphics
Windowing & Gfx
Machine
Independent
Services
Application
Services
SYSTEM CALL API
MD API
Device Drivers
Shells
System Utils
Quake Sql Server
Logical OS Structure
15
The OS and Hardware
• An OS mediates programs’ access to hardware resources
– Computation (CPU)
– Volatile storage (memory) and persistent storage (disk, etc.)
– Network communications (TCP/IP stacks, ethernet cards, etc.)
– Input/output devices (keyboard, display, sound card, etc.)
• The OS abstracts hardware into logical resources and well-
defined interfaces to those resources
– processes (CPU, memory)
– files (disk)
– sockets (network)
16
Why bother with an OS?
• Application benefits
– programming simplicity
• see high-level abstractions (files) instead of low-level hardware details
(device registers)
• abstractions are reusable across many programs
– portability (across machine configurations or architectures)
• device independence: 3Com card or Intel card?
• User benefits
– safety
• program “sees” own virtual machine, thinks it owns computer
• OS protects programs from each other
• OS fairly multiplexes resources across programs
– efficiency (cost and speed)
• share one computer across many users
• concurrent execution of multiple programs
17
The major OS issues
• structure: how is the OS organized?
• sharing: how are resources shared across users?
• naming: how are resources named (by users or programs)?
• security: how is the integrity of the OS and its resources ensured?
• protection: how is one user/program protected from another?
• performance: how do we make it all go fast?
• reliability: what happens if something goes wrong (either with hardware or
with a program)?
• extensibility: can we add new features?
• communication: how do programs exchange information, including across
a network?
18
Major issues in OS (2)
• Concurrency: how are parallel activities created and controlled?
• Scale and growth: what happens as demands or resources increase?
• Persistence: how to make data last longer than programs
• Compatibility & Legacy Apps: can we ever do anything new?
• Distribution: Accessing the world of information
• Accounting: who pays the bills, and how do we control resource
usage?
These are engineering trade-offs
Based on objectives and constraints
19
© Silberschatz, Galvin and Gagne
Progression of concepts and form factors
20
Has it all been discovered?
• New challenges constantly arise
– embedded computing (e.g., iPod)
– sensor networks (very low power, memory, etc.)
– peer-to-peer systems
– ad hoc networking
– scalable server farm design and management (e.g., Google)
– software for utilizing huge clusters (e.g., MapReduce, Bigtable)
– overlay networks (e.g., PlanetLab)
– worm fingerprinting
– finding bugs in system code (e.g., model checking)
• Old problems constantly re-define themselves
– the evolution of PCs recapitulated the evolution of minicomputers, which had
recapitulated the evolution of mainframes
– but the ubiquity of PCs re-defined the issues in protection and security
21
Protection and security as an example
• none
• OS from my program
• your program from my program
• my program from my program
• access by intruding individuals
• access by intruding programs
• denial of service
• distributed denial of service
• spoofing
• spam
• worms
• viruses
• stuff you download and run knowingly (bugs, trojan horses)
• stuff you download and run obliviously (cookies, spyware)
22
OS history
• In the very beginning…
– OS was just a library of code that you linked into your program;
programs were loaded in their entirety into memory, and executed
– interfaces were literally switches and blinking lights
• And then came batch systems
– OS was stored in a portion of primary memory
– OS loaded the next job into memory from the card reader
• job gets executed
• output is printed, including a dump of memory
• repeat…
– card readers and line printers were very slow
• so CPU was idle much of the time (wastes $$)
23
Spooling
• Disks were much faster than card readers and printers
• Spool (Simultaneous Peripheral Operations On-Line)
– while one job is executing, spool next job from card reader onto
disk
• slow card reader I/O is overlapped with CPU
– can even spool multiple programs onto disk/drum
• OS must choose which to run next
• job scheduling
– but, CPU still idle when a program interacts with a peripheral
during execution
– buffering, double-buffering
24
Multiprogramming
• To increase system utilization, multiprogramming OSs
were invented
– keeps multiple runnable jobs loaded in memory at once
– overlaps I/O of a job with computing of another
• while one job waits for I/O completion, OS runs instructions from
another job
– to benefit, need asynchronous I/O devices
• need some way to know when devices are done
– interrupts
– polling
– goal: optimize system throughput
• perhaps at the cost of response time…
25
Timesharing
• To support interactive use, create a timesharing OS:
– multiple terminals into one machine
– each user has illusion of entire machine to him/herself
– optimize response time, perhaps at the cost of throughput
• Timeslicing
– divide CPU equally among the users
– if job is truly interactive (e.g., editor), then can jump between
programs and users faster than users can generate load
– permits users to interactively view, edit, debug running programs
(why does this matter?)
26
• MIT CTSS system (operational 1961) was among the first
timesharing systems
– only one user memory-resident at a time (32KB memory!)
• MIT Multics system (operational 1968) was the first large
timeshared system
– nearly all OS concepts can be traced back to Multics!
– “second system syndrome”
27
• CTSS as an illustration of architectural and OS
functionality requirements
OS
User program
28
Parallel systems
• Some applications can be written as multiple parallel threads or
processes
– can speed up the execution by running multiple threads/processes
simultaneously on multiple CPUs [Burroughs D825, 1962]
– need OS and language primitives for dividing program into multiple parallel
activities
– need OS primitives for fast communication among activities
• degree of speedup dictated by communication/computation ratio
– many flavors of parallel computers today
• SMPs (symmetric multi-processors, multi-core)
• MPPs (massively parallel processors)
• NOWs (networks of workstations)
• computational grid (SETI @home)
29
Personal computing
• Primary goal was to enable new kinds of applications
• Bit mapped display [Xerox Alto,1973]
– new classes of applications
– new input device (the mouse)
• Move computing near the display
– why?
• Window systems
– the display as a managed resource
• Local area networks [Ethernet]
– why?
• Effect on OS?
30
Distributed OS
• Distributed systems to facilitate use of geographically
distributed resources
– workstations on a LAN
– servers across the Internet
• Supports communications between programs
– interprocess communication
• message passing, shared memory
– networking stacks
• Sharing of distributed resources (hardware, software)
– load balancing, authentication and access control, …
• Speedup isn’t the issue
– access to diversity of resources is goal
31
Client/server computing
• Mail server/service
• File server/service
• Print server/service
• Compute server/service
• Game server/service
• Music server/service
• Web server/service
• etc.
32
Peer-to-peer (p2p) systems
• Napster
• Gnutella
– example technical challenge: self-organizing overlay network
– technical advantage of Gnutella?
– er … legal advantage of Gnutella?
33
Embedded/mobile/pervasive computing
• Pervasive computing
– cheap processors embedded everywhere
– how many are on your body now? in your car?
– cell phones, PDAs, network computers, …
• Typically very constrained hardware resources
– slow processors
– very small amount of memory (e.g., 8 MB)
– no disk
– typically only one dedicated application
– limited power
• But this is changing rapidly!
34
CSE 451
• Philosophy
– you may not ever build an OS
– but as a computer scientist or computer engineer you need to
understand the foundations
– most importantly, operating systems exemplify the sorts of
engineering design tradeoffs that you’ll need to make throughout
your careers – compromises among and within cost, performance,
functionality, complexity, schedule …
• A good OS should be easily usable by everyone
35
Next time
• What features in the Hardware does an OS need?

1-Introduction madul include all the.ppt

  • 1.
    1 CSE451 Introduction toOperating Systems Spring 2007 Module 1 Course Introduction Gary Kimura & Mark Zbikowski March 26, 2007
  • 2.
    2 Today • Class details •CSE451 educational objectives • A quick look at what is an operating system & some history • The class web page (http://www.cs.washington.edu/451) is up and running – Class information – Lecture notes – Project and homework assignments – Helpful hints and other pointers – Email discussion
  • 3.
    3 Class details • Instructors: –Gary Kimura (garyki at cs dot washington dot edu) – Mark Zbikowski (mzbik at cs dot washington dot edu) • TAs: – Ben Lerner (blerner at cs dot washington dot edu) – Gabriel Maganis (gym at cs dot washington dot edu) • Our background • Please ask questions during class and make the lectures interactive • Class size
  • 4.
    4 Grading (subject toadjustment) • 15% Homework – Approximately 8 assignments – One week from when the assignment is handed out to when it it due • 50% Exams – One midterm (20%) (tentatively May 2) – Final (30%) • 30% Projects – Tentatively 4 projects – At least two weeks to finish each project • 5% Other
  • 5.
    5 Tentative class outline •Silberschatz, et.al., Operating System Concepts (7th Edition) – OS Overview (Chapters 1 and 2) – Process Management (Chapters 3, 4, 5, 6 and 7) – Memory Management (Chapter 8 and 9) – Storage Management and I/O (Chapters 10, 11, 12 and 13) – Security (Chapters 14 and 15) – Linking and Loading
  • 6.
    6 Your job forweek #1 • Readings in Silberschatz – Chapter 1 (Monday lecture), – Chapter 2 (Wednesday lecture) • Homework #1 – Out: Today Monday March 26, 2007 – Due: Next Monday April 4, 2007 in class – See handout and the class web page • Project #0 will be discussed Thursday • Brush up on “C” and binary/octal/hexadecimal
  • 7.
    7 CSE 451 Educationobjectives • Two views of an OS – The OS user’s (i.e., application programmers) view – The OS implementer’s view • In this class we will learn: – What are the major parts of an O.S. – How is the O.S. and each sub-part structured – What are the important common interfaces – What are the important policies – What algorithms are typically used • We will do this through reading, lectures, and a project. • You will need to keep up with all three of these.
  • 8.
    8 What is anOperating System? • The average computer user has trouble understanding this question • Note card exercise – On the blank side of the note card write in one sentence your own definition of an operating system – On the lined side of the card write three things you would like this class to cover
  • 9.
    9 What is anOperating System? • An operating system (OS) is: – a software layer to abstract away and manage details of hardware resources – a set of utilities to simplify application development – “all the code you didn’t write” in order to implement your application Applications OS Hardware
  • 10.
    10 DOS What is Windows? Application ©John DeTreville, Microsoft Corp.
  • 11.
    11 DOS What is Windows? Windows Installer COM Printing TCP/IP Browser … Filesystem … … Application Application © John DeTreville, Microsoft Corp.
  • 12.
    12 Internet What is .NET? Application ©John DeTreville, Microsoft Corp.
  • 13.
    13 magic magic Internet What is .NET? .NET Device independence XML Identity &security Asynchrony Extensibility … … Application eBay FedEx Bank © John DeTreville, Microsoft Corp.
  • 14.
    14 What’s in anOS? Machine Dependent Services Interrupts, Cache, Physical Memory, TLB, Hardware Devices Generic I/O File System Memory Management Process Management Virtual Memory Networking Naming Access Control Windowing & graphics Windowing & Gfx Machine Independent Services Application Services SYSTEM CALL API MD API Device Drivers Shells System Utils Quake Sql Server Logical OS Structure
  • 15.
    15 The OS andHardware • An OS mediates programs’ access to hardware resources – Computation (CPU) – Volatile storage (memory) and persistent storage (disk, etc.) – Network communications (TCP/IP stacks, ethernet cards, etc.) – Input/output devices (keyboard, display, sound card, etc.) • The OS abstracts hardware into logical resources and well- defined interfaces to those resources – processes (CPU, memory) – files (disk) – sockets (network)
  • 16.
    16 Why bother withan OS? • Application benefits – programming simplicity • see high-level abstractions (files) instead of low-level hardware details (device registers) • abstractions are reusable across many programs – portability (across machine configurations or architectures) • device independence: 3Com card or Intel card? • User benefits – safety • program “sees” own virtual machine, thinks it owns computer • OS protects programs from each other • OS fairly multiplexes resources across programs – efficiency (cost and speed) • share one computer across many users • concurrent execution of multiple programs
  • 17.
    17 The major OSissues • structure: how is the OS organized? • sharing: how are resources shared across users? • naming: how are resources named (by users or programs)? • security: how is the integrity of the OS and its resources ensured? • protection: how is one user/program protected from another? • performance: how do we make it all go fast? • reliability: what happens if something goes wrong (either with hardware or with a program)? • extensibility: can we add new features? • communication: how do programs exchange information, including across a network?
  • 18.
    18 Major issues inOS (2) • Concurrency: how are parallel activities created and controlled? • Scale and growth: what happens as demands or resources increase? • Persistence: how to make data last longer than programs • Compatibility & Legacy Apps: can we ever do anything new? • Distribution: Accessing the world of information • Accounting: who pays the bills, and how do we control resource usage? These are engineering trade-offs Based on objectives and constraints
  • 19.
    19 © Silberschatz, Galvinand Gagne Progression of concepts and form factors
  • 20.
    20 Has it allbeen discovered? • New challenges constantly arise – embedded computing (e.g., iPod) – sensor networks (very low power, memory, etc.) – peer-to-peer systems – ad hoc networking – scalable server farm design and management (e.g., Google) – software for utilizing huge clusters (e.g., MapReduce, Bigtable) – overlay networks (e.g., PlanetLab) – worm fingerprinting – finding bugs in system code (e.g., model checking) • Old problems constantly re-define themselves – the evolution of PCs recapitulated the evolution of minicomputers, which had recapitulated the evolution of mainframes – but the ubiquity of PCs re-defined the issues in protection and security
  • 21.
    21 Protection and securityas an example • none • OS from my program • your program from my program • my program from my program • access by intruding individuals • access by intruding programs • denial of service • distributed denial of service • spoofing • spam • worms • viruses • stuff you download and run knowingly (bugs, trojan horses) • stuff you download and run obliviously (cookies, spyware)
  • 22.
    22 OS history • Inthe very beginning… – OS was just a library of code that you linked into your program; programs were loaded in their entirety into memory, and executed – interfaces were literally switches and blinking lights • And then came batch systems – OS was stored in a portion of primary memory – OS loaded the next job into memory from the card reader • job gets executed • output is printed, including a dump of memory • repeat… – card readers and line printers were very slow • so CPU was idle much of the time (wastes $$)
  • 23.
    23 Spooling • Disks weremuch faster than card readers and printers • Spool (Simultaneous Peripheral Operations On-Line) – while one job is executing, spool next job from card reader onto disk • slow card reader I/O is overlapped with CPU – can even spool multiple programs onto disk/drum • OS must choose which to run next • job scheduling – but, CPU still idle when a program interacts with a peripheral during execution – buffering, double-buffering
  • 24.
    24 Multiprogramming • To increasesystem utilization, multiprogramming OSs were invented – keeps multiple runnable jobs loaded in memory at once – overlaps I/O of a job with computing of another • while one job waits for I/O completion, OS runs instructions from another job – to benefit, need asynchronous I/O devices • need some way to know when devices are done – interrupts – polling – goal: optimize system throughput • perhaps at the cost of response time…
  • 25.
    25 Timesharing • To supportinteractive use, create a timesharing OS: – multiple terminals into one machine – each user has illusion of entire machine to him/herself – optimize response time, perhaps at the cost of throughput • Timeslicing – divide CPU equally among the users – if job is truly interactive (e.g., editor), then can jump between programs and users faster than users can generate load – permits users to interactively view, edit, debug running programs (why does this matter?)
  • 26.
    26 • MIT CTSSsystem (operational 1961) was among the first timesharing systems – only one user memory-resident at a time (32KB memory!) • MIT Multics system (operational 1968) was the first large timeshared system – nearly all OS concepts can be traced back to Multics! – “second system syndrome”
  • 27.
    27 • CTSS asan illustration of architectural and OS functionality requirements OS User program
  • 28.
    28 Parallel systems • Someapplications can be written as multiple parallel threads or processes – can speed up the execution by running multiple threads/processes simultaneously on multiple CPUs [Burroughs D825, 1962] – need OS and language primitives for dividing program into multiple parallel activities – need OS primitives for fast communication among activities • degree of speedup dictated by communication/computation ratio – many flavors of parallel computers today • SMPs (symmetric multi-processors, multi-core) • MPPs (massively parallel processors) • NOWs (networks of workstations) • computational grid (SETI @home)
  • 29.
    29 Personal computing • Primarygoal was to enable new kinds of applications • Bit mapped display [Xerox Alto,1973] – new classes of applications – new input device (the mouse) • Move computing near the display – why? • Window systems – the display as a managed resource • Local area networks [Ethernet] – why? • Effect on OS?
  • 30.
    30 Distributed OS • Distributedsystems to facilitate use of geographically distributed resources – workstations on a LAN – servers across the Internet • Supports communications between programs – interprocess communication • message passing, shared memory – networking stacks • Sharing of distributed resources (hardware, software) – load balancing, authentication and access control, … • Speedup isn’t the issue – access to diversity of resources is goal
  • 31.
    31 Client/server computing • Mailserver/service • File server/service • Print server/service • Compute server/service • Game server/service • Music server/service • Web server/service • etc.
  • 32.
    32 Peer-to-peer (p2p) systems •Napster • Gnutella – example technical challenge: self-organizing overlay network – technical advantage of Gnutella? – er … legal advantage of Gnutella?
  • 33.
    33 Embedded/mobile/pervasive computing • Pervasivecomputing – cheap processors embedded everywhere – how many are on your body now? in your car? – cell phones, PDAs, network computers, … • Typically very constrained hardware resources – slow processors – very small amount of memory (e.g., 8 MB) – no disk – typically only one dedicated application – limited power • But this is changing rapidly!
  • 34.
    34 CSE 451 • Philosophy –you may not ever build an OS – but as a computer scientist or computer engineer you need to understand the foundations – most importantly, operating systems exemplify the sorts of engineering design tradeoffs that you’ll need to make throughout your careers – compromises among and within cost, performance, functionality, complexity, schedule … • A good OS should be easily usable by everyone
  • 35.
    35 Next time • Whatfeatures in the Hardware does an OS need?