Oriel — AI & technology worth noticing, every day.

Understanding "You are not expected to understand this."

Web page · https://taniwha.com/~paul/not.html

First seen by Oriel on .

AI summary

Paul Campbell explains V6 Unix’s infamous “You are not expected to understand this” comment as a consequence of stack restoration during swapped-process context switching.

  • V6 stores process state in a process-table entry and a per-process udot containing the kernel stack, mapped at a fixed kernel address.
  • savu() saves stack and frame pointers, while retu() and aretu() restore them; retu() also remaps the process’s udot through the MMU.
  • newproc() saves u.u_ssav before swapping out a process, marks it SSWAP, and later resumes execution through aretu(u.u_ssav).
  • After restoration, swtch() continues to return 1, causing the swapped-in child to return 1 from newproc(), while the parent follows the normal path.
  • The explanation notes that register variable rp must survive these transitions, probably through r4, because savu() and retu()/aretu() leave r2-r4 untouched.

#unix v6 #context switching #pdp-11 #memory management

Generated by gpt-5.6-sol. Check the original for details.

Metric trends

Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained

Points

Score reported by the source.

  • Hacker News: 3, latest observation
  • Lobsters: 24, latest observation ; +22 over observed period since

Comments

Comment count reported by the source.

  • Hacker News: 0, latest observation
  • Lobsters: 3, latest observation ; +3 over observed period since

Aliases

SourceExternal IDURL
Hacker News50670994https://www.taniwha.com/~paul/not.html Read discussion
Lobstersnkmtqkhttps://www.taniwha.com/~paul/not.html Read discussion