Operating Systems II Flashcards

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

What do you have to do to run powershell commands? What is their file extensions?

A
  • run as admin

- .ps1

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

Which commands do not carry over from bash?

A
  • chmod
  • wc
  • < but >&raquo_space; are allowed
  • grep is instead called sls
  • case is instead called switch
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the measure-object command?

A
  • allows us to retrieve information of passed in values

- such as count, sum, min and max

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

What is the sign for variables in PS?

A

$

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

What is the correct formation for functions and conditional structures?

A
  • Functions must be defined with “Function” before the name

- round brackets are used for conditionals

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

How can process be created? What is it called?

A
  • can be created by a user or by another process (parent and child processes)
  • spawning is act of creating a new process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What happens in process creating in UNIX?

A
  • first process created at start up is responsible for scheduling (called sched) and has PID = 0
  • creates another process (called init) which is origin of all child processes PID=1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is fork and what is exec?

A
  • two system calls used to create process in a programme
  • Fork = creates an exact copy (child) of the current process in a separate memory space
  • exec = called by the child, loads a new program in the memory space (replace)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a thread?

A
  • unit smaller than a process, can be scheduled and executed

- can have single threaded (common) and multi-threaded processes (maximises eff)

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

What is context change?

A
  • during switch from process 1 to process 2 the OS stores the current state of p1 and the last state of p2
  • time consuming
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the definition of scheduling?

A

-trying to find the most efficient assignment of processes to the CPU

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

What are the 3 types of scheduling?

A
  • high level scheduling HLS = whether to admit process or not
  • MLS = temporarily remove or reintroduce a new process
  • LLS = decides which ready process must be assigned to CPU
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What are the 5 different states?

A
  • Running - process assigned to CPU
  • blocked - process is waiting for I/O
  • ready - process is waiting to be assigned to CPU, cpu busy
  • suspend and resume - suspended process remain in sleep mode until resumed
  • processes can be suspended at the blocked, ready and running stage and will enter either blocked suspended or ready suspended
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is pre-emptive scheduling policy?

A

-remove a process from running state

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

What are non-pre-emptive scheduling processes

A

-processes run until they perform an I/O operation (blocked) or simply terminate

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

What is FCFS?

A
  • Non-pre-emptive
  • ready process is dispatched when the running process releases CPU
  • run to completion
  • average waiting time depends on order in which processes are fed into it
  • simple and fast, bad for short and I/O processes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

What is shortest job first?

A
  • completes shortest job start to finish
  • non-pre-emptive
  • calculates shortest estimated run time
  • next process is the one in the ready queue with the shortest estimated time
  • some longer processes may never be seen (starvation)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What is shortest remaining time?

A
  • pre-emptive
  • process with shortest time runs unless a new process comes with a shorter time, in which case that new process is executed
  • better for short processes, starvation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is highest response ratio next?

A
  • non-pre-emptive
  • both waiting time and run time considered
  • one way to work out priority is; p = (wait time +run time)/run time
  • wait time set to 0 for every process and beginning so each one has priority 1
  • if wait time increases so does priority
  • no starvation, more complicated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is round-Robbin?

A
  • pre-emptive
  • processes are all given equal amount of time in CPU (time quantum)
  • time quantum should not be too short
  • if process does not finish it is sent to back of queue
  • simple with no starvation, frequent context changes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are MLFQ’s?

A
  • pre emptive that combines many techniques
  • different priority level FIFO queues
  • enter first priority level, executed for time quantum, sent to second priority queue if not finished, executed for time quantum etc unless another process enters a higher P queue in which case that will be executed until it catches up with first process or it completes
  • favours short and new processes, starvation (solved by varying time quantum and priority)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

What are concurrent programming applications?

A

-set of cooperating processes dealing with asynchronous events

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

What are resources?

A
  • processes can be competing for hardware or logical resources
  • there are two types; reusable (not destroyed when being used; hardware) and consumable (temporary data or signals created by a processes and deleted when received by another)
