UMUC CS 412, Sp 97, Introduction
Silberschat and Gavin chapters 1, 2, and 3
Tanenbaum, chapter 1
Introduction - What is an operating system? (S, chapter 1)
First: what is a computer:
- Hardware
- An operating system
- Applications
- Users
An operating systems acts something like:
- A government
- An environment
- A resource allocator
- A controller
Survey of hardware components:
- CPU - central processing unit
- Memory
- Devices
- Monitor
- Keyboard
- Mouse
- CD - compact disk
- Tape
- Disk drive
- Modem
- Printer
- Network
- Sensors
- Servos, actuators
No universally accepted definition - perhaps just what a supplier ships
Issues: user convenience and efficiency
Evolution, mostly driven by hardware utilization and CPU vs peripheral
speed:
- Hardware - bare, program through switches
- Assemblers, loaders, linkers
- Libraries for reusability
- I/O difficulties leads to device driver libraries
- buffers
- flags
- registers
- control bits
- state bits
- Compilers; steps:
- load and run compiler, accept high level code, produce assembler code
- load and run assembler, input is assembler code, output is machine
object code
- load and run object code
- Batch systems, manual
- Automatic job sequencing using a resident monitor
- loader, job sequence, control cards, control card interpreters
- job deck, see S f 1.3, pg 10
- cards to mag tape to CPU to mag tape to cards, sequential access
- spool (simultaneous peripheral operation on-line), random access
- Jobs
- job pool
- scheduling and sharing resources
- multiprogram, many jobs in memory at same time
- Time sharing
- many users with real-time access to computer system
- interactive
- file systems
- response time issue
- based on processes
- virtual memory
- Personal computers - their own evolutionary trajectory
- Parallel systems
- tight and loose coupling
- graceful degradation
- Distributed systems
- speed, reliability, access to resources, cost
- Real-time systems
Computer System Structure (S, chapter 2)
Bus-based systems, see S f 2.1, pg 30; plus MMU (memory management
unit) and PROM or ROM (programmable read-only memory).
Boot strap program - loaded by ROM, loads OS
OS then waits for events (interrupts)
- disable/enable interrupts
- traps = S/W interrupts
- hardware interrupts
- polling
Input/output structure
- data goes from and to devices through buffers
- Output
- prepare buffer
- load registers
- loop, poll, wait in interrupt, return to user, or return to system
- Device status table in OS
- Input - on interrupt:
- determine interrupt source
- look at device status table
- route message to requesting process
- buffering and type ahead
- DMA - direct memory access
- card access to memory vs direct byte by byte CPU transfer
Storage
- Registers
- Cache memory, fast and expensive
- Main memory: RAM (random access memory), core, drum; volatile
- Secondary storage
- RAM Disk
- Magnetic disk (track, cylinder, head, sector)
- Optical disk
- Tape
- Paper tape and punch cards
- Cache management - copy leads to coherency and consistency problems
Hardware protection
- User and monitor (kernel, supervisor, privileged) modes
- Privileged instructions
- No direct user access to devices
- Memory protection (S, chapters 8 & 9)
- Base/limit registers and MMU (memory management unit)
- CPU protection
- CPU hog
- Timer with interrupt
- Time slice
- Context switch
- Time limits
Talking to OS - monitor mode from user mode
- traps
- syscalls
- data: trap number, registers, stack, memory with pointers, parameter
blocks
Operating System Structures (S, Chapter 3)
- Components
- Services
- System calls
- System programs
- System structures
- Virtual machines
- Design and implementation
- System generation and configuration
Components or functions. Manage: processes, RAM, secondary storage,
I/O, files, security, networking and communications, command interpreter
(window and line oriented control), IPC (interprocess communications)
- Processes (Who's got the program counter?)
- create and delete user and system processes
- suspend and resume processes
- process synchronization
- process communication
- deadlock handling
- IPC
- RAM (memory)
- in use map
- which processes get ram
- allocate and deallocate
- Secondary storage
- Free space
- Storage allocation
- Scheduling
- Input/output
- hide wierdness
- buffer cache
- general I/O interface
- specific hardware drivers
- Files
- create and delete files
- create and delete directories
- file and directory manipulation
- map files to secondary storage
- backups
- Security
- authorize users
- authorize processes
- protect resources
- Networking
- OSI (open systems interconnect) 7-layer stack
- TCP/IP (transmission control protocol/internetwork protocol)
- process to process
- Command interpreter
- command line
- job control
- windows
OS services
- Program execution
- I/O operations
- File system
- Communications
- Error detection and recovery
- Resource allocation
- Accounting
- Security
System calls
- Process control (S chapters 4 and 6)
- File system services (S chapters 10 and 11)
- Device control
- Information (S section 4.1.3)
- Communications (S chapter 6)
System programs
- File manipulation
- Status information
- File modification
- Programming support
- Program loading and execution
- Communications
- Applications
System Structure
- O/S's are large programs or projects
- Layered systems
- Both user and kernel software elements
- Replace parts
- Extensions and DLL's
Virtual machines
- system development
- system compatibility
- simulation
Design and implementation
- User goals: convenient, easy to learn, easy to use, reliable, safe,
fast
- System goals: easy to design, implement and maintain, flexible,
reliable, error free, efficient
Mechanisms versus policies: what vs how
Implementation: originally in assembly language, nowadays much is in
a high level language
System generation
- Parameters
- CPU
- Memory
- Devices
- Options
- Use:
- parameter tables, configuration files
- substitute elements, programs
- compile a new kernel