600 likes | 1.02k Views
2. Operating system overview. An example of computing without an operating systemSession scheduling and set-up timeFront panel lights and toggle switchesBootstrap loader on paper tapeCompiler on cardsSource deckPaper tape object fileData deckExecution. 3. Operating system objectives. ConvenienceMakes the computer more convenient to useEfficiencyAllows computer system resources to be used in an efficient mannerAbility to evolvePermit effective development, testing, and introduction o9446
E N D
1. 1 Chapter 2: Operating System Overview CS 472 Operating Systems
Indiana University – Purdue University Fort Wayne
2. 2 Operating system overview An example of computing without an operating system
Session scheduling and set-up time
Front panel lights and toggle switches
Bootstrap loader on paper tape
Compiler on cards
Source deck
Paper tape object file
Data deck
Execution An early computer system
Argonne National Lab
Late 1960sAn early computer system
Argonne National Lab
Late 1960s
3. 3 Operating system objectives Convenience
Makes the computer more convenient to use
Efficiency
Allows computer system resources to be used in an efficient manner
Ability to evolve
Permit effective development, testing, and introduction of new system functions without interfering with service
4. 4 Layers of computer system
5. 5 Operating system kernel The kernel is a portion of operating system that is always in main memory
It contains most frequently used functions
Also called the nucleus
6. 6 Convenience Services provided by the operating system
Program development
Editors and debuggers
Program execution
Access to I/O devices
Controlled access to files
System access
Login and passwords
Error detection and response
Accounting
7. 7 Error detection and response Internal and external hardware errors
Memory error
Device failure
Software errors
Arithmetic overflow
Access forbidden memory locations
Operating system cannot grant a request made by an application
8. 8 Accounting Collect usage statistics
Monitor performance
This information can be used . . .
to anticipate future enhancements
for billing purposes
9. 9 Efficiency The OS promotes efficiency by managing resources
Processor(s)
Memory
Devices
Files
The OS functions same way as ordinary computer software
It is program that is executed
The OS frequently relinquishes control of the processor and relies on the processor to regain control
10. 10 Ability to evolve A major OS should be able to evolve over time in response to . . .
Hardware upgrades and new types of hardware such as
Paging hardware for virtual memory
Multiple processors
New services such as
Overlapping windows
Client / server computing
Errors in the OS
11. 11 Evolution of operating systems Serial processing
Simple batch systems
Multiprogrammed batch systems
Time-sharing systems
12. 12 Serial processing (discussed earlier) No operating system
Manual scheduling of use
Computer operated from a console with display lights, toggle switches, input device, and printer
Setup included . . .
Loading the compiler
Loading the source program
Saving compiled program
Loading and linking object files
13. 13 Simple batch systems Developed in the 1950s by GM for the IBM 701
Simple batch OS called a monitor
Monitor software controlled a sequence of jobs
A batch of sequential jobs was loaded into a card tray
The monitor called the first (next) job
Each job program branched back to monitor when finished
Only one user job could run at a time
Processor idle waiting for I/O
But idle time between jobs and within jobs eliminated
14. 14 Job Control Language (JCL) A special type of programming language
Provides commands to the monitor
Identifies new jobs
Specifies what compiler to use
Specifies which object files to load and link
Specifies what data to use
Etc.
15. 15 Job Control Language (JCL) Example of JCL cards (with / /) in a deck
16. 16 Hardware support for simple batch Memory protection
Does not allow the memory area containing the monitor to be altered by a job
Timer
Prevents a job from monopolizing the system
Privileged instructions
Certain machine level instructions can only be executed by the monitor
E.g. - I/O instructions (a program should not read cards of next job)
Note: a program “requests” that the monitor perform the instruction
Interrupts
Allow processor to do something else while waiting for I/O
Early computer models did not have this capability
17. 17 Hardware support for simple batch The need for memory protection and privileged instructions led to the concept of processor modes
A bit in the PSW register toggles the processor between user mode and kernel mode
Each user program executes in user mode
Certain privileged instructions may not be executed
Only the program area may be referenced
The monitor executes in kernel mode
Privileged instructions may be executed
Protected areas of memory may be accessed
18. 18 Multiprogrammed batch systems Several jobs resident in memory simultaneously
Gives processor something to do while one job is waiting for I/O
19. 19 Multiprogrammed batch systems
20. 20 Multiprogrammed batch systems
21. 21 Multiprogrammed batch systems In these systems . . .
Interrupt-driven DMA emerged
This was the start of multiprocessing
Concept of logical (vrs. physical) devices emerged
22. 22 Time-sharing systems Adds an interactive computing capability to a multiprogrammed batch system
Processor’s time is shared among multiple interactive users
Multiple users simultaneously access the system through terminals
Essential for transaction processing systems
Example: Compatible Time-Sharing System (CTSS)
First time-sharing system
Developed at MIT in 1961 for the IBM 709
23. 23
24. 24 Problems Multiprogramming and time sharing led to the identification of new problems
Memory protection
File security
Contention for resources
E.g. - printers
25. 25 Major achievements Process concept
Focus of chapters 3, 4, 5, and 6
Memory management
Focus of chapters 7 and 8
Information protection and security
Focus of chapters 12, 14, and 15
Scheduling and resource management
Focus of chapters 9, 10, and 11
System structure
26. 26 Major achievement – process concept A process is . . .
A program in execution
An instance of a program running on a computer
An entity that can be assigned to and executed on a processor
Activity characterized by a current state and an associated set of system resources
27. 27 A process consists of . . . Activity
An executable program
Data
Variables
Work space (stack)
Buffers
Etc.
Execution context (process state)
All information the operating system needs to manage the process
Registers (PC, PSW, registers)
Pending I/O
Allocated memory
Priority and privilege
28. 28 Context switch A context switch is where . . .
The hardware context registers (hardware Process Control Block or hardware PCB) of the old process are saved in its context area in memory
The hardware PCB of the new process is restored from its context area of memory
This is similar to a subprogram call
But includes the PSW and stack pointer
Implemented in hardware
An interrupt, for example, results in a context switch
From the interrupted program to the interrupt handler
29. 29 A context switch
30. 30 VAX computer systemhardwareprocess control block (PCB)
31. 31 Problems leading to process concept Multiprogrammed batch
Many jobs in memory simultaneously
Need to isolate one job from the others
Need to switch among jobs at I/O start and end
Time sharing
Need to switch rapidly due to a timer interrupt
Need for responsiveness
Real-time transaction processing
Many jobs share information and memory
32. 32 Problems leading to process concept See the paragraph before the bullets, text p. 66
Four main causes of errors
Improper synchronization
Failed mutual exclusion
Deadlock
Nondeterminate program operation
33. 33 Problems leading to process concept Improper synchronization
Data is lost or duplicate data is received
A process initiating I/O must wait until the handler process detects completion
Failed mutual exclusion
Two process must not book the same seat on an airplane
Example from transaction processing
34. 34 Problems leading to process concept Deadlock
Common for two processes to hang up waiting for each other
For example, one process may want to copy disk to tape while another copies the tape to disk
Nondeterminate program operation
Outputs or success of an operation depends on the scheduling of unrelated programs
Hard to debug because the condition that produced the error is difficult to reproduce
35. 35 Major achievement – memory management Responsibilities of memory management
Process isolation
Transparent allocation and management of memory within a process across the memory hierarchy
Virtual memory
Real (main) memory
Cache memory
Support of modular programming
Dynamic creation, resizing, and deallocation of program modules
Protection and access control
Controlled sharing of memory among processes
Long-term storage in files
36. 36 Major achievement – information protection and security Availability
Concerned with protecting the system against interruption
Confidentiality
Assuring that users cannot read data for which access is unauthorized
Data integrity
Protection of data from unauthorized modification
Authenticity
Concerned with the proper verification of the identity of users and the validity of messages or data
37. 37 Major achievement – scheduling and resource management Fairness
Give equal and fair access to resources within the same class
Differential responsiveness
Discriminate among different classes of jobs
Efficiency
Maximize throughput, minimize response time, and accommodate as many users as possible
38. 38 Major achievement – system structure In a large OS, modularity is necessary but not sufficient
View the system as a series of layers
Each layer performs a related subset of functions
Each layer relies on lower levels to perform more primitive functions
Each layer provides services to higher levels
Think client / server computing
The text identifies 13 levels
39. 39 Hardware levels (not part of OS) Level 1
Electronic circuits
Objects are registers, memory cells, and logic gates
Operations are clearing a register or reading a memory location
Level 2
Processor’s instruction set
Operations such as add, subtract, load, and store
Level 3
Adds the concept of a procedure or subroutine, plus call/return operations
Level 4
Interrupts
Interrupt handling routines are part of the OS
40. 40 Multiprogramming levels Level 5
Concept of the process is supported
Ability to suspend and resume processes (context switch)
Synchronization primitives implemented
Level 6
Secondary storage devices
Transfer of blocks of data
Level 7
Creates logical address space for processes
Organizes virtual address space into blocks
41. 41 Support for external devices / networks Level 8
Communication of information and message passing
Level 9
Supports long-term storage of named files
Level 10
Provides access to external devices using standardized interfaces
42. 42 Support for external devices / networks Level 11
Responsible for maintaining the association between the external and internal identifiers
Level 12
Provides full-featured facility for the support of processes
Level 13
Provides an interface to the operating system for the user
Called a shell or an Application Programming Interface (API)
43. 43 Modern OS characteristics Microkernel architecture
There is no monolithic OS kernel with most OS features
Kernel has only a few essential functions
Address space
Interprocess communication (IPC)
Basic scheduling
Other traditional OS features are distributed among user mode processes
44. 44 Modern OS characteristics Multithreading
A process is divided into threads that can run concurrently
Thread
Dispatchable unit of work
Includes registers and a stack
Executes sequentially and is interruptable
Process is a collection of one or more threads
A thread switch has less overhead than a process switch
45. 45 Modern OS characteristics Symmetric MultiProcessing (SMP)
There are multiple processors
These processors share same main memory and I/O facilities
All processors are equivalent and can perform the same functions
True parallel processing is possible
Processors may be added and removed
The number of processors is transparent to applications
46. 46 Multiprogramming and multiprocessing
47. 47 Modern OS characteristics Distributed operating system
This is an OS for a cluster of separate computers (multicomputer system)
Separate main memories, disks, and devices
Provides the illusion of a single main memory space, a single secondary memory space, and unified access to all devices
48. 48 Example systems Microsoft Windows
UNIX
Traditional
Modern
Linux
49. 49 Microsoft Windows Impressive OS
Single-user multitasking OS that evolved out of MS-DOS
Modular structure for flexibility
Any module can be removed, upgraded, or replaced without rewriting the entire system
Executes on a variety of hardware platforms
Pentium, Itanium, PowerPC, Alpha, etc.
Provided by the Hardware Abstraction Layer (HAL)
This isolates the operating system from platform-specific hardware differences
Supports applications written for other operating systems
This is provided by various environment subsystems
50. 50
51. 51 Windows organization Modified microkernel architecture
Not a pure microkernel
Many system functions outside of the microkernel run in kernel mode
Kernel
Consists of the most used components
Thread scheduling
Process switching
Interrupt handling
SMP
Does not run in threads and is not preemptible
Executive
Contains base operating system services
Memory management
Process and thread management
Security
I/O
Interprocess communication
52. 52 Windows client-server model Simplifies the Executive
Possible to construct a variety of APIs
Improves reliability
Each service runs on a separate process with its own partition of memory
Clients cannot not directly access hardware
Provides a uniform means for applications to communicate via Local Procedure Call (LPC)
Provides base for distributed computing
53. 53 Windows threads and SMP Operating system routines can run on any available processor or simultaneously on different processors
Multiple threads of execution within a single process may execute on different processors simultaneously
Server processes may use multiple threads to process requests from multiple processes simultaneously
Mechanisms provided to share data and resources between processes
54. 54 Traditional UNIX Hardware is surrounded by the operating system software
Operating system is called the system kernel
Comes with a number of user services and interfaces
Shell
Components of the C compiler
55. 55 Traditional UNIX architecture
56. 56 Traditional UNIX kernel
57. 57 Modern UNIX kernel
58. 58 Modern UNIX systems System V Release 4 (SVR4)
Platform for commercial UNIX deployment
Solaris 9
Widely used
Preemptable, multithreaded kernel
Full support for SMP
4.4BSD (Berkeley Software Distribution)
Widely used in universities
Mac OS X is based on this
Linux
Began as a UNIX variant for the Intel X86 architecture (1991)
Supported by the Free Software Foundation (FSF)
High quality kernel
Highly modular