24
Q

What is serially reusable?

A
  • can only be used by one process at a time

- it is mutually exclusive

25
Q

What is the critical region?

A
  • eg; we have 2 processes with critical regions. If A enters its region B cannot enter its region and pauses. The CR requires mutual exclusion
  • also works vise versa
  • data could be lost of both enter region at same time
26
Q

How does OS deal with mutual exclusion?

A
  • allows processes to exit without fear of data loss

- efficient, equitable handling of shared resources

27
Q

What is a deadlock?

A
  • processes created by the need for mutual exclusion has the potential for deadlocks
  • processes waiting for events that will never occur
  • can create deadlock circle; process P1 is using printer and needs access to file F, P2 already has mutual access to file F and is waiting on printer
28
Q

What is the hardware approach to achieving mutual exclusion?

A
  • CPU could provide special instruction called test-and-set
  • checks he value of a flag then sets it to 1, in one operation
  • no delays between testing values and setting them
  • does not waste time in busy waiting
29
Q

What are semaphores?

A

-special type of variable. Two operations can be performed on them;
Wait - controls entry into critical region
Signal - controls exit from region
-no wasting time as processes checked before being executed rather than executing slightly then being blocked
-wait and signal cannot be interrupted
-LLS can block these processes instead of waiting time n busy-waiting
-there can be binary and counting (>=0) semaphores

30
Q

What is race condition?

A

-occurs when competing processes attempt to perform operations at the same time - without mutual exclusion

31
Q

What are the 4 conditions for a deadlock to occur?

A
  • mutual exclusion
  • resource handling - process holding some resources waiting for others
  • no pre-emotion - resources cannot be forcibly removed from a a process
  • circular wait
32
Q

What are the four strategies for deadline with deadlocks?

A
  • deadlock prevention - one of the four conditions for the deadlock is denied
  • deadlock avoidance - the four conditions still prevail, but when a deadlock would arise from a resource allocation, it is not made
  • deadlock detection - deadlocks can happen and then broken by the same means
33
Q

How effective is deadlock prevention?

A
  • mutual exclusion cannot be disallowed
  • resource holding cannot relinquish resources and no pre-emption has the same problem
  • circular wait can be prevented if resources are organised into an order. Inefficient and difficult to apply
34
Q

How efficient is deadlock avoidance?

A
  • process requests are checked dynamically to decide whether to allocate a resource or not
  • current resource - allocation state is evaluated, considering the max number of resources required by each process
  • if all necessary resources can be assigned (in any order), the state is safe, otherwise it is unsafe
35
Q

What is the bankers algorithm?

A
  • helps avoid deadlocks
  • requirements = ma number of reassures, number of allocated resources, number of resources available
  • resources may be allocated to a process if the resource requested <= amount available. Otherwise wait until resources available
  • state = safe if it is possible for all processes to finish their execution, state=unsafe otherwise
36
Q

How effective is deadlock detection?

A
  • ostrich algorithm = stick head in sand and pretend there is no problem
  • Usual principle is to detect a circular wait situation by using resource allocation graphs
  • breaking a deadlock implies that processes be aborted, or resources pre-emptied from processes (loss of work)
37
Q

What are the four main characteristics of IO devices

A
  • Data rate
  • Unit of transfer
  • Operations
  • error conditions
38
Q

How do IO devices communicate with one another?

A
  • through the bus system

- interrupts used for asynchronous communication with the CPU and the device control

39
Q

What is the structure of an IO system

A

-split into hardware and software
software; Application program IO control system IOCS device driver…..
Hardware; …Device controller device

40
Q

What is the IOCS

A
  • Part of the OS that deals with IO system calls
  • IO requests are validated and processed to be handled at the next stage
  • IOCS is also responsible for management of IO interrupts
41
Q

What is a device driver?

