Unit 2.1 Flashcards

1
Q

Why Do we need Operating Systems?

A
  • Operating Systems manage the hardware and software resources of a computer system.
  • They provide an interface between the user and the hardware, allowing the user to interact with the system and run applications.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main functions of operating systems?

A
  • Resource Management
  • File Management
  • Interrupt handling
  • Security
  • Providing a platform software to run
  • Providing a user interface
  • Providing utilities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is recourse management?

A
  • Operating systems manage the computer’s resources, including the CPU, Memory and disk drive.
  • The allocate resources to specific tasks and ensure that they are used effectively
  • e.g. when a user opens multiple applications, the operating systems decides:
    > How much memory to allocate to each application
    > When and for how long each gets to use the CPU
    > How to handle data being read from or written to the hard drive.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is file Management

A
  • Operating systems handle the storage, retrieval, and manipulation of data files.
  • When working with files, operating systems provide a GUI of the file system that allows a user to decide which directory a file should be saved in and what the file name will be.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is interrupt handling?

A
  • Interrupt events require the immediate attention of the processor.
  • In order to maintain the smooth running of the system, interrupts must be resolved in a timely manner.
  • e.g. if a user clicks cancel on a file conversion process, a signal is sent from the mouse, interrupts the processor and the operating system will trigger the cancellation routine.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is security?

A
  • Operating systems provide security features such as password-protected system accounts, a firewall, virus scanning and file encryption.
  • Password-protected system accounts are a very common feature in operating systems.
  • System accounts can also be restricted from performing certain actions, e.g. editing network settings, installing unapproved software, changing the account settings of other users.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Providing a platform for Software to run?

A
  • Operating systems provide a platform on which application software can run, this is mainly by allowing software access to system resources
  • e.g. if a computer game has intensive graphics and online play, the operating system will grant it access to the GPU and the network card
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Providing a User Interface?

A
  • Operating systems provide interaction in 2 ways: visually through a graphical user interface (GUI) or text-based through a command-line interface (CLI)
  • Most modern PC operating systems provide both options, and a user will prefer one over the other depending on the task
  • Mobile operating systems such as Android and iOS provide GUIs that are suitable for interaction through touch
  • Ubuntu is an OS popular with software engineers because it provides a no-frills GUI and an efficient CLI
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Providing Utilities?

A
  • Utility programs help with system maintenance and security
  • Some utility programs include: file encryption, file compression, disk defragmentation, system backup, disk cleanup
  • File encryption allows users to send files over networks securely
  • File compression reduces the size of a file, which helps send large files over a network
  • Disk defragmentation physically reorganises files on the hard disk so they can be found and accessed faster
  • Disk cleanup scans the hard disk for duplicate and corrupt files and deletes them to create more space on the disk
  • Backup software allows users to restore their system to a point in history
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Memory Management?

A
  • Memory management is a fundamental role of the operating system, dealing with the allocation and deallocation of the computer’s primary memory
  • When a user opens an application, its data is loaded from storage into active memory so that it can run smoothly
  • When a user opens a file from the file system, e.g. word document, the CPU loads this file data, as well as application data, into the primary memory
  • Primary memory is a limited resource in the system, so it needs careful management
  • Efficient allocation of memory enables a system to continue multitasking
  • Memory management is made more efficient through 3 techniques:

> Paging

> Segmentation

> Virtual Memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Paging?

A
  • Data stored in memory will lead to the smooth running of applications
  • Paging is a method of chunking the primary memory into equal-sized blocks
  • When an application is launched, data will be moved from the hard disk into Pages for faster access
  • As users move between applications, memory is dynamically allocated
  • Pages will be taken away from applications not in active use and granted to applications that are in active use
  • Paging can lead to internal fragmentation
  • If a 200KB file is divided into four 64KB Pages, the last Page would have 8KB of unused space
  • Unused space in a Page is wasteful because other unrelated data cannot be stored in this Page
  • Over time, more pockets of wasted space will exist across the memory; this process is called internal fragmentation
  • The image below shows a single 64KB Page with 4KB of unoccupied space
  • The box below this shows many Pages, each with varying sizes of internal fragments
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Segmentation?

A
  • Segmentation is a method of chunking memory into blocks that correspond to different types of data needed by an application
  • A video editing application may have a Segment for video data, audio data and special effects
  • Segments are not all the same size; they are sized depending on their allocated data
  • Segmentation is space-efficient due to only allocating space depending on the amount an application needs
  • Segmentation can lead to external fragmentation
  • As Segments fill up the memory, physical gaps reduce the maximum size of new Segments that can be allocated
  • Below (left) shows different application data assigned to a Segment
  • The arrangement of data in the segment becomes more fragmented over time because as blocks are taken away it’s not possible to guarantee a new block will occupy the same amount of space
  • Below (right) shows a defragmented version of the Segment to highlight the total unused space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Virtual Memory?

A

If a computer is running low on primary memory, it can make secondary storage act as an ‘extension’ of the main memory

The operating system can offload data from the primary memory into virtual memory

