Sei sulla pagina 1di 13

Operating System Overview Structure 1.0 Introduction 1.1 Objectives 1.2 Introduction to Operating System 1.2.1 1.2.2 1.2.

3 1.2.4 1.2.5 Functions of Operating System History of Operating System Objectives How the operating system acts as an interface Services rendered by operating system Check your Progress 1.3 How Operating System acts as a Resource Manager 1.4 Evolution of Operating System 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 Reason for evolution Serial Processing Simple Batch System Multiprogrammed Batch Systems Time sharing systems Check Your Progress 1.5 Let us Sum up

1.0 Introduction This unit provides an overview of Operating System principles. We begin with Objectives, Functions and Services of Operating System, which serves to define the requirements that an operating system is intended to meet. We will also see how the resources are effectively managed by operating system. Then we will focus on how an operating system evolved from Simple batch system to Multiprogrammed, and Timesharing systems. 1.1 Objectives At the end of this unit you will be able to Define the purpose of operating system State the functions, objectives and services of operating system Provide the reasons for evolution of operating system Explain how operating system evolved 1.2 Introduction to Operating System An operating system is a program that controls the execution of application programs and acts as an interface between the user of a computer and the computer hardware. In other words The software that controls the hardware. Some examples of operating systems are UNIX, Mach, MS-DOS, MS-Windows, Windows/NT, OS/2, MacOS, VMS, MVS, and VM. Controlling the computer involves software at several levels. We will differentiate kernel services, library services, and application-level services, all of which are part of the operating system. Processes run Applications, which are linked together with libraries perform standard services. The kernel supports the processes by providing a path to the peripheral devices. The kernel responds to service calls from the processes and interrupts from the devices. The core of the operating system is the kernel, a control program that functions in privileged state (an execution context that allows all hardware instructions to be executed), reacting to interrupts from external devices and to service requests and traps from processes. Generally, the kernel is a permanent resident of the computer. It creates and terminates processes and responds to their request for service. Operating

Systems are resource managers. The main resource is computer hardware in the form of processors, storage, input/output devices, communication devices, and data. 1.2.1 Functions implementing the user interface sharing hardware among users allowing users to share data among themselves preventing users from interfering with one another scheduling resources among users facilitating input/output recovering from errors accounting for resource usage facilitating parallel operations organizing data for secure and rapid access handling network communications.

1.2.2 The History of Operating Systems Operating systems have evolved through a number of distinct phases or generations, which corresponds roughly to the decades. The 1940's - First Generations The earliest electronic digital computers had no operating systems. Machines of the time were so primitive that programs were often entered one bit at time on rows of mechanical switches (plug boards). Programming languages were unknown (not even assembly languages). Operating systems were unheard of. The 1950's - Second Generation By the early 1950's, the routine had improved somewhat with the introduction of punch cards. The General Motors Research Laboratories implemented the first operating systems in early 1950's for their IBM 701. The system of the 50's generally ran one job at a time. These were called single-stream batch processing systems because programs and data were submitted in groups or batches.

The 1960's - Third Generation The systems of the 1960's were also batch processing systems, but they were able to take better advantage of the computer's resources by running several jobs at once. So operating systems designers developed the concept of multiprogramming in which several jobs are in main memory at once; a processor is switched from job to job as needed to keep several jobs advancing while keeping the peripheral devices in use. For example, on the system with no multiprogramming, when the current job paused to wait for other I/O operation to complete, the CPU simply sat idle until the I/O finished. The solution for this problem that evolved was to partition memory into several pieces, with a different job in each partition. While one job was waiting for I/O to complete, another job could be using the CPU. Another major feature in third-generation operating system was the technique called SPOOLing (simultaneous peripheral operations on line). In spooling, a high-speed device like a disk interposed between a running program and a low-speed device involved with the program in input/output. Instead of writing directly to a printer, for example, outputs are written to the disk. Programs can run to completion faster, and other programs can be initiated sooner when the printer becomes available, the outputs may be printed. Another feature present in this generation was time-sharing technique, a variant of multiprogramming technique, in which each user has an on-line (i.e., directly connected) terminal. Because the user is present and interacting with the computer, the computer system must respond quickly to user requests, otherwise user productivity could suffer. Timesharing systems were developed to multiprogram large number of simultaneous interactive users. Fourth Generation With the development of LSI (Large Scale Integration) circuits, chips, operating system entered in the system entered in the personal computer and the workstation age. Microprocessor technology evolved to the point that it became possible to build desktop computers as powerful as the mainframes of the 1970s. Two operating systems have dominated the personal computer scene: MS-DOS, written by Microsoft, Inc. for the IBM PC and other machines using the Intel 8088 CPU and its successors, and UNIX, which is dominant on the large personal computers using the Motorola 6899 CPU family.

