Lecture 2: Process / Shell (Part 1) Flashcards
Process Information includes 3 things:
1) Process Stack
2) Data Section
3) Heap
Define: Process Stack of Process Info
Includes temporary data:
- function parameters
- local variables
- return address
Define: Data Section of Process Info
Includes global variables
Define: Heap of Process Info
Memory that is dynamically allocated during run-time
Program code of a process is known as:
text section
State the 4 process states:
1) New
2) Running
3) Waiting
4) Terminated
How is a process represented in the Operating System (OS)?
As a Process Control Block.
What is included in a Process Control Block?
Info related to program execution and context info such as:
- PID
- Process State
- Program counter
- CPU Registers
- CPU_Scheduling info
- Memory-Management info
- I/O Status
List the 7 broad categories of Operating System services:
1) User Interface
2) Program Executions
3) I/O Operations
4) File Manipulations
5) Resource Allocation
6) Accounting
7) Protection and Security
Define: Shell
An interface between user and OS to access OS services. Is a Command Interpreter (a program that accepts commands from the user and interprets the commands)
When using the Shell, the execution of a command is done by ________. What does the Shell make use of when carrying out commands?
A separate process (child process) from the shell process. Makes use of System Calls.
Does the shell wait for command processes to finish before the user can use it again or can you always use the shell process?
You have to wait (unless you initiate command with the AND sign which runs the command in the background)
When a fork system call is made, what does the child process inherit from the parent?
The parent’s state: Same program instructions, variables have the same values, same position in the code. (Parent and child have separate copies of that state).
What does fork() return when called?
PID to parent; 0 to child if successful. Else, -1 if failure to fork.
If a failure occurs, what will be the main reason behind the failure?
Failure occurs when the limit of processes that can be created is reached.