Transcript osd01

CS 6560 Operating System
Design
Lecture 1
Overview
•
•
•
•
•
1.1 What is an operating system
1.2 History of operating systems
1.3 The operating system zoo
1.4 Computer hardware review
1.5 System Calls
Some References
Core References
Computer System
• A Computer System Consists of
– Hardware
• Internal: CPU, CPU support, memory, bus, adapters, disk
drives
• External: display, keyboard, disk drives, printers
– Software
•
•
•
•
Firmware
Operating System
Other System Software
Application Programs
A Computer System
Applications
Office Suite
Compilers
Operating System
Web Browsers
Interpreters
Multimedia tools
Editors
Kernel
Machine Language interface
Hardware
Microprogramming system
Physical devices
• A computer system consists of
– hardware
– system programs
– application programs
What is an Operating System
• It is an extended machine
– Hides the messy details which must be performed
– Presents user with a virtual machine, easier to use
• It is a resource manager
– Each program gets time with the resources
– Each program gets space on the resources
History of Computer Systems
•
First generation 1945 - 1955
–
–
–
–
•
Second generation 1955 - 1965
–
–
–
–
–
•
Technology: transistors, punch cards
Mainframes
Languages: FORTRAN, COBOL,
Jobs
OS: batch systems, libraries
Third generation 1965 – 1980
–
–
–
–
•
Technology: vacuum tubes, plug boards
Sign up for time, exclusive use of the machine
Languages: none
OS: no operating system
Technology: Integrated Circuits
Large mainframes and smaller machines (IBM 360 family)
Minicomputers (DEC)
OS: multiprogramming, large systems (multipart), batch and timesharing, emergence of Unix
Fourth generation 1980 – present
–
–
–
Technology: Mass production of integrated circuits (chips and boards)
Personal computers/servers/Internet
OS: embedded -> supercomputer, CP/M -> Windows, PARC->Macintosh, Unix ->
Linux/Solaris
History of Operating Systems
(2nd Generation)
• Structure of a typical job – 2nd generation
System Life Cycle
• Ontogeny Recapitulates Phylogeny (Ernst
Haeckel, 1866)
• Ontogeny = "the development of an
individual organism from egg to maturity”
• Recapitulates = “repeats”
• Phylogeny = “the development over time of
a kind of organism”
The Operating System Taxonomy
•
•
•
•
•
•
•
•
•
Mainframe operating systems
Server operating systems
Multiprocessor operating systems
Personal computer operating systems
Real-time operating systems
Embedded operating systems
Smart card operating systems
Virtual systems
Clusters and grids
Computer Insides
Computer Hardware
DVD/CD Disk
Display
Monitor
Memory
CPU
Hard Disks
Video
Adapter
Disk
Controller
Keyboard
Keyboard
Controller
Mouse
Mouse
Controller
Bus
• Components of a typical computer
Network
Adapter
Types of Devices
• Categories
–
–
–
–
–
–
–
–
CPU
Memory
Clock
Bus control: Arbitration, Interrupt, DMA
Block devices
Character
Memory mapped
Networking
• Performance
• Wide range from 10 byes/sec (keyboard) to several hundred
megabytes/sec (PCI bus)
CPU Architecture
•
•
•
•
•
Memory Cache
Instruction Decoding
Arithmetic Logic Units
Floating Point Unit
Internal Buses
Computer Hardware Review
Structure of a Pentium-based system
CPU Registers
•
•
•
•
•
Program counter
Stack Pointer
Program Status Word
Data
Address
Computer Hardware - Memory
One base-limit pair and two base-limit pairs
Computer Hardware
• Typical memory hierarchy
– numbers shown are rough approximations
Type
Access Time
Size
Registers
1 nanosecond
< 1KB
Cache
2 nanoseconds
1 MB
Main Memory
10 nanoseconds
256 MB - 4 GB
Disk
10 microseconds
100 GB - 1 TB
Tape
10 seconds
200 GB - ?
Secondary and Third Level Storage
Disks
• Types
– Magnetic (fixed and removable, internal and external,
RAID)
– Optical (CD-ROM, CD-R, DVD)
• Interfaces
– IDE, SCSI, USB, Fiber Channel, etc.
• Recall basic structure
– Cylinders, tracks, sectors
– Issues: Cylinder skew, sector interleaving, virtual
geometry, logical block addressing
– Architecture
• Integrated disk drive (drive with embedded computer system)
• Bus-interface controller (interfaces between system bus and
cable to integrated disk drive)
Computer Hardware Review
Structure of a disk drive
Tanenbaum, MOS
Examples of Disks
Computer Hardware Review
(a)
(b)
(a) Steps in starting an I/O device and getting interrupt
(b) How the CPU is interrupted
Kernel-based Systems (Monolithic)
System calls
General Purpose Functions
Process Management
File Management
Interprocess Communication Management
Memory Management
Device tables
Device Drivers
System Calls
Some Win32 API calls
Steps for System Call
•
•
•
•
•
•
•
•
•
1-3) Push registers on stack
4) call library function
5) place function # in register (or stack)
6) execute TRAP instruction
7) dispatch to call handler
8) runs a handler
9) returns to library function
10) returns back to program
11) cleans up the stack
Steps in Making a System Call
There are 11 steps in making the system call
read (fd, buffer, nbytes)
Operating System Concepts
• A process tree
– A created two child processes, B and C
– B created three child processes, D, E, and F
Operating System Concepts
Two processes connected by a pipe
Operating System Concepts
Typical file and directory system for a university
department
Operating System Concepts
(a) A potential deadlock. (b) an actual deadlock.