functions of OS Flashcards
operating system
manages the hardware and provides an interface for the user and application software
boot loader
stored in ROM, loads the OS into RAM when t he computer is turned on
OS functions
user interface, memory management, interrupt handling, processor scheduling
memory management
the allocation and management of memory between programs in use
paging
memory is divided into fixed sized pages, process may be held in several non-contiguous ones
page table
maps between the physical and logical memory locations
segmentation
the logical division of memory into varying length segments
virtual memory
an area of the hard disk designated to supplement RAM
interrupt
signal sent from hardware, software or clock to alert the CPU that it needs instruction
software interrupt
occurs when an application program terminates or requests a certain service from the OS
hardware interrupt
occurs when an I/O operation completes, error occurs (ie printer out of paper)
dealing with interrupts
when an interrupt signal is received, execution of the running program/process is suspended and all lower priority interrupts are disabled, the values in the registered are then put onto the system stack and the ISR routine handles the interrupt, once it’s been serviced the original values of the registers are retrieved from the stack and the original process resumes
low priority interrupt - examples
an I/O device sends a signal requesting service or signalling end of I/O
medium priority interrupt - examples
clock interrupt
high priority interrupt - examples
power-fail interrupt
multi-tasking
carrying out small parts of multiple larger tasks in turn giving the appearing of carrying out several tasks simultaneously
scheduler
the operating system module responsible for making sure that processor time is used as efficiently as possible
scheduler - objectives
maximise throughput, be fair to all users on a multi-user system, provide acceptable response time to all users, provide acceptable response time to all users, ensure hardware resources are kept as busy as possible
round robin
each process is given an equal time slice, if it doesn’t finish within it’s slice it joins the end of the queue
first come first served
processes are dealt with in the order they arrive
shortest remaining time
picks the process with the shortest estimated time remaining time to finish, the scheduler will switch to a new process with a shorter
shortest job first
picks the process with the shortest estimated running time and runs it until it finishes
multi-level feedback queues
multiple queues with different priorities are used
disk thrashing
excessive swapping of pages between RAM and virtual memory which noticeably slow down the computer
round robin - advantages
guarantees a reasonable time for all processes to be executedin
round robin - disadvantages
doesn’t consider priority
first come first served - advantages
simple/easy to implement
first come first served - disadvantages
doesn’t consider priority
shortest remaining time - advantages
higher throughput
shortest remaining time - disadvantages
starvation, user has to estimate the job time
shortest job first - advantages
higher throughput
shortest job first - disadvantages
starvation