What is an operating system?
A program/set of programs that manages the operations of the computer for the user. It acts as a bridge between the user and the computers hardware.
How is the operating system loaded?
The operating system is held in permanent storage, eg. on a hard disk. The loader is held in ROM. When a computer is switched on, the loader sends instructions to load the operating system by copying it from storage to RAM.
What are the functions of an operating system?
Memory management. Interrupt service routines. Processor scheduling. Backing store management. Management of all input and output.
Why is memory management needed?
It allows several processes to be run at the same time. It also allows memory to be reallocated and shared when necessary. It protects the data and processes from each other, providing security.
What is paging?
Memory is split into equal fixed sized sections called pages. Programs are allocated a number of pages depending on their size. Some programs may therefore have access memory that they do not require.
What is segmentation?
A logical devision of memory space into various sized blocks called segments. As the segments are based on the program size it is less likely to cause excess memory.
What are the advantages of paging?
Reduces internal fragmentation.
Simple to implement.
Swapping is easy due to the fixed page sizes.
What are the disadvantages of paging?
There is internal fragmentation.
It requires extra memory space which is bad for systems with small RAM.
What are the advantages of segmentation?
There is no internal fragmentation.
It may save memory if the segments are small.
What are the disadvantages of segmentation?
There is external fragmentation.
It can have costly management algorithms.
It needs to find big enough free memory space areas.
Segments of unequal size are not suited for swapping.
What is virtual memory?
Virtual memory is an area of a computer systems secondary memory storage that acts as if it exists as part of the systems RAM or primary memory.
Why is virtual memory needed?
Memory is not limitless. When there is not enough RAM, an area of the hard drive is assigned as virtual memory. A computer can then multitask using more/bigger programs than normally possible.
What are the advantages of virtual memory?
It is helpful in fitting larger programs into smaller programs.
Allows you to run more than 1 application at once.
What are the disadvantages of virtual memory?
Applications may run slower.
Reduces system stability.
Not the same performance as RAM.
Offers less hard drive space.
What is an interrupt?
A signal sent to the CPU, generated by a source such as an I/O device or a system software routine, which causes a break in the execution of the current routine.
What are four types of interrupts?
What is an I/O interrupt?
Generated by I/O devices to signal a job is complete or an error has occured.
What is a timer interrupt?
Generated by an internal clock to signal the processor should attend to a time-critical activity.
What is a hardware error?
Eg. A power failure.
The computer must attempt to shut down as safely as possible.
What is a program interrupt?
Generated due to an error in a program, such as a violation of memory usage.
What happens when an interrupt is called?
The CPU suspends execution of the running program/process and disables all interrupts of a lower priority. If the current task has the higher priority then it will continue running. However, if the interrupt has higher priority, the ISR begins.
What happens when the interrupt service routine is called?
The contents of the CPU register are copied to a stack and then the interrupt is run to completion. The interrupts flag in the interrupt queue is then reset and the system checks for any further priority interrupts before restoring the contents of the registers from the stack.
What is processor scheduling?
The operating system is responsible for allocating processor time to each application. Whilst on application is using the the CPU for processing, the OS can queue up the next process required by another application to make efficient use of the processor.
What is the operating system scheduler responsible for?
Making sure that processor time is used as efficiently as possible.
What does processor scheduling allow?
The appearance of carrying out several tasks at once by carrying out smaller parts of multiple larger tasks in turn.
What is FCFS secheduling algorithm?
First Come First Serve. Jobs are processed in the order in which they arrive, there is no system of priorities.
What is SJF scheduling algorithm?
Shortest Job First. The process with the smallest estimated running time is run next.
What is RR scheduling algorithm?
Each job is given a maximum. Amount of processor time. After this time it will return to the queue. Once the job is finished, it leaves the queue.
What is SRT scheduling algorithm?
The queue is sorted on the amount of expected time to completion left.
What are Multi Level Feedback Queues?
A number of different queues are used, each with a differing priority.
What are the advantages of FCFS?
There is no complex logic.
It is simple and easy to implement.
Every process will eventually get a chance to run.
What are the disadvantages of FCFS?
The is no option for pre-emption of a process, it must must executed until the end once started.
If this is a long task, the processes in the back of the queue therefore must wait for a long time.