Lecture 2: Introduction to Operating Systems Joe McCarthy CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction 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
CSS 430: Operating Systems - Introduction 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
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 Material derived, in part, from Operating Systems Concepts with Java, 8th Ed. © 2009 Silberschatz, Galvin & Gagne CSS 430: Operating Systems - Introduction
What is a computer system? CSS 430: Operating Systems - Introduction
What is a computer system? CSS 430: Operating Systems - Introduction
What is an Operating System? CSS 430: Operating Systems - Introduction
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
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
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
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
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
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
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
Computer System Components CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction Computer Hardware CSS 430: Operating Systems - Introduction
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
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
CSS 430: Operating Systems - Introduction Interrupt handling CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction Interrupt handling www.iti.uni-stuttgart.de/~radetzki/Seminar06/08_report.pdf CSS 430: Operating Systems - Introduction
Brief history of Operating Systems Batch systems Multiprogramming Time-sharing Multiprocessing Multi-computer systems CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction 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 IBM 1403 CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction 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
CSS 430: Operating Systems - Introduction 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
Multiprocessing Multiple CPUs, shared memory (asymmetric or symmetric) CSS 430: Operating Systems - Introduction
Multiprocessing Multiple CPUs, shared memory (asymmetric or symmetric) Advantage(s)? CSS 430: Operating Systems - Introduction
Multiprocessing Multiple CPUs, shared memory (asymmetric or symmetric) Advantage(s)? Increased throughput Economy of scale Increased reliability CSS 430: Operating Systems - Introduction
Multi-processor vs. Multi-core CSS 430: Operating Systems - Introduction
Multi-processor vs. Multi-core Multiple CPUs on separate chips Multiple CPUs on same chip CSS 430: Operating Systems - Introduction
Multi-processor vs. Multi-core Multiple CPUs on separate chips Multiple CPUs on same chip Advantage(s)? CSS 430: Operating Systems - Introduction
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
Multi-computer Systems Local Area Network (LAN) (shared storage or other peripherals) Client-Server System (e.g., WWW) CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction How a Computer Works CSS 430: Operating Systems - Introduction
Instruction Execution Cycle http://ocw.capilanou.ca/computing-science/breadth-topics-in-computing-science/course_files/programming/ProgrammableMachine.html CSS 430: Operating Systems - Introduction
Two modes of processing Why 2 modes? What causes shifts between modes? Why would a CPU need a timer? CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction Process Management Activities an OS must perform? CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction 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
CSS 430: Operating Systems - Introduction Hierarchy of Memory Variables: CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction Hierarchy of Memory Variables: Speed Cost Size Volatility CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction Memory Performance CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction Memory Management Activities OS must perform? CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction 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
File System Management Activities an OS must perform? CSS 430: Operating Systems - Introduction
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
Speaking of file systems … CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction See your UW NetID in that list? CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction 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: UWNetID@uw1-320-lab.uwb.edu More info: http://www.uwb.edu/css/facilities/unix CSS 430: Operating Systems - Introduction
CSS 430: Operating Systems - Introduction For next time Readings Chapter 2: Operating System Structures Assignment 1 CSS 430: Operating Systems - Introduction