1.2.1 Systems Software Flashcards
(28 cards)
what is os
operating system:
-boot loader from ROM loads OS into RAM
-manages hardware and provide interface and application software
the need of os
provide interface
control access
control hardware(peripheral management)
act as a platform which application can be run
function of os
-UI
-memory management
-interrupt handling
-processor scheduling
memory management
paging and segmentation
-os needs to manage the allocation of main memory (RAM) for the programs
paging
memory split into fixed size
-pages are memory divided into fixed size chunks
-each page have an address
-pages can be used by programs and processes
-page table maps the logical memory location and physical memory location
disadvantage: takes no account of how it splits the program-> pages will not be contiguous in physical terms
segmentation
memory split into different lengths
-segments are memory divided into different lengths
-could store a part of program (e.g. particular function/subroutine)
virtual memory
when some of the pages currently open but not actively in used are temporarily swapped and allocated into secondary storage
problem: disk thrashing
-> as main memory fills up and pages are constantly swapping with virtual memory→ computer gets slower
interrupts
sending a signal to the cpu to raise awareness
examples:
-I/O devices sends interrupt signal
-printer out of paper
-error in program
-power failure
-scheduled interrupt(e.g. updates)
role of ISR
mini program to repsond to interrupt request
role of interrupt and ISR within FDE cycle
interrupts are checked at the end of each clock cycle
ISR kicks in if needed
- pushing current contents of its registers into a stack
- popped from stack and reloaded into CPU once interrupt process is finished
purpose of processor scheduling
-one cpu process instruction for one application at a time
-os need to schedule when application to use cpu
- illusion of multi-tasking/ applications running simultaneously
aim of processor scheduling
- give reasonable run time
- maximise the use of time in CPU
- fairness on a multi-user system
process of scheduling
- new process enters the ready queue
- moves onto running state when the previous process is executed/ blocked
- three outcomes after the running state:
- completely finish the execution AND leave the system
- blocked : require input/output to finish or continue the process
- run out of time → process suspended and goes back to the ready queue
scheduling algorithm
round robin
FCFS
SJF
STR
multi-level feedback queue
round robin (RR)
- system clock slices the task
- each process is allocated a fixed amount of time/time slice (by FIFO)
- if the process is not completed by the end of time slice, it returns to the back of ready queue AND the next job is allocated a time slice
first come first served
- processes executed in the order they arrive
- like a supermarket queue
shortest time remaining
- pre-emptive: process can be suspended when a process of higher priority jumps in
- the suspended process goes to the back of the queue
- if the suspended process had the smallest run time in the queue, it would be run again
shortest job first
- aka shortest process next
- the process of their job is run until they finish
- scheduler needs to know how long each process will take
multi-level feedback queue
- multiple queues are created with different priority queue
- jobs uses too much cpu time will be moved to lower priority queue
- jobs waited for a long time can be moved to a higher priority
advantage: allows flexibility
disadvantage: complex and abstract
suitability: when system has more than one processor/processor core, that can handle more than one process queue at a time
types of os
distributed
embedded
multi-user
multi-tasking
real time
distributed os
using the processing power of multiple computers across a network for one single task
embedded os
- run on dedicated hardware- for max efficiency with low-powered processors(not cpu) and little memory
- applications programs held in ROM
- limited RAM
- simple and minimal user interface
multi-tasking os
- a single processor appear to do more than one task simultaneously by scheduling processor time
- e.g. computers handling more than one application
multi-user os
handle request of multiple people using different computers on a network at the same time