System Software Flashcards
What is an Operating System
A collection of programs that work together to provide an interface between the user and computer
What are the Functions of the Operating System
- Memory management - paging, segmentation, virtual memory
- Resource management - scheduling
- Utility software - disk defragmenter, backup, formatting
- Security - firewall, passwords
- User interface - allows a person to interact with the computer
What are the Types of Memory Management
- Segmentation
- Pagination (paging)
Explain the benefit of memory management to the user
- Security - each process can only access it’s own memeory
- Multitasking - allows more than once program to run at a time
What is Paging
- Paging is when memory is split up into equal-sized sections known as pages
- Each program is then made up of a certain number of equally-sized pages
- If the computer runs out of main memory then the memory manager swaps the least used pages of main memory to virtual memory to free up space
- However different parts of a program may be on different pages meaning when a program runs to be run all the pages holding a part of that program must be moved back to main memory
What is Segmentation
- Segmentation is the splitting up of memory into logical sized divisions, known as segments, which vary in size
- These segments contain blocks of code such as conditional statements or loops
- If the computer runs out of main memory then the memory manager swaps less used segments of main memory to virtual memory to free up space
- If the less used segment is then required, then the memory manager needs to swap back its segments from virtual memory
Describe the Similarities and Differences between Pagination and Segmentation
Similarities -
- Both are a way of dividing memory
- Neither physically divide memory they are just a way of managing memory efficiently
- Both are managed by the memory manager
Differences -
- Paging is only used if virtual memory is needed but segmentation is always used
- A page is a fixed size but segmentation varies
- Pages are contiguous blocks of memory addresses whilst segments are not
What are the Possible Problems of Memory Management
- Disk thrashing - when pages/segments are being swapped too frequently between virtual memory and main memory so the computer ‘freezes’
- Stack overflow - when a computer program tries to use more memory space than the call stack has available
What is an interrupt
A signal generated by software or hardware to indicate to the processor that a process needs attention
In what order and where are interrupts stored
Interrupts are stored in order of their priority within an interrupt register
Where can an Interrupt Signal come from
- Software program - when an application program terminates or needs to requests certain services from the operating system
- Hardware interrupt - when a signal is sent due to the device drive or external drive
- Internal Clock Interrupt - when interrupts are triggered regularly by a timer, to indicate that it is the turn of the next process to have processor time (example of multitasking)
Explain the stages of the Interrupt Service Routine
- Interrupt register is checked at the end of each Fetch-Execute cycle
- If there is an interrupt that exists with higher priority than 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 and deals with the interrupt
- Interrupt register checked again. If interrupts are higher priority, the process is repeated,
- If there are no interrupts with a higher priority, the contents of the stack are popped and placed back into their registers
- The Fetch-Execute cycle renews as before
Describe the Different Types of Scheduling Alogrithms
- FCFS (First Come First Served) - jobs are processed in the order they arrive
- Round Robin - each job is given a limited time slice/quantum (time with the CPU) so if a job is not completed by the end of its time slice, it returns to the back of the queue
- Shortest Job First - the jobs are ordered according to the time required for completion, with the longest jobs being serviced at the end, the job with the smallest estimated time to finish is run next
- Shortest Time Remaining - the jobs are ordered according to completion time, jobs that arrive with a shorter completion time then the current job are dealt with first
- Multilevel Feedback Queue - different queues are created that uses different schedulling algorithms, each of which is ordered based on different priority and jobs can move between queues depending on their priority
Describe the Advantages and Disadvantages of each Scheduling Algorithm
FCFS (First Come First Served) -
- Advantages - straightforward to implement and will definitly complete
- Disadvantages - does not allocate processor time based on priority
Round Robin
- Advantages - ensures that every task is allocated processor time without a long wait
- Disadvantages - does not allocate processor time based on priority and does not scale well
Shortest Job First
- Advantages - suited to batch systems (shorter jobs are given preference)
- Disadvantages - requires the processor to know or calculate how long each job will take and this is not always possible and a risk of processor starvation if short jobs keep getting added
Shortest Time Remaining
- Advantages - suited to batch systems (shorter jobs are given preference)
- Disadvantages - requires the processor to know or calculate how long each job will take and this is not always possible and a risk of processor starvation if short jobs keep getting added
Multilevel Feedback Queue
- Advantages - allocate processor time based on priority
- Disadvantages - very hard to implement
What is processor starvation
When a particular process does not recieve enough processor time in order to be execute and be complete