Chap 01
Chap 01
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-2
Introduction 1
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-3
Why Study Operating Systems?
• Understand the model of operation
– Easier to see how to use the system
– Enables you to write efficient code
• Learn to design an OS
• Even so, OS is pure overhead of real work
• Application programs have the real value to
person who buys the computer
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-4
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-5
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-7
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-8
System Software
•Independent of individual applications, but
common to all of them
•Examples
–C library functions
–A window system
–A database management system
–Resource management functions
–The OS
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-9
Software
SoftwareAPI
API
Command
Command
Line Loader
Loader
System Software
Line Window
Interpreter
Interpreter Window
System
System
Libraries
Libraries
Libraries
Libraries
Compiler
Compiler Libraries
Libraries
Database
Database OS
OS
Management
Management
System
System
Hardware
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-10
Application Software, System Software, and the OS
Human-Computer Interface
Application Software
API
System Software
(More Abstract Resources)
OS Interface
Trusted OS
(Abstract Resources)
Software-Hardware Interface
Hardware Resources
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-11
The OS as Resource Manager
•Process: An executing program
•Resource: Anything that is needed for a
process to run
–Memory
–Space on a disk
–The CPU
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Disk Abstractions Slide 1-13
Application
Programmer
OS Programmer
int fprintf(…) {
...
void write() { write(…)
load(…); …
seek(…) }
load(…);
seek(…); out(…)
out(…); }
Abstract Resources
User Interface
Application
Middleware
Hardware Resources
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-15
Abstract Machines
Abstract
Machines
Idea
Program
Program Result
Result
Physical
Machine
Idea
Program
Program Result
Result
…
…
…
Idea
Program
Program Result
Result
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-16
Resource Sharing
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
The OS as a Conductor Slide 1-17
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Multiprogramming Slide 1-18
OS Resource Sharing
PPi Memory
i Memory
PPk Memory
k Memory
…
Time-multiplexed PPj Memory
j Memory
Physical Processor
Space-multiplexed
Physical Memory
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-19
Multiprogramming(2)
• Technique for sharing the CPU among
runnable processes
– Process may be blocked on I/O
– Process may be blocked waiting for other
resource, including the CPU
• While one process is blocked, another
might be able to run
• Multiprogramming OS accomplishes CPU
sharing “automatically” – scheduling
• Reduces time to run all processes
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-20
How Multiprogramming Works
Process 1
Process 2
Process 3
Time-multiplexed CPU
Process 4
Space-multiplexed Memory
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Speeding Up the Car Wash Slide 1-21
Vacuum
Wash Dry
Inside
Vacuum
Inside
Wash Dry
Multiprogramming Performance
Pi’s Total Execution Time, ti
Time
0 ti
(a) Pi’s Use of Machine Resources
P1
P2
…
Pi
…
PN
Time
OS Strategies
• Batch processing
• Timesharing
• Personal computer & workstations
• Process control & real-time
• Network
• Distributed
• Small computers
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-24
Batch Processing
Job 3
Job 19
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Batch Processing(2) Slide 1-25
• Uses multiprogramming
• Job (file of OS commands) prepared offline
• Batch of jobs given to OS at one time
• OS processes jobs one-after-the-other
• No human-computer interaction
• OS optimizes resource utilization
• Batch processing (as an option) still used
today
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-26
A Shell Script Batch File
cc -g -c menu.c
cc -g -o driver driver.c menu.o
driver < test_data > test_out
lpr -PthePrinter test_out
tar cvf driver_test.tar menu.c driver.c test_data test_out
uuencode driver_test.tar driver_test.tar >driver_test.encode
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-27
Timesharing Systems
Abstract
Machines
Result
Physical
Command Machine
Result
Command
…
Result
Command
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Timesharing Systems(2) Slide 1-28
• Uses multiprogramming
• Support interactive computing model
(Illusion of multiple consoles)
• Different scheduling & memory allocation
strategies than batch
• Tends to propagate processes
• Considerable attention to resource isolation
(security & protection)
• Tend to optimize response time
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-29
Personal Computers
• CPU sharing among one person’s processes
• Power of computing for personal tasks
– Graphics
– Multimedia
• Trend toward very small OS
• OS focus on resource abstraction
• Rapidly evolved to “personal multitasking”
systems
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-30
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-31
Networks
• LAN (Local Area Network) evolution
• 3Mbps (1975) 10 Mbps (1980) 100 Mbps
(1990) 1 Gbps (2000)
• High speed communication means new way to do
computing
– Shared files
– Shared memory
– Shared procedures/objects
– ???
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-32
Distributed OS
Distributed OS
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Distributed Systems Slide 1-33
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-35
Small Computers
• PDAs, STBs, embedded systems became
commercially significant
• Have an OS, but
– Not general purpose
– Limited hardware resources
– Different kinds of devices
• Touch screen, no keyboard
• Graffiti
– Evolving & leading to new class of Oses
• PalmOS, Pocket PC (WinCE), VxWorks, …
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-36
Evolution of Modern OS
Timesharing
Network OS
Memory Mgmt
Scheduling PC & Wkstation Client-Server Model
Batch Protection
System software
Protocols
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-37
Examples of Modern OS
• UNIX variants (e.g. Linux) -- have evolved
since 1970
• Windows NT/2K -- has evolved since 1989
(much more modern than UNIX
– Win2K = WinNT, V5
• Research OSes – still evolving …
• Small computer OSes – still evolving …
• Book provides Linux examples
• This course will use Windows NT as the
main example
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
The Microsoft OS Family Slide 1-38
Win32
Win32API
API
Win32
Win32API
APISubset
Subset
Win32
Win32API
APISubSet
SubSet
Windows
WindowsCE CE
(Pocket
(PocketPC)
PC)
Windows
Windows95/98/Me
95/98/Me
Windows
WindowsNT/2000/XP
NT/2000/XP
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-39
Microsoft Windows NT
• Heavily window-oriented
• Foundation behavior is windows-
independent
– We will focus on the foundation
– Use only the “MS-DOS prompt” -- [Link]
OS API
NT Executive
NT User Interface
NT Kernel and Graphics
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-40
Windows NT (cont)
• OS API has text orientation (like UNIX)
• Object-oriented implementation
• Heavy use of threads
• Broad spectrum of synchronization tools
• Modern I/O system
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-41
VxWorks Organization
Applications
Applications
VxWorks
VxWorksRuntime
RuntimeSystem
System
VxWorks
VxWorksConfigurable
Configurable
Core
CoreOS
OSExtension
Extension
Wind
WindMicrokernel
Microkernel
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1
Slide 1-42
Windows CE Organization
Network Graphics,
Object and Window Mgr,
Kernel Store Comm and
Services Event Mgr
Device Drivers
OEM Abstraction Layer
Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1