1.2.3 Objectives Convenience An operating system makes a computer more convenient to use. Efficiency An operating system allows the computer system resources to be used in an efficient manner. Ability to evolve An operating system should permit the effective development, testing, and introduction of new system function without interfering with the service. 1.2.4 The Operating System as a user / computer interface The hardware and software that are used in providing applications to a user can be viewed in a layered, or hierarchical, fashion as depicted in figure 1.1. The user of the applications is called the end user. The end user views a computer system in terms of an application. The applications are expressed in a programming language and are developed by an application programmer. Utilities implement frequently used functions that assist in program creation, management of files, and the control of I / O devices. A programmer makes use of the facilities in developing an application. The most important system program is Operating System. It masks the details of the hardware from the programmer and provides the programmer with a convenient interface for using the system. End User Programmer Application Programs Utilities Operating Systems Computer Hardware

Operating System Designer

Figure 1.1 Layers and views of a computer system

1.2.5 Services of operating system Program creation - Operating system provides a variety of facilities and services, such as editors and debuggers, to assist the programmer in creating programs. Program execution A number of tasks need be performed to execute a program. The instructions and data must be loaded into main memory, I/O devices and files must be initialized, and other resources must be performed. The operating system handles all the tasks. Access to I / O devices Each I / O requires its own peculiar set of instructions, or control signals for operation. The operating system takes care of the details. Controlled access to files The operating system deals with the file format of the storage medium and the nature of the I / O device. System Access The operating system controls the access to the system as a whole and to specific system resources. The access function must provide protection of resources and data from unauthorized users and must resolve conflict. Error detection and response The operating system must take the response that clears the error condition with the least impact on running applications. Accounting An operating system collects usage statistics for various resources and monitors performance parameters such as response time to improve performance. Check your progress 1. Define Operating system. 2. Give some examples of Operating system. 3. State any two functions of operating system. 4. List the objectives of operating system. 5. Expand SPOOL. 1.3 The operating system as resource manager A computer is a set of resources for the movement, storage and processing of data and for the control of these functions. The operating system is responsible for managing these resources. The operating system functions in the same way as ordinary computer software, that is, it is a program executed by the processor.

The operating system frequently relinquishes control and must depend on the processor to allow it to regain control. The operating system directs the processor in the use of system resources. For the

processor to do any of these things, it must cease executing the operating system and execute other programs. Figure 1.2 shows the main resources that are managed by the operating system. A portion of the operating system is in the main memory. This includes the Kernel or Nucleus, which contain the most frequently used functions in the operating system. The remainder of the main memory contains other user programs and data. The operating system does the following function: Allocation of resource Memory management hardware in the processor Decides when an I/O device can be used by the program Controls access to and use of files Determines how much processor time is devoted to the execution of a particular user program.
Memory

I/O Devices I/O Controller

Operating System Software Programs and Data

I/O Controller

I/O Controller

Processor

Processor O/S Programs Data

Figure 1.2 The operating system as a resource manager

1.4 Evolution of operating system 1.4.1 Ease of Evolution of an Operating System An operating system will evolve over time for a number of reasons: Hardware upgrades plus new types of hardware Early versions of UNIX did not employ paging mechanism because they were run on machines without paging hardware. Most recent versions have been modified to exploit paging capabilities. New Services In response to user demand or in response to the needs of system managers, the operating system will expand to offer new services. Fixes An operating system may contain some faults which may be detected over time and fixes will need to be made. 1.4.2 Serial Processing No operating system Machines run from a console with display lights, toggle switches, input device, and printer. Programs in machine code were loaded with the input device. If an error halts the program, then the error indication was given by lights. Main problems faced by early systems: Schedule time - Most installations used a sign-up sheet to reserve machine time. On the other hand, the user might run into problems, or not finish in the allotted time, and be forced to stop before resolving the problem. Setup time A single program called a job involves loading the compiler, source program, saving compiled program, and loading and linking together the object program and common functions. 1.4.3 Simple Batch System Early computers were very expensive and therefore it was important to maximize the machine use. To improve use, the concept of batch processing was developed. Batch processing scheme use a piece of software known as the Monitor. With this type of operating system the user submits the job on cards or tape to a computer operator,

