Title: CS530 Operating Systems
1CS530 Operating Systems
2Chap 1. Introduction
- 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 Operating system concepts
- 1.6 System calls
- 1.7 Operating system structure
3Introduction
- A computer system consists of
- hardware
- system programs
- application programs
4What 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 resource
- Each program gets space on the resource
5Why DO We Study OS?
- to make a better OS
- to understand computer systems better.
- We are all computer users !!
- the capstone of all the computer science
principles - languages, hardware, data structures, algorithms.
,,,
6What Do We Study?
- Abstraction
- OS gives us an illusion that there are infinite
number of CPUs, infinite memory, single world
wide computing, .... - System Design
- tradeoffs between performance and simplicity
- functionality either by hardware or by software
- How computers work
- let's look inside of computers
- OS Research
7Why do we study history?
- 1. Main focus
- Effect of changes in hardware technologies,
computer usage, and cost on the design of OS - 2. Hardware changes
- 1980 2000 factor
- MIPS 1 1000 1000
- cost/MIPS 100K 5 20000
- memory 128KB 1GB 8000
- disk 10MB 100GB 1000
- network 9600BPS 1GBPS 100000
- address bits 16bits 64bits 4 (24)
8History of Operating Systems (1)
- Early batch system
- bring cards to 1401
- read cards to tape
- put tape on 7094 which does computing
- put tape on 1401 which prints output
9History of Operating Systems (2)
- First generation 1945 - 1955
- vacuum tubes, plug boards
- Second generation 1955 - 1965
- transistors, batch systems
- Third generation 1965 1980
- ICs and multiprogramming
- Fourth generation 1980 present
- personal computers
10History of Operating Systems (3)
- Structure of a typical FMS job 2nd generation
11History of Operating Systems (4)
- Multiprogramming system
- three jobs in memory 3rd generation
- Hardware was very expensive
12History of Operating Systems (5)
- When hardware is cheap and humans are expensive
- Interactive timesharing
- Use cheap terminals to let multiple users
interact with the system at the same time. - Sacrifice CPU time to get better response time
for users. - Personal computing
- Computers are cheap, so give everyone a computer.
- Initially, OS became subroutine library again,
but since then, have added back in memory
protection, multiprogramming, ..etc.
13Lessons from the history
- Have to change with changing technologies
- Situation today is much like it was in the late
60's OS's of today are enormous, complex. (You
may think about dinosaurs) - small OS 100K lines
- big OS 10M lines
- Why OS's are getting complex?
- intelligence show off
- market demands more features
- Avoid complexity
14The Operating System Zoo
- Mainframe operating systems
- Server operating systems
- Multiprocessor operating systems
- Personal computer operating systems
- Real-time operating systems
- Embedded operating systems
- Smart card operating systems
15Computer Hardware Review (1)
Monitor
Bus
- Components of a simple personal computer
16Computer Hardware Review (2)
- (a) A three-stage pipeline
- (b) A superscalar CPU
17Computer Hardware Review (3)
18Computer Hardware Review (4)
- Structure of a disk drive
19Computer Hardware Review (5)
- program protection relocation
20Computer Hardware Review (6)
(b)
(a)
- (a) Steps in starting an I/O device and getting
interrupt - (b) How the CPU is interrupted
21Computer Hardware Review (7)
- Structure of a large Pentium system
22Hardware Supports for OS
- timer operation
- atomic synchronization operations
- memory protection, fast address translation (TLB)
- IO control and operations (DMA, IOP)
- interrupts and exceptions
- OS protection (kernel/user mode)
- protected instructions
- system calls
- partial completion of an instruction
23Operating System Concepts (1)
- A process tree
- A created two child processes, B and C
- B created three child processes, D, E, and F
24Operating System Concepts (2)
- (a) A potential deadlock. (b) an actual deadlock.
25Operating System Concepts (3)
- File system for a university department
26Operating System Concepts (4)
- Before mounting,
- files on floppy are inaccessible
- After mounting floppy on b,
- files on floppy are part of file hierarchy
27Operating System Concepts (5)
- Two processes connected by a pipe
28Steps in Making a System Call
- There are 11 steps for read (fd, buffer, nbytes)
29Some System Calls For Process Management
30Some System Calls For File Management
31Some System Calls For Directory Management
32Some System Calls For Miscellaneous Tasks
33System Calls (1)
- A stripped down shell
- while (TRUE) / repeat forever /
- type_prompt( ) / display prompt /
- read_command (command, parameters) / input
from terminal / -
- if (fork() ! 0) / fork off child process
/ - / Parent code /
- waitpid( -1, status, 0) / wait for
child to exit / - else
- / Child code /
- execve (command, parameters, 0) / execute
command / -
-
34System Calls (2)
- Processes have three segments text, data, stack
35System Calls (3)
- (a) Two directories before linking/usr/jim/memo
to ast's directory - (b) The same directories after linking
36System Calls (4)
- (a) File system before the mount
- (b) File system after the mount
37The ls Command in Unix
- Steps in executing the command ls type to the
shell
38System Calls (5)
39The Win32 Application Programming Interface
- The Win32 API allows programs to run on almost
all versions of Windows
40Environment Subsystems (1)
- Various routes taken to implement Win32 API
function calls
41Operating System Structure (1)
- Simple structuring model for a monolithic system
42Operating System Structure (2)
- Structure of the THE operating system
43Operating System Structure (3)
- Structure of VM/370 with CMS
44Operating System Structure (4)
45Operating System Structure (5)
- The client-server model in a distributed system
46OS Research
- Identification of a problem/phenomenon
- physical memories are small
- CPU is getting faster but IO is NOT that much
- applications change often but OS does NOT
- personal computing is popular
- Hypothesize a solution
47OS Research (2)
- Evaluate hypothesis
- Measure
- Measure
- Measure again
- Use real system if possible
- gather trace data
- instrument existing systems
- simulation
- analytical investigation
- isolate small components
48OS Research
- Draw conclusions
- use result to suggest new hypotheses
- compare results against other's results
- Toughest things
- there are not necessarily any right answers
- no one can tell you with certainty that you are
right - you are never done
- large system is difficult to understand