Chapter 16.1 Flashcards
"Purposes of an Operating System"
what is an operating system
provides an interface between users and the hardware
what is the purpose of an OS?
- interacts with hardware and runs software.
- provides multiprogramming ability
- maximises resources - CPU time, memory, I/O system. (manages process, device, and memory management)
- provides a user interface (CLI, GUI, voice recog.)
- provides file system to store data and programs
- manages peripherals
resources list
cpu
memory
I/O devices
maximise memory
moving frequently accessed instructions to cache for faster recall (SRAM over DRAM)
making use of virtual memory
partitioning memory (to allow for multiprogramming)
kernel
program that controls all other programs. responsible for communication between hardware, software and memory.
how does the operating system hide the complexities of the hardware from the user?
provides interface (CLI, GUI) - user doesnt interact directly with hardware
uses device drivers to synchronize hardware
program
written/static code
process
executing code
how is multi-tasking achieved
scheduling is used to decide which processes should be carried out, which ensures the best use of computer resources (see scheduling)
kernel overlaps the execution of each process based on scheduling algorithms - CPU clock is also used!
process states:
running = process is being executed
ready = process is in the queue waiting for the processor’s attention
blocked = process is waiting for an event so it cannot be currently executed, e.g. I/O
why is blocked > running not possible?
when I/O operation is completed for process in the blocked state,
the process is transferred to the ready queue,
THEN the OS decides to allocate to processor
preemptive scheduling algorithms
if a higher-priority process comes then the CPU’s attention is allocated to that process. examples are:
round robin and shortest time remaining
non-preemptive scheduling algorithms
does not halt a process until it is completed or transitions to a waiting state. examples include:
first come first serve and shortest job first
round robin
preemptive. each process gets a fixed time slice (all processes are given the same priority). when the time is up, if it’s still not completed the process is moved to the end of the ready queue.
benefit: starvation doesn’t occur, processes are given equal time slices
drawback: requires frequent switching, which can result in a high overhead
first come first served
non-preemptive. each process is queued as it is received and is executed one by one.
benefit: starvation also doesn’t occur, every process eventually gets a chance to run.
drawback: is inefficient, less complex features