Virtual memory creates an illusion of a larger memory and enables applications to continue to multitask

However, accessing data in virtual memory is considerably slower compared to RAM

Solid-state drives are faster than traditional hard-disk drives, but neither are as fast as RAM

Over-reliance on virtual memory can lead to performance issues

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are interrupts?

A
  • An interrupt is a signal to the processor that stops its current task and performs a different task temporarily
  • Interrupts can be hardware events or time-sensitive tasks
  • When an interrupt occurs, the processor suspends the current program execution and transfers control to an interrupt service routine
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the Purpose and Role of Interrupts?

A
  • Real-time Event Handling: hardware errors and signals from input devices e.g. hard disk failure
  • Device Communication: alerts from external devices e.g. printer jams and network errors
  • Multitasking: suspending processing in one application so that the user can switch to another
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Explain The Interrupt Process:

A

Interrupt Request (IRQ)

  • An external device or software generates an interrupt, signalling the processor to stop its current task
  • The interrupt controller passes this to the interrupt handler for assessment

Interrupt Acknowledge

  • The interrupt handler decides if the interrupt needs to be dealt with now or later
  • If yes, the current contents of the processor registers are saved in memory

Interrupt Service Routine (ISR) Lookup

  • The processor fetches the corresponding Interrupt Service Routine (ISR) associated with the interrupt type

ISR Execution

  • The processor transfers control to the ISR and executes the routine to handle the specific interrupt

Interrupt Exit

  • After the ISR completes, the processor restores the content of the registers from step 2
  • The fetch-decode-execute cycle is resumed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is an ISR?

A
  • An ISR is a special function that handles a particular interrupt type
  • Each type of interrupt has a corresponding routine, e.g. printer jam, hard disk failure, file download error, network connection error all have routines to be followed when they happen
  • ISRs should be concise, efficient, and carefully designed to minimise the time taken to execute, as they often need to handle time-sensitive events
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Interrupt priority and nesting

A
  • Interrupt prioritisation means the processor can acknowledge and switch to resolving a higher-priority interrupt
  • Prioritising interrupts is vital because many things can go wrong at the same time
  • Lower-priority ISRs may be temporarily suspended until the higher-priority ISR completes the execution
  • Nesting of interrupts refers to the ability of the processor to handle interrupts within interrupts
  • Proper management of nested interrupts avoids potential conflicts and ensures system stability
19
Q

What is Scheduling?

A
  • Deciding which tasks to process, for how long, and in what order is achieved through scheduling algorithms
  • A CPU is responsible for processing tasks as fast as possible
  • Different algorithms are used to prioritise and process tasks that need CPU time
  • The algorithms have different uses, benefits and drawbacks.
20
Q

What is Scheduling categories?

A
  • Pre-emptive: allocates the CPU for time-limited slots
  • Non-pre-emptive: allocates the CPU to tasks for unlimited time slots
21
Q

What is Pre-emptive Scheduling?

A
  • Allocates the CPU for a specific time quantum to a process
  • Allows interruption of processes currently being handled
  • It can result in low-priority processes being neglected if high-priority processes arrive frequently
  • Example algorithms include Round Robin and Shortest Remaining Time First
22
Q

Non-Pre-emptive Scheduling?

A
  • Once the CPU is allocated to a process, the process holds it until it completes its burst time or switches to a ‘waiting’ state
  • A process cannot be interrupted unless it completes or its burst time is reached
  • If a process with a long burst time is running, shorter processes will be neglected
  • Example algorithms include First Come First Serve and Shortest Job First
23
Q

Explain Round Robin (RR)?

A
  • RR is a pre-emptive algorithm, equally distributing processor time amongst all processes
  • Each process is given a time quantum to execute
  • Processes that are ready to be worked on get queued
  • If a process hasn’t been completed by the end of its time quantum, it will be moved to the back of the queue
24
Q

Explain First-Come-First-Served (FCFS)?

A
  • FCFS is non-pre-emptive, prioritising processes that arrive at the queue first
  • The process currently being worked on will block all other processes until it is complete
  • All new tasks join the back of the queue
25
Q

Explain the Multi-Level Feedback Queue (MLFQ):

A
  • MLFQ is a pre-emptive priority algorithm where shorter and more critical tasks are processed first
  • Multiple queues are used so that tasks of equal size are grouped together
  • All processes will join the highest priority queue but will trickle down to lower priority queues if they exceed the time quantum
26
Q

Explain the Shortest job first (SJF)

A
  • SJF is non-preemptive, where all processes are continuously sorted by burst time from shortest to longest
  • When new processes arrive - on the queue, they are prioritised based on their burst time in the next cycle
  • Shorter jobs are placed at the front of the priority queue
  • Longer jobs have lower priority, so they are placed at the back
27
Q

Explain: Shortest remaining time first (SRTF)

A
  • SRTF is a pre-emptive version of SJF, where processes with the shortest remaining time are higher priority
  • Time quantum is set, and if a task doesn’t complete in time, it will be re-queued for further processing
  • Before the next cycle starts, all processes are inspected and ordered by the shortest remaining time to complete
