Professional Documents
Culture Documents
Page 1
Page 2
users and application programs. For a user, therefore, a computer is nothing but the operating system running on it. It is extended machine THE TWO PRIMARY OBJECTIVES/ GOALS OF AN OS A Computer System Convenient to use Managing resources of a Computer System A Computer System Convenient to use The primary goal of an OS is convenience for the user to operate. Operating systems exist because they are supposed to make it easier to compute with them than without them. The OS acts as an intermediary between the hardware and its users, providing a high level interface to low-level hardware resources and making it easier for the programmer and for application programs to access and use.
Process Management:
execution. During execution, a process needs certain resources such as CPU Time, memory space, files and I/O devices etc. The process management module of an OS takes care of the creation and deletion of the processes, scheduling of various system resources to the different processes requesting them. Memory Management: The memory management module of an OS
taes care of the allocation and deallocation of the memory space to various programs in need of this resource. File Management: All computer systems are used for storage,
information in units called files. This module takes care of file related activities such as organization, storing, retrieval, naming, sharing and protection of files.
Device Management:
I/O devices. The device management module of an OS takes care of controlling all computers I/O devices. Security: access. Command Interpretation: A user communicates with the OS, for using The security module of an OS is protected resources and
the various system resources via set of commands provided by the OS. The Command Interpretation module of an OS takes care of interpreting use commands, supplied individually or in the form of command language and directing the system resources to handle the request.
Page 5
to do per unit time. It is measured as the number of processes that are completed by the system per unit Time. For Example :
the throughput is taken as n/t processes per second during interval. Throughput is normally measured in processes/hours. The value of the Throughput is not depend only on the capability of a system but also on the nature of jobs being processed by the system. Turnaround Time: the job. Although higher throughput is desirable from the point of view of the overall system performance, individual users are more interested in better turnaround time for their jobs. Response Time: Response Time is the interval from the time of submission of a job to the system for processing to the time the first response for job is produced by the system. (e.g. Internet).
Page 6
Program Execution Services I/O Operation Services File System Services Communication Services Error Detection Services Accounting Services Protection Services
Program Execution Services: The system must be able to load a program into memory and to run it. The program must be able to end its execution, wither normally or abnormally (indication error). I/O Operation Services: services. File System Services: The file need to be read, write, create and delete by A running program may require I/O. This
I/O may involve a file or an I/O device. So the OS must provide some I/O
Page 7
There
are
two
ways
in
which
1. Between processes executing on the same computer system. 2. Between processes executing on different computer system that are tied together by a computer network. Error Detection Services: Errors may occur in the CPU and memory,
hardware, in I/O devices, a connection failure of network, in the user program etc. For each type of error, the OS should tae the appropriate action to ensure correct and consistent computing. Accounting Services: Keep track of which users use how much and what
kinds of computer resources. This record keeping may be for accounting or simply for accumulating usage statistics. Protection Services: Protection involves ensuring that all access to the
resources is controlled. Security starts with each user having to authenticate himself/herself to the system, usually by means of password to be allowed access to the resources.
Page 8
Page 9
CLASSIFICATION OF OPERATING SYSTEM Single User Single Processing System The simplest of all the computer systems is a single use-single processor system. It has a single processor, runs a single program and interacts with a single user at a time. The operating system for this system is very simple to design and implement. However, the CPU is not utilized to its full potential, because it sits idle for most of the time.
User User
In this configuration, all the computing resources are available to the user all the time. Therefore, operating system has very simple responsibility. A representative example of this category of operating system is MS-DOS.
Page 10
Batch Processing Systems The main function of a batch processing system is to automatically keep executing one job to the next job. The main idea behind a batch processing system is to reduce the interference of the operator during the processing or execution of jobs by the computer. All functions of a batch processing system are carried out by the batch monitor. The batch monitor permanently resides in the low end of the main store. a batch monitor is responsible for controlling all the environment of the system operation. The batch monitor accepts batch initiation commands from the operator, processes a job, performs the job of job termination and batch termination. In a batch processing system, we generally make use of the term Turnaround Time. In Batch Processing Systems, jobs were typically executed in the following manner: Programmers would prepare their programs and data on card decks or paper tapes and submitted them at the reception counter of the computer centre.
The operator could periodically collect all the submitted programs and would batch them together and then load them all into the input device of the system at one time.
The operator would then give a command to the system to start executing the jobs. The jobs were then automatically loaded from the input device and executed by system one by one without any operator intervention.
Page 11
System would read the first job from the input device, execute it, print out its result on printer and so on till all the jobs were over.
When all the jobs in the submitted batch were processed, the operator would separate the printed output for each job and keep them at the reception counter.
The Structure of a Sample Dec of Cards submitted for Processing in a Batch Processing System
Page 12
Advantages: To speed up Processing, jobs with similar needs were batched together and run together. Reducing the idle time of a computer system to a great extent.
Disadvantage: From executing one job to another did not require any operator intervention. The CPU is often idle. Because the difference in speed between CPU and I/O devices.
Page 13
MULTIPROGRAMMING
The objective of a multiprogramming operating system is to increase the system utilization efficiency. The batch processing system tries to reduce the CPU idle time through operator interaction. However, it cannot reduce the idle time due to IO operations. The multiprogramming operating system tries to eliminate such idle times by providing multiple computational tasks for the CPU to perform. This is achieved by keeping multiple jobs in the main store. So, when the job that is being currently executed on the CPU needs some IO, the CPU passes its requirement over to the IO processor. Till the time the IO operation is being carried out, the CPU is free to carry out some other job. The presence of independent jobs guarantees that the CPU and IO activities are totally independent of each other. The area occupied by each job residing simultaneously in the main memory is known as Memory Partition. Some of the most popular multiprogramming operating systems are: UNIX, Windows NT etc.
Advantages:
Job Scheduling is the ability to multiprogramming. Multiprogramming increase CPU utilization that the CPU always has one job to execute.
Page 14
A typical scenario of jobs in a multiprogramming system is shown with the help of Diagram
Main Memory Execution in Progress
CPU
Three Jobs in a Multiprogramming System
At a particular time instance : Job A is not utilizing the CPU since it is busy writing output data on the disk. CPU utilized to execute job B, which is also present in the main memory. Job C also residing in the main memory, is waiting for the CPU become to free.
Page 15
Three States of jobs residing in the main memory in case of Multiprogramming 1. Running 2. Blocked 3. Ready
1. Running:It is using by the CPU. 2. Blocked: It is performing I/O Operations. 3. Ready: It is waiting for CPU to be assigned to it. Although many jobs may be in ready and blocked states, only one job can be running at any instant.
New Job
Ready
Running
I/O Completed
Blocked
The three different states in which jobs may be after getting loaded in the main memory in a Multiprogramming System.
Page 16
memory protection mechanism to prevent a job in one memory partition from chaining information or instruction of a job in another memory partition. Job Status Preservation: For this OS maintains a Process Control
Block (PCB) for each loaded process. With this arrangement, before taking away the CPU from a running process, its status is preserved in its PCB and before the process resumes execution when the CPU is given back to it at a later time, its status is restored back from its PCB. Thus the process can continue execution without any problem. Proper Job Mix: For Effectively use the operations of the CPU a proper job mix of I/O Bounds (input amount of data, perform very little computation) and CPU Bounds (perform numerical calculations, with little I/O operation) is required. CPU Scheduling: When more than one process is in the ready state when the CPU become free, the OS must decide which of the ready jobs should be allocated the CPU for execution. The part of the OS concerned with this decision is called the CPU Scheduler, and the algorithm it uses is called the CPU Scheduling algorithm.
Page 17
MULTITASKING
Multitasking is a logical extension of multiprogramming. Multitasking is the systems capability to concurrently work on more than one task. Basically, there is But no difference Authors between prefer Multitasking to use the and term,
Multiprogramming.
Many
Multiprogramming for multi-user systems (Client/Server environment) and Multitasking for Single user System (Systems that are used by only one user such as PC). Multiprogramming is the concurrent execution of multiple jobs (of same or different users) in a multi-user system. Multitasking is the concurrent execution of multiple jobs (often referred to as tasks of same user) in a Single User System.
Page 18
Page 19
The short period of time during which a user process gets the attention of the CPU is known as Time Slice, Time Slot or Quantum and is typically of the order of 10 to 100 milliseconds. The Process State diagram of time sharing system is as :
New Job
Ready
Running
I/O Completed
Blocked
Advantages: Reduce CPU idle time. Provides advantages of quick Response Time. Offers good computing to Small Users. Requirements of Time Sharing System Large Memory to support Multiprogramming Memory Protection Mechanism Job Status Preservation Mechanism Special CPU Scheduling Algorithm Alarm clock mechanism to send an interrupt signal to the CPU after every time slice.
Page 20
PARALLEL SYSTEM
Most systems to date are single-processor systems i.e. they have only one main CPU. Parallel system have more than one processor in close communication, sharing the computer bus, the clock, and sometimes memory and peripheral devices. These systems are also referred to as Tightly Coupled Systems. Increased Throughput: One advantage is increased throughput. By
increasing the number of processors, we hope to get more work done in a shorter period of time. The speed-up ratio with n processors is not n, however, but rather is less than n. Save Money: Multiprocessors can also save money compared to multiple single systems because the processors can share peripherals, cabinets, and power supplies. If several programs are to operate on the same set of data, it is cheaper to store those data on one disk and to have all the processors share them, rather than to have many computers with local disks and many copies of the data. Increase Reliability: Another reason for multiprocessor systems is that they increase reliability. If functions can be distributed properly among several processors, then the failure of one processor will not halt the system, but rather will only slow it down. If we have 10 processors and one fails, then each of the remaining nine processors must pick up a share of the work of the failed processor. Thus, the entire system runs only 10 percent slower, rather than failing altogether. Continued operation in the presence of failures requires a mechanism to allow the failure to be detected, diagnosed, and corrected
Page 21
Two Models of Parallel/ Multiprocessing System Symmetric Model: In which each processor runs an identical copy of
the operating system, and these copies communicate with one another as needed. Example : Unix for Multimax Computer. Asymmetric Model: In which each processor is assigned a specific task.
A master processor controls the system. The other processors wither look to the master for instruction or have predefined tasks. This scheme defines Master-Slave relationship. The master processor schedules and allocates work to the slave processors. Example: Sun's operating system SunOS Version 4. Disadvantages: Require very Sophisticated OS to Schedule, balance and coordinate the input, output and processing activities of multiple processors. More expensive to procure and maintain.
Page 22
DISTRIBUTED SYSTEMS
The processors communicate with one another through various communication lines, such as high-speed buses or telephone lines. These systems are usually referred to as loosely coupled systems, or distributed systems. The processors in a distributed system may vary in size and function. They may include small microprocessors, workstations, minicomputers, and large general-purpose computer systems. These processors are referred to by a number of different names, such as sites, nodes, computers, and so on, depending on the context in which they are mentioned. Major reasons for building distributed systems Resource Sharing: If a number of different sites (with different
capabilities) are connected to one another, then a user at one site may be able to use the resources available at another. For example, a user at site A may be using a laser printer available only at site B. Meanwhile, a user at B may access a file that resides at A. In general, resource sharing in a distributed system provides mechanisms for sharing files at remote sites, processing information in a distributed database, printing files at remote sites, using remote specialized hardware devices (such as a high-speed array processor), and performing other operations. Computation Speedup: If a particular computation can be
partitioned into a number of sub computations that can run concurrently, then a distributed system may allow us to distribute the computation among
Page 23
the various sites to run that computation concurrently. In addition, if a particular site is currently overloaded with jobs, some of them may be moved to other, lightly loaded, sites. This movement of jobs is called Load Sharing. Reliability: If one site fails in a distributed system, the remaining
sites can potentially continue operating. If the system is composed of a number of large autonomous installations (that is, general-purpose computers), the failure of one of them should not affect the rest. If, on the other hand, the system is composed of a number of small machines, each of which is responsible for some crucial system function (such as terminal character I/O or the file system), then a single failure may effectively halt the operation of the whole system. Communication: There are many instances in which programs need to exchange data with one another on one system. Window systems are one example, since they frequently share data or transfer data between displays. When many sites are connected to one another by a communication network, the processes at different sites have the opportunity to exchange information. Users may initiate file transfers or communicate with one another via Electronic Mail. A user can send mail to another user at the same site or at a different site.
Page 24
Page 25