Unit 2 : Systems Software Flashcards
What is an operating system
● A collection of programs that provide an interface between the user and computer
● Provide the following features:
○ Memory management
○ Resource management eg. scheduling
○ File management
○ Input/ Output management
○ Interrupt management
○ Utility software
○ Security
○ User interface
What does the computer do when it doesn’t have enough memory
● Main memory is often not large enough to store all of the programs being used.
● Paging, segmentation and virtual memory are techniques used by the operating system to ensure memory is shared effectively by programs.
What is paging
● Memory is split up into equal-sized sections known as pages.
● Pages are swapped between main memory and the hard disk as needed.
What is segmentation
● Memory is split up into logical sized divisions, called segments.
● Segments vary in size
● Segments represent the structure and logical flow of the program.
What is virtual memory
- A section of the hard drive acts as RAM when the space in main memory is insufficient to store programs being used.
- Sections of programs not currently being used are temporarily moved into virtual memory through paging.
- This frees up memory for other programs in RAM.
- The key issue with using these techniques is disk thrashing, when the computer ‘freezes’ due to pages being swapped too frequently between the hard disk and main memory.
What are interrupts
● Signals generated by software or hardware to indicate to the processor that a process needs attention.
● Interrupts have different priorities and this is considered when allocating processor time.
● They are stored within an abstract data structure called a priority queue in an interrupt register.
What is the interrupt service routine
● Processor checks the interrupt register at the end of each Fetch-Decode-Execute cycle.
What happens when there is an interrupt with higher priority to the current process
● If there is an interrupt exists with a higher priority to the current process
○ The current contents of the registers in the CPU are transferred into a stack.
○ The relevant interrupt service routine (ISR) is loaded into RAM.
○ A flag is set to signal the ISR has begun.
○ The flag is reset once the ISR has finished.
○ This process is repeated.
What happens If there are no interrupts with a higher priority to the current process
● If there are no interrupts with a higher priority to the current process
○ The contents of the stack are popped back into the registers
○ Fetch-Decode-Execute cycle resumes
What is scheduling
● Operating system ensures all sections of programs being run (known as ‘jobs’) receive a fair amount of processing time using scheduling.
what is pre-emptive scheduling
- Jobs are actively made to start and stop by the operating system. For example: Multilevel Feedback Queues, Shortest Remaining Time, Round Robin
What is non-preemptive scheduling
- Once a job is started, it is left alone until it is completed.
- For example: First Come First Served, Shortest Job First
What is the round robin algorithm
- Each job is given a section of processor time - a time slice - within which it runs.
- Once each job in the queue has used its first time slice, they are given another slice of processor time until a job has been completed
- Completed jobs are removed from the queue.
What are the advantages of the round robin algorithm
- All jobs will eventually be attended to
What are the disadvantages of the round robin algorithm
- Longer jobs will take a much longer time for completion
- Round robin does not take into account job priority or urgency
What is the first come first served algorithm
- Jobs are processed in chronological order by which they entered the queue
What are the advantages of the first come first served algorithm
- Straightforward to implement
What are the disadvantages of the first come first served algorithm
- Does not take into account job priority or urgency
What is the multilevel feedback queue
- This makes use of multiple queues, each which is ordered based on a different priority.
What are the advantages of the multilevel feedback queue algorithm
- Takes into consideration different job priorities
What are the disadvantages of the multilevel feedback queue algorithm
- Difficult to implement
What is the shortest job first algorithm
- The queue storing jobs to be processed is ordered according to the time required for completion, with the longest jobs being serviced at the end.
What are the advantages of the shortest job first algorithm
- Suited to batch systems, as waiting time is reduced
What are the disadvantages of the shortest job first algorithm
- Requires processor to calculate how long each job will take
- Processor starvation if short jobs are continuously added to the queue
- Does not take into account job priority or urgency