1.2.1 - Operating Systems Flashcards
What is the operating system?
The operating system is the most fundamental piece of system software. It is the software that manages the computer.
What is the purpose of an operating system?
- To act as a platform on which the other software can run.
- To handle the operations common to different pieces of software running on the same system, like writing and reading to secondary storage.
Name 4 examples of OS functions that do not relate to memory or storage.
- Processor scheduling, determining the order in which processes will be executed.
- Handling interrupts, dealing with requests that disrupt the processor.
- Providing the user interface, how users interact with a computer.
- Providing security, ensuring resources are protected through permissions and passwords.
Name 3 examples of OS functions relating to memory or storage.
- Memory management, recording how memory is divided to efficiently allocate it.
- Secondary storage management, to track where files and programs are stored and which parts are available.
- I/O Management, ensuring efficient communications with devices and managing functionality issues.
What can happen without memory management?
Each different program will be using its own data. Without memory management, one program could change the data of another, and a maliciously coded program could access or amend the data of another program.
What is paging?
Paging is splitting programs up into physical units of the same size, stored in page frames. The operating system uses a page table to keep track of where the pages are stored, meaning all the pages of a process don’t have to be stored contiguously.
What is segmentation?
Segmentation is splitting programs up into segments of different sizes to fit the varying memory requirements of each process. The segments don’t need to be stored continuously across a fixed address space, and can be moved in and out of memory as required.
How is processor time allocated to urgent processes?
Interrupts are used (a signal sent to the processor to request immediate attention.) When the processor receives this request, it suspends what it is doing and runs the process associated with the interrupt.
Why might a processor be interrupted?
It could be interrupted because:
A hardware device has signalled it has data to process.
A hardware device has finished a task.
A software process needs a service to be provided or OS function to be performed.
A certain amount of time has expired.
A hardware failure has occurred.
What is an ISR and where is it found?
An ISR is a mini program designed to respond to an interrupt’s request. It can be built into an operating system or provided via device drivers.
What happens if an interrupt is raised at the end of a fde cycle?
The contents of the PC and other registers are copied to an area of memory called a stack.
All other lower-priority interrupts are put on hold.
The relevant ISR is loaded by changing the PC to where the ISR starts in memory.
The ISR executes.
The previous values are restored and interrupts re-established.
What is the job of a scheduler?
A scheduler is a program that manages the amount of time different processes have in the CPU.
What is the round robin scheduling algorithm?
In round robin scheduling, processor time is divided equally among all tasks.
Each process is given a fixed time period called a time slice, and if it hasn’t finished when the time is up it stops running and the computer switches to the next process.
What are the advantages and disadvantages of round robin?
Every task is allocated processor time without a long wait.
However, it doesn’t scale well, because as more processes run, the time slice for each gets smaller so more urgent processes are less likely to be completed quickly.
What is the first come, first served scheduling algorithm?
Processes run from start to finish in the order in which the processor receives their request to run.
What are the advantages and disadvantages of first come, first served?
This is the simplest method to implement. Also, with this algorithm, once a job starts, it will definitely complete.
However, there can be a long wait before a process can run.
What is the shortest job first scheduling algorithm?
In shortest job first, processes are queued and the process that needs the shortest total time to complete goes first.
What are the advantages and disadvantages of shortest job first?
It reduces wait times because shorter processes are removed quickly, meaning the processor can allocate more time to longer jobs.
However, this type of scheduling is susceptible to starvation if shorter jobs keep being added.
What is the shortest time first scheduling algorithm?
In shortest time remaining scheduling, the processes with the shortest time to completion go first, until a different task is added with a shorter time to completion, which then takes priority.
This is different to the shortest job first algorithm because a long job which is mostly complete might have a very short time remaining, and would therefore be prioritised.
What are the advantages and disadvantages of shortest time first?
Like shortest job first scheduling, this algorithm also has the effect of delaying longer processes from completing sooner if shorter processes are added in the meantime. The less a process has left to do, the higher priority it becomes.
How does the multi-level feedback queue work?
Initially, processes are added to a queue with a certain level of priority.
If a process uses too much CPU time, it is moved to a lower priority queue and if a process has been idle for a long time, it is moved to higher priority queue.
Processes that depend on input/output devices require a lot of processing time, so they are kept in high priority queues, and processes that are quick to complete are served first
What are the advantages and disadvantages of multi-level feedback queue?
Starvation is avoided.
All tasks are given processor time, but the more important jobs are dealt with sooner.
The queues become more balanced the more the tasks are processed, ensuring that no single high-priority task dominates the processor’s time.
What are distributed operating systems?
Separate computers can be joined together through networks to make a more powerful whole, which is difficult because the data and instructions to be processed need to be split between each computer.
A distributed OS coordinates the communication between these nodes, useful when processor intensive tasks need to be completed.
What are embedded operating systems?
Embedded operating systems are used in computers which serve a specific purpose, providing a reliable platform for specific applications.
They are often used to provide hardware reliability and ensure efficient resource use, though often at the cost of flexibility.