Sunteți pe pagina 1din 59

Back in the early 1950s there were very few computers.

Large universities might have one, as might government research laboratories, and a few big companies. A scientist or engineer wanting to run a program would book time on the machine. When their turn came, they would be totally in control of "THE COMPUTER".

They had to load the assembler (or high level language translator), use it to convert their program to binary instruction format, load the binary version of their program, start their program using the switches on the front of the computer, Feed data cards to their program as it ran, etc. It all involved a lot of running around fiddling with card readers (and, later on, magnetic tapes), pressing buttons, flicking switches. Most people didn't do the job very well and wasted a lot of the time that they had booked on the machine.

Organizations that had computers soon started to employ professional "computer operators". Computer operators were responsible for getting maximum use out of the computing equipment. They would run the language translators and assemblers for users, they would load binary card decks and get the programs run. Since they worked full time with the computers, they were familiar with the all the operating procedures involved and so made many fewer mistakes and wasted much less time.

Since users no longer directly controlled the running of their programs, they had to write "job control instructions" for the operators. These job control instructions would tell the operators of any special requirements such as the need to mount a particular magnetic tape on which a program was to store some generated data.

By the early 1960s, Disks were not common, most systems made do with tape decks. An early disk unit would have been about five feet high, would have had a multi-platter arrangement with disks about 18 inches across. A complete disk unit would have held about as much data as a modern floppy and would have costed well certainly more than a new car, probably something close to the price of a small suburban house. Disks were a lot faster than tapes (faster transferring data, no need to read all the data sequentially because the disk control could move the disk heads to the blocks containing the specific data required, no need to "rewind", ...).

A disk unit could substitute for several tapes. But even if a disk was being used, the operations remained much the same as described for the tapebased machines. But there were problems. CPU usage was still relatively low. Even with smart peripherals running simultaneously with computations, most programs spent a large amount of time (often 50% or more) in "wait loops" waiting for input data to be read from devices, or waiting for output data to be printed.

Programmers were inconvenienced by slow turn around and lack of opportunity to test and debug their programs. Some programs needed more memory than could be obtained. It was common to have to wait 24 hours for results to be returned, and the 'results' might be simply a statement to the effect that the compiler had found the second card of the program to be wrongly punched!

The most pressing problem was the "waste" of CPU cycles when the single job in the computer's memory had to wait for an i/o transfer to complete. The CPU was by far the most costly part of the computer system of this period. The availability of larger main memories provided the solution to the problem of keeping the CPU busy. If a single job in main memory couldnt keep the CPU occupied all the time, then have two or more jobs in memory

The computer's memory was be split up into "partitions". One held the OS. Another (tiny) part would hold the 'boot' loader (the name 'boot' loader apparently relates to some argument that starting the computer using this loader to read the OS from tape/disk was like 'picking oneself up by ones bootstraps'. ?. !) The rest of memory was split up among two, three or more program partitions.

The "partitioning" of memory was adjustable. The operators could enter commands at the control terminal that would get the OS to rearrange the way memory was used. The process of switching the CPU among the different programs was all done automatically, in mere millisecond times, under the control of the of code in the OS. The human operators were involved in the relatively slow, and infrequent, process of reconfiguring the machine for a different degree of "multiprogramming".

The OS would get the device to start the data transfer, and arrange to be notified when the transfer was complete. But the requesting program usually wouldn't be able to continue until the transfer was done so the OS switched the CPU to work for another program. Essentially all operating systems now use some form of multiprogramming system. Support for multiprogramming may be limited in an OS for a personal computer. a personal computer may have many different programs concurrently in memory but the CPU may only get switched when the user selects the window associated with a different program.

Multiprogrammed systems improved the usage of the CPU but didn't do that much for the programmers. Programmers were lucky to get one test run of their programs each day. While this may have encouraged a meticulously careful style of coding it really didn't do much for the productivity of the average programmer. Programmers needed a system where they could edit their code making additions and corrections, give thenew code to a language translator (compiler) and either rapidly get any coding errors identified or get a program that could be run.

"Timesharing" systems starting around 1960, provided programmers with more appropriate development environments. It was the development of disk (and drum) storage that made these new systems possible. They are a variation on disks in which data is recorded in tracks on a cylinder rather than on a flat platter. Each track had its own read-write head. Drums were a lot faster than disks, but the multiple read-write heads made them expensive. They have gone out of fashion because their maximum storage capacity is a lot less than a disk.

There are obvious similarities in "multiprogramming" and "timesharing"; both involve the OS controlling the use of a computer system so that it appears as several computers. Multiprogramming and timesharing evolved to meet different needs; multiprogramming was to optimize CPU usage, timesharing was an attempt to optimize programmer usage! The switching of the CPU and swapping of programs after a time quantum is quite wasteful; during the switch the CPU isn't doing any useful work.

Reduced by size as well as cost. Fitted on small mother board. Speed of devices in nanoseconds. Size of main memory increased Input devices are keyboard, scanner,mouse, tracker ball Output devices are color monitors LCD screens, laser printers, ink jet printers etc. Sec storge are floppy disk, hard disk, CDROM, pendrive. Main memory is RAM , ROM , PROM, etc.

Known as parallel system or tightly coupled. Many processors on mother board. Handles many programs, many users depending on multiprogrammed os Only designed for speciall applns. Supports thread programming, object oriented programming, event based programming etc. Very costly.

Client server system

Central system acts as server to satisfy request of other terminals ie clients. Terminals connected to centralized systems. Faster more powerful.
Keeps database so that all users can use it. Updates databas online Only designed for some special applns.

Peer to Peer system.


Used in railway reservation Used in airline reservation system. Costly.

Used in all desktop systems Supports CLI Supports GUI Very popular. Access to all. Requires license copy.

Has sensors which collects information Uses delay if required. Designed for special applications Like satellite, industrial control, robotics, manufacturing process, hospital. Used in controlling physical activity Very costly.

An OS is an intermediate program between computer user and h/w. Without o/s user cannot interface with computer. Every application program require to write down IO interface program again and again which is time consuming and bulky Os provide set of system program which can control and automate hw as well as software activity. Collection of such system program is the o/s software of computer system.

Helps in starting using startup program stored in ROM and booting process of sec. storage. Os provides user interface to user through CLI and GUI. Os controls each and every activity of all IO devices using driver programs. OS provides run time environment to users program means user can execute his own program or any other application program. Os has to manage main memory and sec. memory so that new data should not be stored on used memory.

Os provides data management, which manages data on sec storage using files. Os provides security to user applications and data using password facility and assigning rights to files. Os accounts resource usage. It has to maintain allocation and de-allocation of various resources like main memory, secondary Memory, i/o devices, process, processor etc. Os provides utilities and services . Services perform file operations like copy, move, delete .. Utilities include system services like checking sec. disk for errors etc. Os provides n/w communication facility, which connect computer to LAN, WAN ,etc.

Views are of 3 categories: Physical View: describes physical structure of OS. ie represents map of logical software entity to physical structure. ie by which it defines physical organization of various functions and data structures of OS. Logical View: describes logical structure. ie. Internal functional organization of OS. Divides OS software into various subsystems and shows interaction between them and also manages resources and defines software architecture of OS.

User View: 3 different types of users:

Programmers View:
should know all m/c instructions . All system calls with their functions and implementation. APIs in system libraries to obtain services from OS.

Developers View:
Describes linkage and association of source code in

development environment. Provides set of system programs needed for development process to translate and execute programmers source code.

End-Users View:
Describes all preliminary information to user through GUI

interface or CLI so thst he can easily handle the system.

Memory Management Module Device Management Module Processor Management Module Information Management Module.

Divided into 4 categories

Keep track of each every memory location. Decides whether memory is allocated to requested job or not? If decision is yes, then allocates free memory to requested process. When process is finished, then it de-allocates memory from process.

Divided into 4 categories:

It keeps track of each and every input output devices. Decides whether device is allocated to requested job or not. If yes, then allocates devices to requested process. When process finishes then it de-allocates device from process and updates data structures accordingly.

Divided into 4 categories:

Keep track of jobs, process, processor using states. Decides which jobs are loaded for main memory, which process is selected for which processor depending on priority/policy or techniques. If decision is yes, then jobs are converted into process, passive process converted to active process, active to passive or send for IO operations and update data structure accordingly. When process finishes, it de-allocates from processor and updates data structure accordingly.

Also called as File Management. Divided into 4 categories


Keeps track of each and every information stored on sec memory using FAT, linked list, tables etc. Decides which information can be allocated to which requested process, user or not. Decision based on user rights and file permissions. If decision is yes, then it allocates information t o process and updates data structures. When job or process is finished then it de-allocates information from process. ie file closing and updates data structure accordingly.

O/s provides 2 types of facilities to user and programmer. System call and System program. O/s is collection of system calls and system programs. System call provide the interface between running program and o/s.

System programming is a program which helps to execute users program effectively on a computer system. System programming can be defined as the activity of designing and implementing system programs. The collection of such system program is the system software of a computer system. The software required for running a majority of user programs is called system software.

Special purpose software designed for specific use or some specific areas of application is called application program or application software. System programming software is also called as a language processor.

System call provide interface between a running program and the operating system. System calls are of 3 different categories:
Process or job control Device and file manipulation and Information maintenance

System calls are generally available in assembly language. o/s allows them to be directly available to user with help of highlevel language.

System calls require other information called as either parameter or attributes. That we are passing into it. Various types of system calls are:
1.
2. 3. 4. 5. 6.

Process of Job control Device manipulation File manipulation Information maintenance Communication System call implementation

The major system calls available are:


1.
2. 3. 4.

5. 6. 7.

End, Abort Load, Execute Create Process, Terminate process Get Process, Set Process attributes (when new process is created, for process to be executed efficiently, it needs to control execution and for this we need get attributes for a process and set attributes for the process if required) Wait for Time Wait Event, Signal Event ( used in process synchronization) Allocate and De-allocate Memory

Major system calls available under this category are:


1. 2. 3. 4.

Create File, Delete File Open, Close Read, Write, Reposition Get File Attributes, Set File Attributes (in file creation, information is attached in the form of parameters or attributes by the o/s)

The major system calls available under this category are:


1. 2. 3. 4.

Request Device, Release Device Read, Write, Reposition Get Device Attributes, Set Device Attributes Logically attach and detach devices A program when is running may need additional resources like memory to access to other files If these resources are available, then they can be granted by o/s and control can be returned to user program.

If these resources are not available then program has to wait until required resources get released. If system has multiple users we must first have to request the resources and once consumed, we must release them These system calls are similar to open and close system call.

Major system calls available are:

Get time or date, set time or date Get system date, set system date Get process, file or device attribute Set process, file or device attribute. These are used for purpose of transferring information between user and o/s System calls return information about system such a as amount of free memory space. System calls generally process information as get file attribute and set file attribute.

Major system calls are: 1. Create, delete communication connection. 2. Send, receive messages 3. Transfer , status information 4. Attach a detach remote service There are 2 modes of communication 1. Message passing model: information is exchanged though inter process communication facility provided by o/s. connection is opened before communication starts. Name of other communication may be known . PID exists for each process and get host ID method is used to know process and host terminal ID.

2.

Share memory model: exchange of information by reading and writing data in shared area of memory.

System call occur in different ways, depending upon the computer in use. The system call identifies itself by some number. System call makes a trap to o/s. o/s then accordingly processes the system call. Two general methods are used to pass parameters to the o./s.
simplest approach is to pass parameters in register. In other case, if there are more parameters than registers then, parameters are stored in a block of table in memory and starting address of the block is passed as parameter in a register.

The main function of o/s is to provide programming environment to user. So every o/s provides a set of system programming tools with o/s.

Assemblers: binary instructions in m/c language. are replaced with mnemonic language which describe machine instructions. Mnemonic language is assembly language. Loaders: loader places object program in to the memory and execute it . For this, loader converts object code into executable form by relocating object code.

Macros:

small program which can be replaced with macro call by pre-processor called as expansion. Macro increases speed of object code. Macro provides an easy and efficient solution to the problem of repeatedly needing the sequence of instruction. The entire o/s is written as series of macro definition and macro calls. Macro is the abbreviation of group of instruction. It requires pre-processor for expansion , called as macro processor. Input of macro is: assembly language program with macro. Output of macro is: macro program without macro.

