1.2.1 systems software Flashcards

1
Q

What are the 8 functions of an operating system?

A
  • Managing the hardware
  • Managing software (loading programs in and out of RAM to be executed)
  • Provide a user interface (so user can interact with hardware)
  • manages security
  • provides a platform for utilities/applications
  • manages external devices
  • managing the processor/scheduling
  • provides a platform for networking
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does an OS provide?(4)

A
  • User interface
  • Memory/resource Management
  • Interrupt handling
  • Processor scheduling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Name 4 common operating systems.

A

Windows, Android, Linux, iOS

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

What is the kernel?

A
  • the core of the operating system that provides basic services for all other parts of the OS.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the tasks of the kernel?

A
  • Loading and unloading programs from RAM
  • CPU scheduling
  • Memory management
  • Storing files to and from storage
  • File management
  • Data security
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Why do different operating systems have different kernels?

A

Because different devices have different priorities.
e.g. A kernel for a mobile phone will need to be as power efficient as possible whereas one for a desktop will be optimised for performance

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

What are device drivers?

A
  • software which enables communication between OS and device so
    OS can interact with and control it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does a device driver do?

A
  • Translates commands from the operating system into series of hardware specific commands that only that device understands. The device can also pass data back to the operating system using the device driver.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Device drivers are…

A

hardware dependent and OS specific

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

Who makes the driver for a specific device?

A

The company who created the device.

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

What is a user interface? What does it contain.

A
  • Software that allows the user to interact with computer’s hardware.
  • WIMP (Windows, Icons, Menus, Pointers)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Name two user interfaces.

A

GUI and CLI

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

what is a GUI. Give advantages and disadvantages

A
  • graphical user interface
  • uses WIMP (Windows, Icons, Menus, Pointers) to provide clear graphical interface for user to control computer.
  • visual, interactive and optimised for mouse and touch gesture input
  • allows for multitasking
  • can take longer to perform tasks
  • more resource intensive
  • requires more power (more data involved)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a CLI. Give advantages and disadvantages

A
  • command line interface
  • allows user to type commands directly into the computer.
  • more reliable + more control due to direct communication from commands
  • requires less power
  • hard to use without knowledge of commands. But if experienced, its fast to use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Give 3 examples of utilities.
(utilities help to maintain the computer)

A
  • Print queue
  • File management
  • Encryption software
  • Compression Software
  • Antivirus
  • Disk defragmenter
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is the job of the memory manager?

A
  • Allocating memory to each program that runs
  • Mapping logical addresses to actual physical addresses
  • Prevents programs from overwriting each other
  • Moving files to virtual memory when running short on RAM
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Give two ways that an operating system manages memory.

A

Paging (Pagination) and Segmentation

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

Give some similarities about paging and segmentation

A
  • both allow programs to run despite insufficient memory
  • pages and segments are stored on disk
  • pages and segments are transferred into memory when needed
  • Allows programs to be stored in memory non-contiguously
  • both are ways of partitioning memory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Give 3 differences about paging and segmentation

A
  • pages = fixed size, segments = different sizes
  • pages made to fit section of memory, segments are complete sections of program
  • pages are physical divisions but segments are logical divisions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How does segmentation work?

A
  • An application running is split into processes (segments)
  • Each segment is a complete section of program that is allocated a space in RAM and executed separately.
  • The large program is run by running the smaller segments as required.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What does segmentation do?

A
  • Allows a program to be run on a system without using up too much memory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

what are segments?

A
  • logical divisions of varied sizes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

What is the code segment?

A

A segment which holds the executable instructions for the process.

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

What is the data segment?

A

A segment which holds all of the variables for the process.

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

What is the stack segment?

A

A segment which holds the memory addresses for the process which is running.

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

What is the free memory segment?

A

A segment which allows the stack segment to grow and shrink as necessary.

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

How does segmentation prevent files from overwriting each other?

A

All the processes have a set section of memory which is controlled by the OS.

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

What is virtual memory?

A
  • allocated section of the hard disk which can be used as memory when the memory is full.
  • Pages that aren’t needed are moved to VM and moved back to physical memory when required
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
29
Q

Why is virtual memory not ideal to use? (why do instruction currently being run have to be on RAM and not on hard disk)

A

