1/29
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is an operating system
An operating system is a collection of programs which work together to provide an interface between the user and the computer
Operating systems allow the user to communicate with the computer and perform certain low-level tasks like management of computer memory and resources
What features do operating systems provide
Memory Management (Paging, Segmentation, Virtual Memory)
Resource Management (Scheduling)
File Management (Moving, Editing, Deleting files and folders)
Input / Output management (device drivers)
Interrupt management
Utility Software (disk defragmenter, backup, formatting)
Security (Firewall)
User Interface
What are the three methods of memory management
Paging
Segmentation
Virtual memory
What is paging
Paging is where memory is split up into equal sized sections known as pages with programs being made of a certain number of equally sized pages these can then be swapped between main memory and hard disk as needed
What is segmentation
Where data is split up into segments which are logically divided and vary in size
They still show the structure and logical flow of the program with segments being allocated to blocks of code such as conditional statements or loops
What is virtual memory
Virtual memory uses a section of the hard drive to act as RAM when the space in main memory is full and so no more programs can be stored
Sections of programs which are not currently being used are temporarily moved into virtual memory through paging this frees up memory for other programs
What is an issue with using virtual memory
Disk thrashing - This is where the computer freezes because programs are being swapped too often between the hard disk and main memory.
As a result more time is spent swapping programs rather than actually running the program
As virtual memory becomes more full this becomes worse
What is an interrupt
An interrupt is a signal generated by software or hardware which indicates to the CPU that a process needs attention
How does the operating system deal with interrupts
Each interrupt has a priority level and so the operating system will allocate time to how urgent or important each interrupt is.
For example a Printer signalling the completion of a print will not be given priority over a peripheral signalling power failure
Interrupts are stored in order of their priority in an abstract data structure called a priority queue in a register named the interrupt register.
The operating system must make sure that each interrupt is given their fair share of processing time
What is the interrupt service routine
Where the processor swaps out contents of a processor with a interrupt which is a higher priority after an FDE so that higher priority interrupts are prioritised
Explain how the interrupt service routine works
Checks the contents of the interrupt register at the end of each FDE cycle
If there is an interrupt in the priority queue which has a higher priority than the process currently being serviced the contents of the process currently being serviced will be swapped into a stack
The processor then responds to the interrupt by loading the ISR (interrupt service routine) into RAM
Once the interrupt has been serviced the priority queue is checked again to see if there is any interrupts with a higher priority than the one currently being executed
If there are no interrupts with a higher priority the FDE cycle will continue
What is scheduling
A core function of the operating system which makes sure all processes and interrupts receive their fair share of processor time
What are the two ways scheduling can work and give two examples of each
Pre - emptive- The operating system actively starts and stops jobs
Examples: Multilevel feedback queues, Shortest remaining time, Round Robin
Non pre - emptive- Once a job is started the operating system leaves it alone till it is completed
Examples: First Come First Served, Shortest Job First
What is the round robin scheduling algorithm
Round robin scheduling issues an equal share of processor time to each job in the queue. Once a job is completed it is removed from the queue and it’s processor time is divided amongst each job equally
What is a pro and a con of round robin
Pro: Each Job is seen to and given it’s processor time
Cons: Since longer jobs have their execution inefficiently split over many clock cycles this leads to longer time for execution
Round Robin does not take into account priority leading to high priority jobs not being completed quickly
What is first come first served
Pro and a con
Jobs are processed in order of when they arrived in the queue
Easy to implement
Does not take priority into account
What is a multilevel feedback queue
Makes use of multiple queues, each queue is ordered based on a different priority level
Can be hard to implement due to deciding which job should be prioritised when there is a big combination of priorities
What is shortest job first scheduling
Pros and Cons
The shortest job in the queue is executed firs and the longest tasks last
Pros: Suited to batch systems where short jobs are given preference to minimise waiting time
Cons: Requires the processor to know how long each job will take - this is sometimes not possible
Risk of processor starvation if short jobs are continually added to the queue - the longer jobs will never be serviced
What is a batch system
A batch system processes jobs in big batches instead of individually- suitable for tasks with large repeating data sets
What is shortest remaining time
The queue processing each job orders each job according to the time left in executing each job - from shortest remaining time first to longest remaining time last
Risk of processor starvation again
What is processor starvation
Where tasks in the queue are not attended to by the processor for ages
What is every operating system and then give a brief explanation of each
REDMM
Distributed operating system - Operates across multiple device - the load is spread across multiple processors
Embedded operating system - Performs a small number of tasks- catered towards a specific device. They are limited in their functionality and hard to update but consume far less power than any other OS
Multi-tasking operating system - Multi-tasking operating systems enable the user to carry out tasks at the same time (But not concurrently) Done by time slicing to switch between programs and applications in memory
Multi-user operating system - Multiple users on one computer. So a scheduling algorithm is used to ensure jobs are given a fair share of processing time. If an unsuitable algorithm is used this will lead to processor starvation
Real time operating system - Mr reliable used in time-critical computer systems, a real time OS performs a task within a guaranteed time frame. Used in a situation where a response within a certain time is crucial to safety - ie a self driving car
What is BIOS
The basic input output system is the first program which is ran once the computer is started - (as the program counter points to it’s location first)
The BIOS runs various crucial tests before the operating system is loaded into memory by the bootstrap
Crucial to the computer system as the operating system can only be loaded into RAM from the hard disk after these checks have been completed
What is the BIOS’s key tests that it runs
POST (power-on self test) - Ensures all hardware (keyboards, disk drives) are correctly connected and functional
Checking CPU clock, memory and processor is operational
Testing for external memory devices which are connected to the computer
What is the bootstrap / bootloader
The program that loads the operating system from the hard disk into main memory
What is a device driver
A device driver is provided by the operating system and allows the operating system to connect to hardware
When hardware is used (a keyboard), the device driver communicates the request to the operating system which then displays the relevant output (A letter on the screen)
Device drivers are specific to the computers architecture so different drivers are needed for different device types
Device drivers is an abstraction as the user uses hardware without knowing how hardware works
What is virtual memory
A theoretical computer which is a software implementation of a computer system
Provides environment with a translator for intermediate code to run
What is a computer enviroment
The hardware platform and operating system needed to run a program along with the tools and software required for development
What are the 3 uses for a virtual machine
Provides environment with a translator to allow the intermediate code to run
Protection from malware- malware will effect the virtual machine rather than the device being used
Running incompatible software - A virtual machine can run software which would have been incompatible with the operating system - this saves time and money which would have been spent on new software
Common example of this is a games console implemented on PCs using a virtual machine
What is intermediate code
Code that is halfway between machine code and object code is called intermediate code
Independent of the processor architecture so can be used across different machines and operating systems
Virtual machines are commonly used to create a development environment for programmers to test programs on different operating systems - saves money and time of having to buy new devices just to use them for testing.
However using intermediate code in a virtual machine is very slow compared to using low-level code on the device it was intended to be used upon