A
  • software modules responsible for communication with, and control of, IO devices
  • convert user requests into actual instructions for the specific device
  • considered part of OS and closely integrated with IOCS
42
Q

What is the device controller?

A
  • hardware modules that interface IO devices to the bus system
  • Device controllers are specifically designed for a computer system
  • devices are usually designed, instead, to work with different computer systems
43
Q

What are block devices

A
  • communicate with the computer system through groups of characters (blocks of data) at a time
  • difficult to deal with but faster transfer rate
  • DVD’s and CD’s
44
Q

What are character devices

A
  • communicate by transferring one character at a time
  • easier to deal with but slower transfer
  • mouse/keyboard
45
Q

How are devices in Linux seen?

A
  • stored as special files under directory /dev

- as files they can be read or written (not executed), and have permission attributes

46
Q

What are virtual devices?

A
  • simulate devices which are not physically present or available
  • from user POV they look like normal devices so they respond to normal system calls
  • in Linux /dev/null
47
Q

What is data buffering?

A
  • data transfer takes a lot longer than data processing
  • can introduce a buffer which allows transferring and processing to occur simultaneously
  • information goes into temp buffer first not memory, new info then starts to be fetched and at the same time the info in the buffer goes into working memory
  • can add multiple buffers to allow for even more simultaneous processing
48
Q

What type of files do UNIX and windows have?

A

Both;
-regular files = programs, text, data etc
-directories = files containing references to other files
Unix;
-character/block special files = not true files, but directory entries that refer to devices
-pipes = temp files for inter-process communication

49
Q

What is volume?

A
  • refers to actual part of secondary storage used for data
  • one physical disk can contain more volumes, formatted with different file systems for different OS’s
  • current techniques use dynamic allocation where space is allocated in units of fixed size (allocation units)
  • an allocation unit has size of disk physical sector in uNIX or is multiple of them in windows (clusterS)
50
Q

Difference between chained and listed clusters?

A
  • chained = each cluster points to next one, contain pointer as well as data which takes up more space. Must go through entries chain in order even if you wish to find cluster which is at end of chain
  • cluster list = where the file contains a list of all the clusters making up the cluster itself
51
Q

What is FAT?

A
  • File location table is an array of 16 bit values where each entry is associated to one single cluster (except first 2)
  • the value of each entry is a pointer to the next one
  • held in memory when the disk is used, access is much faster than basic chained cluster
52
Q

How does cluster size affect performance?

A
  • cluster is the min size allocated for a file, even if not all used
  • smaller the cluster the smaller the chance to waste space, but also bigger FAT table and disk accessed more frequently
  • bigger the cluster the smaller the FAT table and number of accesses but also bigger waste of disk space
53
Q

How do we calculate max disk space based on cluster size?

A
  • since max number of entries in FAT table is 2^16 this then sets max disk space that can be accessed
  • eg; if cluster size = 1024
  • 1024 * 2^16 = 67108864 (64MB)
54
Q

What is NTFS?

A
  • New technology file system overcomes limitations of FAT; such as max storage space and security features
  • uses Master file table (MFT) to manage the file allocation for the volume
  • consists of 1Kb records, each record with attributes relative to one file
  • data attribute of an MFT entry can contain the whole file, if its smaller than 700 bytes, or a list of pointers to its relative clusters
55
Q

Difference between LCN and VCN?

A
  • Each entry in a table contains these
  • LCN = logical cluster number with length of contiguous group of physical clusters
  • virtual cluster number = indicates the sequential number of clusters within the file
56
Q

What is an iNode?

A
  • used in UNIX and there is one for each file
  • contains; owner and group ID, file type, perms, last access and modified, size, number of links and pointers to disk locations
57
Q

Structure of an iNode?

A
  • each iNode contains 13 or more pointers
  • 10 are used to point directly to data blocks
  • 3 are used to point to index blocks
  • 3 index blocks can contain new lists of pointers to data blocks or other index blocks