Chapter 7 - Functions of an operating system Flashcards
What are some functions of the operating system?
» Hardware
» User interface
» Memory management
» File management
» Multitasking
» Scheduling
What is a helpful acronym to remember the functions of the operating system?
» MUSH FM
What is multitasking?
2 marks
» When you have more than one program open and running at the same time
» Processor allocates a small amount of time to each process and cycles between them
What is user management?
» Allows multiple users to log into the same computer
» OS will retain settings for each use
What is WIMP?
» Windows
» Icon
» Menus
» Pointers
What is an operating system?
» A collection of programs that work together to provide an interface between the user and the computer
» Manages the computer’s hardware
What is the user interface?
» The means by which the computer and user interact
» Can be a commmand line interface
» Can be a GUI interface
Where is the OS held?
» On the hard disk
How does is the OS loaded into RAM?
» Small program called loader which is in ROM sends instructions to load operating system by copying it from storage into RAM
Why is memory management needed?
2 marks
» Protects programs from each other, such as being overwritten
» To enable memory to be shared
» To rellocate memory when necessary
How does the operating system manage memory management?
» Memory is used efficently - program that are being used need to be stored in memory without space being wasted
What are the 2 ways in which memory can be split?
» Paging
» Segmentation
What is paging?
3 marks
» Memory is split into equal-sized sections known as pages
» Can be swapped between main memory and the hard disk as needed
» Pages are physical divison that are made to fit sections of memory
What is segmentation?
3 marks
» Splitting up of memory into logical sized divisions known as segments
» Segments are different sizes
» Segments are complete sections of programs
When is virtual memory needed?
» When there is insufficient memory space in RAM to store prgorams
Which is more expensive, RAM or secondary storage?
» RAM
How does virtual memory work?
» Uses a section of the hard drive to act as RAM
» Sections of program that are not currently in use are temporarily moved into virtual memory through paging.
» Pages are swapped to main memory when required
What is disk thrashing?
» When the computer slows down
» Due to pages being swapped too frequently between the hard disk and main memory
» As a result more time is spent transferring these pages, then actually running the program
What is an interrupt?
» Signals generated by software or hardware to indicate to the processor that a process needs attention
What is the interrupt Service routine?
» Program code that is called when an interrupt is called
» Checks to see the priority of the interrupt
What is a priority queue?
» Stores the interrupts in order of their priority
When does the processor check the contents of the interrupt?
» At the end of each FDE cycle
What are the steps of the ISR when the priority is higher priority then the process being executed?
» Contents of the program counter and other special purpose registers are copied transferred to a stack
» Relevant ISR can be loaded by changing the program counter to the locaiton of the ISR in memory
» When ISR is complete, previous values of the program counter and other registers can be restored by popping the stack
What happens when an interrupt is being services a new higher priority interrupt is raised?
» The interrupt currently being services is also added to a stack in memory and the new interrupy is serviced
What is loaded in when the stack is popped?
» Retreive the previous values for the orignal program
» Carry on executing the original program where we left off
What is a problem of paging?
» It could sperate the instructions inside a lopping condition so they are in different pages - very inefficient
What are 3 similarities between paging and segmentation?
» Both allow programs to run despite insufficient memory
» Both are stored on a disk
» Pages and segments are transferred in to memory when needed
What are 3 differences between paging and segmentation?
» Pages are fixed size. Segments are different sizes
» Pages are made to fit sections of memory. Segments are complete sections of memory
» Pages are physical divisions. segments are logical divisions
What are 3 example of hardware interrupts?
» Power supply failure
» Power/reset button pressed
» Power down command - screen off
What are 3 example of user interrupts?
» Moving the mouse
» Clicking/ tapping an icon to open a new program
» Keyboard presses
What are 3 examples of software interrupts?
» illegal instruction encountered
» Arithmetic overflow
» New log-on request
What is an example of timer interrupts?
» Screen - recording application
What is an example of a input/output device interrupt?
» Buffer nearly empty
What does a scheduler manage?
2 marks
» To process as many job as possible in the least amount of time
» Ensure all jobs are processed fairly - to maximise number of processes with fast respons times
How does scheduling work?
» Process enters the ready queue
» Then enters the running state
» From here it will finish executing completely
» Get blocked, as it requires an input/ouput command
How does scheduling work?
» Process enters the ready queue
» Then enters the running state
» From here it will finish executing completely
» Get blocked, as it requires an input/ouput command
How does scheduling work?
» Process enters the ready queue
» Then enters the running state
» From here it will finish executing completely
» Get blocked, as it requires an input/ouput command
What is First come first serve scheduling?
3 marks
» Processes are executed in the order they arrive
» If a process takes a long time, the others behind it simply have to wait
» The time the different process take to execute is irrelevant
What is the short job first?
2 marks
» Picks the process that take the shortest amount of time and runs them until they finish
» Scheduler needs to know how long each process will take
What is round robin?
3 marks
» Each process is allocated a fixed amount of time - known as time slice - or quantum
» If the process is not complete by the end of its time slice, it returns to the back of the ready queue
» Repeats until all users serviced
» Time slices are fractions of a second
What is shortest remaining time?
» The scheduler estimates how long each process will take
» Picks the one that will take the least amount of time
» It is pre-emptive
What is pre-emptive?
» This means that if hasnt completed after a certain amount of time, the scheduler checks to see whether any shorter processes have been added, if so it switches to them
What is a multi-level feedback queue?
» If the computer has more tha none processer or processor core - it can handle more than one process queue at a time
» Different queues have different level of priorities
» Scheduler can move jobs between the different queues as needed
What is processor starvation?
» When a particular process does not receive enough processor time in order to execute and be completed
» Occurs in shortest job first
Explain why the first come first sever method may not be efficient?
2 marks
» Once a job starts it prevents another job from being processed
» A job using a slow resource wastes processor time
Explain why scheduling is necessary?
4 marks
» Process as many jobs as possible
» In the least amount of time
» Ensure all jobs are processed farily
» Efficient use of resources/processer time
» Prevent processes from being starvated
Describe how virtual memory is used?
» Use of secondary storage as it if was main memory
» Swap pages between memory and secondary storage
Explain why interrupts are used in a computer system?
2 marks
» To obtain processor time
» For a device that needs to be serviced
» To avoid delays
Give one example of an interrupt that allows the job to be resumed after the system has serviced the interrupt?
» User interrupt - e.g new long on request