1.2.1 Systems Software Flashcards
Operating system
- a collection of programs that provide an interface between the user and computer
Functions of the OS
- provides a user interface [1]
- manages/controls hardware [1]
- provides a platform for software to run [1]
- handles interrupts [1]
- provides security [1]
- provides utilities for system maintenance [1]
- input/output management (device drivers)
- file management (moving editing deleting files and folders)
- resource management (scheduling)
- memory management (paging segmentation and virtual memory)
Utilities
- software program with a specific function linked to the maintenance of the OS [1]
- file encryption : encodes files before transfer allowing users to send files over networks securely
- file compression : reduces file size to take up less storage space or for faster transfer over a network [1]
- disk defragmentation : physically reorganises files on a hard disk so they can be found and accessed faster [1]
- backup software : creates system snapshots and will restore them on demand /makes regular copies of files In case of loss [1]
- disk clean up: scans the Hard disk for duplicate or corrupted files and removes them freeing up hard disk space
Memory management
- is a fundamental role of the OS
- deals with the allocation and deallocation of RAM to ensure RAM is used efficiently and not wasted [1]
- benefit : enables multitasking allowing multiple programs to run at once [1]
Memory management techniques
- paging
- segmentation
- virtual memory
Paging
- main memory is split into fixed sizes sections called pages [1]
- uses physical divisions
- pages are swapped between main memory and hard disk as needed
Paging benefits + drawbacks
- benefits : facilitates efficient memory management and enable use of virtual memory
- programs/data can be held in non contiguous memory locations [1]
- to avoid having to move content around to fit in new programs
- drawbacks : can lead to internal fragmentation (pockets of wasted space within pages)
- unused space in pages is wasteful as other unrelated data cannot be stored on this page
Segmentation
- divides main memory into logical sized divisions called segments which can vary in size [1]
- are complete sections of programs
- segments represent the structure and logical flow of the program
- eg. In a video editing application different segments may be created for video data, audio data, effects and UI elements
Segmentation advantages + disadvantages
- benefits : is space efficient due to only allocating space depending on the amount an application needs
- drawbacks : can result in external fragmentation [1]
PAGING VS SEGMENTATION similarities
- both allow programs to run despite insuffienct memory [1]
- both are ways of splitting up memory [1]
- both allow programs to be stored non continuously in memory [1]
- both pages and segments use virtual memory (are stored on a disk) [1]
- both pages and segments are transferred into memory when needed [1]
PAGING VS SEGMENTATION differences
- paging uses fixed sized memory blocks , segmentation uses variable length memory block [1]
- paging uses physical divisions, segmentation use logical divisions [1]
- pages are made to fit sections of memory , segments are complete sections of programs
Virtual memory
- virtual memory is a section of hardrive/secondary storage device [1]
- when memory intensive applications exceed available RAM
- the OS moves less frequently accessed pages to virtual memory [1]
- this frees up space for other programs in RAM [1]
- pages are transferred back into RAM from virtual memory as needed [1]
Virtual memory advantages
- allows more extensive programs to be run
- facilitates effective multitasking
Virtual memory disadvantages
- slower to access than physical memory which degrades performance if overused
- can lead to disk thrashing, when the computer freezes due to pages being swapped too frequently between the hard disk and main memory [1]
What is an interrupt?
a signal to the processor indicating that a device/process needs attention [1]
Interrupt service routine
- The processor checks the interrupt register at the end of each FDE cycle [1]
- If an interrupt exists with a higher priority to the current process :
- the current contents of the registers in the CPU are transferred into a stack [1]
- the relevant ISR is loaded into RAM by loading the relevant value into the PC [1]
- when the ISR is complete and if there are no interrupts with a higher priority to the current process [1]
- the contents of the stack are popped/loaded back into the register [1]
- the FDE cycle resumes [1]
Scheduling + why is it necessary ?
- the method used by the OS to ensure all jobs get sufficient/fair processor time ensuring efficient use of resources /processor time [1]
- as many jobs as possible are processed in the least possible it time [1]
- scheduling algorithms can be pre- emptive or non-pre-emptive
Pre-emptive
- assigns the CPU to a process for a limited amount of time
- allows interruption of processes currently being handled
- it can result in low priority processes being neglected if high priority processes arrive frequently
- e.g round robin , STRF, multi level feedback queues
Non pre-emptive
- Allocates the CPU for unlimited time slots
- so once the CPU is given to a process that process keeps using it until it’s completed
- a process can’t be interrupted unless it completes or it’s burst time is reached
Round robin
- is pre-emptive
- each process is given a fixed/equal amount of time [1]
- if the process hasn’t been completed by the end of its time quantum, it returns to the back of the ready queue [1]
Round robin advantages
- all processes/jobs will eventually be attended to
- all process get an equal/fair share of the CPU
Round robin disadvantages
- choosing the right time quantum can be difficult
- doesn’t take into account job priority/urgency
First come first served
- is non-pre-emptive
- jobs are processed on a FIFO basis [1]
- whichever process is received first , is executed first
- each job is equal priority [1]
- e.g for printer queue : all documents have equal priority [1]
- whichever document is received first is printed first [1]
First come first serve advantages+ disadvantages
- benefits: is easy to implement
- drawbacks: does not take into account job priority/urgency
- short process can starve if a long process arrives before a short process
Multi level feedback queues
- is pre emptive
- uses queues with different priorities [1]
- jobs can be moved between queues [1] e.g if they exceed the time quantum
- shorter and more critical task are processed first
MLFQ advantages
- shorter task are prioritised
- helps avoid starvation by allowing processes to move between queues
MLFQ disadvantages
difficult to implement/more complex than other algorithms
Shortest job first
- non- pre-emptive
- process which has shortest time remaining is completed first [1]
SJF advantages
- minimise waiting time
- efficient and fast for short processes
SJF disadvantage
- requires knowing the burst of processes in advance
- long processes can starve if short processes keep arriving
Shortest time remaining First (strf)
- jobs with the shortest time remaining are processed first
- If a shorter job arrives while a process is running, the current process will be preempted and requeued until it has the shortest remaining time.
Strf Advantages
Ideal for jobs with short burst times
Strf disadvantages
- can lead to processor starvation/ longer processes can starve if shorter processes keep arriving
Types of OS
- distributed OS
- Embedded OS
- multi-tasking OS
- multiuser OS
- real-time OS
Distributed OS
Allows multiple computers to work together on a single task (sharing the load) [1]
Embedded OS
has a dedicated function and is read only/cannot be changed + stored in the ROM [1]
Multitasking OS
runs multiple programs at the same time [1]
Multi-user OS
- allows multiple users to access computer resources at the same time [1]
Real time OS
- designed for immediate data processing and can ensure tasks are processed in specific/guaranteed time frames
- commonly used in time critical computer systems eg. Automotive - self driving cars where low latency is critical to safety
BIOS (basic input output system)
- basic input output system is the first program that runs when a computer is switched on
- is stored in ROM [1]
- it performs a power on self test (POST) that ensures all the hardware components and working properly [1]
- is used to call the bootstrap which boots up the operating system [1]
Device drivers
- A piece of software that enables communication between an OS and (external) hardware [1]
- eg printers, graphics cards, network cards
- are specific to the computers architecture
- are specific to the OS
Virtual machines
- a theoretical computer and a software implementation of a computer system [1]
- VMs are entitled OSs running inside another OS
- running a VM helps access software that is only designed to run on specific OSs
Virtual machines uses
- enables multiple OS to be run on a single machine
- can be used to create isolated test environments that leave the host operating system unaffected, debugging and development without affecting the main system [1]