1.2.1 Systems Software Flashcards

1
Q

What’s an Operating System (OS)?

A
  • Software that controls the computer’s hardware and software resources.
  • It allows applications to interact with hardware on a computer.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the functions of an OS?

A
  • Providing a platform for software to run
  • Processor scheduling
  • Handling Interrupts
  • Memory Management
  • Secondary Storage Management
  • Input/Output Device Management
  • Provides the user interface
  • Security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

*What is meant by processor scheduling? (OS)

A

It determines the order in which processes will be executed, allowing for multi-tasking

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

*What is meant by handling interrupts? (OS)

A

It deals with requests that disrupt the processor’s work

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

*What’s meant by memory management? (OS)

A

Records how memory in the computer is divided and identified so that memory is allocated efficiently between processes that are running

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

What’s meant by secondary storage management? (OS)

A

Tracks where files and programs are stored and which parts are available for storage, and managing files and folders based on user permissions

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

What’s meant by input/output device management? (OS)

A

Ensures efficient communication with devices and managing functionality issues

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

How does the OS manage memory?

A
  • Instructions and data initially stored on non-volatile media (e.g. hard disk), they’re then loaded to the main memory for data to be processed and instructions to be executed
  • (*)They handle multiple memory management operations, such as:
    - Tracking the status of memory and allocation (DC4(???))
    - Determining storage requirements
    - Controlling memory usage
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Tracking status of memory allocation

A
  • Memory divided up into physical address spaces initially marked as free
  • OS loads data into these spaces and marks them as allocated
  • When data/instructions no longer needed, OS marks them as free again
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Memory Allocation Techniques

A
  • Paging
  • Segmentation
  • Virtual Memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Logical Address Space

A
  • A series of logical addresses are produced when a program is executed
  • The total of these logical addresses makes up the logical address space of that process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Paging

A

PHYSICAL divisions

  • Available memory physically divided into fixed sized chunks called pages
  • Each page has an address
  • Process loaded into RAM gets allocated sufficient pages (these may not be next to each other)

A page table is used to map between the locations of the logical memory and physical memory

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

Benefit of paging

A

Allows data to be stored in a non-contiguous manner (means pages of the same process don’t need to be stored together, but instead allocated to any free space)

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

Segmentation

A

LOGICAL divisions

  • Memory divided into segments of variable lengths
  • Segments can relate to parts of a program (e.g. a particular function or subroutine may occupy a segment)

Segment table used to record where each segment required for a process is located

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

Segmentation Vs. Paging

A

Similarities
- Allows programs to run despite insufficient memory
- Pages and segments stored on disk
- Pages and segments transferred to memory when needed

Differences
- Pages are fixed sizes, segments have variable size
- Pages are made to fit sections of memory, while segments are complete sections of program

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

Virtual Memory

A
  • An area of the hard disk can be allocated as virtual memory if there’s insufficient space space in RAM
  • Some pages of a current process are stored in virtual memory and swapped out when needed
  • If too many processes are running with insufficient RAM, lots of time is spent swapping pages in and out of virtual memory
    - Repeatedly swapping pages can cause the computer to noticeably slow down, also known as disk thrashing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Interrupts

A

A signal that is sent to the processor to request immediate attention. When it receives this request, it suspends what it’s doing and runs the process associated with the signal.

CPU checks for interrupts at the end of each clock cycle

Examples:
- Power failure
- Scheduled interrupt from internal clock
- Hardware error occurs
- I/O device sends an interrupt signal

18
Q

Interrupt Service Routine (ISR)

A
  • A mini program that’s designed to respond to an interrupt’s request.
  • They can be built into an operating system or provided via device drivers
19
Q

Interrupts in the FDE cycle

A
  1. Processor receives interrupt
  2. Processor completes FDE cycle of instruction it was running at time of interrupt
  3. Contents of the processor registers saved to memory
  4. Origin of interrupt identified so appropriate ISR can be called (other low-priority interrupts put on hold to allow ISR to finish running)
  5. PC updates with address of first ISR instruction and ISR completes its execution
  6. Registers are reloaded with values from memory
  7. Lower-priority interrupts put on hold are re-established
  8. PC set to point to address of next instruction to be executed from previously running program
20
Q

Processor Scheduling

A
  • Single CPU can only process instructions for one application at a time, so the OS must schedule when each app can use the CPU
    • This provides the illusion of multi-tasking
21
Q

Aims of Scheduling

A
  • Provide an acceptable response time to all users
  • Maximise time CPU is fully engaged
  • Ensure fairness on a multi-user system
22
Q

Round Robin

A

Preemptive method

- Each program allocated a time slice (via FIFO) during which it can use the CPU's resources
- If it's not complete when its time's up, it stops running and the computer switches to the next allocated process

Pro: Ensures every task is allocated time without a long wait

