Skip to content

New Program, Same Process

Exercise: 52k_userland · Thu Dec 3 · Length: 6:53 · Reading: Week 15 · Replace the program, keep the process · Explainer: New Program, Same Process

A narrated walk through the explainer, for before Thursday's session (Dec 3), to go with the Week 15 reading fork, wait, and the User Shell: exec keeps the process and gives it a new program, and sh runs every command by forking, letting the child exec, and waiting. The video reads one process part by part, its slot and the pages it points at, then steps through one line the lab typed at sh's $ prompt under cargo run: sh's fork, the child's exec call and the new program's first instruction, with every part of the child drawn at the call and after it. A mistyped name follows, with what the child does once its exec comes back, in sh's given code and in the typed session. Then kernel A, a broken kernel, by its recorded consoles and the line the test prints for it. The video ends on what you write and the test's checks. It shows no solution code: only the process's parts, its registers and each call's answer at each step, with example words and pages, or the test's own.

Download the video (MP4, 9 MB) · Captions (WebVTT) · All eleven Week 15 videos