CS314: Operating Systems Midterm

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

1/41

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.

42 Terms

1
New cards

What is the kernel?

- Core of an OS, intermediary between hardware and software

- manages resources and processes

- works in conjunction with the scheduler

- (works with) scheduler, dispatcher, signal handlers

- data structures: process table, open file table, other tables/bookkeeping data structures 

2
New cards

Variables/characteristics involved in scheduling algorithms

- burst/cycle time*, arrival time*, quantum/quanta*, priority*, period*, (atomicity)

- waiting time/age*, queue size, deadline*, dependencies

3
New cards

What is the difference between a mutex lock and a semaphore?

- mutex lock: mutually exclusive lock (0,1), on or off, locked or unlocked

       - one process accesses its critical section at a time

- semaphore: more advanced, yet more general

       - allows for multiple resources to access their critical sections

4
New cards

Why are orphan and zombie processes so problematic in the operating system?

- zombies: they aren’t doing anything! Taking up resources despite done

- orphans: similar, now have to become a child of init

5
New cards

What is an operating system?

- software (multiple programs) that is the intermediary between software and hardware 

- a system that acts in:

- resource allocation

- memory management

- user interface

- etc.

6
New cards

List the 5 process states

- New, running*, ready*, waiting*, terminated

7
New cards

What are some things that make threads much lighter than processes?

- Threads share resources in contrast to child processes which have their own PCB process (control block), program stack, etc./

- Less complex, the operations they perform are generally less memory-intense

- Reduced overhead with regards to the content switch (switching from one process to another)  

          - interthread communication is easier than interprocess communication (IPC)

8
New cards

Most user processes live in what ring of the OS security rings model? Why is that?

- Ring 3 (highest ring, least amount of OS privilege) 

- Ring 2 - device driver extensions

- Ring 1 - drivers

- Ring 0 - the kernel (hardware)

9
New cards

What is a system call? What are some examples of system calls?

- A request from an application to the kernel for (something) (Ex. hardware, CPU time, attention) 

- A function

- fork(), sleep(), exit(), open(), read(), write(), …

10
New cards

P1 has 5 steps (a,b,c,d,e) and P2 has 4 steps (a,b,c,d). Assuming all suboperations are the same size, which is more atomic?

- P2 is more atomic

- atomicity: (smallest it can be reduced to) the measure of irreducibility in a process 

- something that is more atomic than something else is “easier to package up” into one step

11
New cards

System calls are functions called in a program that force the operating system to partition the disk. (T/F)

False

12
New cards

Processes that are considered "multithreaded" create several instances of itself to perform different tasks, and have one program counter per thread. (T/F)

True

13
New cards

What do operating system data structures use to communicate between each other and other process?

interrupts

14
New cards

The primary type of multitasking in an operating system, also known as concurrent programming, is mainly referred to as:

multiprocessing

15
New cards

Which of the following data structures does the operating system utilize to keep track of things like files and processes?

hash maps, linked list, binary trees (all of the above are used by the OS)

16
New cards

Select all of the responsibilities of the operating system.

  • allocate resources for individual processes

  • work with the kernel to interpret I/O signals

  • manage memory aross the system to optimize the transfer of data

  • maintain data structures like the process table and device table

  • process signals from system calls

17
New cards

Which scripting language allows programmers to call programs from inside their script files?

batch script and BASH

18
New cards

BASH script files must be prefixed with a line or lines pointing the OS to the right script interpreter. (T/F)

True

19
New cards

Processes that run indefinitely in the background and typically are hidden by the operating system are referred to as:

daemon processes

20
New cards

System call implementation is the same across all operating systems. (T/F)

False

21
New cards

Which system call allows the user to create a process from another process?

fork()

22
New cards

System calls are part of a(n):

API (Application Program Interface)

23
New cards

Which OS mode interacts with the hardware?

kernel mode

24
New cards

System calls are function calls that allow the programmer to interact with OS resources more closely. (T/F)

True

25
New cards

Parent processes spawn:

child processes

26
New cards

The context switch is a register in the system which flips on for if a process is running and off for is a process is waiting. (T/F)

False

27
New cards

A process has asked the user to enter their name as part of a C program. This process is in what state?

waiting

28
New cards

Which type of process takes up space on the system despite being terminated?

zombie process

29
New cards

The OS stores processes:

hierarchically, like a tree

30
New cards

In the context switch, the OS saves:

the state and information of the two processes involved in the switch

31
New cards

A process is using up time and resources on the CPU to calculate the one millionth digit of pi. Which process state would it be in?

running

32
New cards

Processes that need information from one another engage in IPC, or interprocess communication. (T/F)

True

33
New cards

Which two entities facilitate IPC?

sockets and pipes

34
New cards

The process scheduler is a program in the OS which determines which processes get time and resources from the CPU. (T/F)

True

35
New cards

Kernels are typically not multithreaded because concurrency allows for different process contexts to be switched on easily. (T/F)

False

36
New cards

Which of the following entities processes interrupts sent from one multithreaded process to another to facilitate communication?

signal handler

37
New cards

Threads are considered heavyweight structures. (T/F)

False

38
New cards

What is one problem from using threads?

shared space and resources lead to inconsistencies in data

39
New cards

Parallelism allows for multiple processes to actually run at the same time in multicore systems where concurrency allows for one process at a time to make progress, simulating parallelism in single processor systems.

True

40
New cards

Threads are typically created programmatically, via a(n):

API

41
New cards

Threads are implemented differently by different operating systems and different programming languages because:

each OS's internal communication protocols are different; threads might require more or less resources in a different environment

42
New cards

The register set, stacks, and private storage area are known as the context of the thread, and is therefore subject to a context switch. (T/F)

True