Unit 2 - Systems Software Flashcards
What are the tasks of the OS? (5)
- Managing processor: chooses which process to execute and handles interrupts
- Managing memory: uses paging and segmentation
- Manages peripherals: uses device drivers to communicate with hardware
- Manages security: accepts/denies requests to access resources connected to the computer
- Provides networking: communication through protocols to other devices
What are the differences between paging and segmentation? (3)
- Paging divides memory into fixed-size chunks called pages; segmentation divides memory into varied-length chunks called segments.
- Pages are made to fit sections of memory; segments are complete sections of programs
- Pages have physical divisions; segments have logical divisions
Explain how virtual RAM works.
- When the main memory is full
- Programs that are not currently in use
- Are sent to a section of secondary storage through paging
- To free up space in the main memory for other programs
What is disk thrashing?
- When the computer slows down from pages being swapped too frequently between secondary storage and main memory.
What is an interrupt and what are the types of interrupt?
- Interrupts are a signal sent by a device via the control bus to the CPU to indicate that it requires attention
- Hardware interrupt: power/reset button is pressed or memory is corrupted
- Software interrupt: illegal instruction encountered, arithmetic overflow, new log-on request
- Input/Output: buffer nearly empty, signal the completion of data to/from a device
What is the memory stack?
- A stack located in memory
- Which holds the contents of the register when an interrupt is detected
- Contents are reloaded back into the registers in a FILO order
- If a higher-priority interrupt is detected while another interrupt is being processed, the contents of the registers for the lower-priority interrupt is also pushed to the memory stack
Explain the different types of scheduling.
- Round Robin: each job is allocated an equal time slice by using a FIFO order during which it can use the CPU’s resources
- First Come First Serve: jobs are executed in the order they arrive
- Shortest Job First - the processor picks the job that the scheduler knows will take the least amount of time and processes it until it is completed
- Shortest Time Remaining: switches to and runs the job the scheduler knows will take the least time. If a shorter process arrives, it will switch to it.
What are the differences between open-source and proprietary software?
- Open source is usually free; proprietary is usually not free
- Open source is less secure; proprietary is more secure
- Open source allows users to see and modify source code; proprietary hides source code from users
- Users own the open source code once they obtain it; users only own a licence to the source code when purchasing propriety software
What are the differences between interpreters and compilers?
- Interpreters execute lines sequentially until they hit an error; compilers cannot execute if there is an error in the code
- Compilers translate high-level code to an executable file written in object code
- Once compiled, high-level code does not need to be recompiled to be run; high-level code must be interpreted each time it is run
Explain the 4 stages of compilation.
Lexical Analysis:
1) Whitespace is removed
2) Code is tokenised
3) Symbol table is created
Syntax Analysis:
4) Syntax is checked against language rules
5) Abstract syntax tree created
6) Errors are generated
Code Generation:
7) Syntax tree is converted to object code
Code Optimisation:
8) Code is optimised, redundant code is removed