CSIT 345 OS Midterm

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/101

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

102 Terms

1
New cards

What does the device controller cause an interrupt? a. When it starts the operation b. When it finishes its operation c. When the CPU requests I/O information from a device d. When the device produces data to be sent

When it finishes its operation

2
New cards

If our process divides by zero, an interrupt is invoked, the unique number 0 is associated with it. What is this number used for? a. The unique number zero represents the first interrupt service routine b. The number zero is used to correct the division and continue execution c. The number zero represents the memory address the interrupt service routine resides at d. Indexing the interrupt vector to find the correct memory address that points to the correct interrupt service routine

Indexing the interrupt vector to find the correct memory address that points to the correct interrupt service routine

3
New cards

Jesse is writing a program that will consistently use a variable named “counter”, counter will be incremented by 1 every time the function it is in is called. Where should the counter be stored in memory? a. Cache b. Register c. Main Memory d. Hard-Disk Drive

Register (if persistent across calls then static in main memory)

4
New cards

How many interrupts are generated when we use Direct Memory Access to move a block of data? a. 2 b. 3 c. 4 d. 1

1

5
New cards

What type of multiprocessing system has each processor assigned to a specific task? a. Asymmetric multiprocessing b. Symmetric multiprocessing c. Asymmetric cluster d. Symmetric cluster

Asymmetric multiprocessing

6
New cards

Which of the following is not a way to pass parameters to the operating system? a. Pass the parameters in registers b. Parameters are stored in a block, or table, in memory, and the address of the block is passed as a parameter in a register c. Parameters can be placed, or pushed, onto a stack by the program and popped off the stack by the operating system d. Parameters are stored in a queue and processed in a first in first out order by the operating system

Parameters are stored in a queue and processed in a first in first out order by the operating system

7
New cards

Jesse has an idea to create a new service where packets received from a network are filtered based on specific parameters. He wants this service to run at boot-time each time he loads the system. How might he implement this? a. Write a bash script that must be manually invoked b. Write a C program that automatically is ran by the Kernel at run time c. Write a kernel module that is linked in with the other services of the kernel d. Write a kernel module that is dynamically linked at runtime with other services of the kernel

Write a kernel module that is linked in with the other services of the kernel

8
New cards

Which of the following is not a part of an activation record? a. Global variables b. Function parameters c. Local variables d. Return address

Global variables

9
New cards

Which of the following is not a scheduling queue the process scheduler maintains? a. Job Queue b. Ready Queue c. Device Queue d. Message Queue

Message Queue

10
New cards

The system invokes a process that writes to a text file every 10 seconds the state of the system. Another process reads from this file to check to ensure everything is running smoothly. What type of processes are these? a. CPU bound processes b. I/O bound processes c. Memory bound processes d. Network bound processes

I/O bound processes

11
New cards

Which of the following is not one of the issues we may encounter from shared memory? a. Race conditions b. Deadlocks c. Buffer overflow d. Data inconsistency

Buffer overflow

12
New cards

Which of the following methods do not implement implicit threading a. Pthread_create() b. Thread pools c. OpenMP d. Grand Central Dispatch

Pthread_create()

13
New cards

I am running a process and I get stuck in an infinite loop, I input control+c on the keyboard. This generates a SIGINT which interrupts the process. What is this considered? a. Synchronous signal b. Nonmaskable interrupt c. Asynchronous signal d. Maskable interrupt

Asynchronous signal

14
New cards

Which of the following is an example of a direct system call in C? a. printf() b. scanf() c. malloc() d. socket()

socket()

15
New cards

Which of the following is not an issue that can occur from preemptive scheduling? a. Race conditions b. CPU monopolization c. Inconsistent data d. Interrupt during crucial OS activities

CPU monopolization

16
New cards

Using the formula below, please approximate the next CPU burst using the following: Jesse is trying to determine the next CPU burst that may occur in the system. He predicted the first burst was 6ms, but the actual burst was 10ms, his second prediction was 8ms, but the actual burst was 6ms. What will be his third CPU burst prediction? The alpha value is .5

