CMSC 125 Operating Systems 1. Operating System Objectives and Functions
CMSC 125 Operating Systems 1. Operating System Objectives and Functions
Operating Systems
Concepts to be discussed:
Usage
Computer system
Control
Support
a. usage
users of a computer system:
programs - use memory, use CPU time, use I/O devices
human users
programmers - use program development tools such as debuggers, editors
end users - use application programs, e.g. Internet explorer
c. control
The operating system controls the usage of the computer resources - hardware devices
and software utilities. We can think of an operating system as a Resource Manager. Here
are some of the resources managed by the OS:
Processors,
Main memory,
Secondary Memory,
Peripheral devices,
1
Information.
d. support
The operating system provides a number of services to assist the users of the computer
system:
For the programmers:
Utilities - debuggers, editors, file management, etc.
For the end users - provides the interface to the application programs
For programs - loads instructions and data into memory, prepares I/O devises for
usage, handles interrupts and error conditions.
The hierarchical view of the computer system illustrates how the operating system interacts with
the users of the computer system:
Memory protection: do not allow the memory area containing the monitor to be altered
Timer: prevents a job from monopolizing the system
Problems:
Bad utilization of CPU time - the processor stays idle while I/O devices are in use.
More than one program resides in the main memory. While a program A uses an I/O device the
processor does not stay idle, instead it runs another program B.
3
New features:
Memory management - to have several jobs ready to run, they must be kept in main
memory
Job scheduling - the processor must decide which program to run.
Time-Sharing Systems
Characteristics:
Using multiprogramming to handle multiple interactive jobs
Processors time is shared among multiple users
Multiple users simultaneously access the system through terminals
BatchMultiprogramming TimeSharing
4
Time sharing is multiprogramming. The key differences between time-sharing systems and batch
multiprogramming systems are given in the table above.
3. Major Achievements
Five major theoretical advances in development
Processes
Memory Management
Information protection and security
Scheduling and resource management
System structure
3.1. Processes
What is a process?
A program in execution
An instance of a program running on a computer
The entity that can be assigned to and executed on a processor
A unit of activity characterized by a single sequential thread of execution, a current state,
and an associated set of system resources
An executable program
Associated data needed by the program
Execution context of the program: All information the operating system needs to manage
the process
5
3.2. Memory Management
Responsibilities of OS
Process isolation - prevent independent processes from interfering with each other
Automatic allocation and management - transparent to the programmer
Support of modular programming
Protection and access control
Long-Term Storage
The above requirements are satisfied by means of virtual memory and file system facilities
File system
Implements long-term store
Information stored in named objects called files
Access Control - regulates user access to the whole system, subsystems, and data
Information flow control- regulates the flow of data within the system and its delivery to users.
Certification- relates to proving that access and flow control mechanisms perform according to
their specifications and enforce desired protection and security policies.
Factors to be considered:
Fairness- give equal and fair access to all jobs of the same class
Differential Responsiveness- discriminate between different classes of jobs.
Efficiency- maximize throughput, minimize response time and accommodate as many users as
possible.
The major elements of the operating system involved in scheduling and resource management in
a multiprogramming environment are depicted in Figure 2.11
I/O queues: processes waiting for I/O devices ( a queue is associated with each I/O
device)
Short-term queue: a list of processes whose execution has been started. They reside in
main memory. Round-robin technique: give each process some time in turn.
Long-term queue: a list of new jobs waiting to be started.
7
3.5. System structure
Guidelines:
Modular software
Well-defined interfaces between modules, as simple as possible
Hierarchical layered structure
Each level:
- performs a related subset of functions
- relies on the next lower level to perform more-primitive functions and to conceal the
details of those functions
- provides services to the next higher level
8
4. Characteristics of Modern Operating Systems
Microkernel architecture-assigns only a few essential functions to the kernel, including address
spaces, interprocess communication, and basic scheduling.
Multithreading- the process is divided into threads that can run simultaneously
Thread- dispatchable unit of work. It includes a processor context program counter and stack
pointer and its own data storage for the stack. It executes sequentially and is interruptable
Symmetric multiprocessing- standalone computer with multiple processors that share the same
memory and I/O facilities connected by a communication bus. All processors can perform the
same functions
Distributed operating systems - provide the illusion of a single main memory and single
secondary memory space. Used for distributed file system
Exam-like questions: