Operating systems - history & principles. This lesson includes the following sections: History of OS...

20
Operating systems - history & principles

Transcript of Operating systems - history & principles. This lesson includes the following sections: History of OS...

Page 1: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Operating systems -

history & principles

Page 2: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

This lesson includes the following sections:

• History of OS Development

• Process Allocation

• Memory Management

• Scheduling

• Resource Allocation

• The File System

Page 3: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

An operating system is the most important and most complex piece of software accompanying a computer. The effort in design and development of an operating system is comparable to that of the computer hardware.

The modern operating system is a composite of systems designed since the late 1940s and to date one can delineate four generations (each with significant milestones) of operating systems.

A history of operating systems development

Page 4: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

First generation OS (circa 1945-55)

There was no OS, and very little support software!

• machine operation was hands on, time was blocked out for operating the machine.

• programmers were physically in the room, with paper tapes, punch cards etc.

• loading programs was done with buttons at the console.• difficult, arduous process and “programmers” were

highly trained professionals.

Very inefficient use of expensive (~$1M) equipment. The majority of time was spent analysing and thinking.

human thinking time = idle machine

Page 5: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Second generation OS (circa 1955-65)

To keep machines busy, batch operating systems were developed.

• programs handed (on cards) to an operator.

• several programs were grouped into a batch, then translated onto tape.

• tape would then be loaded onto the computer.

• programs run singularly, with results written to tape.

• output tape was then translated to printed form.

Page 6: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Second generation OS - pluses & minuses

“turn around” time was hours to days - even to find a syntax error! Programmers saw this as cumbersome.

However, system utilization increased dramatically.

• No programmer set up or “thinking” time.

• As one job terminated, the computer would load the next job in the batch and begin execution.

Since programmers were separated from the machine, job control languages were developed to specify to the operating system the operations to perform on their program.

Page 7: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Third generation OS (circa 1965-85)

The use of integrated circuits dramatically improved computer speeds. Batch systems ran “continuously”, but only one job at a time.

If a job was paused (to execute an IO process) the CPU was idle, if only for a few milliseconds.

The same philosophy that led to 2nd generation systems held - how to make computers work continuously?

Many milestone concepts were developed for third generation (multiprogramming) operating systems.

Page 8: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

multiprogramming OS

supported many user programs simultaneously in memory.

when a running job paused for IO, one of several ready jobs would be executed.

system utilization further improved

efficient allocation of resources became very important.

memory protection became very important.

time-sharing, interactive communication with the operating system by many users, was developed.

Page 9: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Fourth generation OS (circa 1985- )

Small, cheap PCs resulted in a move away from a centralized environment to a distributed environment.

Shared peripherals, email and networks lead to new operating systems, ones that supported local computation and remote access (for users and resources)

Network operating systems

Page 10: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Network OS

Manages all the resources of the single computer and those of the telecommunications network (LAN).

Users could use the computers as usual with the OS providing all of the services previously described.

Users could also access many shared network services, as though they were local.

• file servers• print servers• mail servers• compute servers

Page 11: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Operating system modules

There are several modules to a modern operating system, each responsible for a separate task, and together make for the safe and efficient execution of the computer system and the application software.

A modern multi-programming, time-sharing operating system needs to perform many functions, and some of the larger and more important modules are explained briefly here.

Page 12: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Process allocation - the dispatcher

The OS is responsible for initiating and coordinating the processes (program execution) that must be performed.

The existence of a number of processes implies the CPU must be shared amongst them. It keeps a queue of programs to be executed, and as the CPU is freed, a new process is allocated to it.

There are three possible states of a process, running (being executed), ready (executable and awaiting CPU time), blocked (unable to proceed, until the completion of some task).

Page 13: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Process allocation - CPU time slices

Equitable time sharing of the CPU is achieved by allocating a quantum of time to a process for its continuous execution. Time slices is ~0.1 sec.

After a quantum is used up, the process moves from a running to the ready state, yielding the CPU to some other ready process.

When is dispatcher invoked?• a running process becomes blocked• the quantum of a running process expires• a running process terminates

Dispatcher sometimes considers process priority.

Page 14: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Memory management - the security guard

Has three major aspects

1 the allocation of sufficient memory for the program and its associated data.

2 protection of allocated memory

3 utilisation of memory

A program will possess program addresses starting at 0.

Program addresses differ from the memory addresses in which the object program eventually resides.

Mapping between addresses is done during execution using information maintained by the operating system.

Page 15: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Scheduling - the efficiency expert

Scheduler module is responsible for initiating processes and takes account of:

• amount of required resources• amount of resources currently available• priority of the job• the length of the waiting time.

The scheduler maintains the information about resources currently available, and updates this as resources are allocated and released.

Page 16: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Resource allocation

(1) static allocation: All resources required by a process are allocated at initiation, and when the process is complete, the resources are reclaimed (a process can be initiated only when all the required resources are available).

(2) dynamic allocation: Resources are allocated to a process as required, and are released when the process doesn't need it any more (a process may be initiated at any time, but it may become blocked if the resource is unavailable).

Dynamic allocation leads to better resource utilisation but action must be taken to avoid deadlock (ie. two processes each hold a resource which is required by the other.)

Page 17: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

Deadlock resolution - the traffic officer

Deadlock is analogous to a gridlock traffic jam, where opposing streams of traffic are trying to cross each other’s path - each occupies the space required by the other.

Program A, needs disk drive, laser printer, prints fileProgram B, needs laser printer, disk drive, prints file

If the OS satisfies the first request of each program, then both are blocked awaiting the release of resources.

Effective deadlock resolution algorithms can be complex.

A simple prevention algorithm is, if a resource is not available, give up ALL your resources and issue new requests.

Page 18: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

The file system

Computer systems need to store information for long periods, eg. programs, its own OS etc. Secondary storage is typically a magnetic disk.

Information is usually stored in the form of a file.

OS responsibility for files are typically:• creation, deletion of files• provision of access to files• secondary storage management• protection from unauthorised access• protection against loss and corruption.

A user is not concerned with the physical location of the file, so it is normally accessed through a name.

Page 19: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

The file system

The OS maintains a directory of the names of files and their corresponding locations on the storage media. These are further broken into a system master directory, and several individual user directories.

The Master directory contains a list of (allowed) user names, and the locations of user directories.

The User directory contains, for each “file”, the file name, its physical location, its size, its access control information, other administrative information such as creation and last modification dates.

Page 20: Operating systems - history & principles. This lesson includes the following sections: History of OS Development Process Allocation Memory Management.

The OS has many other responsibilities, such as IO processing, maintaining the system clock, recovery from power failure, access security and literally dozens of other tasks - some large, some trivial but all essential to a functioning computer system.

What else does it do?