Unit 2 Lesson 1 - OS Functions Flashcards
What is an Operating System?
Software to manage communication with computer hardware.
Manages the hardware and provides an interface for the user and application software.
What functions does the Operating System provide?
User Interface
Memory Management
Interrupt Handling
Processor Scheduling
What is Memory Management via Operating System?
The Operating System handles allocation of RAM to the different programs.
There may not be sufficient RAM for all desires processes o be completely loaded into RAM at once
What is Paging?
When available memory is divided into fixed sized chunks called “pages”.
Each page has an address
A process loaded into RAM is allocated sufficient pages, but those pages may not be Contiguous (next to each other) in physical terms
What is Segmentation?
Memory is divided into segments which can be different lengths.
Could refer to parts of a program e.g: a function / subroutine may occupy a segment
What is Virtual Memory?
An area of the Hard Disk which is designated as Virtual Memory.
It is a memory space which is used when RAM is full.
Pages can be put into Virtual Memory until they are needed in which they are put back into RAM
What can disk thrashing happen by using Virtual Memory?
If many processes are running and computer has insufficient RAM, lots of time is spent swapping pages in and out of virtual memory
Repeatedly swapping pages in and out RAM can noticeably slow down the computer
This is known as Disk Thrashing
Interrupts & Examples
The CPU must be able to be interrupted when necessary.
Interrupts can be sent to CPU by software, hardware devices or CPU’s internal clock.
The CPU checks at the end of each clock cycle whether there are any interrupts to be processed
Examples:
Power Failure
Error in a program
Scheduled interrupt from internal clock
What happens when an interrupt is detected?
The processor stops fetching instructions and instead pushes the current contents of its registers onto a stack.
The CPU uses an interrupt service routine to process the interrupt
What is Interrupt Priority?
Interrupts have different priorities. Interrupts will be processed in order of priority.
Interrupts can be interrupted if new interrupt has higher priority.
What happens when an interrupt is interrupted?
When a higher priority interrupts occurs while an interrupt is being processed, the original interrupts registers is pushed onto the stack as well.
What is Processor Scheduling?
A CPU can only process instruction for one application at a time.
The Operating System must schedule when each application can use the CPU.
Gives illusion of multi-tasking (multiple applications running simultaneously)
What are the aims of processor scheduling?
To provide acceptable response times for all users
To maximise time the CPU is usefully engaged
To ensure fairness on a multi-user system
What is Round Robin scheduling?
What is First Come First Served scheduling?
What is Shortest Remaining time scheduling?
What is Shortest Job First scheduling?
What are Multi Level Feedback Queues?