7ms

17
New cards

Using Amdahl’s law, calculate the potential speedup of a program on two different systems. A program consists of 25% serial execution and 75% parallel execution. You want to run this program on a system with: i. 6 processing cores ii. 10 processing cores. What is the potential speedup for both systems, going to the third decimal place?

Speedup (6 cores) ≈ 2.667; Speedup (10 cores) ≈ 3.077

18
New cards

What is the operating system?

A program that acts as an intermediary between a user of a computer and the computer hardware

19
New cards

What are some goals of the operating system?

Execute user programs easily, make system convenient to use, efficient use of hardware

20
New cards

What are the components of a computer system?

Hardware, Operating system, Application programs, Users

21
New cards

Define what the operating system does depending on user view vs system view

User view: ease of use, performance, security. System view: resource allocator, control program

22
New cards

What is the kernel?

The core part of OS always running

23
New cards

What is the responsibility of the device controller?

Manage data transfer between device and its local buffer

24
New cards

When does it cause an interrupt?

When it finishes its operation

25
New cards

What is the purpose of the device driver?

Provide standard interface for OS to interact with hardware

26
New cards

What is an interrupt service routine (ISR)/what does it do?

Handles interrupt and returns control to interrupted instruction

27
New cards

What is an interrupt vector?

A table of pointers to service routines

28
New cards

How do we ensure we choose the correct interrupt service?

Use the interrupt’s unique number to index the interrupt vector

29
New cards

If we consider an operating system to be interrupt driven, what features are needed?

Deferred interrupt handling, efficient handler invocation, prioritization

30
New cards

What is a nonmaskable interrupt and maskable interrupt?

Nonmaskable: cannot be disabled (e.g. hardware fault). Maskable: can be disabled during critical code

31
New cards

What is caching? Why is it beneficial?

Cache = fast memory storing frequently accessed data. Benefit: faster access, fewer main memory operations

32
New cards

What is direct memory access (DMA)? What problem do we solve?

DMA lets device controller transfer whole block to memory with minimal CPU involvement, solves overhead of many interrupts

33
New cards

What is the job of a CPU core?

Execute instructions and maintain registers

34
New cards

What are the two types of multiprocessor systems?

Asymmetric multiprocessing, symmetric multiprocessing

35
New cards

What are the advantages of a multicore design?

Faster on-chip communication, lower power consumption vs multiple chips

36
New cards

In a clustered environment, what is graceful degradation and fault tolerance?

Graceful degradation: maintain reduced service in face of failures. Fault tolerance: continue operation despite individual component failure

37
New cards

What is an asymmetric cluster vs a symmetric cluster?

Asymmetric cluster: one hot-standby server monitors active; symmetric cluster: multiple active servers monitoring one another

38
New cards

What does a mode bit do? What are the two modes it allows us to switch between?

Mode bit distinguishes kernel mode (0) and user mode (1)

39
New cards

What is the difference between a program and a process?

Program: static instructions. Process: executing instance of program

40
New cards

What does the program counter do?

Holds the address of the next instruction to execute

41
New cards

How many program counters are needed for a single threaded process vs a multithreaded process

Single thread: one PC. Multi-threaded: one PC per thread

42
New cards

What is the purpose of cache coherency?

Ensure all CPUs see the most recent value in their caches

43
New cards

What is the difference between protection and security?

Protection: controlling access to resources. Security: defending system from threats

44
New cards

What are some methods of checking user and group control and access?

User ID, group ID, privilege escalation

45
New cards

What are some services the operating system provides?

User interface, program execution, I/O, file system, communications, error detection, resource allocation, logging, protection/security

46
New cards

Between I/O operations and File System Manipulation, how do we differ between reading from a network interface or writing to a file system?

Use socket/ networking syscalls vs file open/read/write syscalls

47
New cards

What are some resources that need to be allocated when we have multiple processes running concurrently?

