Lecture 1
Introduction
What is an Operating System?
- Tool to make programmer's job easier
- Resource allocator
- Must be fair; not partial to any process
- Must discriminate between different classes of jobs with different
service requirements
- Must do the above efficiently
- Control program
- Tool to facilitate efficient operation of computer system
- Virtual machine that is easier to understand and program
- Layered architecture
- Must be a wizard that maintains the illusion that the user has the sole
attention of the computer.
History 1
First Generation Systems
- 1945 - 1955
- Bare machines -- vacuum tubes and plugboards
- Example: ENIAC
- Electronic Numerical Integrator And Computer
- Designed by J.W. Mauchly and J.P. Eckert at University of Pennsylvania
in 1945
- Commissioned by the Ballistics Research Lab at Aberdeen Proving Ground
- Made up of 18,000 vacuum tubes and 1,500 relays
- No operating system
- Black box concept -- human operators
- No protection
History 2
Problem: Computers are expensive, yet they are not being very efficiently
used. All I/O goes through the lone general-purpose CPU register, the Accumulator. This is very inefficient. Can we figure out a way to do the I/O
some other way, freeing up the accumulator to continue computing?
Second Generation Systems
- 1956 - 1965
- Transistors and batch systems
- Clear distinction between designers, builders, operators, programmers and
maintenance personnel
- I/O channel
- Read ahead; spooling
- Interrupts; exceptions
- Minimal protection
- Libraries; JCL
History 3
Third Generation Systems
We're still not making good use of computing resources. Even though I/O has
been separated from the CPU, the program sometimes has to wait for I/O to complete before executing more instructions. Programs and data do not always fill memory. Etc. Solution: Have several programs on the computer and have them trade off on the CPU. One can be running while the other is waiting for I/O.
- 1965 - 1980
- Integrated circuits
- Multiprogramming
- Spooling (simultaneous peripheral operation on-line)
- Time sharing
- On-line storage for
- System software
- User programs and data
- Program libraries
- Virtual memory
- Multiprocessor configurations
- MULTICS
- Multiplexed Information and Computing Service
- Design started in 1965; completed in 1972
- Collaboration between GE, Bell Labs, MIT (Project MAC)
- Aims:
- Simultaneous computer access by large community of users
- Ample computation power and data storage
- Easy data sharing between users, if desired
- Protection
- See Multics home page (access from course home page).
History 4
Fourth Generation and Beyond
Finally, the hardware gets cheap and people expensive. It's more cost efficient
to put a computer on every desk so the user's time is not wasted. Since there is less need for general-purpose time-sharinf systems, a lot of attention is turned toward developing special-purpose computers for scientific and engineering applications.
- Personal computers and workstations
- MS-DOS and Unix
- Massively parallel systems
- Pipelining
- Array processing / SIMD
- General multiprocessing / MIMD
- Symmetric multiprocessing / SMP
- Any process or thread can run on any available processor
- Computer networks -- network operating systems
- Distributed computing -- distributed operating systems
Operating System Concepts
- Process
- Kernel
- Files
- System calls
- Shell
Processes
The Process Concept
- "A program in execution"
- May be stopped and later restarted by OS
- Process table contains Process Control Block for each process
- PCB records information about the process
- Program code
- Data
- Stack
- Program counter, stack pointer, other registers
- Core image
- Process has a parent and may create other processes (children)
- Communication through messages
- Process ownership determined by UID and GID
- Process id identifies the process
- Special process ids in Unix:
- Swapper -- 0
- sbin/init -- 1
- Page daemon -- 2
The Kernel
Two modes of execution: user mode and kernel mode.
- User mode
- Processes can access own instructions and data but not kernel's
- Cannot execute certain privileged machine instructions
- Kernel mode
- Processes can access kernel and user instructions and data
- No limit to which instructions can be executed
Services provided by the kernel
- Always resides in main memory
- Controls execution of processes by allowing their creation, termination
or suspension
- Schedules processes fairly for execution on CPU
- Allocates main memory for an executing process
- File system maintenance
- Allows processes access to peripheral devices (terminals, tape drives,
disk drives, network devices)
Services provided by kernel transparently
- Always resides in main memory
- Recognizes that a given file is a regular file or device but hides
the distinction from the user processes
- Formats data for internal storage; hides format from user; returns unformatted byte stream
- Allows shell to read terminal input, spawn processes dynamically, synchronize process execution, create pipes, redirect I/O