2.1 Introduction An operating system provides the environment - TopicsExpress



          

2.1 Introduction An operating system provides the environment within which programs are executed. Internally, operating systems vary greatly in their makeup, since they are organized along many different lines. The design of a new operating system is a major task. It is important that the goals of the system be well defined before the design begins. We can view an operating system from several vantage points. One view focuses on the services that the system provides, another, on the interface that it makes available to users and programmers; a third, on its components and their interconnections. 2.2 Operating System Services (PIFCE) An operating system provides services to programs and to the users of those programs. It provided by one environment for the execution of programs. The services provided by one operating system is difficult than other operating system. Operating system makes the programming task easier. The common service provided by the operating system is listed below. 1. Program execution: Operating system loads a program into memory and executes the program. The program must be able to end its execution, either normally or abnormally. 2. I/O Operation: I/O means any file or any specific I/O device. Program may require any I/O device while running. So operating system must provide the required I/O. 3. File system manipulation: Program needs to read a file or write a file. The operating system gives the permission to the program for operation on file. 4. Communication: Data transfer between two processes is required for some time. The both processes are on the one computer or on different computer but connected through computer network. Communication may be implemented by two methods: a. Shared memory b. Message passing. 5. Error detection: error may occur in CPU, in I/O devices or in the memory hardware. The operating system constantly needs to be aware of possible errors. It should take the appropriate action to ensure correct and consistent computing. Operating system with multiple users provides following services. 1. Resource Allocation 2. Accounting 3. Protection A) Resource Allocation: If there is more than one user or jobs running at the same time, then resources must be allocated to each of them. Operating system manages different types of resources require special allocation code, i.e. main memory, CPU cycles and file storage. There are some resources which require only general request and release code. For allocating CPU, CPU scheduling algorithms are used for better utilization of CPU. CPU scheduling algorithms are used for better utilization of CPU. CPU scheduling routines consider the speed of the CPU, number of available registers and other required factors. B) Accounting. Logs of each user must be kept. It is also necessary to keep record of which user how much and what kinds of computer resources. This log is used for accounting purposes. The accounting data may be used for statistics or for the billing. It also used to improve system efficiency. C) Protection: Protection involves ensuring that all access to system resources is controlled. Security starts with each user having to authenticate to the system, usually by means of a password. External I/O devices must be also protected from invalid access attempts. In protection, all the access to the resources is controlled. In multi-process environment, it is possible that, one process to interface with the other, or with the operating system, so protection is required. 2.3 Operating System Components Modern operating systems share the goal of supporting the system components. The system components are: 1. Process Management 2. Main Memory Management 3. File Management 4. Secondary Storage Management 5. I/O System Management 6. Networking 7. Protection System 8. Command Interpreter System 2.4 Batch System Some computer systems only did one thing at a time. They had a list of the computer system may be dedicated to a single program until its completion, or they may be dynamically reassigned among a collection of active programs in different stages of execution. Batch operating system is one where programs and data are collected together in a batch before processing starts. A job is predefined sequence of commands, programs and data that are combined in to a single unit called job. Fig. 2.1 shows the memory layout for a simple batch system. Memory management in batch system is very simple. Memory is usually divided into two areas: Operating system and user program area. Resident Portion Transient Program Operating System User Program Area Fig 2.1 Memory Layout for a Simple Batch System Scheduling is also simple in batch system. Jobs are processed in the order of submission i.e. first come first served fashion. When job completed execution, its memory is releases and the output for the job gets copied into an output spool for later printing. Batch system often provides simple forms of file management. Access to file is serial. Batch systems do not require any time critical device management. Batch systems are inconvenient for users because users can not interact with their jobs to fix problems. There may also be long turn around times. Example of this is system id generating monthly bank statement. Advantages o Batch System Move much of the work of the operator to the computer. Increased performance since it was possible for job to start as soon as the previous job finished. Disadvantages of Batch System Turn around time can be large from user standpoint. Program is difficult to debug. A job could enter an infinite loop. A job could corrupt the monitor, thus affecting pending jobs. Due to lack of protection scheme, one batch job can affect pending jobs. 2.5 Time Sharing Systems Multi-programmed batched systems provide an environment where the various system resources (for example, CPU, memory, peripheral devices) are utilized effectively. Time sharing, or multitasking, is a logical extension of multiprogramming. Multiple jobs are executed by the CPU switching between them, but the switches occur so frequently that the users may interact with each program while it is running. An interactive, or hands-on, computer system provides on-line communication between the user and the system. The user gives instructions to the operating system or to a program directly, and receives an immediate response. Usually, a keyboard is used to provide input, and a display screen (such as a cathode-ray tube (CRT) or monitor) is used to provide output. If users are to be able to access both data and code conveniently, an on-line file system must be available. A file is a collection of related information defined by its creator. Batch systems are appropriate for executing large jobs that need little interaction. Time-sharing systems were developed to provide interactive use of a computer system at a reasonable cost. A time-shared operating system, uses CPU scheduling and multiprogramming to provide each user with a small portion of a time-shared computer. Each user has at least one separate program in memory. A program that is loaded into memory and is executing is commonly referred to as a process. When a process executes, it typically executes for only a short time before it either finishes or needs to perform I/O. I/O may be interactive; that is, output is to a display for the user and input is from a user keyboard. Since interactive I/O typically runs at people speeds, it may take a long time to complete. A time-shared operating system allows the many users to share the computer simultaneously. Since each action or command in a time-shared system tends to be short, only a little CPU time is needed for each user. As the system switches rapidly from one user to the next, each user is given the impression that she has her own computer, whereas actually one computer is being shared among many users. Time-sharing operating systems are even more complex than are multi-programmed operating systems. As in multiprogramming, several jobs must be kept simultaneously in memory, which requires some form of memory management and protection. 2.6 Multiprogramming When two or more programs are in memory at the same time, sharing the processor is referred to the multiprogramming operating system. Multiprogramming assumes a single processor that is being shared. It increases CPU utilization by organizing jobs so that the CPU always has one to execute. Fig. 2.2 shows the memory layout for a multiprogramming system. The operating system keeps several jobs in memory at a time. This set of jobs is a subset of the jobs kept in the job pool. The operating system picks and begins to execute one of the jobs in the memory. Multi-programmed system provides an environment in which the various system resources are utilized effectively, but they do not provide for user interaction with the computer system. Jobs entering into the system are kept into the memory. Operating system picks the job and begins to execute one of the job in the memory. Having several programs in memory at the same time requires some form of memory management. Multiprogramming operating system monitors the state of all active programs and system resources. This ensures that the CPU is never idle unless there are no jobs. Advantages 1. High CPU utilization. 2. It appears that many programs are allotted CPU almost simultaneously. Disadvantages 1. CPU scheduling is requires. 2. To accommodate many jobs in memory, memory management is required. 2.7 Spooling It’s an acronym for simultaneous peripheral operations on line. Spooling refers to putting jobs in a buffer, a special area in memory or on a disk where a device can access them when it is ready. Spooling is useful because device access data that different rates. The buffer provides a waiting station where data can rest while the slower device catches up. Fig 2.3 shows the spooling. Computer can perform I/O in parallel with computation; it becomes possible to have the computer read a deck of cards to a tape, drum or disk and to write out to a tape printer while it was computing. This process is called spooling. The most common spooling application is print spooling. In print spooling, documents are loaded into a buffer and then the printer pulls them off the buffer at its own rate. Spooling is also used for processing data at remote sites. The CPU sends the data via communications path to a remote printer. Spooling overlaps the I/O of one job with the computation of other jobs. One difficulty with simple batch systems is that the computer still needs to read the decks of cards before it can begin to execute the job. This means that the CPU is idle during these relatively slow operations. Spooling batch systems were the first and are the simplest of the multiprogramming systems. Advantage of Spooling 1. The spooling operation uses a disk as a very large buffer. 2. Spooling is however capable of overlapping I/O operation for one job with processor operations for another job. 2.8 Essential Properties of the Operating System 1. Batch: Jobs with similar needs are batched together and run through the computer as a group by an operator or automatic job sequencer. Performance is increased by attempting to keep CPU and I/O devices busy at all times through buffering, off line operation, spooling and multiprogramming. A Batch system is good for executing large jobs that need little interaction; it can be submitted and picked up latter. 2. Time sharing: Uses CPU s scheduling and multiprogramming to provide economical interactive use of a system. The CPU switches rapidly from one user to another i.e. the CPU is shared between a numbers of interactive users. Instead of having a job defined by spooled card images, each program reads its next control instructions from the terminal and output is normally printed immediately on the screen. 3. Interactive: User is on line with computer system and interacts with it via an interface. It is typically composed of many short transactions where the result of the next transaction may be unpredictable. Response time needs to be short since the user submits and waits for the result. 4. Real time system: Real time systems are usually dedicated, embedded systems. They typically read from and react to sensor data. The system must guarantee response to events within fixed periods of time to ensure correct performance. 5. Distributed: Distributes computation among several physical processors. The processors do not share memory or a clock. Instead, each processor has its own local memory. They communicate with each other through various communication lines. 2.9 Summary An operating system provides services to programs and to the users of those programs. It provided by one environment for the execution of programs. The services provided by one operating system is difficult than other operating system. Operating system makes the programming task easier. Batch operating system is one where programs and data are collected together in a batch before processing starts. In batch operating system memory is usually divided into two areas: Operating system and user program area. Time sharing, or multitasking, is a logical extension of multiprogramming. Multiple jobs are executed by the CPU switching between them, but the switches occur so frequently that the users may interact with each program while it is running. When two or more programs are in memory at the same time, sharing the processor is referred to the multiprogramming operating system. Spooling is useful because device access data that different rates. The buffer provides a waiting station where data can rest while the slower device catches up. 2.10 Model Question Q. 1 Explain various operating system services? Q. 2 Define Spooling? Describe Spooling process? Q. 3 Differentiate Multitasking & Multiprogramming?
Posted on: Sun, 29 Jun 2014 10:55:17 +0000

Trending Topics



Recently Viewed Topics




© 2015