Processes and System calls Flashcards

(11 cards)

1
Q

What is a Process

A
  • A process is a program that’s running
  • Program loader,
    invoked by exec( ), retrieves and unpacks executable
  • ## Note a thread is a flow of execution within process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Processes are defined by their context..

A

CPU Registers
Memory Layout
Open Files
On-going communication state

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

PCB

A

Basic Process Control Block holds all the essential management information/context for a process. There’s one PCB per process.
Process state,
Process ID,
Priority

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

Process Hierarchy

A
  • Processes can spawn child processes
  • Each child has parent process– Ultimately responsible for resources used by child
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Creating a Child Process

A

In Unix this carried out by fork( ) system call– Returns child’s Process ID to parent and 0 to child

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

Process heap

A

The heap is a part of a process’s memory where it can dynamically request more memory while running — useful when you don’t know in advance how much memory you’ll need.

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

Process Stack

A

The stack is a part of a process’s memory used to keep track of function calls like a to-do list for the CPU.
- Stack grows and shrinks as functions are called and return.
- On x86 systems, it grows downward
-

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

what is System calls

A

User programs can’t directly Communicate with (most) hardware as unrestricted access would allow any program to read/ change anything so System Calls Offer standard interface to kernel/ OS functions meaning they communicate to the OS.
System calls Provides access control mechanism Single point of entry that can check all parameter

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

examples of system calls

A

read() → read data from a file or input

write() → write data to a file or output

fork() → create a new process

exec() → run a new program

exit() → end a process

open(), close() → manage files

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

What happens during a system call?

A

The program switches to kernel mode, the OS performs the action, then control returns to the program.

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