Because the hard disk is much slower than the RAM.

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

what are pages

A
  • physical divisions of fixed size to fit into sections of memory
  • programs split up to fit into a given number of pages
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
31
Q

How does paging work?

A
  • RAM split up into numbered pages, each 4MB in size.
  • this method doesn’t take into account how the program is split (it could split looping instruction –> inefficient)
  • Pages that have not recently been used can be copied from the RAM into virtual memory to free up space in RAM.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
32
Q

What is disk thrashing?

A

When more time is spent swapping data (pages/segments) in and out of RAM than on actually processing the data.
- increases amount of time OS spends on management tasks + is witnessed through slowing of operations on computer.

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

What is a memory leak?

A

When a program does not flush its used data and so it takes up more and more space the longer it runs.

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

What will happen if a memory leak is bad enough?

A

The RAM will be completely full and the system will require restarting to clear the contents of the RAM.

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

Why is a memory leak less likely to happen to a well written program?

A

Because a well written program will regularly flush out the used data that it no longer requires, freeing up space in RAM.

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

What is a stack overflow?

A

The more memory addresses are used in a process, the more the stack segment expands into the free memory. If the stack segment gets too big, then it overflows, causing the program to crash.

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

What are the main two ways that the CPU reacts to events?

A

Polling and interrupts.

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

How does polling work?

A

The CPU regularly checks to see if any peripherals or applications require attention.

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

Why is polling good?

A

It is very simple and predictable.

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

Why is polling inefficient?

A

It uses up CPU processing time waiting for potentially nothing to happen.

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

What is an interrupt?

A

A signal produced by either hardware or software which tells CPU it requires the processors attention and that the current task should be stopped and carry out the interrupt task instead.

42
Q

what is the code called that is run when an interrupt is flagged

A
  • interrupt service routine
43
Q

what is the interrupt service routine

A
  • a software routine that hardware or software invokes in response to an interrupt
44
Q

How does the CPU know whether the interrupt task is more important than the task currently being executed?

A

Because an interrupt comes with a priority label. If this is higher than the task currently being executed then it replaces this task.

45
Q

How does a CPU process an interrupt? (ISR)

A
  • pushes values of registers onto stack in a stack frame
  • contents of PC changed to point to address of 1st instruction for interrupt. Then, process the interrupt
  • Once interrupt complete, pop frame off top of stack to reload values into registers + carry on executing where original program left off
46
Q

how is using the stack data structure beneficial (relate to if higher priority interrupt (ISR B) is sent through but ISR A is trying to be executed)

A
  • the previous program/ ISR A can be suspended, pushing contents onto top of stack to start executing ISR B of higher priority. Once completed, pop frame off top of stack to retrieve values of ISR A, load them into registers and carry on executing ISR A
47
Q

What is scheduling?

A

The way that the processor time is managed when multiple programs want to use it.

48
Q

a scheduler manages what 2 things

A
  • which process to execute next
  • length of time the next process can execute for
49
Q

Aims of scheduling

A
  • provide acceptable response time to all users
  • maximise time the CPU is usefully engaged (make most efficient use of processor)
  • ensure fairness on a multi-user system
  • Prevent processes from failing to run / Process starvation / Deadlock
50
Q

Explain why scheduling is necessary (4 marks)

A
  • Process as many jobs as possible in least possible time
  • Ensure all jobs are processed fairly
  • Maximise number of interactive user with fast response times (real time)
  • Efficient use of resources / processor time
51
Q

What are the duties of the scheduler?

A
  • Processing as many tasks as possible in given amount of time
  • Prioritising jobs
  • Altering priorities when needed
  • Ensuring no job is left waiting too long, even at low priority
  • Minimising delay between user request and action
52
Q

what happens if a process enters the running state but requires data from hard disk

A
  • Hard disk = very slow compared to CPU –> process blocked until input request has been serviced
  • Next process can enter running state. While process is running, the process that got blocked receives data it needs
  • Therefore, an interrupt is generated to tell scheduler it can re-join queue
53
Q

Describe the Round Robin (RR) scheduling algorithm.

A
  • queue holds all processes ready to be run.
  • First process is loaded + given set amount of time to run (time slice).
  • If it’s completed in time, next process loaded
  • If it isn’t then it’s sent to back of queue + next process is loaded.
