1.2.1 System Software pt 1 Flashcards
Operating System
A collection of programs that interact to provide an interface between a user and the computer
Do you interact with the OS?
Only via applications
OS Functions
User interface, memory management, interrupt management, processor scheduling
What does a user interface do?
Hides the complexity of the hardware by providing an interface for the user to interact with
4 types of user interface
Graphical User Interface
Command Line Interface
Menu-based Interface
Voice Interface
Graphical User Interface (GUI)
A computer interacts with a series of graphics
e.g. iPhones
Convenient, easy to use, intuitive
Command Line Interface
The user has a command line they can use
e.g. Command window in windows OS
Text-based, more power to use more commands, can use batch processing
Menu-based Interface
The user can interact with a series of menus
e.g. ATM/PIN machine
Secure, limited functions, easy to use
Voice Interface
You interact using your voice
e.g. Amazon Alexa/ google home
Can interact anywhere, easy, hands-free
Paging
- Memory is divided into fixed-size chunks (pages)
- Each process is allocated x amount of pages - still 1 page if less than page size but may not be contiguous
- A page table maps logical memory and physical memory location
Contiguous
Where all the memory for a process is next to each other
Paging advantages and disadvantages
+ Improves efficiency of space as data can be stored in all available space
- A whole page may not be full with a process
- Can increase reading time as data is separated
Segmentation
Memory is divided into segments which can be of different lengths
All segments of the same process are contiguous
Could relate to part of a program
Segmentation advantages and disadvantages
+ All memory for a process is together
- The remaining space may be smaller than the size of the segment required
- Swapping is more difficult
Virtual Memory
An area of the hard disk drive is designated as virtual memory
Some current pages are stored there if RAM is full and are swapped back in when needed
Swapping
Moving pages between RAM and Virtual Memory
Disk Thrashing
Repeatedly swapping pages can slow down the computer as more time is spent swapping pages than running code
Interrupt
- A signal to the CPU that something needs dealing with
- Can be sent by software, hardware or internal clock
- Stored in a priority queue
Parity Error
An error caused by irregular changes in data - caused by electromagnetism
Arithmetic Overflow
Where the answer to the calculation is bigger than the memory space available e.g. /0
Buffer
A region of memory to temporarily store data
Interrupt cycle
- F/D/E
- Are there any higher priority interrupts to be processed? No- F/D/E again
- Push registers on memory stack
- Load interrupt service routine into program counter and sets a flag to show the ISR has begun
- F/D/E on interrupt
- Are there any higher priority interrupts to be processed? No- pop register data off of the stack
How do interrupts work?
They have different priorities and are processed in order of priority
Interrupts can be interrupted if a new interrupt has a higher priority
What happens if an interrupt is interrupted?
The registers for the interrupt are also pushed onto the stack
They are retrieved on a last-in first-out basis
Why is scheduling needed?
A single-core CPU can only process instructions for one application at a time so the OS must schedule when each process uses the CPU
Pre-emptive
The job that is running can be interrupted
What is scheduling used for?
a) Provide an acceptable response time to all users
b) Maximise the time the CPU is fully engaged
c) To ensure fairness on a multi-user system
Round Robin (RR)
Each process is allocated a maximum amount of processor time, at which stage it is put back on the ready queue
Very inefficient for long jobs
Pre-emptive
First-come First-served (FCFS)
The first job to enter the ready queue is the first to enter the running state
Not pre-emptive
Shortest remaining time (SRT)
The ready queue is sorted based on how long each time each process has left, with the shortest running
The time for each process only has to be estimated when it enters the queue
Pre-emptive
Shortest job first (SJF)
The user estimates how long each job will take and the shortest is run to completion
Suited to batch systems
Non pre-emptive
Multilevel Feedback Queues (MLFQ)
- Multiple queues are created with different priority levels - jobs move between as their priority changes
- Jobs move down if they have uses up a lot of CPU time or up if they haven’t been recently used
- Pre-emptive
Starvation
Where a job has to wait a long time before it gets running on the CPU
Fragmentation
When memory or storage is used inefficiently, reducing capacity or performance
Intermediate code
Code between machine code and object code, independent of the processor architecture. Used to create a development environment to test programs