Chapter 16: System Software Flashcards

(37 cards)

1
Q

How an OS can maximise the use of resources

A
  • Operating task
  • maximise the use of computer resources
  • Hide complexities of hardware from the users
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why OS needs scheduling algorithm

A
  • allow multiprogramming
  • Ensure fair use of processor
  • Ensure fair use of memory
  • Ensure fair use of peripheral
  • Ensure higher priority tasks are executed sooner
  • Ensure all process have opportunity to finish
  • Keep CPU busy all the time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

The ways in which the user interface hides the complexities of the hardware from the user

A
  • Using GUI interface rather than CLI
  • Using device drivers which simplifies the complexity of hardware interface
  • Simplifying the saving and retrieving of data from memory and storage devices
  • Carrying out background utilities, such as virus scanning
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Multitasking

A
  • Allows computer to carry out more than one process at a time
  • Process: A program that has started to be executed.
  • Ensure best use of computer resources by monitoring the state of each process
  • Processes will share common hardware resources
  • Schedule is used to decide which processes should be carried out
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Role of high-level scheduler in multiprogramming OS

A

Decides which process are to be loaded from backing store into ready queue

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

Role of low-level scheduler in multiprogramming OS

A
  • decides which process in ready state
  • Should be put into processor
  • Based on priority
  • Invoked by interrupt
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Ready state

A
  • process is not being executed
  • Process in the queue
  • Process is waiting for its processor time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Running state

A
  • process is being executed by the processor
  • Process is currently using its allocated processor time
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Blocked state

A
  • process is waiting for an event
  • e.g input/output
  • So it cannot be executed at the moment
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Conditions to move from ready to running state

A
  • Process is capable of using processor
  • processor is available
  • Process is the head of the ready queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Conditions to move from running to blocked state

A
  • process is running when It needs to perform I/O operations
  • Placed in blocked state until I/O operation completed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Conditions to move from blocked to ready state

A
  • the only
  • Required resources is available
  • Process wait I/O operation to be completed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Round robin (Scheduling Routines)

A
  • Each process is assigned fixed CPU time
  • Starvation doesn’t occur
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Conditions to move from running to ready state

A
  • The process in processor has finished its time slice
  • Process can no longer use processor
  • Although it is capable for further processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Why cannot move from blocked to running state

A
  • when a process finished I/O operation
  • It needs to go ready state
  • OS decides which process to allocate to processor from the ready queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Shortest job first (Scheduling Routines)

A
  • Process is executed in the ascending order of the amount of time required.
  • More processes can be executed in short amount of time
  • Non-preemptive scheduling algorithm
12
Q

First come first serve (Scheduling Routines)

A
  • No complex logic, each process queued as it is received and executed one by one
  • Starvation doesn’t occur, all process get chance to run.
13
Q

Shortest remaining time (Scheduling Routines)

A
  • Same as shortest job first
  • Preemptive scheduling algorithm
14
Q

Non-pre-emptive

A
  • Once resources is allocated to a process, the process
    retains them until it has completed its burst time or
    the process moved to waiting state

Burst time: the time when a process has control of
the CPU

  • Cannot be interrupted, must first finish or switch to waiting state
    -More rigid form of scheduling
  • If a process with a long burst time is running in the
    CPU, there is a risk that another process with a
    shorter burst time may be starved of resources
14
Q

Pre-emptive

A
  • Resources allocated to process for a limited time
  • The process can be interrupted while it is running
  • More flexible form of scheduling
  • High priority processes arriving the ready queue
    frequently can mean there is a risk that low priority
    processes may be starved of resources
15
Q

How the kernel of the OS acts as an interrupt handler & how interrupt handling is used to manage low
level scheduling

A
  • When interrupt is received, other interrupts are then disabled so that the process that dealt with the
    interrupt cannot itself be interrupted
  • State of current process is saved in kernel stack
  • Identify source of interrupt
  • Priority of interrupt is checked
  • kernel will use interrupt dispatch table (IDT)
  • IDT links the device description with the appropriate interrupt routine
  • Once completed, the state of current interrupted process is restored using values saved on kernel stack
  • The process is continued
  • The interrupts is restored so any further interrupts can be dealt with
16
Q

Types of interrupt signals

A
  • Device interrupt (e.g printer out of paper, device not present)
  • Exceptions (e.g instruction fault such as division by zero, undefined op code)
  • Software interrupt (e.g process requesting a resource such as a disk drive)
17
Q

Virtual memory

A
  • Disk used to extend RAM
  • So CPU can access more memory space than available RAM
  • Only part of data in use needs to be in RAM
  • Data is swapped between RAM and disk
18
Q

Terms for paging

A
  • page : VM is divided into blocks of fixed size
  • Page frame : main memory/RAM is divided into page frames of the same size as a page
  • Page table : a table that show mapping of pages on page frames, translate logical to physical address
19
Paging vs segmentation
- Paging divides memory into fixed size block, segmentation various size block - Paging has faster access time than segmentation
20
Paging
- Faster access time - Invisible to user - Consists of static linking & dynamic loading - Procedures and associated data cannot be separated when using paging
20
Segmentation
-Slower access time - Visible to user - Consists of dynamic linking & dynamic loading - Procedures and associated data can be separated when using segmentation
21
How paging is used to manage VM
- pages are required back to RAM as soon as they are moved to disk - There is continuous swapping (on the same page) - No useful processing happen - Because pages that are in RAM and on disk are inter-dependent - Nearly all the processing time used for page swapping
22
Disk thrashing
- pages are required back to RAM as soon as they are moved to disk - There is continuous swapping (on the same page) - No useful processing happen - Because pages that are in RAM and on disk are inter-dependent - Nearly all the processing time used for page swapping
23
how an interpreter can execute programs without producing a translated version ?
- an interpreter examines source code one statement at a time - It checks each statement for error - If no error is found the statement is executed - If an error is found this is reported and the interpreter halt - Interpretation is repeated for every iteration in same section of code
24
Why code optimisation
- code has fewer instruction - Less memory space required - Shorter program execution time
25
Interrupt
- a signal of software source or hardware device seeking attention of processor
26
Phrases of compiler
1) lexical analysis (convert source code) into tokens) 2) Syntax analysis 3) Code generation - produce object code 4) Code optimisation - improve efficiency of object code (minimise execution time & memory requirement)
27
How keyword table and symbol table are used to translate the source code program ?
- keyword looked up in keyword table - Represented by tokens - Identifier looked up in symbol table - Convert to location - Used to create a sequence of tokens (for the program)
27
Lexical analysis stage:
1) Keyword table - the reserved word used - The matching token - The operators used 2) Symbol table - identifier name used - The data type - Value of constant - Role. e.g contant & variable 3) removal of comments 4) removal of white spaces 5) removal of redundant characters 6) identification of error
28
Syntax analysis (make use of tree data structure)
- Parsing - Check the table of tokens to ensure grammar of language is obeyed - producing error report
29
Why RPN ?
- no need bracket - No need rules of precedence for operators - Rules of precedence means operators have different priorities - Evaluation can be read from left to right - No need to backtrack