Operating System Flashcards
Operating system
a program or set of programs that manage the operations of the computer for the user. It acts as a bridge between the user and the computer’s hardware, since a user can’t communicate directly with hardware. It disguises the complexities of managing and communicating with hardware from the user via a simple interface where they can click and immediately achieve tasks
where is OS held
permanent storage e.g. hard disk
the loader*
a small program held in ROM. When computer is turned on, the loader in ROM sends instructions to load the OS by copying it from storage to RAM
functions of OS
all OS share basic functions:
- processor scheduling
- UI
- provide utility software to carry out household tasks
- memory management and file handling
- ISR
- backing store management
- management of all I/O
- security for user files
how memory management works
each program/open file/copied clipboard item must be allocated a SPECIFIC area of memory whilst computer is running. When switching applications, both in memory simultaneously. If program closed, relinquishes memory and then free space. you don’t need to load the whole program into memory initally
paging
partitioning memory: memory divided into fixed page sizes eg 4kB and are physical divisions. a process held in memory may be held in several non-contigous pages. consecutive logical memory addresses physically stored in separate pages anywhere within physical memory and age table uses mapping to store link between physical memory address and virtual memory address.
used for virtual memory
page table does what
uses mapping to store the link between physical and logical memory address, preventing running out of memory and putting two things in the same place
why segmentation and paging
shuffling things in memory takes time so split up and makes better use of memory
both use VM and allow programs bigger than memory to run and allow non contiguous torage
segmentation
a way of partitioning memory by the logical division of memory into varying length segments of complete sections of programs depending on structure of program
virtual memory
Allows programs to run when insufficient memory available
as more jobs are loaded into memory OS may store PAGES (fixed sizes) of temoporarily inactive jobs onto disk as memory isn’t limitless. acts as secondary backing storage, an extension of memory to make room for pages next job with share of PROCESSOR TIME
large number of jobs loaded leads to
deterioration of performance as insuff. memory in RAM, pages swapped in and out until more time spent swapping than processing instructions- slows down PC (thrashing)
interrupts
a signal from a software program, hardware device or internal clock to the CPU as a request for processing time when requiring immediate attention, causing a break in the execution of the current routine. It allows important tasks to take precedence/be processed. Also allows multitasking
software interrupt
when an application program terminates or requests certain services from OS e.g. I/O operation complete, or error occurred e.g. printer out of paper
timer interrupt
indicates its time for next process to have processor time
memory management and why its necessary
To do with the organisation of main memory via converting logical addresses to physical addresses. OS manages allocation and management of space. Partitioning is used, involving paging/segmentation and virtual memory.
- allows memory to be Managed more easily
- allows Optimum use of memory
- allows programs to Share/be allocated memory and protects programs/data from each other
- allows you to work on Several at a time.
- allows running when Insufficient space in memory/allows running programs larger than main memory
first come first serve is inefficient
once a job starts- prevents other jobs being processed.
a job using slow resource e.g. printer wastes processor time
when a CPU receives an interrupt signal
It suspends execution of running program/process and lower priority interrupts. It puts values of program counter and each register and PC onto the system stack. Meanwhile source of interrupt is identified and ISR called to deal with interrupt- a particular routine will be run to service it depending on type of interrupt. after interrupt serviced original values of registers retrieved, interrupts are enabled and process resumes from point left off from
hardware interrupt eg
hard disk READ SET OF DATA BLOCKS
buffer is full or has free space
interrupts are assigned…
priorities (order of importance) and lower priorities may be disabled whilst a higher priority is being serviced, allows processes to take place and precedence
order of priority
power fail, clock, IO device sends signal requesting service or signalling end of IO operation
when are interrupt tests done
at end of each FDE cycle
processor scheduling
OS allocates processor time for each application as they compete for CPU because computers are able to run multiple applications simultaneously
a single processor can…
only process one instruction at a time but can multitask thanks to interrupts
single user multitasking
can run on a STANDALONE computer. only one user uses machine AT A TIME. constantly switching between small parts of multiple larger tasks in turn, according to SCHEDULING ALGORITHMS allowing more than one task (apparently) to be carried out at a time. giving appearance of carrying out several tasks simultaneously. Several tasks are in memory at one time but most not currently being executed
what is the scheduler*
the OS module responsible for ensuring processor time is used as efficiently as possible, allocating processor time to applications competing for CPU acc to scheduling algorithms
objectives of scheduler
- allow the processing, prioritisation of tasks and multitasking
- be fair to all jobs
- able to prioritise jobs and ensure they get processed (no starvation)
- maximum throughput (process as many jobs possible in least possible time)
- be fair to all users
- ACCEPTABLE RESPONSE TIME to all users (main aim)- maximise number of interactive users with fast/real time response time
- make max/efficient use of CPU time and other resources
- keep hardware as busy as possible
round robin*
> > PREEMPTIVE <>FIFO«_space;basis , and each have a limited/quantum very small time slice of CPU time, managed by interrupting timer generating interrupts.
If process not completed/higher priority occurs dispatcher gives CPU to next user/job and puts VALUES onto system STACK. Job put at back of queue.
Some systems have a system of priorities so higher priority has more than 1 consecutive time slice (order may depend on users priorities) Users are unaware of any delays
adv and disadv round robin
starvation free, all get a time slice
v
takes longer for all jobs
not always able to PRIORITISE
first come first served
jobs processed in order of arriving with NO SYSTEM OF PRIORITIES
disadv first come first served
if one large job comes all little ones have to wait a long time
shortest remaining time
a preemptive algorithm meaning process will be blocked by scheduler after a fixed time. Smallest estimated time to completion is run next
adv shortest remaining time and shortest job first
greater throughput/yield, less WAITING time, less smaller jobs BEHIND BIG JOBS, smaller jobs done quicker and advantages to new jobs