who batches the jobs together sequentially and places the entire batch on an input device for use by the monitor. The monitor controls the sequence of events. To do this much of the monitor always remains in the main memory referred as Resident monitor. The rest of the monitor consists of Utilities and common functions that are loaded as subroutines to the user program at the beginning of any job that require them. The monitor reads in jobs one at a time from the input device. As it read in, the current job is placed in the user program area, and control is passed to this job. When the job is completed, it returns control to the monitor, which immediately reads in the next job. The monitor handles the scheduling problem - a batch of job is queued up, and jobs are executed as rapidly as possible, with no interventing idle time. The monitor also handles the setup time by having the instructions included in primitive form of Job Control Language (JCL), which is a special type of language used to provide instructions to the monitor regarding what compiler to use and what data to use. Hardware Features Memory protection While the user program is executing, it must not alter the memory area containing the monitor. If such an attempt is made, the processor hardware should detect an error and transfer the control to monitor and job should be aborted by the monitor by displaying an error message. Timer A timer is used to prevent a single job from monopolizing the system. A timer is set at the beginning of the job. If the timer expires, an interrupt occurs and control returns to the monitor. Privileged instructions Certain instructions are designated as privileged and can be executed only by the monitor. If the processor executes such an instruction while executing a user program, an error interrupt occurs. Interrupts This facility gives the operating system more flexibility in relinquishing control to and regaining control from user programs.

1.4.4 Multi-programmed Batch Systems Even though the job sequencing is done automatically by simple batch processing system, the processor is often idle. The problem is that I / O devices are slow compared to the processor. More than 96% of the time is spend waiting for I / O devices and during this time the processor will be idle. Inorder to overcome the inefficiency, the concept of multiprogramming evolved which requires a large memory space. Suppose if there is a room for one operating system and two user programs, when one job needs to wait for I / O, the processor can switch to the other job, which likely is not waiting for I / O. It is known as Multiprogramming or Multitasking.

Run Time

Wait

Run

Wait

(a) Uniprogramming Program A Run Wait Wait Run Wait Wait

Program B

Run Run B

Run Run A Run B

Wait

Combined

Run A

Wait

Wait

Time (b) Multiprogramming with two programs 1.4.5 Time sharing Systems

For many jobs, it is desirable to provide a mode in which the user interacts directly with the computer. For jobs like transaction processing, an interactive mode is needed. Multiprogramming can be used to handle multiple interactive jobs and the technique is referred to as Time-sharing. In other words the processors time is shared among multiple users. The basic technique is to have multiple users simultaneously using the system through terminals, with the operating system interleaving the execution of each user program in a short burst, or quantum, of computation. Example: Assume that there are four interactive users with the following memory requirements: Job1 15K Job2 20K Job3 05K Job4 10K Initially the monitor loads in Job1 and transfers control to it (Figure 1.4 a). Later, the monitor decides to transfer control to Job2. Because Job2 requires more memory than Job1, Job1 must be written out first, and then Job2 can be loaded (Figure 1.4 b ). Next Job3, is loaded in to be run. However, because Job3 is smaller than Job2, a portion of Job2 can remain in the memory, reducing disk writ time (Figure 1.4 c). Later, the monitor decides to transfer control back to Job1. An additional portion of Job2 must be written out when Jb1 is loaded back into memory (Figure 1.4 d). When Job4 is loaded, part of Job1 and the portion of Job2 remaining in memory are retained (Figure 1.4 e). At this point, if either Job1 or Job2 is activated, only a partial load will be required. In this example, it is Job2 that runs next. This requires that Job4 and the remaining resident portion of Job1 be written out and that the missing portion of Job2 be read in.
32 K 20 K 32 K 25 K 32 K 25 K

JOB1
5K 0
MONITOR

JOB2
5K 0 10 K
MONITOR

(JOB2) JOB3
MONITOR

5K 0 (c)

(JOB2)
32 K 32 K

(a)

(JOB2) (JOB1) JOB4

(b)

JOB1
MONITOR

JOB2
MONITOR

5K

5K

MONITOR

32 K 25 K 20 K 25 K 20 K 15 K 5K 0 (d) Figure 0 (e) 0 (f) 25 K

Fig 1.4 Compatible Time Sharing System (CTSS) operation Check Your Progress 1. Give the purpose of Kernel. 2. Expand JCL and CTSS. 3. Define Multitasking. 4. Explain the concept of Time sharing. 5. Define Monitor. 1.5 Let us Sum up An operating system is a program that controls the execution of application programs and acts as an interface between the user of a computer and the computer hardware. A computer is a set of resources for the movement, storage and processing of data and for the control of functions. The operating system is responsible for managing these resources. In order to understand the key requirements of operating system and its significance, it is useful to consider how the operating system evolved. With the early computers no operating system found and followed a technique called Serial processing user had access to computer in series. Next emerged Simple Batch system - . With this type of operating system the user submits the job on cards or tape to a computer operator, who batches the jobs together sequentially and places the entire batch on an input device for use by the monitor. Followed by Multitasking - A mode of operation that provides for the concurrent performance or interleaved execution of two or more computer tasks and Time sharing -The basic technique is to have multiple users simultaneously using the system through terminals, with the operating system

interleaving the execution of each user program in a short burst, or quantum, of computation.

Potrebbero piacerti anche