Week 2 Flashcards

1
Q

What is Pseudo Parallelism?

A

The illusion that the computer is multitasking

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

What is Multiprocessor?

A

When the CPU is dividing its resources to work on different tasks

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

What is the difference between program and process?

A

The program is like the recipe
The process is like the cook

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

What is multiprogramming?

A

When the CPU switches between processes

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

CPU Utilization

A

1 - p^n
p is processor
n is number of processes

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

Kernel

A

One of two core components of OSs(with the file system)

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

File Management System

A

one of three core components of OSs (with the kernel and I/O Component). All data in a computer is stored in the form of a file, and the OS helps maintain the file sizes, names, locations, directory structures, and file access rights

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

CPU

A

the Computer Processing Unit. Circuitry to execute program instructions

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

CPU Cycle

A

the cycle performed by the CPU to read a program instruction, execute it, and repeat

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

User Mode

A

applications in user mode can only run instructions that affect its own application. Executing functions in the application’s code

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

Kernel Mode

A

allows privileged machine instructions to run. This mode is entered by flipping a bit on the CPU

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

Privileged Machine Instructions

A

have global effects on your whole computer and external devices. Examples include (1) writing data to disks and (2) running the logic that makes one application stop running, and instead start running another application

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

Process

A

a program in execution. Because there are limited CPU cycles and the OS needs to perform many tasks, the process concept allows OSs to switch between executing different tasks.

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

Process Content

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

Process Management

A

a function of the OS kernel that manages applications using an abstraction called a process

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

Address Space

A

The memory organization model for processes. Each process has its own address space of five segments, including (1) Code, (2) Data, (3) Heap, (4) Stack, and (5) Kernel space.

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

Code

A

A segment of the process address space that is, by convention, stored in the memory locations specified by the lowest addresses. Consists of the instructions being executed for the process

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

Program Counter

A

Register value stored in the CPU. It points to the address of the next instruction to execute in the Code segment.

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

Data

A

a segment of the process address space that, by convention, is stored in the memory locations just above the Code segment. Stores statically-defined variables.

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

Heap

A

a segment of the process address space that, by convention, is stored in the memory locations just above the Data segment. Stores dynamically allocated memory. Grows and shrinks at runtime during program execution, for example using malloc() and free() system calls in C.

21
Q

Stack

A

a segment of the process address space that, by convention, is stored in the memory locations just above the Heap segment. Stores temporary values required during function calls and pops them off once the function completes

22
Q

Kernel Space

A

a segment of the process address space that, by convention, is stored in the memory locations just above the Stack segment. Reserved space for the OS and privileged code

23
Q

Process Identification Number (PID)

A

unique number assigned to each process by the OS

24
Q

Process table

A

contains an array of process control blocks, and is maintained by the OS

25
Q

Process Control Block (PCB)

A

Each PCB stores the context of a single process.

26
Q

Init process

A

The only process that exists when the OS is booted. All other processes are child processes of init

27
Q

Parent and child processes

A

Processes are managed in a hierarchical structure. A parent process creates child processes

28
Q

PPID

A

PID of the process’s parent

29
Q

File descriptors

A

handles to open files used by processes

30
Q

Copy-on-write

A

On the creation of a new process, the child shares the parent’s memory address space until a modification is required. On a modification, a distinct memory page is then created for the child

31
Q

Fork()

A

System call that creates a new process and gives an integer return value, which is used to differentiate between the child and parent processes that are simultaneously running the same code after the call

32
Q

Exec()

A

accepts a path name to a code file as an input, and allows the child to execute this new piece of code.

33
Q

Wait()

A

allows a process to wait for another process to finish completing, to give a signal, or to perform some other specified condition. The settings are specified in the Linux man-pages.

34
Q

Exit()

A

terminates the process in which the exit() command is invoked

35
Q

Process state

A

running, blocking, or ready

36
Q

Running

A

instructions for this process are being executed by the CPU

37
Q

Blocked

A

process is waiting on I/O access, user input, or some other condition required to continue executing

38
Q

Ready

A

the process has all it needs to run and is waiting for CPU access

39
Q

Signals

A

software interrupts sent from process A to process B to communicate an event that took place in process A. Process B can be set up to watch for certain signals and respond accordingly, depending on the application being run

40
Q

Superuser

A

an account with special permissions on a machine. The exact permissions vary depending on the machine’s OS

41
Q

Orphan process

A

process A is an orphan process if process A is the child of process B, B has terminated, but A is still running

42
Q

Zombie process

A

process A is a zombie process if process A is the child of process B, but B has not called wait on A

43
Q

Daemon process

A

system-level processes that are started to run OS-specific management tasks

44
Q

Shell

A

an interface allowing the user to enter OS commands

45
Q

Explain the read and the three parameters?

A
  1. Where to read from
  2. Where to read to
  3. How much to read
46
Q

Explain the write and the three parameters?

A
  1. Where to write to
  2. What to write
  3. How much to write
47
Q

Why use strncpy() instead of strcpy()?

A

It is safer to use because it copies over everything minus 1 so that it has a null terminator

48
Q

Show me strncpy() three parameters?

A