Con: Doesn’t scale well - as more processes run, time slices get smaller meaning tasks are less likely to be completed quickly

23
Q

First Come First Served

A

First program to arrive is executed until completion.

Pros:
- Simplest method to implement
- No risk of starvation (when a process cannot complete its execution because it’s constantly denied processor time)

Cons:
- Can be a long wait before a process can run

Can work well in a system with only a few concurrent processes

24
Q

Shortest Remaining Time

A

Preemptive Method

- Time to completion estimated as each new program arrives
- Program with shortest remaining time to completion executed first, allowing new program to take over from the current process

Con: Can delay longer processes from completing sooner if shorter processes are added in the meantime

25
Shortest Job First
- Processes queued and process that needs shortest *total* time to complete goes first _Pro_: Reduces wait times as shorter processed are removed quickly, allowing processor to allocate more time to longer jobs _Con_: Susceptible to starvation if shorter jobs keeps being added - scheduler will constantly prioritise short jobs and neglect longer ones
26
Multi-Level Feedback Queue
Preemptive Method - Multiple queues created with different priority levels - If a program uses too much CPU time, it's moved down to a lower priority queue - Alternatively, if a program has been waiting for a long time it's moved to a higher priority queue - Processes depending on I/O devices require lots of processing time and are thus kept in high priority queues, & processes quick to complete are served first _Pro_: All tasks given processor time with more important programs dealt with sooner
27
Different Types of Operating Systems
- Distributed - Embedded - Multitasking - Multi-user - Real time
28
Distributed OS
- Can coordinate the processing of a single job across multiple computers - Distribution of tasks coordinated by the OS passing instructions between computers (each called a *node* in the system) _Pros_: - User can access more computational power with illusion of working with a single processor - No need for training or writing programs differently - Useful when processor-intensive tasks need to be completed and a single processor can't provide enough computational power on its own _Con_: - Programmer has no control over the task distribution as this is entirely handled by the OS
29
Embedded OS
- Used in computers which only serve a specific purpose (e.g. mobile phones) - Must provide a reliable platform for specific applications to carry out their processes _Pros_: - Offer hardware reliability - Ensure efficient use of resources _Con_: - Pros usually come at the cost of system flexibility
30
Multi-Tasking OS
Switches between tasks quickly to provide the illusion of multiple tasks running at the same time
31
Multi-user OS
- Provides facilities for multiple users to access the same system - Controls consumption of resources so simultaneous access doesn't adversely affect other users
32
Real Time OS
- Must respond extremely quick to input - May need to cope with many inputs simultaneously - Usually seen in safety-critical environments (e.g. plane autopilot, self-driving cars) - Must have a failsafe to detect and respond appropriately if a hardware component fails - Hardware redundancy - duplicates of crucial components in case of failure
33
BIOS
Basic Input Output System - Stored in ROM - Boots computer at start-up - Initialises and tests hardware - Loads OS into RAM
34
How does BIOS boot up the computer?
- POST (Power-On-Self-Test) ensures all hardware correctly connected and functional - Checks CPU clock, memory and processor is operational - Tests for external devices connected to the computer - OS system can then be loaded into RAM from hard disk by bootstrap/bootloader
35
Device Drivers
- A program that controls the operations of a specific type of device that's part of a computer system - Provides an interface for the OS and other software to interact with a device - Specific to the computer's architecture - OS doesn't need to know the specifics of the hardware to be able to access it
36
How does the device driver enable the use of hardware?
_Input (via hardware)_ - When a piece of hardware is used, the device driver communicates this request to the operating system which then can produce the relevant output _Output (via hardware)_ - Program -> OS - Requests to controls a device - OS -> Driver - Invokes driver routine - Driver -> Hardware - Instructions sent to device
37
Driver Routines
- (When a program requests to interact with hardware) The routine causes the device to perform specific tasks after being called - Driver may receive requests requiring processor to be interrupted, so the driver therefore provides the interrupt handling instructions to the OS
38
Virtual Machines
Software that allows other software to behave as if it were running on a hardware system (Software used to emulate a machine)
39
Uses of a Virtual Machine
_Running alternative OS Systems_ - Can be created to allow the installation of one OS within another OS _Supporting Incompatible Software_ - Can emulate an older system which the user can run older software on _Creating a test system_ - VMs are closed & controlled environments ('hardware' of VM only exists as self-contained software process, isolated from actual host system) - Therefore provides an opportunity to run potentially damaging software, e.g. malware of early versions of software that need to be analysed _Running multiple servers_ - More than one server can run on VM, allowing for separation of services without need for multiple pieces of hardware
40
Executing Intermediate Code
VM acts as an intermediary between the system and the source code _Pros_: - Independent of processor architecture (and so can be run across different machines and OS) - Saves time and money of purchasing multiple devices for testing _Con_: - Running intermediate code in a VM can be considerably slower