it is what it is really
what is an operating system?
a program or set of programs that manages the operations of the computer for the user
acts as a bridge between user and hardware
held in permanent storage
when a computer is switched on, the loader in ROM sends instructions to load the OS by copying it from storage into RAM
what are the basic functions of an operating system?
use the mindblowingly shit acronym BUMPII to remember them
BACKING store management
USER interface management (you shouldn’t really use this in an exam)
MEMORY management
PROCESSOR scheduling
INTERRUPT service routines
INPUT and output management
what is memory management?
each program/file that the user is using must be allocated a specific area of memory while the computer is running
if a user wants to switch applications, each one must be stored in memory simultaneously
the allocation and management of space in RAM is controlled by the operating system
what is paging?
memory is divided into fixed size pages of 4Kb each
a process currently in memory may be held in several non-contiguous pages
in logical memory, the pages appear to be next to each other as the user sees them
in physical memory, the pages can be stored in memory locations anywhere within the physical memory space
what is segmentation?
the logical division of address space into varying length segments which depend on the program structure
it is possible to load only part of a program into memory initially
what is virtual memory? (again)
when there is not enough space in RAM to store all programs and data, some pages of inactive programs are swapped out to an area on the hard disk, which acts as a slower form of RAM
this is so that the OS can make room for more active programs in RAM
if a large number of programs are loaded, pages may need to be constantly swapped in and out of RAM, which is called disk thrashing
as the OS is spending so much time swapping pages in and out, the performance deteriorates and the CPU slows down
what are interrupts?
a signal from the software, hardware or the clock to the CPU
eg. when an application terminates or requests services from the OS, when an I/O operation is complete, paper jam
interrupts are triggered regularly by a timer to indicate that it’s the next process’s turn to have processor time
at the end of each FDE cycle, a test for the presence of interrupts is carried out
interrupts help multi-tasking to take place
what happens when the CPU receives an interrupt?
the running program or process is suspended
any lower priority interrupts are disabled (i/o interrupts < clock interrupts < power fail interrupts)
the values stored in the registers are saved onto the system stack
an interrupt service routine is called which is different depending on the type of interrupt
after the interrupt has been serviced, the original values of the registers are retrieved from the stack
the process resumes from the point it left off
what is processor scheduling?
the OS allocates processor time to each application as it competes for the CPU, so the CPU can run applications simultaneously
when one application is using the CPU, the OS can queue up the next process required by another application to make efficient use of the processor
by carrying out small parts of multiple larger tasks in turn, the processor can give the appearance of carrying out tasks simultaneously (multitasking)
what is the scheduler and what does it do?
an OS module which ensures processor time is used efficiently
can be very complex on larger networks
the scheduler aims to maximise throughput, be fair to all users, provide good response times to all users, ensure hardware resources are kept as busy as possible
what is round robin scheduling?
the OS allocates a time slice / quantum to each job in which it can use the CPU
if the job is not completed by the end of the time slice, it returns to the back of the queue
the next process then takes its turn
an interval timer generates interrupts at specific times
this method helps guarantee reasonable response times for all users
what is first come first served scheduling?
first job is executed until it completes
the time that each process takes to execute is irrelevant
inefficient if small tasks have to wait for large ones
what is shortest remaining time scheduling?
the process with the shortest remaining time to completion is run next
processes can be suspended if a higher priority process joins the queue, so a shorter new job can take over from the current process
reduces the number of small jobs waiting behind big jobs and requires knowledge of how long a job will take
possible for batch jobs or scientific / commercial jobs which are run regularly
what is shortest job first scheduling?
the OS picks the process with the shortest amount of time and runs it until it’s finished
scheduler must know duration of each process
what is multi-level feedback queues scheduling?
multiple queues are created with different priority levels
jobs can be moved to different queues depending on how much processor time they use
the algorithm gives preference to short jobs, gives preference to I/O bound processes, separate processes into categories based on their need for the processor
it maximises processor use by keeping the I/O devices as busy as possible because they’re much slower than processor speed
what is backing store management?
when files and applications are loaded, they are transferred from backing storage into memory
the OS keeps a directory of where files are stored so they can be quickly accessed
it needs to know which areas of storage are free
the file management system enables a user to move files, delete files and protect files
what is peripheral management?
different applications require different I/O devices
the operating system needs to communicate with the printer to check it is online, check it’s a printer and begin communication
the data to be printed is transferred to an area of memory called a buffer so that the CPU can continue with another task
the purpose of the buffer is to compensate for the difference in speed between the printer and the CPU