54
Q

Give a pro and con of round robin.

A
  • Useful if all processes are the same length and priority
  • Not useful if processes vary in length and priority as it does not take these into account
55
Q

Describe the first come first serve (FCFS) scheduling algorithm.

A
  • Loads all processes into queue. Then gives them as long as they need to run before loading next process.
  • think like a supermarket queue
56
Q

Give a pro and con of first come first serve.

A
  • It is simple to implement and ensures that all jobs will complete in minimum time once they have started.
  • Doesn’t consider length and priority (long processes will block more important ones from taking place + once job starts it prevents others from being processed)
57
Q

Describe the shortest job first (SJF) algorithm.

A
  • scheduler organises processes into a queue based on number of cycles (time) they take. They are executed in this order.
  • When a new task comes along, it’s slotted into correct place in queue.
  • If it’s shorter than whole queue then current task is interrupted.
58
Q

Give a pro and a con of the shortest job first scheduling algorithm.

A
  • Ensures that the maximum number of jobs are completed
  • Does not take priority into account - long jobs may be waiting for a long time
59
Q

Describe the shortest remaining time (SRT) scheduling algorithm.

A

SIMILAR TO SHORTEST JOB FIRST BUT
- scheduler organises processes into queue based on how many cycles they have left instead of their total number of cycles.
- SRT is a pre-emptive algorithm so processes can be suspended if higher priority process joins queue

60
Q

Why is shortest remaining time better than shortest job first?

A

Because if a long job is executing or is interrupted, it may have a low amount of cycles left out of a high total number of cycles. SJF would keep this at the end of the queue due to its high total cycles meaning that it wouldn’t be run however SRT will move it to the front because it will take less time to execute than lots of smaller processes.

61
Q

Describe the multilevel feedback queue scheduling algorithm.

A
  • Scheduler organises processes into one of 3 ready queues, each with a different scheduling algorithm, based on their priorities to promote or demote processes (high priority queue always executed first)
  • Scheduler can reallocate processes from one queue to another if it became more important / has been waiting too long.

(I/O bound processes sleep in wait queue to give other processes CPU time)

62
Q

Give a pro and con of multilevel feedback queues.

A
  • They take priority into account (only one)
  • They are complicated to implement and are no more useful if the processes are all the same priority
63
Q

Non pre-emptive algorithms

A
  • First come first serve
  • shortest job first
64
Q

Pre-emptive algorithms

A
  • Round Robin
  • Shortest Remaining Time
  • Multi-level feedback queue
65
Q

Pre-emptive

A
  • ‘Pre-emptive’ algorithms are able to interrupt a job during its running state and move it into a ready state.
66
Q

non pre-emptive

A
  • ‘Non pre-emptive’ algorithms aren’t able to interrupt a job during its running state and must wait for it to finish before loading another.
67
Q

what is multitasking

A
  • more than 1 program open and running simultaneously
68
Q

How does an operating system provide a platform for multi-tasking

A
  • O.S manages available space in RAM and allocates memory for tasks held in a queue to allow processor to multitask
69
Q

What is a multitasking OS?

A
  • allows multiple processes to be carried out at the same time, or at least gives the illusion of this by using time slicing.
  • Scheduler in charge of switching between multiple processes to keep all applications up to date. - Because it’s so fast, it appears to user it’s all happening at once.
70
Q

Give some examples of a multitasking OS.

A

Windows, Android, Linux, macOS

71
Q

What is a multiuser OS?

A
  • Multiple workstations connected to single server through a network.
  • The workstations don’t run their own OS but rely on OS of central computer to allocate them resources.
  • when users logs on, their customisation and access rights/permissions are managed by computer
72
Q

Where are multiuser operating systems usually found?

A
  • Offices
  • Schools
73
Q

Why are multiuser operating systems useful for businesses?

A
  • allow easy sharing of files
  • Any update applied to main computer is instantly available to all workstations
  • Antiviruses apply to all workstations (security managed centrally)
74
Q

State what is meant by a distributed system. [1]

A
  • A system which shares processing (between the processors on a network) / shares the data between different systems (on a network in order to reduce bottlenecks).
75
Q

What is a distributed OS?

