M2: Operating Systems Overview Flashcards

1
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
2
Q

File management system

A

one of two core components of OSs (with the
kernel). 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
3
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
4
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
5
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
6
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
7
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
8
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
9
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
10
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
11
Q

Address space

A

the memory organization model for processes. Each process has its own address space = virtual address space, to distinguish it from physical address. Consists 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
12
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
13
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
14
Q

Data

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

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

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

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

Process Identification Number (PID):

A

unique number assigned to each process by the OS.

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

Process table

A

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

20
Q

Process Control Block (PCB):

A

each PCB stores the context of a single process.

21
Q

Init process

A

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

22
Q

Parent and child processes:

A

processes are managed in a hierarchical

structure. A parent process creates child processes.

23
Q

PPID

A

PID of the process’s parent

24
Q

File descriptors:

A

handles to open files used by processes.

25
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.

26
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

27
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

28
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.

29
Q

Exit()

A

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

30
Q

Process state: running, blocking, or ready

A

○ 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 required to continue executing.
○ Ready: the process has all it needs to run and is waiting for CPU
access.

31
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.

32
Q

Superuser

A

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

33
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.
Reclaimed by init

34
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.
process A has completed but its PCB is still in the process table

35
Q

Daemon process:

A

system-level processes that are started to run OS-specific management tasks.
system-level process or background jobs owned by init process

36
Q

Shell

A

an interface allowing the user to enter OS commands

37
Q

Snapshot of Process Memory

A

Program Counter, Code, Stack, data (e.g. global variable), Heap, Program Counter, Stack Pointer

38
Q

Data Segement

A

Will not grow during the lifetime of a process, since it only deals with statically defined variables

39
Q

What is updated in memory whenever a process is executing

A

only the hardware registers are updated. But when the operating system decides to stop running the process, its register values including the stack pointer and program counter are stored in the PCB.

40
Q

Which of the elements of a process are stored in a process control block (PCB)?

A
  • Stack Pointer
  • Register Values
  • Program Counter
  • File Descriptors
  • Memory Context: Pointer to page table

While the PCB of a process stores file descriptors of files in use by the process, the PCB does not store the files themselves.

41
Q

OS

A

Interface bw. user applications and computer hardware

Charge multiple tasks of varying priorities and allocating system memory

42
Q

OS Functions:

A
  • Provides abstraction of the hardware – hide messy implementation details
  • Resource Manager: Manage CPU Time and Memory
43
Q

Advantage of Limiting the transition to a small set of system calls

A

protects the operating system from being corrupted by applications either through software errors or malicious attacks.

44
Q

Resources shared bw. child and parent usually not shared bw. processes

A

open file descriptors, semaphores, pipes,

45
Q

Copy on Write

A

A child’s memory space is nearly identical to that of its parent. In a fork() operation, if we blindly create a child that is a replica of the parent, it is a lot of wasted work especially if the child address space is going to be overwritten later on through an exec() call. A lazy copy-on-write mechanism is used instead. If the child process modifies a piece of the memory, then a new copy of it is created.