Chapter 7 - Functions of an Operating System (1.2) Flashcards
What is an operating system?
program/set of programs that manages the operations of the computer for user
Where is the operating system held?
permanent storage
What are some functions of an operating system? (6)
- provides a user interface
- memory management
- interrupt service routines
- processor scheduling
- backing store management
- management of all input and output
What is paging?
When memory is split up into equal sized sections known as pages, can be swapped between main memory and the hard disk as needed
What is segmentation?
Splitting up memory in segments which can vary in size, represents the structure and logical flow of the program
What is virtual memory?
Uses a section of the hard drive in RAM when there’s no more space in main memory to run apps, moves rarely used programs here through paging which frees up memory for other programs in RAM
What’s the issue with paging, segmentation and virtual memory?
Disk thrashing (when pages are swapped too frequently between the hard disk and main memory, causing the computer to slow down)
Describe the process of interrupts.
At the end of the fetch decode execute cycle (during the execute phase), the processor checks for any interrupts in the interrupt register. if there are any, if the priority of the interrupt is higher than the priority of the current instruction being executed, the current instruction’s contents are pushed onto a stack and the interrupt is executed. If the interrupt is of same or lower priority, its contents are pushed onto a stack and is fetched once the current instruction’s contents are executed. If an interrupt of higher priority is in the interrupt register when the first interrupt has been executed, the first interrupt’s contents are pushed onto a stack and the second interrupt is executed. Stacks work in a FIFO (first in first out) order, so the first interrupt’s contents would be put back into registers before the original instruction.
What is a scheduler?
The operating system module responsible for making sure that processor time is used as efficiently as possible
Scheduling algorithms can either be..? (2)
Pre-emptive (jobs are actively made to start and stop by the operating system)
Non pre-emptive (once a job is started, it’s left alone until completion)
Describe the round robin scheduling algorithm.
Each job is given a time slice within which it is allowed to execute. If the process hasn’t completed before before the time slice ends or a higher priority interrupt occurs, the OS gives the CPU the next process. Once each job in the queue has used its first time slice, the OS again grants each job a time slice, until a job has been completed, where it’s then removed from the queue.
What is an advantage of the round robin scheduling algorithm?
Ensures every job is executed.
What are 2 disadvantages of the round robin scheduling algorithm?
- Longer jobs will take way more time to complete due to it being inefficiently split into multiple cycles
- Doesn’t take into account job priority
Describe the first come first served scheduling algorithm.
Jobs are processed in the order in which they arrive.
What is a disadvantage of the first come first served scheduling algorithm?
Doesn’t take into account job priority.