Compiler and Interpreter:

These are language translators which translate HLL into LLL or object program.

Command Interpreter: User interface provided by o/s.


Always wait for command by displaying command prompt on screen. If user enters any command, then it satisfies that command immediately and again waiting for next command.

Editors: programs which edits the text. Debuggers: used for debugging programs.

Debug monitors used for dynamic debugging. Provides following facilities:


Setting breakpoint in program Initiating a debug conversation when control reaches a

breakpoint. Displaying values of variables. Assigning new values to variables. Testing user defined assertions and predicates involving program variables.

Interrupt: A signal that causes the control unit to branch to a specific location to execute code to service the occurrence of an external condition. Classes of Interrupts:
H/w Failure: Power failure or memory parity error. I/O: Generated by an I/o controller, to signal normal completion of an operation or to signal an error condition. Timer: Generated by a timer within the processor. Program: Generated by some condition that occurs as a result of an instruction execution, such as arithmetic overflow, division by zero, etc.

For a user program, an interrupt suspends the normal sequence of execution. When the interrupt processing is completed, execution resumes.
. . . . . . Transfer of Control Via Interrupt . . . .

Interru pt occurs here

. . . .

Steps in interrupt mechanism: 1. When i/o device complete their work, they transfer signals to CPU that they are ready to transfer or accept data from CPU. 2. When CPU receives this signal from IO device then immediately it searches interrupt service subroutine from the interrupt vector. 3. Interrupt service subroutine is the IO interfacing program which actually transfers data. 4. The interrupt mechanism is also used to handle a wide variety of exceptions such as dividing by zero, accessing a protected or non-existent memory address or attempting to execute a privileged instruction from user mode.

The user program does not have to contain any special code to accommodate interruption; the processor and the o/s are responsible for suspending the user program and then resuming it at the same point. In the interrupt stage, the processor checks to see if any interrupts have occurred, indicated by the presence and an interrupt signal. If no interrupts are pending, the processor proceeds to the fetch stage and fetches the next iteration and the current program. If an interrupt is pending, the processor suspends execution of the current program and executes an interrupt handler routine.

Fetch Stage

Execute Stage

Interrupt Stage

Start

Fetch next instruction

Execute instruction

Check for interrupt initiate interrupt handler.

Halt

Modern operating systems need more sophisticated interrupt handling features. O/s should distinguish between high and low priority interrupts and should respond with appropriate degree of urgency .

Types of Interrupts:

Non-maskable Interrupt: reserved for events such as unrecoverable memory errors. Maskable Interrupt: can be turned off by the CPU before the execution of critical instruction sequences that must not be interrupted.

Kernel is the Portion of processes operating system that is processes in main memory. Contains most frequently processes used functions. Also called the nucleus. kernel kernel kernel Virtual machine VM Logically treats hardware and OS kernel as hardware hardware

VM is a software implementation of a system that executes programs just like a physical machine. Virtual machines are categorized into 2 groups based on their use and degree of correspondence to a real machine

System virtual machine: provides a complete system platform which supports the execution of a complete OS. Process virtual machine: designed to run a single program.

Creates illusion of multiple processes - each with its own processor and virtual memory It is a design concept in which the programming model is implemented by the o/s rather by underlaying physical hardware. i.e., the o/s provides simulation of hardware for the programmers use.

It is defined by Popek and Goldberg as an efficient, isolated duplicate of a real machine and they have no direct correspondence to any real hardware. Multiple interactive sessions are implemented by a set of virtual machine one for each user. Each user directs the virtual m/c to perform different commands. These commands are executed on a physical machine in a multi programming environment.

Virtual machine software can run in monitor /kernel mode. But virtual machine itself executes in only user mode. Advantages:

Use of virtual machine is more reliable than any other system. Provides good security Supports research and development of o/s Solves system compatibility problems. Solves problem of system development time. Each virtual m/c is completely isolated from all other virtual machines so no security problems.

S-ar putea să vă placă și