Introduction - UW Courses Web Server

Download Report

Transcript Introduction - UW Courses Web Server

Chapter 1:
Introduction to Operating Systems
Joe McCarthy
CSS 430: Operating Systems - Introduction
1
Outline
• Questions from last time?
• Updates
• Introduction to Operating Systems (Ch 1)
– Overview & History
– Process management
– Memory Management
– File System Management
• Informal Linux Lab orientation (UW1-320)
CSS 430: Operating Systems - Introduction
2
Updates
• Updated syllabus page (http://bit.ly/css430B)
– Shared Discussion Board (Sections A & B)
– Slides posted from last time (“Overview” link)
– Will merge/create class homepage by Monday
• Shifted MW evening office hours:
– Old: 5:00-5:30pm, UW2-317
– New: 7:45-8:15pm, UW1-220 (and/or UW2-317)
• Best to email ahead of time
• Chapter 2, Assignment 1: next time
– http://courses.washington.edu/css430/prog/prog1.html
– “Program 1” via “Homework Assignments” on main CSS
430 page
CSS 430: Operating Systems - Introduction
3
Chapter 1: Introduction
•
•
•
•
•
•
•
•
•
•
•
•
•
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
Open-Source Operating Systems
CSS 430: Operating Systems - Introduction
Material derived, in part, from
Operating Systems Concepts with Java, 8th Ed.
© 2009 Silberschatz, Galvin & Gagne
4
What is a computer system?
CSS 430: Operating Systems - Introduction
5
What is a computer system?
CSS 430: Operating Systems - Introduction
6
What is an Operating System?
CSS 430: Operating Systems - Introduction
7
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
CSS 430: Operating Systems - Introduction
8
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
• Kernel vs. system program vs. application program?
CSS 430: Operating Systems - Introduction
9
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
• Kernel: “The one program running at all times on the computer”
– Everything else is either a system program (ships with the OS)
or an application program
CSS 430: Operating Systems - Introduction
10
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
• Kernel: “The one program running at all times on the computer”
– Everything else is either a system program (ships with the OS)
or an application program
• Bootstrap program?
CSS 430: Operating Systems - Introduction
11
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
• Kernel: “The one program running at all times on the computer”
– Everything else is either a system program (ships with the OS)
or an application program
• Bootstrap program is loaded at power-up or reboot
– Typically stored in firmware (ROM or EEPROM)
– Initializes all aspects of system, loads OS kernel and starts execution
CSS 430: Operating Systems - Introduction
12
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
• Kernel: “The one program running at all times on the computer”
– Everything else is either a system program (ships with the OS)
or an application program
• Bootstrap program is loaded at power-up or reboot
– Typically stored in firmware (ROM or EEPROM)
– Initializes all aspects of system, loads OS kernel and starts execution
• OS desiderata?
CSS 430: Operating Systems - Introduction
13
What is an Operating System?
• OS is a resource allocator
– Manages resources efficiently & efficiency, resolves conflicts
• OS is a control program
– Controls execution of programs, operations of devices
• No universally accepted definition
– “Everything a vendor ships when you order an operating system”
• Kernel: “The one program running at all times on the computer”
– Everything else is either a system program (ships with the OS)
or an application program
• Bootstrap program is loaded at power-up or reboot
– Typically stored in firmware (ROM or EEPROM)
– Initializes all aspects of system, loads OS kernel and starts execution
• OS desiderata: effective, efficient, easy-to-use
CSS 430: Operating Systems - Introduction
14
Computer System Components
CSS 430: Operating Systems - Introduction
15
Computer Hardware
CSS 430: Operating Systems - Introduction
16
Computer system operation
• CPU & I/O devices can execute concurrently
• Each device controller
– is in charge of a particular device type
– has a local buffer
• CPU moves data from/to main memory to/from local buffers
– Device 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
CSS 430: Operating Systems - Introduction
17
Interrupt handling: motivation
“…on a fully saturated 100 Mb/s Ethernet link
with an average packet size of 512 bytes, the
network adapter may generate over 20,000
interrupts per second.
If each interrupt takes 15μsec, over 30% of the
processor time may be devoted to interrupt
handling.”
Profiling Interrupt Handler Performance through
Kernel Instrumentation
Branden Moore, Thomas Slabach, Lambert Schaelicke
Proceedings of the 21 st IEEE International Conference
on Computer Design, 2003
CSS 430: Operating Systems - Introduction
18
Interrupt handling
CSS 430: Operating Systems - Introduction
19
Interrupt handling
www.iti.uni-stuttgart.de/~radetzki/Seminar06/08_report.pdf
CSS 430: Operating Systems - Introduction
20
Interrupt handling, with priorities
CSS 430: Operating Systems - Introduction
21
Brief history of Operating Systems
•
•
•
•
•
Batch systems
Multiprogramming
Time-sharing
Multiprocessing
Multi-computer systems
CSS 430: Operating Systems - Introduction
22
Batch Systems
•
•
•
•
•
Job: program + the data + control info
Programmers pass their jobs to an operator
The operator batches together jobs
OS transfers control from one job to another
Job output is sent back to the programmer
IBM 1402
CSS 430: Operating Systems - Introduction
IBM 1403
23
Multiprogramming
• Several jobs are kept in main
memory a same time
• OS picks one of them to execute
• The job may have to wait for a
slow I/O operation to complete
• OS picks & executes another job
• OS Requirements:
– Job scheduling
– Memory management
IBM System/360
CSS 430: Operating Systems - Introduction
24
Timesharing
• Timesharing (multitasking): CPU switches jobs
frequently so that multiple users can interact
with their jobs while they is running (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
CSS 430: Operating Systems - Introduction
25
Multiprocessing
Multiple CPUs, shared memory
(asymmetric or symmetric)
CSS 430: Operating Systems - Introduction
26
Multiprocessing
Multiple CPUs, shared memory
(asymmetric or symmetric)
Advantage(s)?
CSS 430: Operating Systems - Introduction
27
Multiprocessing
Multiple CPUs, shared memory
(asymmetric or symmetric)
Advantage(s)?
• Increased throughput
• Economy of scale
• Increased reliability
CSS 430: Operating Systems - Introduction
28
Multi-processor vs. Multi-core
CSS 430: Operating Systems - Introduction
29
Multi-processor vs. Multi-core
Multiple CPUs on separate chips
Multiple CPUs on same chip
CSS 430: Operating Systems - Introduction
30
Multi-processor vs. Multi-core
Multiple CPUs on separate chips
Multiple CPUs on same chip
Advantage(s)?
CSS 430: Operating Systems - Introduction
31
Multi-processor vs. Multi-core
Multiple CPUs on separate chips
Multiple CPUs on same chip
Advantage(s)?
More efficient
• Faster
• Less power
• Less heat
CSS 430: Operating Systems - Introduction
32
Multi-computer Systems
Local Area Network (LAN)
(shared storage or
other peripherals)
Client-Server System
(e.g., WWW)
CSS 430: Operating Systems - Introduction
33
How a Computer Works
CSS 430: Operating Systems - Introduction
34
Instruction Execution Cycle
http://ocw.capilanou.ca/computing-science/breadth-topics-in-computingscience/course_files/programming/ProgrammableMachine.html
CSS 430: Operating Systems - Introduction
35
Two modes of processing
• Why 2 modes?
• What causes shifts between modes?
• Why would a CPU need a timer?
CSS 430: Operating Systems - Introduction
36
Process Management
• Activities an OS must perform?
CSS 430: Operating Systems - Introduction
37
Process Management
• Activities an OS must perform:
– Creating and deleting user & system
processes
– Suspending and resuming processes
– Providing mechanisms for process
synchronization
– Providing mechanisms for process
communication
– Providing mechanisms for deadlock
handling
CSS 430: Operating Systems - Introduction
38
Hierarchy of Memory
Variables:
CSS 430: Operating Systems - Introduction
39
Hierarchy of Memory
Variables:
• Speed
• Cost
• Size
• Volatility
CSS 430: Operating Systems - Introduction
40
Memory Performance
CSS 430: Operating Systems - Introduction
41
CSS 430: Operating Systems - Introduction
42
CSS 430: Operating Systems - Introduction
43
Memory Management
• Activities OS must perform?
CSS 430: Operating Systems - Introduction
44
Memory Management
• Activities OS must perform:
– Keeping track of which parts of
memory are currently being used
and by whom
– Deciding which processes (or parts
thereof) and data to move into and
out of memory
– Allocating and deallocating memory
space as needed
CSS 430: Operating Systems - Introduction
45
File System Management
• Activities an OS must perform?
CSS 430: Operating Systems - Introduction
46
File System Management
• Activities an OS must perform:
– Creating and deleting files & directories
– Primitives to manipulate files &
directories
– Mapping files onto secondary storage
– Backup files onto stable (non-volatile)
storage media
CSS 430: Operating Systems - Introduction
47
Speaking of file systems …
CSS 430: Operating Systems - Introduction
48
See your UW NetID in that list?
CSS 430: Operating Systems - Introduction
49
Linux overview
• Basic commands
–
–
–
–
–
–
Directories: cd, mkdir, ls
Manipulate files: cp, mv
Edit files: vi, pico, emacs
Help: man
Print: lpr -Puw1-320-p1
Compile: g++, javac
• Remote login:
– [email protected]
• More info:
– http://www.uwb.edu/css/facilities/unix
CSS 430: Operating Systems - Introduction
50
For next time
• Readings
– Chapter 2: Operating System Structures
• Assignment 1
– Assigned (not due)
CSS 430: Operating Systems - Introduction
51