Title: ITFN 3601 Operating Systems
1ITFN 3601 Operating Systems
- Byron Jeff
- byronjeff_at_clayton.eduComputer Hardware Review
- OS Concepts Overview
2Agenda
- OS Introduction
- Flavors of OS
- Hardware Review
- OS Concepts Overview
- System Calls
- Various OS Approaches
3So What is an OS?
- And Ya Cant Say
- Operating System
4OS Placement
Applications (Word, IE, Games, etc.)?
User
Low-level apps (compilers, interpreters, editors)?
Operating System
Machine Language (Binary)?
Machine
Microarchitecture (processor-level)?
Physical Devices (Hardware)?
5OS Defined
- Abstract Interface
- Service provider for hardware
- Abstracts the details of the machine
- Provides an API (system calls) to user
- Resource Manager
- Multiple users, multiple resources
- Orderly, controlled allocation of resources
- Fairness, protection, space-time, etc.
6History of Operating Systems
- Machine-centric ? Human-centric
- Vacuum Tubes (1945-1955)?
- All programming done in machine language
- No OS,
- Usage done by the same people who built the
machine
7History of OS (cont)?
- Transistors Batch (1955-1965)?
- University, government, big-business
- Mainframes operators in dedicated rooms
- Punch cards
- Deck readers
- Input/Output bins
- Batch processing onto tape
8History of OS (cont)?
- Integrated Circuits (1965-1980)?
- Software-compatible product lines
- Birth of the modern notion of the OS
- Multi-purpose machine w/ software (OS)
intermediary - Multiprogramming (multiple programs/jobs sharing
resources)? - UNIX
9History of OS (cont)?
- Personal Computing (1980-present)?
- LSI chips
- Cheap memory, disk space, processing, etc.
- DOS, Windows, Mac OS, X
- Distributed computing
- PDA/embedded-devices
10Flavors of OS
- Mainframe
- Server
- Multiprocessor
- Personal Computer
- Real-Time
- Embedded
- Smart Card
11Mainframe OS
- High-end I/O capacity
- 1000 disks
- Gigabytes of data
- High-end web servers
- B2B (business to business) E-commerce
- High-speed VR/FMV Rendering
- Many small, simultaneous jobs
12Server OS
- Large personal computers (kahuna, zidane, etc.)?
- Print, file servers for small businesses
- Web servers
- Can load balance these to increase performance
- UNIX, Linux, Win2000 Server OS
13Multiprocessor OS
- Connect multiple computers together
- Share/distribute jobs among multiple
machines/processors - Specialized protocols for managing communication
- Win2000 Advanced Server
14Personal Computer OS
- Focus on single user, multiple jobs
- What youre running on your machine
- Windows XP/Vista, Win2003/2008 Pro, Linux
15Real-Time OS
- Time dominates these machines specs
- Data collection from production lines, factory
machinery - Hard real-time time critical in all instances
- Soft real-time OK to drop occasionally
16Embedded OS
- Personal Digital Assistants
- TVs, microwaves, mobile phones
- Very small OS, embedded on chip
- PalmOS, WinCE
17Smart Card OS
- Credit card sized devices
- Specialized OS for specialized purposes
- E-payment cards (e-cash cards)?
- Some JVM coming into play
18Hardware Review
CPU
Memory
Display
Display Controller
Bus
Keyboard
Keyboard Controller
Floppy
Floppy Controller
Hard Disk
Hard Disk Controller
19Hardware Review
- Processors
- Memory
- I/O Devices
- Bus
20Processors
- Brain of the computer
- Fetch, decode, execute cycle
- Registers
- Program Counter (PC)?
- Stack Pointer (SP)?
- Pipelining improves performance, but complexities
of rolling back appear - Kernel vs. User Mode (enables establishing
limitations of instruction set available)?
21Memory
- Trade off of speed vs. cost/size
- Registers (on processor)?
- Cache (processor)?
- Cache (mainboard)?
- Main Memory
- Disk
- Other Network Cache/Machines
- Tape
Cost increases
Speed decreases
22Memory Allocation
- We need a protective and fair way of allocating
and resizing memory blocks for processes/jobs - Two sections of memory
- Code (typically static)?
- Data (volatile)?
Limit
User 2 Data
Base
Limit
User 1 Data
Base
Limit
Program Code
Base
OS
23I/O Devices
- Typically consist of two parts
- Controller
- Device
- Controller manages presents the API of the
device to the OS - The software that talks to the controller is
called a device driver
24Invoking Device Actions
- Busy wait execute a kernel-level system call
and wait (ties up the processor ?)? - Ask the device to generate an interrupt (signal
that its done or failed)? - Doesnt tie up the processor
- Adds complexity
- DMA Direct Memory Access
- Bypasses the use of the processor
- Allows the device to write directly to memory
once the rules of the road are established
25Bus
- Communication highway for all data to travel
upon - Multiple buses exist in modern machines
- Cache (fastest)?
- Local (on mainboard other busses connect to it)?
- Memory
- PCI (successor of ISA - high-speed I/O)?
- SCSI (high-speed scanners disks)?
- USB (slow peripherals)?
- IDE (disks, etc.)?
- ISA (slowest legacy)?
26OS Concepts
- Processes
- Deadlock
- Memory Management
- I/O
- Files
- Security
27Processes
- Defined as a program in execution
- AKA a job
- Contain
- Instructions (code segment)?
- SP, PC, registers, file handles
- Data segment
- Processes can spawn subprocesses threads
- The OS must ensure fairness protection,
timeslicing managing multiple processes at a
time
28Deadlock
- Two or more processes stalemated because they
cant make progress
Process A Has resource 1 Waiting on resource 2
Process B Has resource 2 Waiting on resource 1
29Memory Management
- Providing protection of one process memory
section from another process (security)? - Providing a fair allocation of memory to multiple
processes - Swapping memory to disk as needed
30Input/Output
- All OS must manage I/O devices
- Two categories
- Device independent
- Device dependant (device drivers)?
31Files
- System calls
- Create, remove, read, write, etc.
- Directories subdirectories
- Create, remove, rename, move, etc.
32Security
- Allocate permissions
- Directories
- Files
- Example UNIX policies to consider
- Read, Write, Execute
- User, Group, World
33System Calls
- Services that the OS provides to the user
- Set of API that user-level programs may invoke
- Flavors of System Calls
- UNIX
- Win32
34UNIX System Calls
- pid fork() creates child process
- exit() terminates process
- fd open(file, ) opens file
- s mkdir(name, mode) creates directory
- s chmod(name, mode) sets file/dir permissions
- s kill(pid, signal) sends signal to process
35Win32 System Calls
- CreateProcess() creates new process
- ExitProcess() terminates process
- CreateFile() opens file
- CreateDirectory() creates directory
36Approaches to OS
- Monolithic
- Virtual Machines
- Client-Server (microkernel)?
37Monolithic OS Architecture
- OS written as a set of procedures
- Each procedure has well-defined interface
(parameters)? - Very little structure or information hiding
38Virtual Machine OS Architecture
- Replicate the hardware within software
- Trap OS calls and translate/handle them
- Breaks down if you make direct I/O calls
- Slow
- Other approach JVM (define an alternate
instruction set and translate to various OS)?
39Client-Server OS Architecture
- Implement as much as possible in user-level
modules - The OS is as small as possible
- It only serves to translate and message pass
OS-level calls to service processes
40Summary
- Various levels of OS complexities/sizes exist
(mainframe to smart cards)? - Important to know your hardware
- Processors, memory, I/O, buses
- Important topics in OS forthcoming
- Processes, deadlock, mem mgmt, files, etc.
- System calls provide an API to user-level
programs - Varied OS architecture approaches
- Monolithic, VM, client-server
41FIN