Академический Документы
Профессиональный Документы
Культура Документы
CECS 326
Professor: Mr. Ratana Ngo Textbook Title: Operating Systems, 3rd edition Author: Gary Nutt ISBN: 0-201-77344-9 Assignments and Grading Programs and homework packets: 25% Quizzes and Exams: 50% Final exam: 25%
System Software
Application Programmer
Slide 4
System Software
Command Command Line Line Interpreter Interpreter Compiler Compiler Database Database Management Management System System
OS OS
Hardware
Slide 5
Sharing a CPU
Efficiency: time multiplexing the CPU enables more than one application and more than one user to use the computer system Throughput: multiprogramming reduces the time to execute all computing tasks Responsiveness: multiprogramming minimizes computational delay Multi-tasking raises productivity Multi-threading improves software
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 6
Time-multiplexed CPU
Space-multiplexed Memory
Some considerations
CPU versus I/O (using rough estimates) CPU clock: 1 GHz (or 1 nsec/cycle) Keyboard: 100 wpm < 3000 char/min < 1 char/sec (or 1000 msec per char) Hard disk operation: 10 msec
Conclusion: I/O bound processes User takes hundreds of seconds to enter some data, CPU uses nanoseconds to process it. More than 90% of CPU capacity is wasted. Question: Why are users obsessed with faster CPU? Homework: Consider a DSL line at 1 Mbps! Estimate the difference in speed. Where is the bottleneck?
Slide 8
Supporting multiprogramming
OS features needed for multiprogramming: Interface with input/output devices Management of devices Memory management CPU scheduling
Slide 9
Slide 10
Client-server example
(server) loop forever listen for client connection spawn new child server pass connection to child endloop
Slide 11
f3
read file
OS Design Constraints
Performance reliability Protection and security Correctness Maintainability Commercial factors Standards and open systems
-- Operating Systems: A Modern Perspective, Chapter 1
Slide 12
Reliability
layout view save print User Interface Application Abstract Resources (API) Middleware OS Resources (OS Interface) OS Hardware Resources
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 13
fwrite cout
write
Slide 14
Performance
The OS is an overhead function should not use too much of machines resources Minimum functionality is to implement generic services Additional function must be traded off against performance
DOS: single process UNIX: command line interface and stream of bytes
Slide 15
OS services
Program execution system capability to load a program and to run it I/O operations user programs are not allowed to execute I/O operations directly; hence, the OS must provide some means to use I/O devices File system manipulation program capability to read, write, create, and delete files Communications exchange of information between processes executing either on the same computer or on different systems connected together by a network
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 16
OS services
Error detection ensure correct computing by detecting errors in the CPU and memory hardware, I/O devices, or in user programs Additionally:
Resource allocation allocating resources to multiple users or multiple jobs executing concurrently Accounting keep track of and record which users use how much and what kinds of computer resources Protection ensuring that all access to system resources is controlled
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 17
System calls
A system call is an OS function provided by the operating system Applications use system calls to interface/request services from the OS Abstract all devices to a few interfaces: read, write, seek, ioctl, etc. Benefits: security, reliability, stability, uniformity/portability
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
System calls
Slide 18
Process control create, terminate, load, execute, allocate/deallocate memory, suspend, resume, etc. Device management request, release, read, write, seek, mount/unmount, get/set attributes File management create, delete, open, close, read, write, seek, get/set attributes Networking/communications create/delete resources, send/receive data, attach/detach resources Information maintenance get/set time/date, get/set system data, get/set process/file/device attribute, etc.
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 19
Common OS components
Process management Main memory management Secondary management File management Device management Networking/communications Protection and security
Slide 20
Slide 21
Slide 22
Secondary storage management - overview Since main memory is too small to accommodate all data and programs, the computer system provides secondary storage to back up main memory Modern computer systems use disks as primary on-line storage medium of data and programs The OS is responsible for:
Free space management Storage allocation Disk scheduling
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 23
Slide 24
Slide 25
Networking/communications - overview
A distributed system is a collection of processors that do not share memory or a clock. The computers in the system are connected through a communication network Communication takes place via a protocol A distributed system provides users access to various resources
Computational speed up Increased data availability Enhanced reliability
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 26
Security policy defines strategies for sharing resources and is separate from mechanism
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 27
Memory Manager
Device Manager
Processor(s)
(revised) Copyright 2004 Pearson Education, Inc.
Main Memory
Devices
CPU Modes
Mode bit: Supervisor/monitor or User mode Supervisor mode
Can execute all machine instructions Can reference all memory locations
Slide 28
User mode
Can only execute a subset of instructions Can only reference a subset of memory locations
(revised) Copyright 2004 Pearson Education, Inc. -- Operating Systems: A Modern Perspective, Chapter 1
Slide 29
Kernels
The critical part of the OS trusted code that executes without any constraints essential that the kernel is correct Executes in supervisor mode
Slide 30
Trap Table
Linux architecture
Slide 31
monolithic design to minimize the overhead of message passing Linux kernel services include: CPU scheduling, process management, memory management, interprocess communication loadable kernel modules can be loaded or unloaded as needed. these modules include file systems, device drivers, networking, etc. non-kernel OS services are implemented as system library functions
Slide 32
Microkernel Organization
Process Process Libraries Libraries
User Supervisor
Networking Networking
Processor(s)
(revised) Copyright 2004 Pearson Education, Inc.
Main Memory
Devices
Windows NT Organization
T
Slide 33
Process Process
T
T T
Libraries Libraries
User Supervisor
Subsystem Subsystem
Process Management Memory Management File Management Subsystem Subsystem Subsystem Subsystem Device Mgmt Infrastructure
Process Process
Process Process
T T
Main Memory
Devices
Virtual Machines
Each virtual machine is isolated from all other virtual machines CPU scheduling can create the appearance that users have their own processor Spooling and a file system can provide virtual card readers and virtual line printers A normal user time sharing terminal servers as the virtual machine operators console
Slide 34