1.2.1 Flashcards
The need for, function and purpose of operating systems including (27 cards)
Memory Management
Computers often need more memory than is available and so must efficiently manage the available memory and share it between programs.
Paging
- Memory is broken down into equal sized parts called pages.
- Pages are swapped between main and virtual memory.
Segmentation
- Memory is split up into segments.
- Segments can vary in size.
- These segments represent the logical flow and structure of a program.
Virtual Memory
- Part of the hard drive can be used as RAM.
- Access is slower than RAM.
- Paging is used to move sections which are not in active use into virtual memory.
Interrupts
- A signal generated by hardware or software to tell the processor it needs attention.
- Have different priorities.
- Stored with a priority queue in an interrupt register.
Interrupt Service Routine (ISR)
- At the end of the fetch, decode, execute cycle the interrupt register is checked.
- If there is an interrupt with a higher priority than the current task:
- The contents of the registers are transferred into a stack .
- The appropriate (ISR) is loaded into RAM.
- A flag is set, noting that the ISR has begun.
- The flag is reset when the ISR has finished.
- This process repeats until no more interrupts exist.
Round robin
Each process is allocated a certain time-slice of CPU time (5ms in the example right) .
If the process is still running when the time slice expires it is swapped out and added to the back of the queue.
Round robin pros and cons
Pros
- Avoids process starvation.
Cons
- Can be inefficient if the processor is allocated to a process that
is waiting for input or output eg printer to print.
- Overhead in swapping
- Performance depends heavily on the size of the time quantum
selected. If the quantum is very large (infinite), RR is the same
as FCFS.
First come first served (FIFO)
Processes are allocated processor resources in the order in which they are requested.
First come first served (FIFO) pros and cons
Pros
- Easy to implement with a FIFO queue
- No swapping in and out so no overhead
Cons
- A more important process might have to wait for a less
important one to finish which could crash the system.
- Quick jobs may have to wait for a long job to complete.
- A long process could monopolise the CPU.
- Average waiting time may be long. The average waiting time
under a FCFS policy is generally not minimal, and may vary
substantially if the process burst times vary greatly.
Multi-level feedback queues
- Has a number of queues each assigned a different priority level.
- All processes start in top priority queue (FIFO). Processes on a higher priority queue run first.
- If a process uses up its time allotment, its priority is reduced and it will be moved to a lower-priority queue.
- Using this feedback, processes move between queues.
-To prevent processor starvation, after a set interval, all processes are promoted.
- A MLFQ is the most common general CPU-scheduling algorithm as well as being the most complex.
Multi-level feedback queues advantages and disadvantages
Advantages
- A process that waits too long in a lower priority queue may be moved to a higher priority queue.
- No prior knowledge of the job is needed
- Fair and makes progress for long-running CPU-intensive workloads. - For this reason, many systems including Windows operating systems use a form of MLFQ as their base scheduler.
Disadvantages
- Moving the process around queue produces more CPU overhead.
- How many queues should there be? How big should the time slice be per queue?
-How often should priority be boosted in order to avoid starvation?
Shortest job first
-Process with the estimated shortest execution time takes priority over all others in the system.
-Execution time is evaluated when previous process completes (no pauses)
Shortest job first pros and cons
Pros
-SJF is optimal in that it gives the minimum average waiting time for a given set of processes
Cons
-Problem is there is no way of knowing in advance exactly how long a job will take (guestimates are used).
-Possible that longer jobs never get executed if shorter jobs keep coming in.
-If two jobs take the same time, FCFS is used to determine what goes next.
Shortest remaining time
Process with the shortest remaining time takes priority.
This needs to be evaluated constantly at the end of each time slice often causing pauses as new processes are added.
It can also mean that longer jobs are never executed.
Distributed operating system
- Runs across several devices
- Spreads task load across multiple computers
Embedded system
-Built to perform a specific small task
- Built for a specific device and hardware
- Limited functionality
- Less resource intensive
Multi tasking
-Allows multiple tasks to be completed simultaneously
- Uses time slicing to switch between applications
Multi user
- Several users can use a single computer
- A scheduling algorithm allocates processor time between jobs
Real time
- Performs tasks within a guaranteed time frame
- Used in time critical systems.
BIOS
- Basic Input Output System.
- Runs when a computer first turns on.
-Runs tests then loads the main OS into memory.
- Power On Self Test (POST) makes sure all hardware is connected and functional
- Tests the CPU, Memory and external devices.
Device drivers
- Code which allows the OS to interact with hardware
- Specific to the OS and architecture type
Operating systems
User Interface - to provide an interface between the user and computer (ie, CLI, GUI)
File Management - enables files and directories to be moved, copied, deleted and renamed.
Device Management - manages the system hardware using device drivers
Network management - sharing resources of a remote computer such as files or printers.
Utilities eg Disk defraggers, anti-virus, disk cleaner, system monitor, backups, compression
CPU) Scheduling (process management) allows multiple processes to run in turn using a scheduling algorithm.
Interrupts - runs the relevant Interrupt Service Routine
Memory Management - store the programs and data in use by the system, safely and efficiently
Security eg user access rights, user authentication, file permissions.
What is virtualisation?
Virtualisation refers to the act of creating a virtual (not physically existing as such but appearing so through the software) version of something, including virtual machines for running other operating systems, virtual machines to execute intermediate code and virtual storage.