A
  • you can combine processing power of multiple computers across a network for a single task
  • In distributed computing, OS controls cluster of computers at a time in order to complete task which requires a lot of computing power, returning results to a central server.
  • Presents computers to user as if they were a single powerful system
76
Q

What is Distributed computing?

A
  • the method of making multiple computers work together to solve common problem.
  • It makes a computer network appear as a powerful single computer that provides large-scale resources to deal with complex challenges.
77
Q

What is a distributed OS an example of?

A

Parallel processing

78
Q

Where might distributed operating systems be used?

A
  • Testing new drugs
  • Online shopping (basket handled by 1 server while the querying of items handled by another. as system gets busy with more user requests, additional server will automatically join system)
79
Q

What is a real time OS?

A
  • intended to handle input data as soon as it arrives within guaranteed time (latency), typically without buffering delays
  • very reliable + has very precise and consistent timings.
  • vital for safety-critical environments like medical monitoring systems, aircraft autopilot, missile and car management systems.
  • Real time OS usually have plenty of redundancy meaning CPU and memory can never be at maximum capacity.
80
Q

How does a real time OS handle two inputs which arrive at the same time?

A

It orders them by priority and then handles them in this order.

81
Q

Where are real time operating systems commonly found?

A

Aeroplane systems
Car engine systems
Robot control systems

82
Q

What is an embedded OS?

A
  • highly specialised OS which may control a device like ATM’s, cars or microwaves.
  • It’s designed with dedicated hardware to carry out one task so it will be coded to do this with max. efficiency using low-powered processors and very little memory.
  • Not designed to multitask but may react in real time.
83
Q

list some features of embedded systems

A
  • designed for single purpose
  • includes single or no interface
  • often resource limited
84
Q

what is an embedded system

A

any computer systems with a dedicated function within a larger mechanical or electrical system.

85
Q

Is BIOS part of the operating system?

A

NO

86
Q

What is BIOS?

A
  • small piece of software responsible for checking the hardware is present and functioning (uses bootstrap which performs POST) before loading the OS kernel into RAM.
87
Q

Where is BIOS stored?

A

In a small chip of non volatile memory on the motherboard.

88
Q

what would be the effects if BIOS is overwritten

A
  • computer wouldn’t be able to boot / load OS
  • cant do initial configuration / hardware checks. These 2 things make the computer unusable
89
Q

How does the BIOS communicate with the user and vice versa?

A

Through very basic user interface (CLI) and also through beeps to communicate error codes.

90
Q

What is a virtual machine?

A
  • piece of software which has the same functionality as a physical computer

(simulates fully functioning computer by using resources from a host computer)

91
Q

Give an example of how a virtual machine is used

A
  • to emulate arcade games from 1980’s onto todays hardware
  • develop game on PC but use emulator for another device (games console / phone) to test program before release
92
Q

How many virtual machines can you have running on a single host?

A

Multiple

93
Q

can emulation be used to support a large number of virtual servers spread over a small number of physical servers?

A

YES
(example: 4 physical servers can run 6 virtual servers)

94
Q

how can a large number of virtual servers be utilised

A
  • as demand on network increases, additional servers can be spun up and the load balanced across different physical devices
  • if 1 server stops working, others can pick up load and continue working as if nothing happened
95
Q

what are virtual servers

A
  • process of using software to create multiple instances of a server
96
Q

what is a virtual network

A
  • non-physical private network that runs on public / existing network
  • can combine 1 or more physical networks into 1 logical network (partitions physical network)
  • users in virtual network can only access data in virtual network but can join network from an location
97
Q

What are the benefits of running an operating system on a virtual machine?

A
  • Old incompatible applications can be run
  • Multiple operating systems can be run
  • Real computer can be protected from malware by opening files in the VM
98
Q

How are virtual machines used to run intermediate code?

A
  • Instead of recompiling code to run on multiple different operating systems, you can write the code to run on a VM and then just run that VM on the computer which you want to run the program on.
    Many programs do this automatically.
99
Q

Describe a commonly used virtual machine for running intermediate code.

A

Java Virtual Machine compiles its code into intermediate code (bytecode)
- this code is then translated by JVM which is running on a target device which then translates it into specific machine code

  • this process makes java code highly portable between different devices
100
Q

what is a JVM

A
  • interpreter that translates intermediate code