chapter 4: the abstraction: the Process Flashcards

1
Q

what is a process?

A

a running program

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

what is Time Sharing and Space Sharing?

A

sharing time and space between programs (only one or a few CPU and only one big address space

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

what are the steps an OS has to do to run a program?

A
  1. load its code and static data into memory, the address space of the process
  2. programs initially reside on disk, SSDs in some kind of executable format.
  3. OS reads those bytes from disk and place them in memory somewhere
  4. memory allocated for the programs runtime stack. (local variables, function parameters, return addresses.
  5. the OS fill in the parameters to main() and initialze the stack.
  6. the OS allocate memory for program’s heap. (malloc() , free()). heap will be small at first, OS may get involved and add more memory if needed.
  7. OS sets up I/O
  8. start the program main() by jumping to the main() routine. Transfers control of CPU to process
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

how was loading process done in OS before?

A

it was loaded EAGERLY, all at once before running the program. now its done LAZILY, only loading it when needed.

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

Process states

A

running, ready, blocked

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

how do the states change from one another

A

running to ready: descheduled
ready to running: scheduled
Blocked to ready: I/O done
running to blocked: I/O initiate

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

data structures of a process

A

the OS keeps a process list: to track states of all processes
each process has a PCB: contains information of a process (stack pointer, PID, process state, parent process etc)

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