Lecture 004

This lecture covers OSC Chapter 3 (but not 3.5, 3.6 "POSIX Shared Memory", and it's fine to skip)

Pseudo machine life cycle kernel states kernel state memory layout

Birth

fork(): we copy the following, which is expensive

execve(): replace stack, heap, register, data, code, and some other kernel tracked process variables (like timer). This usually run by user after fork().

spawn()/posix_spawn(): fill out a large form (no need to copy, efficient)

Plan9 rfork()/linux clone(): specify which things is shared vs copied.

School

execve():

scheduler states:

Death

Signals

exit(int reason)

SIGUSR convention:

SIGDANGER: Kernel hope program to give up memory.

Cleanups

Release resources:

Accounting: record resource usage in file

Zombie: process state reduced to exit code, util parent calls wait(), process control block (PCB) deleted from kernel

process control block (PCB):

Summary

Virtual Memory Layout

Virtual Memory Layout

Physical Memory Layout

Physical Memory Layout

Minimum Kernel consists of:

Table of Content