CPU cycles, memory, file storage, I/O devices

48
New cards

What is a system call?

An interface provided to processes to request OS services

49
New cards

What is the purpose of the system call interface?

Link processes to OS services; syscall numbers index function table

50
New cards

What are the three methods used to pass parameters to the operating system? Why do we prefer the block or stack method?

In registers; via memory block; via stack. Prefer block or stack when parameters > registers

51
New cards

In C, when we invoke a printf() statement, what type of system call will be made?

write()

52
New cards

Describe the difference between a single task system and a multitask system

Single: one process at a time, reload shell when exit. Multitask: supports multiple processes concurrently via fork/exec

53
New cards

What are object files?

Relocatable binary code not yet loaded

54
New cards

What is a linker? What is a loader?

Linker: combines modules & libraries. Loader: loads executable into memory

55
New cards

When linking and loading, what does the activity relocation mean?

Adjust addresses in code/data based on load address

56
New cards

What are the steps that take place when we run a program using “./filename”?

Shell forks, exec loads program into child, child runs

57
New cards

Why is it beneficial to dynamically link libraries?

Load only libraries used, save memory and CPU

58
New cards

Why is there no one stop shop solution when developing an operating system? What are the requirements divided into?

Because system goals vary. Requirements split into user goals and system goals

59
New cards

What principle do we follow when designing and implementing an OS? What does it state?

Separation of policy and mechanism: mechanism defines how, policy defines what

60
New cards

What are the four ways an OS can be structured that we discussed?

Monolithic, layered, microkernel, modules

61
New cards

What are modules? Why might we use modules?

Kernel loadable components. Use to extend OS without rebuilding whole kernel

62
New cards

What are the sections of memory a process is divided into?

Text, Data, BSS, Heap, Stack

63
New cards

What is an activation record?

Data for function call: parameters, local variables, return address

64
New cards

What are the states a process may be in?

New, Ready, Running, Waiting/Sleeping, Zombie, Stopped, Terminated

65
New cards

What is a process control block? What does it serve as?

Data structure storing all info needed to manage a process (state, registers, memory, I/O info)

66
New cards

What are our two objectives with process scheduling?

Maximize CPU utilization (multiprogramming) and provide responsive time-sharing

67
New cards

What is a process scheduler? What happens if there are more processes than cores?

Selects a process to run on CPU. Excess processes wait in ready queue until a core becomes free

68
New cards

What are the three scheduling queues the process scheduler maintains?

Job Queue, Ready Queue, Device Queues

69
New cards

What does degree of multiprogramming mean?

Number of processes in memory concurrently

70
New cards

What does the CPU scheduler do?

Selects a process from ready queue and assigns it to CPU

71
New cards

What is an I/O bound process vs a CPU-bound process?

I/O bound: many short bursts, does I/O often. CPU bound: long CPU bursts, does computation mainly

72
New cards

What is a context switch?

Save current process state and restore another’s state on CPU

73
New cards

How are processes represented in the system?

Often in a tree (parent/child relationships)

74
New cards

When a process is created, how is it allocated resources?

It may inherit some of parent’s, request fresh ones, or share resources as defined by OS

75
New cards

What must a parent process do prior to terminating?

Wait for all its children to terminate (reap them)

76
New cards

What is the difference between an independent process and a cooperating process?

Independent: no data sharing. Cooperating: can share data or affect each other

77
New cards

What are some reasons we want process cooperation?

Information sharing, speedup, modularity

78
New cards

What are the two models of interprocess communication? How do they work?

Shared memory: processes share memory region. Message passing: OS mediates message send/receive

79
New cards

What are some synchronization issues we may encounter from shared memory?

Race conditions, deadlocks, data inconsistency

80
New cards

What is the producer-consumer paradigm? Why is it important when discussing interprocess communication?

Producer generates data, consumer uses it. Important for buffer management and synchronization

81
New cards

What is the method we discussed for indirect communication?

Mailboxes

82
New cards

