System software and virtual machines Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How does the OS maximize the use of resources ?

A

Memory

  • It moves the frequently accessed instructions to the cache for faster recall
  • It makes use of virtual memory with paging or segmentation to swap memory to and from a disk
  • It divides the memory into static/dynamic partitions to allow for more than one program to be available
  • It removes unused items from the RAM
  • It makes a partition available as soon as the process using it has been terminated

Disk

  • A disk cache will hold the data that is frequently transferred
  • It will decrease the file size on the disk by using compression utility so that more files can be fit on the disk
  • It will use defragmentation utility so that files are rearranged to occupy contiguous spaces to reduce the data access time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does the OS hide the complexities of the hardware from the user ?

A
  • It gives user access to the hardware/software systems without needing the user to be involved in the complex commands, for example drag and drop in a GUI.
  • It uses device drivers to synchronize the hardware
  • It carries out background utilities like virus scanning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the need for scheduling ?

A
  • To allow multitasking
  • To ensure fair usage of the processor
  • To ensure fair usage of the memory
  • To ensure higher priority tasks are executed sooner
  • To ensure all processors have an opportunity to finish
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three states of a process ?

A

Ready

  • The process is not being executed, it is waiting in a queue for the processors attention

Running

  • The process is currently using its allocated time slice and being executed by the processor

Blocked

  • The process is waiting for an event so it can’t be executed at the moment, for example some input/output event
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does the kernel act as an interrupt handler ?

A

The kernel of an operating system acts as an interrupt handler by responding to signals from hardware devices or software conditions that require immediate attention. When an interrupt occurs, the kernel saves the current process’s state, invokes the appropriate interrupt handler to manage the interrupt (such as reading data or handling errors), and then restores the process state to resume execution. This mechanism facilitates low-level scheduling by enabling preemptive multitasking, allowing the kernel to prioritize tasks based on urgency.

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

How does shortest job first work ?

A
  • The processes are executed in ascending order of the amount of CPU time required
  • It leads to an increased throughput as more processes are executed per unit time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How does round robin work ?

A
  • Each process is given the same priority and is served with a fixed time slice
  • Starvation doesn’t occur and the CPU is constantly in use
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does First come first served work ?

A
  • No complex logic, each process is queued as it is received and executed one by one
  • Less procedure overhead
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is virtual memory ?

A
  • Secondary storage is used to extend the RAM available
  • So the CPU appears to be able to access more memory space than the available RAM
  • Only the data in use needs to be in the main memory so data can be swapped between RAM and secondary storage as needed
  • Virtual memory is created temporarily
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is a virtual machine ?

A

It is the emulation of a computer system using a host computer and using guest OS for the emulation

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

What are the pros and cons of using virtual machines ?

A

Pros

  • A new system can be tried on the virtual hardware without needing to purchase the hardware
  • You can emulate programs on the virtual machine which may not be compatible with the host operating system by using the guest OS.
  • More than one computer system can be emulated which allows multiple operating systems to coexist on a single computer

Cons

  • Virtual machines may be unable to emulate hardware that were developed after them
  • Using virtual machines mean executing extra code which may lead to the performance degrading
  • The use of virtual machines increases the maintenance overheads since both the host and guest OS must be maintained.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

How does an interpreter executes a program without producing a complete translated version of it.

A
  • An interpreter examines the source code one statement at a time
  • It checks if there are any errors in the line
  • If there is an error, the interpreter reports the error and halts
  • Otherwise, it executes the statement
  • Interpretation has to be repeated every time the program is run
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the four stages of compilation in a program ?

A
  • Lexical analysis
  • Syntax analysis
  • Code generation
  • Optimisation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is lexical analysis ?

A

It is the first stage in compilation,

It removes any unnecessary characters (comments) and tokenizes the program by adding new symbols to the symbol table

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

What is syntax analysis ?

A

It is the second stage in compilation,

It checks the output from the lexical analysis for any syntax errors.
If any errors are found, the statement and the error are output and code generation will not be attempted. However, if the code is error free it is passed onto the next stage

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

What is code generation ?

A

It is the third stage in compilation,

It produces the object program

17
Q

What is optimization ?

A

It is the fourth stage and last in compilation,

It makes the code as efficient as possible.

  • It minimizes the amount of memory used and the execution time
18
Q

What is the Backus-Naur notation ?

What is a syntax diagram ?

A

BNF is a formal method of defining the grammatical rules of a programming language

Syntax diagrams are a graphical method of defining and showing the grammatical rules of a programming language

19
Q

Why is Reverse Polish Notation used ?

A

The evaluation does not need to use rules of precedence for the operators (BODMAS) so there are no need for brackets. The statement can simply be read from left to right with no need to backtrack.