Operating Systems
The terms refers to a collections of programs that work together to provide an interface between the user and computer.
OS features
-memory management (paging, segmentation, VM)
-resource management(scheduling)
-File management
Input/output management (device drivers)
-Interrupt management
-Utility software (disk defragmenter, backup)
-security
-user interface
Memory management
Paging
when memory is split up into equal-sized sections known as pages, with programs being made up of a certain number of equally-sized pages. These can then be swapped between main memory and the HD as needed.
Pages are physical divisions, equal sizes, made to fit memory.
Segmentation
splitting up the memory into logical sized divisions known as segments, which vary in size.
These are representative of the structure and logical flow of the programs.
Segments are logical divisions, different sizes, complete sections of programs
Similarities between paging and segmentation
-both allow programs to run despite insufficient memory
pages and segments are stored on a disk
pages and segments are transferred into memory when needed.
Virtual Memory
VM uses a section of the hard drive to act as RAM when the space in main memory is insufficient to store programs being used.
Sections of programs that aren’t currently in use are temporarily moves into virtual memory through paging freeing up memory for other programs.
Key issue with VM, paging and segmentation
Disk thrashing - when the computer freezes and occurs as a result of pages being swapped too frequently between the HD and main memory. As a result more time is spent transferring the pages than is spent actually running the programs.
The issue becomes progressively worse as VM is filled up. If this continues programs will likely lock up and not run.
Improved by updating OS or getting more RAM
What is an Interrupt?
Interrupts are signals sent through the control bus to indicate to the processor that a process needs attention.
Stored in order of their priority in a priority queue located in a special register called an interrupt register.
Interrupt Service Routine (ISR)
What is Round Robin (scheduling)
Each job is given an equal section of processor time - known as a time slice - within which it s allowed to execute. Once each job has used its first time slice, the OS again grants each job a time slice. This continues until a job has been completed at which point it is removed from the queue.
Round Robin disadvantages
What is First Come First Served
Jobs are processed in chronological order by which they entered the queue.
Disadvantages of First Come First Served
Although this is straight forward to implement, it doesn’t take into account priority.
Multi-level Feedback queues
Makes use of multiple queues which is ordered based on priority
Multi-level Feedback queues disadvantages
This can be difficult to implement due to deciding which job to prioritise based on a combination of priorities
(Adv = services most interrupts first)
Shortest job first
The queue storing jobs to be processed is ordered according to the time required for completion, with the longest jobs being serviced at the end.
This type is most suited to batch systems, where shorter jobs are given preference to minimise waiting time.
Shortest job first disadvantages
Shortest time remaining
the queue storing jobs to be processed is ordered according to the time left for completion, with the jobs with the least time left for completion being serviced first.
shortest time remaining disadvantages
Distributed OS
type of OS which run across multiple devices allowing the load to be spread across multiple computer processors when a task is run. e.g. internet
Embedded OS
OS built to perform a small range of specific tasks, this OS is catered towards a specific device. They are limited in their functionality.
-hard to update although they consume significantly less power than other types of OS.
Why is scheduling necessary / needed