csc501: operating systems principles
TRANSCRIPT
CSC501: Operating Systems Principles
Assistant ProfessorDepartment of Computer Science
N.C. State University1/8/2009
Xuxian Jiang
1
Logistics
q Instructor – Xuxian JiangQ Email: [email protected] Office: EB2 - 2254Q Office Hour: 11:50 – 11:59am TH
q TA – Anjing WangQ Email: [email protected] Office: MRC-409CQ Office Hour: 2:30 – 4:00pm T
q More informationQ http://courses.ncsu.edu/csc501
2
Course Overview
q Goals:Q OS internals and OS/architecture interactionQ Current trends in OS research
q Structure:Q Lectures in core OS design:v Review basic materialsv Read and discuss papers to understand advanced
issuesQ Significant projects related to core ideas in OS
3
Textbooks -- Recommended
q Silberschatz/Galvin. Operating System Concepts, John Whiley& Sons, 2009. (8th Edition)
q William Stallings. Operating Systems: Internals and Design Principles, Prentice-Hall, 2009. (6th Edition)
q Comer/Fossum. Operating System Design: The XINU approach, Prentice-Hall, 1988 (PC Edition)
4
Topics
q Processes, threads, and synchronizationQ Context switching and scheduling
q Memory managementQ Virtual memoryQ Demand paging
q I/O, file systems, distributed systemsq Protection and securityq Advanced topicsQ OS Memory protectionQ Virtualization
5
Course Requirements/Schedule
q PrerequisitesQ Undergraduate OS and architectures coursesQ Good programming skills in C and UNIX
q What to expectQ Readings v Esp. kernel source code reading
Q 4 or 5 programming assignments Q Midterm and Final exams
q Course ScheduleQ http://www.csc.ncsu.edu/faculty/jiang/csc501/calendar.html
6
Grading
q Midterm 20%q Final 20%q Programming assignments 60%Q Lab 0 – Getting started 5%Q Lab 1 – Process scheduling 15%Q Lab 2 – Reader/write locks 15%Q Lab 3 – Demand paging 20%Q Lab 4 – Survey 5%
7
Lab Facilities
q Front-endQ VCL, unity lab, or your own PC
q Back-endQ 100 raw machines
q Typical scenarios:Q Your own PC (Linux) à BackendQ Your own PC (Windows) à VCL (Linux) à Backend
8
q Academic integrityQ We will strictly enforce the university, college, and
department policies against academic dishonesty. q Unless otherwise noted, work turned in should
reflect your independent capabilitiesQ Plagiarism not allowed and severely punishedQ If unsure, note / cite sources and help
q For programming assignmentsQ No late submission will be acceptedv unless documented emergency (e.g., medical) in special
circumstances
Course Policies
9
Quick Survey 1: Are you familiar with UNIX
environment?
10
Quick Survey 2: Any kernel programming experience
before?
11
Introduction
CSC501 Operating Systems Principles
12
What is an operating system?
13
What is an operating system?
q An intermediary program between a user of a computer and the computer hardware
q Operating system goals:Q Execute user programs and make solving user
problems easierQ Make the computer system convenient to useQ Use the computer hardware in an efficient manner
Question: How about security?
14
What is an operating system?
q Virtual machines Q Virtualizes the hardware
q Manager/policemanQ Organizes; maintains order
q Autonomic systemQ Make things work beneath the covers
15
How does an OS work? à
q Receives requests from the application: system callsq Satisfies the requests: may issue commands to hardwareq Handles hardware interrupts: may upcall the application
hardware
OS
application (user) system calls upcalls
commands interrupts
hardware independent
hardware dependent
Keywords in this class
q AbstractionQ Process, memory, I/O, file, socket, …
q TradeoffQ Separation between mechanisms and policies
17
Abstraction I : Processes
A process is a system abstraction:illusion of being the only job in the system
hardware: computer
OS: process
user: application
Processes: Mechanism and Policy
q Mechanism:Q Creation, destruction, suspension, context
switch, signalling, IPC, etc.q Policy:Q How to share system resources between
multiple processes?
19
Abstraction II: Threads
A thread is a processor abstraction: illusion of having 1 processor per execution context
hardware: processor
OS: thread
application: execution context
Process vs. Thread: Process is the unit of resource ownership,while Thread is the unit of instruction execution.
Threads: Mechanism and Policy à
q Mechanism:Q Creation, destruction, suspension, context
switch, signalling, synchronization, etc.
q Policy:Q How to share the CPU between threads from
different processes?
Q How to share the CPU between threads from the same process?
21
Abstraction III: Virtual memory
hardware: physical memory
OS: virtual memory
Virtual memory is a memory abstraction: illusion of large contiguous memory, often more
memory than physically available
application: address space
Virtual Memory: Mechanism
q Mechanism:Q Virtual-to-physical memory mapping, page-fault,
etc.
physical memory:
v-to-p memory mappings
processes:
virtual address spacesp1 p2
Virtual Memory: Policy
q Policy:Q How to multiplex a virtual memory that is larger
than the physical memory onto what is available?Q How to share physical memory between multiple
processes?
24
Abstraction IV: File System
hardware: disk
OS: files, directories
A file system is a storage abstraction: illusion of structured storage space
application/user: copy file1 file2
File System à
q Mechanism:Q File creation, deletion, read, write, file-block-
to-disk-block mapping, file buffer cache, etc.
q Policy:Q Sharing vs. protection?
Q Which block to allocate for new data?
Q File buffer cache management?
26
Abstraction V: Messaging
hardware: network interface
OS: TCP/IP protocols
Message passing is a communication abstraction:illusion of reliable (sometimes ordered) transport
application: sockets
Message Passing
q Mechanism:Q Send, receive, buffering, retransmission, etc.
q Policy:Q Congestion control and routingQ Multiplexing multiple connections onto a single
NIC
28
Next Lecture
q OS Structure
q We will start class on time, so please don’t come late!
29