Unit 4
Operating Systems

Operating system - program or set of programs which manages the operation of the computer and provides interface between user, hardware and programs

Control program (aka nucleus, monitor, control program, supervisor, executive, kernel) - portion of the OS - most frequently used instructions stored in main memory while other programs are being executed

Booting - process of loading the OS from disk to main memory once the computer has been switched on but before any other programs can be run. A small program (loader) held in ROM instructs the computer how to load all or part of the OS into memory

Single-user single-process - OS supervises the loading and running of one program at a time and the input and output of data to and from peripheral devices

Multi-programming - the apparent simultaneous execution of two or more programs (or running more than one instance of the same program). Two or more programs may be held in memory at the same time with each program being given a small amount of processor time in term. To make efficient use of processor time, OS maximises throughput while ensuring that all jobs are completed in a reasonable time

Multi-user (multi-access) OS - allows two or more users to communicate with the computer at any one time

Multi-tasking - multi-programming on a single user machine

Batch OS - job runs from beginning to end without intervention from the user. Job Control Language (JCL) specifies for example job priority, maximum memory, print lines and execution time required

Multi-user and batch - batch processing jobs run at times of low interactive demand e.g. during the night when few users are active on the system

Real-time - e.g. process control, information and retrieval, transaction processing

Safety critical systems - e.g. on-board computer in aircraft

Built-in redundancy - processor may not be used at its full capacity for a large part of the time so that it can respond instantly when required. In addition, components may be duplicated

Client-server system - network where server provides resources to client workstations e.g. file storage, web access

Printer server - allows all networked machines to have access to a variety of different printers

Spooling - printing jobs sent to server from client workstations held in queue on disk and sent to printer when free

Distributed computer systems - system resources e.g. processors, disk storage, printers exist in separate nodes of a network with transparent access to these resources by users being possible

User interface - way in which human user and computer communicate

Command line interface - interactive terminal allows system to prompt the user to type a command to initiate program execution or perform housekeeping tasks

Advantages:- quicker, greater variety of commands, user less memory, more useful error messages

Disadvantages:- not user friendly, difficult for beginner

Command line interpreter (CLI) performs the actual task of identifying and executing the command

Job control language - user has no direct interaction with the computer system. User prepares a series of instructions off-line using JCL to describe to the system the requirements of the task. After execution, results are made available via an off-line medium e.g. line printer paper

JCL specifies:

Graphical user interface - user interacts with system using windows, icons, menus and a pointer to control the operating system. Selection is achieved by moving a pointer with a mouse and clicking a mouse button

Advantages:- easier for novices to use since more intuitive, only valid options are available, consistency of layout and command representation in applications, comprehensive on-line help available

Disadvantages:- uses more immediate access store and secondary store, requires more powerful processor and better graphics display, slower when executing a command because much more interpretation takes place, can be irritating for simple tasks because greater number of operations required

Operating systems functions

Process - program actually running on the CPU, even though it may be waiting for I/O at a particular moment

Process states

Process control block - holds the details of where a program was in its execution when it was interrupted so that it can resume from exactly that place later on

The process control block holds:

Types of interrupt

Interrupt register - special register in CPU checked at the beginning of each fetch-execute cycle. Each bit represents a different type of interrupt

In some cases if an interrupt occurs during data transfer, some data could be lost so the OS will disable other interrupts until it completes the task

Program Status Word (PSW) - special register which indicates the types of interrupts currently enabled and disabled (disabled interrupts remain pending or are ignored)

Job priorities

Scheduling policy

Round robin scheduling

Memory manager - primarily concerned with the allocation of the physical main memory to processes. No process may exist until a certain amount of main memory is allocated to it

Objectives of memory management

Absolute loader - loads the program into a single fixed area of memory. Address references in the program are fixed at translation time. The program will only work properly when loaded into one specific position in main memory

Relocating loader - can load the program anywhere in main memory because the program has been translated in such a way that all addresses are relative to the start of the program. The start address of the program is held in a special register called the base register

Static relocation - once the relocatable object program has been loaded into main memory, relocatability is lost and the program cannot be moved again

Dynamic relocation - relocatability is maintained and a process can be moved to a different memory area during its execution. The logical to physical mapping is done at run-time using base register addressing

Limit register - holds the highest addressable location of the process to allow memory manager to protect other programs' memory space from being accidentally addressed by program error

Virtual memory - technique for making the computer appear to have more memory than it actually has. Small portions of a process are loaded as and when they are needed and are swapped out when it is the turn for the next process. Many processes can effectively share the same memory space

Paging - each process is divided into a number of fixed length pages (usually 4KB in length). When a processes is to be executed, only pages that are immediately required are loaded into memory

Page management table (PMT) - indicates whether a particular page of the process is loaded or not and which page frame it is occupying in memory

Disadvantages of paging:-

Advantages of paging:-

Dynamic linked library (DLL) - collection of small executable programs which run in the presence of another program

General protection fault (GPF) - occurs if a DLL is called incorrectly e.g. by passing the wrong number of parameters

Allocation units - addressable blocks on a storage device e.g. 512 or 1204 bytes

File management

File Allocation Table (FAT) - maintained by the file management system and details the contents and status of each addressable block on the disk

Data is transferred to and from disk in units of the physical block size e.g. 512 bytes. If the first 100 bytes of a file are requested by a program, the OS reads the whole block of 512 bytes into a buffer in memory and the 100 bytes requested are extracted from the buffer. This process minimises the number of disk transfers at the expense of a small amount of memory space and some extra processing complexity

I/O management

Device controller

Device driver