1.2.1 - 1.2.2 Systems software + Applications generation Flashcards
What are the main purposes of an operating system?
- Managing the hardware
- Managing the software (loading programs in and out of RAM)
- Security (username and password)
- Providing a user interface
Name 4 common operating systems.
Windows, Android, Linux, iOS
What is the kernel?
The kernel is the core of the operating system.
What are the tasks of the kernel?
- Loading and unloading programs from RAM
- CPU scheduling
- Memory management
- Storing files to and from storage
- File management
- Data security
Why do different operating systems have different kernels?
Because different devices have different priorities.
e.g. A kernel for a mobile phone will need to be as power efficient as possible whereas one for a desktop will be optimised for performance
What are device drivers?
A device driver is a piece of software which enables the operating system to interact with and control a specific device.
Who makes the driver for a specific device?
The company who created the device.
What is a user interface?
Software that allows the user to interact with a computer.
Name and describe two common user interfaces.
GUI - graphical user interface - uses images, graphics and icons to provide a clear interface for the user to control the computer.
CLI - command line interface - allows the user to type commands directly into the computer.
Give 3 examples of utilities.
- Print queue
- File management
- Antivirus
- Disk defragmenter
What is the job of the memory manager?
- Allocating memory to each program that runs
- Mapping logical addresses to actual physical addresses
- Prevents programs from overwriting each other
- Moving files to virtual memory when running short on RAM
Give two ways that an operating system manages memory.
Segmentation and Pagination
How does segmentation work?
- An application which is running is split into processes called segments
- Each segment is a program that is allocated a space in RAM and executed separately.
- The large program is run by running the smaller segments as required.
What does segmentation do?
Allows a program to be run on a system without using up too much memory.
What is the code segment?
A segment which holds the executable instructions for the process.
What is the data segment?
A segment which holds all of the variables for the process.
What is the stack segment?
A segment which holds the memory addresses for the process which is running.
What is the free memory segment?
A segment which allows the stack segment to grow and shrink as necessary.
How does segmentation prevent files from overwriting each other?
All the processes have a set section of memory which is controlled by the OS.
What is virtual memory?
A section of the hard disk which can be used as memory when the memory is full.
Why is virtual memory not ideal to use?
Because the hard disk is much slower than the RAM.
How does paging work?
- The RAM is split up into numbered pages, each 4MB in size.
- Pages that have not recently been used can be copied from the RAM into virtual memory to free up space in thr RAM.
What is disk thrashing?
When more time is spent swapping data in and out of RAM than on actually processing the data.
What is a memory leak?
When a program does not flush its used data and so it takes up more and more space the longer it runs.
What will happen if a memory leak is bad enough?
The RAM will be completely full and the system will require restarting to clear the contents of the RAM.
Why is a memory leak less likely to happen to a well written program?
Because a well written program will regularly flush out the used data that it no longer requires, freeing up space in RAM.
What is a stack overflow?
The more memory addresses are used in a process, th more the stack segment expands into the free memory. If the stack segment gets too big, then it overflows, causing the program to crash.
What are the main two ways that the CPU reacts to events?
Polling and interrupts.
How does polling work?
The CPU regularly checks to see if any peripherals or applications require attention.
Why is polling good?
It is very simple and predictable.
Why is polling inefficient?
It uses up CPU processing time waiting for potentially nothing to happen.
What is an interrupt?
A signal produced by either hardware or software which tells the CPU to stop what it is doing and carry out the interrupt task instead.
How does the CPU know whether the interrupt task is more important than the task currently being executed?
Because an interrupt comes with a priority label. If this is higher than the task currently being executed then it replaces this task.
How does a CPU process an interrupt? (ISR)
- Stores values of registers to a stack in memory
- Processes the interrupt
- Once interrupt has finished processing, stack is reloaded into registers and process resumes
What is scheduling?
The way that the processor time is managed when multiple programs want to use it.
What are the duties of the scheduler?
- Processing as many tasks as possible in a given amount of time
- Prioritising jobs
- Altering priorities when needed
- Ensuring no job is left waiting too long, even if it is low priority
- Minimising delay between user request and action
Describe the Round Robin scheduling algorithm.
A queue holds all processes that are ready to run.
First process is loaded and given a set amount of time to run.
If it is completed in this time the next process is loaded, if it is not then it is sent to the back of the queue and the next process is loaded.
Give a pro and con of round robin.
- Useful if all processes are the same length and priority
- Not useful if processes vary in length and priority as it does not take these into account
Describe the first come first serve scheduling algorithm.
Loads all processes into a queue and then gives them as long as they need to run before loading the next process.
Give a pro and con of first come first serve.
- It is simple to implement and ensures that all jobs will complete in minimum time once they have started.
- Does not consider length and priority - long processes will block more important ones from taking place.
Describe the shortest job first algorithm.
The scheduler organises the processes into a queue based on the number of cycles (time) they take. They are executed in this order.
When a new task comes along it is slotted into the correct place in the queue. If it is shorter than the whole queue then the current task is interrupted.
Give a pro and a con of the shortest job first scheduling algorithm.
- Ensures that the maximum number of jobs are completed
- Does not take priority into account - long jobs may be waiting for a long time
Describe the shortest time remaining scheduling algorithm.
SIMILAR TO SHORTEST JOB FIRST BUT
The scheduler organises the processes into a queue based on how many cycles they have left instead of their total number of cycles.
Why is shortest remaining time better than shortest job first?
Because if a long job is executing or is interrupted, it may have a low amount of cycles left out of a high total number of cycles. SJF would keep this at the end of the queue due to its high total cycles meaning that it woudln’t be run however SRT will move it to the front because it will take less time to execute than lots of smaller processes.
Describe the multilevel feedback queue scheduling algorithm.
The scheduler organises processes into one of 3 queues based on their priority. The high priority queue is always executed first.
The scheduler can reallocate processes from one queue to another if it became more important or has been waiting for too long.
Give a pro and con of multilevel feedback queues.
- They take priority into account (only one)
- They are complicated to implement and are no more useful if the processes are all the same priority
What is a multitasking OS?
Runs on most personal computers.
Scheduler is in charge of switching between multiple processes in order to keep all applications up to date.
Because this is so fast, it appears to the user that it is all happening at once.
Give some examples of a multitasking OS.
Windows, Android, Linux, macOS