Module 3: Debugging C 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:

  • heap
  • stack
  • code segment
  • data segment
  • 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.

  1. context switches begin with a TRAP, which is a set of instructions that cause the computer to transition from user mode to kernel mode.
  2. next, the OS saves the current process context in its PCB,
  3. loads in the context of the next process’ PCB,
  4. resumes this next process and
  5. 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

multi-core

A

a system with multiple CPU’s

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

process state

A

running, blocking, or ready
each state has its own process queue in the OS

running: instructions for this process and 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
8
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
9
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 ahead of it in the ready queue
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

prioritization

A

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
11
Q

I/O

A

refers to any interactions between your computer and external devices, such as keyboard, mouse, disks, printers, monitors.

linux assigns a unique file descriptor to each external device

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
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
13
Q

write()

A

accepts a file descriptor as input. returns the number of bytes written to the location specified by the file descriptor
fwrite() == buffered write

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

read()

A

accepts a file descriptor as an input. returns the number of bytes read from the location specified by the file descriptor.
fread() = buffered read

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

disk controller

A

a disk controller circuit that connects the CPU with the actual hard disk. the controller typically runs firmware, which is software written in a low-level language that controls actual hardware

the controller interacts with the disk device drivers running in the OS by sending/receiving data to/from disk to applications

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