28
Q

What is an OS?

A

-An operating system (OS) is a fundamental software that manages the computer hardware, provides common services for computer programs, and acts as an interface between users and the machine

-There are several different types of operating systems, each with unique characteristics and purposes

  • Understanding these types is essential for both developing and using computer systems
29
Q

What are Distributed Operating Systems?

A

Run on multiple machines appearing as a single unit, used for efficient task distribution and load balancing

30
Q

What Embedded Operating Systems?

A

Designed for specific tasks, is the system running inside a device that is not primarily a computer system, e.g. microwave, dishwasher, washing machine

IoT Internet of Things: a term used to describe everyday objects that are connected to the internet, e.g. dishwashers, refrigerators, smart TVs, smartwatches

31
Q

What Multi-tasking Operating Systems?

A

Allows multiple tasks to run concurrently on a single processor, manages system resources and allocates CPU time to different processes

32
Q

What Multi-user Operating Systems?

A

Supports multiple users accessing computer resources concurrently, efficiently manages resource allocation, and provides features for data security and user privacy

33
Q

What are Real-Time Operating Systems (RTOS)?

A

Designed for immediate data processing, and can ensure tasks are processed in specific timeframes, highly efficient

34
Q

Give examples of Distributed Operating Systems:

A

Hadoop is an open-source OS designed to process big data using multiple nodes in a distributed network.

35
Q

Give examples of Embedded Operating Systems:

A

IoT devices and many household devices contain embedded OS. These devices don’t typically run a well-known OS. They run a proprietary OS that has a simple set of functions.

36
Q

Give examples of Multi-Tasking Operating Systems:

A

Windows, MacOS, and Linux are multi-tasking OS that can run multiple applications simultaneously.

37
Q

Give examples of Multi-User Operating Systems:

A

Windows, MacOS, and Linux are multi-user OSs where multiple users can log in and run independent processes.

38
Q

Give examples of Real-Time Operating Systems:

A

Real-time OS are used in industries like aerospace and automotive where low latency is critical to safety.

39
Q

What does BIOS mean?

A
  • BIOS stands for Basic Input/Output System
  • BIOS is a piece of firmware stored on a small memory chip on the motherboard
  • On system start, the BIOS is the first software to run
  • It performs a POST (Power-On Self-Test), a diagnostic testing sequence that ensures all the hardware components are working properly
  • If the BIOS encounters any errors during this test, it will either halt the boot process or issue an error message
  • If the POST succeeds, the BIOS will run the Bootstrap loading sequence, which is the program responsible for starting the operating system
40
Q

What is a Device Driver?

A
  • A device driver is a piece of software that enables communication between an operating system and specific hardware devices such as:

> Printers

> Graphics cards

> Network cards

  • Device drivers allow the OS to control and interact with those devices
  • Because many external devices have embedded system software, a driver bridges the gap between a major operating system and a tiny hardware OS
  • Device drivers make it possible to perform specific operations on the hardware e.g. a printer driver enables the OS to send print commands and manage print jobs
  • Most hardware manufacturers write their own device driver software, meaning a single operating system may have several printer drivers installed
41
Q

What are virtual machines?

A
  • Virtual machines (VMs) are entire operating systems running inside another operating system
  • A user running Windows 11 could run a virtual machine of MacOS
  • This would allow them to navigate the GUI of MacOS and install software on it
  • Running a virtual machine helps access software that is only designed to run on specific operating systems
  • VM management software includes a Hypervisor that monitors all activity happening inside the VM
42
Q

What is Cross-platform and forwards compatibility?

A
  • Not all software is designed to run on all operating systems
  • Apple commonly makes software that only runs on MacOS for performance reasons
  • A Windows user could run a virtual machine of MacOS and install the software they need
  • Most software needs to be updated to work on the latest versions of operating systems
  • A user running the latest release of Windows may need to run a virtual machine of a previous release of Windows to use an application that hasn’t received a forwards-compatibility update
43
Q

How are VMs used In software testing?

A
  • VMs are a way to create isolated test environments, that leave the host operating system unaffected
  • Isolated environments allow a developer to:
  • Monitor the way their software affects system performance
  • Test on a clean-slate system, while no other applications are running
  • VM management software can create virtual machines that act like they have older hardware
  • This allows developers to build software that can be run on older hardware so that more users can use the software
  • A developer can test against various operating systems, such as MacOS, Linux and Windows, for greater compatibility
  • This is achieved through compiling into intermediate code and running against different operating systems
44
Q

Consequences of VMs.

A

V- Ms share the same system hardware as the host OS

  • Over-use of VMs can exhaust the host OS of the system of CPU, hard disk and memory

> VM software such as VirtualBox can set maximum limits on system resources

> A low-specification machine could be configured to allocate only 1GB of memory and 20% of CPU

> A high-specification machine could afford up to 8GB of memory and 50% of the CPU

  • Operating systems are commonly free to download, but require an activation payment to access all features