1.2.1 Systems software [OUT OF SERVICE] Flashcards
What is an operating system?
A collection of programs that provide an interface between the user and computer.
What features does the operating system provide?
Memory Management Resource management (eg scheduling) File management I/O Management Interrupt management Utility software Security User Interface
Why is memory management necessary?
It ensures memory is being shared optimally between programs.
To allocate memory to allow separate processes to run at the same time.
To protect processes/data from each other.
Define paging.
How does this affect processes in memory?
Partitioning memory into fixed-size / equal-size physical divisions called pages.
Processes in memory will be assigned an appropriate number of pages.
Pages are swapped between the main memory and the hard disk as needed.
Explain segmentation.
Are segments fixed size?
What do segments represent?
How can a large program be executed in terms of segments?
Partitioning memory into variable-sized logical divisions called segments.
Segments vary in size.
Segments represent the structure and logical flow of the program.
A large program can be executed by consecutively running its segments.
What is virtual memory?
An allocated area of secondary storage where pages of inactive jobs are swapped into to free up enough RAM for the current job.
How is virtual memory used when there is not enough RAM?
A section of the hard drive acts as RAM when the space in the main memory is insufficient to store programs being used.
Sections of programs currently not being used are temporarily moved into virtual memory through paging.
This frees up memory for other programs in RAM.
Explain disk thrashing.
When the computer freezes due to pages being swapped too frequently between the hard disk and main memory.
What is an interrupt?
What happens if the interrupt is a higher priority than the current task?
Where are interrupts stored? In what way are they stored?
A signal generated by hardware or software to indicate to the processor that a process needs attention.
If the interrupt is a higher priority than the current task, the current routine pauses and resumes after the interrupt is executed.
Interrupts have different priorities which is considered when allocating processor time.
They are stored within the interrupt register in a priority queue.
Explain the steps of the Interrupt Service Routine
1) The processor checks the interrupt register at the end of each FDE cycle
2) If there is an interrupt with a higher priority than the current process
- The current contents of the registers in the CPU are transferred onto the system stack.
- The relevant ISR is loaded into RAM
- A flag is set to signal the ISR has begun
- The flag is reset once the ISR has finished
3) If there are no interrupts with a higher priority to the current process
- The contents of the stack are popped back into the registers
- FDE cycle resumes
What does SCHEDULING ensure?
That all sections of programs being run (jobs) receive a fair amount of processing time.
Define Pre-emptive Scheduling.
Jobs are actively made to start and stop by the OS.
EG MLFQ, SRT, RR
Define Non-Pre-emptive Scheduling
Once a job is started, it is left alone until it is completed.
EG FCFS SJF
How does Round Robin work?
Each job is given a section of processor time (time slice) within which it runs.
Once each job in the queue has used its first time slice, it is given another time slice until a job has been completed.
Completed jobs are removed from the queue.
Round Robin
Pros and Cons
Pros
- All jobs will eventually be attended to.
Cons
- Longer jobs will take a much longer time for completion.
- RR doesn’t take into account job priority
Explain First Come First Served
Jobs are processed in chronological order by which they entered the queue.
First Come First Served
Pros and Cons
Pros
- Straightforward to implement
Cons
- Doesn’t take into account job priority