1. Functions of an Operating System Flashcards
Define the term operating system
A collection of programs that provide an interface between the user and the computer
Name the 8 features that an operating system provides
- Memory management
- Resource management
- File management
- I/O management
- Interrupt management
- Utility software
- Security
- User interface
Name the 3 techniques used by the OS to ensure memory is shared effectively by programs
- Paging
- Segmentation
- Virtual memory
Describe how paging works
- Memory split up into equal-sized sections (pages)
2. Pages swapped between main memory and hard disk as needed
Describe how segmentation works
- Memory split up into logical sized divisions (segments)
- Segments vary in size
- Segments represent structure and logical flow of program
Describe how virtual memory works
- A section of hard drive acts as RAM when space in main memory is insufficient
- Sections of programs not currently being used are temporarily moved to virtual memory through paging
- This frees up memory for other programs in RAM
Define the term disk thrashing
A disadvantage of virtual memory when the computer freezes due to pages being swapped too frequently between hard disk and main memory
Define the term interrupt
Signals generated by software or hardware to indicate to processor that a process needs attention
What is considered when allocating processor time?
The interrupt’s priority
Where are interrupts stored?
Within an abstract data structure called a priority queue in an interrupt register
What is an ISR (Interrupt Service Routine)?
A software process invoked by an interrupt request
Describe what happens when an interrupt exists with a higher priority to the current process
- Current contents of registers in CPU are transferred into stack
- Relevant ISR is loaded into RAM
- Flag is set to signal ISR has begun
- Flag is reset once ISR has finished
- Process is repeated
Describe what happens when there are no interrupts with a higher priority to the current process
- Contents of stack are put back into registers
2. FDE cycle resumes
What is scheduling?
How the OS ensures all sections of programs being run (jobs) receive a fair amount of processing time
What is a preemptive scheduling algorithm?
When jobs are actively made to start and stop by the OS
What is a non-preemptive scheduling algorithm?
Once a job is started, it is left alone until it is completed
Name the 3 examples of preemptive scheduling algorithms
- Multilevel Feedback Queues
- Shortest Remaining Time
- Round Robin
Name the 2 examples of non-preemptive scheduling algorithms
- First Come First Served
2. Shortest Job First
Describe how round robin works
- Each job is given a section of processor time (time slice) within which it runs
- Once each job in queue has used its first time slice, they are given another slice of processor time until a job is completed
- Completed jobs are removed from queue
What is the advantage of round robin?
All jobs will eventually be attended to
What are the 2 disadvantages of round robin?
- Longer jobs take much longer time for completion
2. Does not account for job priority or urgency
Describe how first come first served works
Jobs processed in chronological order by which they entered queue
What is the advantage of first come first served?
Straightforward to implement
What is the disadvantage of first come first served?
Does not account for job priority or urgency
Describe how multilevel feedback queues work
Makes use of multiple queues, each ordered based on different priority
What is the advantage of multilevel feedback queues?
Takes into consideration different job priorities
What is the disadvantage of multilevel feedback queues?
Difficult to implement
Describe how shortest job first works
The queue storing jobs to be processed is ordered according to time required for completion so longest jobs are serviced at the end
What is the advantage of shortest job first?
Suited to batch systems since waiting time is reduced
What are the disadvantages of shortest job first?
- Requires processor to calculate how long each job will take
- Processor starvation if short jobs are continuously added to queue
- Does not account for job priority or urgency
Define the term processor starvation
When a particular process does not receive enough processor time to execute and be completed
Describe how shortest remaining time works
Queue storing jobs to be processed us ordered according to time left for completion so jobs with least time left are serviced first
What is the advantage of shortest remaining time?
Throughput is increased as shorter processes can be quickly completed
What are the disadvantages of shortest remaining time?
- Processor starvation if short jobs are continuously added to queue
- Does not account for job priority or urgency