Principles of Operating Systems
Total Page:16
File Type:pdf, Size:1020Kb
Principles of Operating Systems Lecture 1 - Introduction and overview, operating system structure Ardalan Amiri Sani ([email protected]) [lecture slides contains some content adapted from : Silberschatz textbook authors, Anderson textbook authors, John Kubiatowicz (Berkeley), John Ousterhout(Stanford), previous slides by Prof. Nalini Venkatasubramanian, http://www-inst.eecs.berkeley.edu/~cs162/ and others] 1 Staff • Instructor • Ardalan Amiri Sani ([email protected]) 2 Staff Teaching Assistants: Saehanseul Yi <[email protected]> Claudio Parra <[email protected]> Reader: Mingyi Chen <[email protected]> 3 Course logistics and details • Course web page - • https://www.ics.uci.edu/~ardalan/courses/os/index.html • Discussions • Wednesday 5:00-5:50pm (Zoom link on Canvas) • Friday 6:00-6:50pm (Zoom link on Canvas) 4 Course logistics and details • Textbook: Operating System Concepts -- Ninth Edition A. Silberschatz, P.B. Galvin, and G. Gagne (Tenth, Eighth, Seventh, Sixth, and Fifth editions are fine as well). • Other suggested Books • Operating Systems: Principles and Practice, by T. Anderson and M. Dahlin (second edition) • Modern Operating Systems, by Tanenbaum (Third edition) • Principles of Operating Systems, by L.F. Bic and A.C. Shaw, 2003. • Operating Systems: Three Easy Pieces, by Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau 5 Course logistics and details •Homeworks and Assignments • 4 written homeworks in the quarter • 1 programming assignment (knowledge of C). • Multistep assignment – don’t start in last week of classes!!! • Late homework policy. • Lose 10% of grade for every late hour. • All submissions will be made using Gradescope •Tests • Midterm – Friday, Week 6 (during class time) • Final Exam – per UCI course catalog (Friday, 3/19, 8am-10am) 6 Grading Policy •Written Homeworks - 20% • 4 written homeworks each worth 5% of the final grade. •Project - 10% of the final grade •Midterm - 30% of the final grade •Final exam - 40% of the final grade •Curve will be used if needed. 7 Lecture Schedule •Week 1 • Introduction to Operating Systems, Computer System Structures, Operating System Structures •Week 2 • Processes and Threads •Week 3 • Processes and Threads, and CPU Scheduling •Week 4 • Scheduling •Week 5 • Process Synchronization 8 Lecture Schedule •Week 6 • Deadlocks, Midterm exam •Week 7 • Memory Management •Week 8 • Memory Management, Virtual Memory •Week 9 • File Systems Interface and Implementation •Week 10 • I/O Subsystems 9 Classes I will most likely miss • 2/24/2021: conference program committee meeting (Will announce later if other lectures are to be missed) • Will announce later the plan for missed lectures • Sometimes, the TA will replace me on those dates 10 Office hours • Instructor • Fridays 1:00pm-2:00pm (Same Zoom link as the one used for lectures, available on Canvas) • TA • Tuesdays 10:00am-11:00am (Zoom link on Canvas) Office hours will start on the second week of classes 11 Piazza • https://piazza.com/uci/winter2021/compsci143a 12 Slides • Will upload first draft of the slides for all of the week on Monday • Might (and most likely will) update slides for each class before the class 13 Overview •What is an operating system? •Operating systems history •Computer system and operating system structure 14 What is an Operating System? 15 What is an Operating System? •OS is the software that acts an intermediary between the applications and computer hardware. 16 Computer System Components •Hardware • Provides basic computing resources (CPU, memory, I/O devices). •Operating System • Controls and coordinates the use of hardware among application programs. •Application Programs • Solve computing problems of users (compilers, database systems, video games, business programs). •Users • People, other computers 17 Abstract View of System User User User User 1 2 3 ... n compiler assembler Text editor Database system Application Programs Operating System Computer Hardware 18 Operating system roles •Referee • Resource allocation among users, applications • Isolation of different users, applications from each other • Communication between users, applications 19 Operating system roles •Illusionist • Each application appears to have the entire machine to itself • Infinite number of processors, (near) infinite amount of memory, reliable storage, reliable network transport 20 Operating system roles •Glue • Libraries, user interface widgets, … • Reduces cost of developing software 21 Example: file systems •Referee • Allocates storage space for files for each user • Prevent users from accessing each other’s files without permission •Illusionist • Files can grow (nearly) arbitrarily large • Files persist even when the machine crashes in the middle of a save •Glue • Named directories, printf, … 22 OS challenges 23 OS challenges •Reliability • Does the system do what it was designed to do? 24 OS challenges •Availability • What portion of the time is the system working? • Mean Time To Failure (MTTF), Mean Time to Repair 25 OS challenges •Security • Can the system be compromised by an attacker? 26 OS challenges •Privacy • Data is accessible only to authorized users 27 OS challenges •Performance • Latency/response time • How long does an operation take to complete? • Throughput • How many operations can be done per unit of time? • Overhead • How much extra work is done by the OS? • Fairness • How equal is the performance received by different users? • Predictability • How consistent is the performance over time? 28 OS challenges •Portability • For programs: • Application programming interface (API) • For the kernel • Hardware abstraction layer 29 OS needs to keep pace with hardware improvements $/ 30 Why should I study Operating Systems? 31 Why should I study Operating Systems? • Need to understand interaction between the hardware and software • Need to understand basic principles in the design of computer systems • efficient resource management, security, flexibility 32 Why should I study Operating Systems? • Because it enables you to do things that are difficult/impossible otherwise. 33 Example: Rio: I/O sharing implemented in the operating system kernel 34 Observation: I/O devices important for personal computers 35 A personal computer today ● 64 GB internal storage (extended by microSD) ● Super AMOLED display ● 4G LTE ● Capacitive touchscreen (multitouch) ● S pen ● Audio (speaker, microphone) ● Super AMOLED display (1080 x 1920 pixels, 5.7 inches ● Vibration (~386 ppi pixel density)) ● S pen ● capacitive touchscreen, 16M colors, multitouch ● 13 MP front camera ● speaker, mic, audio jack ● 2 MP back camera ● vibration ● Accelerometer ● NFC ● Gyroscope ● WiFi ● Proximity sensor ● bluetooth ● Compass ● Infrared ● Barometer ● 13 MP front camera ● Temperature sensor ● 2 MP back camera ● Humidity sensor ● Adreno 330 GPU ● Gesture sensor ● Accelerometer ● GPS ● gyro ● 4G LTE ● proximity sensor ● NFC ● compass ● WiFi ● barometer ● Bluetooth ● temperature sensor ● Infrared ● humidity sensor ● 64 GB internal storage (extended by microSD) ● gesture sensor ● Adreno 330 GPU ● GPS ● Hexagon DSP ● Hexagon DSP ● Multimedia processor ● Audio/Video HW accelerator 36 ● Multimedia processor A personal computer today ● Super AMOLED display ● Capacitive touchscreen (multitouch) ● Audio (speaker, microphone) ● Vibration interaction ● S pen ● 13 MP front camera ● 2 MP back camera ● Accelerometer ● Gyroscope ● Proximity sensor ● Compass ● Barometer ● Temperature sensor ● Humidity sensor ● Gesture sensor ● GPS ● 4G LTE ● NFC ● WiFi ● Bluetooth ● Infrared ● 64 GB internal storage (extended by microSD) ● Adreno 330 GPU ● Hexagon DSP ● Multimedia processor 37 A personal computer today ● Super AMOLED display ● Capacitive touchscreen (multitouch) ● Audio (speaker, microphone) ● Vibration ● S pen ● 13 MP front camera ● 2 MP back camera ● Accelerometer ● Gyroscope ● Proximity sensor ● Compass ● Barometer sensing ● Temperature sensor ● Humidity sensor ● Gesture sensor ● GPS ● 4G LTE ● NFC ● WiFi ● Bluetooth ● Infrared ● 64 GB internal storage (extended by microSD) ● Adreno 330 GPU ● Hexagon DSP ● Multimedia processor 38 A personal computer today ● Super AMOLED display ● Capacitive touchscreen (multitouch) ● Audio (speaker, microphone) ● Vibration ● S pen ● 13 MP front camera ● 2 MP back camera ● Accelerometer ● Gyroscope ● Proximity sensor ● Compass ● Barometer ● Temperature sensor ● Humidity sensor connectivity, ● Gesture sensor ● GPS storage ● 4G LTE ● NFC ● WiFi ● Bluetooth ● Infrared ● 64 GB internal storage (extended by microSD) ● Adreno 330 GPU ● Hexagon DSP ● Multimedia processor 39 A personal computer today ● Super AMOLED display ● Capacitive touchscreen (multitouch) ● Audio (speaker, microphone) ● Vibration ● S pen ● 13 MP front camera ● 2 MP back camera ● Accelerometer ● Gyroscope ● Proximity sensor ● Compass ● Barometer ● Temperature sensor ● Humidity sensor ● Gesture sensor ● GPS ● 4G LTE ● NFC ● WiFi ● Bluetooth ● Infrared ● 64 GB internal storage (extended by microSD) ● Adreno 330 GPU ● Hexagon DSP ● Multimedia processor acceleration 40 Multiple computers for unique I/O 41 Multiple computers for unique I/O 42 Multiple computers for unique I/O 43 I/O sharing 44 How to build this? Application Daemons, Libraries User space Kernel Device driver I/O device 45 Application layer Application Application Daemons, Libraries Daemons, Libraries User space User space Kernel Kernel Device driver Device driver ● IP Webcam I/O device ● Wi-Fi Speaker I/O device ● MightyText Client Server 46 Do not meet our criteria • High engineering effort Application •