M3: C Debugging and Process Management Flashcards

1
Q

Process context :

A

the snapshotted state of a process, which includes its data, memory utilization, and execution progress. The process context must be saved
when the OS wants to stop running a process, and it gets reloaded when the OS
resumes running the process.

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

Virtual address:

A

mapped to physical addresses using a data structure called a “page table”. Creates a consistent format for the OS to manage the memory of all processes. Includes the heap, stack, code segment, data segment, and kernel
space.

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

Disk

A

magnetic or optical storage for data. Disk storage is slower than your main memory storage, but is cheaper and stores data even when the computer is turned off.

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

File descriptors

A

used as handles to files by processes
○ STDIN : defaults to keyboard input
○ STDOUT : defaults to printing output on your monitor/terminal

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

Context switch:

A

the OS switches the process being executed. Context switches begin with a TRAP, which is a set of instructions that cause the computer to transition from user mode to kernel mode. Next, the OS saves the current
process context in it’s PCB, loads in the context of the next process’s PCB, resumes this next process, and transitions back to the user mode. Context
switching creates overhead.

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

Process state

A

running, blocking, or ready. Each state has its own process
queue in the OS.
○ Running : instructions for this process are being executed by the CPU.
○ Blocked : process is waiting on I/O access, user input, or some other condition that cannot be met immediately, but is required to continue executing.
○ Ready : the process has all it needs to run and is waiting for CPU access.

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

Preemption

A

when a process becomes ready, immediately give it an opportunity to run, regardless of any processes already running or processes ahead of it in the ready queue

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

OS Scheduler:

A

most OSes have a finite time-slice for which processes can run before they are switched out. Larger time slices reduce the overhead of context switching, however cause longer wait times for new processes that wish to run.

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

Prioritization

A

technique used in scheduling to ensure that urgent processes gain “fast passes” to the CPUs. Different priority processes may be placed in different priority queues. The priority level is an assigned number in a range of possible values that depends on the OS

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

Bytestream abstraction

A

an abstraction in Linux, in which all data is sent to and

read from devices as a sequence of bytes

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

Write()

A

accepts a file descriptor as an input. Returns the number of bytes written to the location specified by the file descriptor. Variations and additional syntactic
information are specified in the man pages.
○ fwrite() : buffered write

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

Read()

A

Read() : accepts a file descriptor as an input. Returns the number of bytes read from the location specified by the file descriptor. Variations and additional syntactic information are specified in the man pages.
○ fread() : buffered read

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

Disk controller:

A

A disk controller is the controller circuit that connects the CPU with the actual hard disk. The controller typically runs firmware, which is software written in low-level language that controllers actual hardware. The controller interacts with the disk device drivers running in the operating system by sending/receiving data to/from disk to applications

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

Contents of PCB

A
  1. Execution Context: SP, PC, Compute register values, segment register values, status(running, blocked ready)
  2. Memory Context: Pointer to page table
  3. Open File Descriptor Table
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

When does Context Switch occur

A
  1. Currently running process makes a system call and is blocked
  2. Currently running process terminates
  3. HW or SW interrupt happens
  4. Current process used up its current “time slice
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Difference Signal vs Interrupt

A

Interrupts are similar to signals, the difference being that signals are used for inter-process communication (IPC), mediated by the kernel (possibly via system calls) and handled by processes, while interrupts are mediated by the processor and handled by the kernel.
Interrupt = no return value, unexpected, hardware generated