1/43
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
Operating system
The collection of programs that work together to provide an interface between the user and computer
Operating system features
Memory management (paging, segmentation, virtual memory)
Resource management (scheduling)
File management
Input/Output management (device drivers)
Interrupt management
Utility software (disk defragmenter, backup, formatting)
Security (firewall)
User interface
Paging
Memory is split up into equal sized sections (pages) that then allows data to be swapped between main memory and the hard disk as needed
Segmentation
Splitting up memory into logical sized divisions (segments) that vary in size
Virtual memory
Uses a section of the hard drive to act as RAM when the space in main memory is insufficient. Programs that are not currently in use are temporarily moved into virtual memory
What is the issue with paging, segmentation and virtual memory?
They cause disk thrashing
What is disk thrashing?
When pages are being swapped too frequently between the hard disk and main memory, more time is being spent transferring the pages than running the program. This results in the computer freezing.
Interrupts
Signals generated by software or hardware to indicate to the processor that a process needs attention.
Where are interrupts stored?
In the interrupt register, organised in order of their priority within an abstract data structure called a priority queue
Interrupt Service Routine
The processor checks the contents of the interrupt register at the end of each FDE cycle
If an interrupt exists that is of higher priority to the process being executed, the current contents of the registers in the CPU are temporarily transferred into a stack
The processor responds to the interrupt by loading the appropriate interrupt service routine into RAM. A flag is set to signal the ISR has begun.
What happens once the interrupt has been serviced?
The interrupt queue is checked again for any other interrupts that are of a higher priority than the original process being executed. The ISR is repeated until all priority interrupts have been serviced. The contents of the stack are then transferred back to the registers and the FDE cycle resumes.
Scheduling
Ensures all sections of programs being run receive a fair amount of processing time
Pre-emptive
Jobs are actively made to start and stop by the operating system
e.g. Multilevel Feedback Queues, Shortest Remaining Time, Round Robin
Non pre-emptive
Once a job is started, it is left alone until it is completed
e.g. First Come First Serve, Shortest Job First
Round Robin
Each job is given a time slice of processor time within which it is allowed to execute
Once each job in the queue has used its first time slice, the OS again grants each job an equal slice of processor time
This continues until a job has been completed
Advantages of round robin
Ensures each job is seen to
Disadvantages of round robin
Longer jobs will take much longer for completion
jobs are inefficiently split up
Does not take into account job priority
First come first served
Jobs are processed in chronological order by which they entered the queue
Advantages of first come first served
Straightforward to implement
Disadvantages of first come first served
Does not allocate processor time based on priority
Multilevel feedback queues
Makes use of multiple queues, each of which is ordered based on a different priority
Advantages of multilevel feedback queues
Allocates processor time based on priority
Disadvantages of multilevel feedback queues
Difficult to implement due to deciding which jobs to prioritise
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. Most suited to batch systems, where you need to minimise waiting time.
Advantages of shortest job first
Minimises waiting time for shorter jobs.
Disadvantages of shortest job first
Requires the processor to calculate how long each job will take which is not always possible
Risk of processor starvation
Shortest remaining time
The queue storing jobs to be processed is ordered according to the time left for completion, with the least time to completion being serviced first
Advantages of shortest remaining time
Reduces waiting time
Disadvantages of shortest remaining time
Risk of processor starvation
Processor starvation
When a particular process does not receive enough processor time in order to execute and be completed
Distributed Operating System
Runs across multiple devices, allowing the load to spread across multiple computer processors
Embedded Operating System
Performs a small range of specific tasks, limited functionality although they consume significantly less power
Multi-tasking Operating System
Enables the user to carry out tasks seemingly simultaneously by using time slicing to quickly switch between programs and applications in memory
Multi-user Operating System
Multiple users use one computer with a multi-user system. Therefore a scheduling algorithm must be used to determine ensure processor time is shared fairly between jobs otherwise there is risk of processor starvation
Real Time Operating System
Used in time-critical computer systems, designed to perform a task within a guaranteed time frame. Often used for scientific purposes
BIOS - Basic Input Output System
The first program that runs when a computer is switched on. PC always points to the BIOS upon start-up.
Key tests BIOS runs before the operating system is loaded into memory
POST (Power-on self test) which ensures that all hardware are correctly connected and functional
Checking the CPU clock, memory and processor is operational
Testing for external memory devices connected to the computer
This all happens before the OS is loaded into RAM from the hard disk
Bootstrap
The program that loads the operating system from the hard disk into main memory
Device drivers
Allow the operating system to interact with hardware
When a piece of hardware is used, the device driver communicates any requests to the OS to produce the relevant output
They are specific to the device, the computer architecture and the operating system
Virtual machine
A theoretical computer that is a software implementation of a computer system. It provides an environment with a translator for intermediate code to run
Intermediate code
Code that is halfway between machine code and object code. It is standardised across operating systems
What are virtual machines used for?
To create a development environment for programmers to test programs on different operating systems
Protection from malware as it is contained in the virtual machine rather than affecting the device being used
To simulate a different operating system than the native one and run incompatible software without needing to purchase extra hardware
Advantages of developing with virtual machines
Saves both time and money on needing to purchase multiple devices to test programs
Dusadvantages of developing with virtual machines
Running intermediate code on a vm can be considerably slower than running low level code on the device it was designed for