Message passing may be either blocking or nonblocking. What is the difference between them/how do they work?

Blocking (synchronous): sender/receiver wait until op completes. Nonblocking (asynchronous): do not wait

83
New cards

How do remote procedure calls work?

RPC: caller sends message saying “execute function X with args Y” to remote process; remote does work and sends back result

84
New cards

What are the two types of pipes we covered? What do they do?

Anonymous pipes (unidirectional, between related processes) and named pipes/FIFOs (bidirectional or unidirectional between unrelated processes)

85
New cards

What is a thread? What is it composed of?

A thread is the smallest unit of execution; composed of program counter, stack, and registers

86
New cards

What is the difference in the term “concurrency” between a single core system and a multicore system?

Single core: concurrency via time-sharing (interleaving). Multicore: true parallel execution of concurrent tasks

87
New cards

What are the two types of parallelism? What do they focus on?

Data parallelism (same op on many data) and task parallelism (different tasks in parallel)

88
New cards

What are user threads? What are kernel threads?

User threads: managed in user space without kernel support. Kernel threads: managed and scheduled by kernel

89
New cards

What are the four relationships we discussed that must exist between user threads and kernel threads? How do they work?

Many-to-one, one-to-one, many-to-many, two-level

90
New cards

What is asynchronous threading and synchronous threading?

Synchronous: thread operations block until complete. Asynchronous: operations return immediately, completion happens later

91
New cards

What is the create/join strategy?

Threads are created; parent may join to wait for their termination before proceeding

92
New cards

What is the difference between implicit threading and explicit threading?

Explicit: programmer creates threads. Implicit: runtime/threading library handles threads automatically

93
New cards

What are three methods we covered when implementing implicit threading? What do they do?

Thread pools, OpenMP, Grand Central Dispatch – they abstract thread creation and scheduling for you

94
New cards

What is a signal? What is an asynchronous signal? What about a synchronous signal?

Signal is notification to a process of event. Asynchronous: comes from external event (e.g. keyboard). Synchronous: comes from process itself (e.g. divide by zero)

95
New cards

Every signal has a default signal handler that the kernel runs when handling that signal, what are some predefined default actions?

Terminate process, core dump, ignore, stop, continue

96
New cards

How do we know where to deliver a signal?

Kernel associates signal with process or specific thread based on type (synchronous signals go to thread generating them)

97
New cards

What is thread cancellation? a. Asynchronous cancellation? b. Deferred cancellation? c. What are some issues we can encounter?

Asynchronous: immediately terminate thread. Deferred: thread periodically checks cancellation point. Issues: resource leaks, inconsistent state

98
New cards

What is a lightweight process?

Kernel‐level thread or LWP: unit scheduling between user threads and kernel threads

99
New cards

What happens when an event triggers an upcall?

Kernel calls back into user thread library to invoke handler in user space

100
New cards

What is nonpreemptive scheduling? a. What is preemptive scheduling? b. What are some issues that can occur from both?

Nonpreemptive: process runs until it blocks/finishes. Preemptive: scheduler can interrupt process. Issues: with nonpreemptive, a process may monopolize CPU. With preemptive: race conditions, inconsistent data, interrupt during critical OS operations

Explore top flashcards

vocab quiz 2
Updated 765d ago
flashcards Flashcards (25)
progressive movement
Updated 755d ago
flashcards Flashcards (44)
Chapters 1-3
Updated 640d ago
flashcards Flashcards (123)
Exam 1
Updated 39d ago
flashcards Flashcards (128)
Svaly bérce - popis
Updated 312d ago
flashcards Flashcards (42)
vocab quiz 2
Updated 765d ago
flashcards Flashcards (25)
progressive movement
Updated 755d ago
flashcards Flashcards (44)
Chapters 1-3
Updated 640d ago
flashcards Flashcards (123)
Exam 1
Updated 39d ago
flashcards Flashcards (128)
Svaly bérce - popis
Updated 312d ago
flashcards Flashcards (42)