Software and Software Development
Back To OverviewSome examples of the functions of an operating system are:
- Processor scheduling - determining the order in which processes are executed, in order to provide an acceptable response time for all processes, and maximise the time the CPU is fully engaged.
- Interrupt handling - allowing processor time to be reallocated to a higher priority process to make the maximum use of processor time, deal with errors, and ensure that each user in a multi user system gets a fair share of processor time.
- Memory management - keeping track of how memory is divided and identified to ensure that memory is allocated efficiently between running processes.
- Secondary storage management - keeping track of where files and programs are stored, which parts are free, and managing permissions.
- I/O device management - allowing efficient communication with devices and managing functionality issues.
- Providing a user interface - allows the user to interact with the computer and receive the information that it processes, hiding the complexity of the hardware.
- Providing security - ensures resources are protected from unauthorised access through the use of permissions and authentication.
- Providing a platform for software to run - allows the user to run applications.
- Providing utilities - software which performs a specific task related to the upkeep of the system, e.g. a disk defragmenter.
The OS must: track the status of memory allocation (marking address spaces as either allocated or free), determine storage requirements (working out how much memory to allocate to each running process), and control memory usage (managing swapping between main and virtual memory).
With paging, memory is divided into fixed-sized chunks called pages. Pages can be stored in a non-contiguous manner, i.e. pages of the same process do not have to be stored physically next to each other. A page table maps between the physical and logical memory locations.
With segmentation, memory is
An interrupt is a signal sent to the processor, indicating that a device / process requires attention. Interrupts have different priorities, and a higher priority interrupt can interrupt a lower priority one.
Interrupts are needed so that processor time can be allocated to processes that are considered urgent. Reasons a processor may be interrupted include:
- A hardware failure has occurred and needs to be addressed.
- A certain amount of time has expired and an action needs to be performed.
- An I/O operation has completed.
- An error has occurred in a program.
- A power failure has occurred.
- A printer has run out of paper.
An interrupt service routine (ISR) is a small program that has been designed to respond to an interrupt's request.
If an interrupt is raised, the following happens:
- The processor finishes the current fetch-decode-execute cycle.
- If the interrupt is of a lower or equal priority to the currently running process, then the current process continues.
- Otherwise, the contents of the CPU's registers are pushed onto a stack in memory.
- The location of the start of the appropriate ISR is loaded into the program counter.
- Once the ISR has completed, the previous contents of the registers are popped from the stack and loaded back into the registers.
CPU time is allocated to different processes using scheduling. By carrying out small parts of multiple larger tasks in turn, the processor can give the appearance of carrying out several tasks simultaneously. Schedulers use different algorithms, such as:
- Round robin - each job gets a fixed time slice.
- First come first served - the first job to arrive is processed until completion, and then the next, etc.
- Shortest job first - The quickest job to complete is processed first.
- Shortest remaining time - The job with the shortest time to completion is processed first, but can be taken over by a shorter job.
- Multi-level feedback queue - Jobs are placed in different queues depending on their priority. If a job uses too much CPU time, it is moved to a lower priority queue, and if a job has waited a long time, it can be moved to a higher priority queue.
There are many different types of OS, including:
- Distributed -
- Embedded -
- Multitasking -
- Multi-user -
- Real time -
The BIOS (Basic Input Output System) is stored in ROM. It is used to initialise & test system hardware, and to load the OS into RAM.
A device driver is a piece of software that controls a hardware device, providing an interface between the device and the OS.
It would not be possible for an OS to be programmed to handle all existing and future devices, and so drivers are needed to allow the OS to interact with hardware devices, without knowing the specifics of them.
A virtual machine is a piece of software that behaves in the same way as an actual computer.