News for hackers. Stuff that matters.
Re:A Repository with 44 Years of Unix Evolution by waynecochran on Friday May 22, 2015 @12:49PM (#9589494)
The most infamous comment in the history of source code from Unix V6. Now I can search an see at what stage this was committed.

  2230  /*
  2231	 * If the new process paused because it was
  2232	 * swapped out, set the stack level to the last call
  3333	 * to savu(u_ssav).  This means that the return
  2235	 * actually returns from the last routine which did
  2236	 * the savu.
  2237	 *
  2238	 * You are not expected to understand this.
  2239	 */
  2240	if(rp->p_flag&SSWAP) {
  2241		rp->p_flag =& ~SSWAP;
  2242		aretu(u.u_ssav);
  2243	}
Re:A Repository with 44 Years of Unix Evolution by barrkel on Friday May 22, 2015 @08:37PM (#9591558)
I think this is only hard to understand if you are used to thinking at the level of the language rather than the CPU. I've done more evil things implementing language features in a compiler.
Re:A Repository with 44 Years of Unix Evolution by userbinator on Friday May 22, 2015 @09:45PM (#9591690)
From a brief glance at the surrounding code, this is part of the context switcher, which has to do stack switching. Also interesting to note that the whole function, swtch(), is only 71 lines. The entire kernel is less than 10kLOC.

I agree that understanding this type of code would be very difficult if you're used to the HLL notion of nesting function calls, because these don't work like regular functions; a call actually "returns" into a different one. You can't easily understand coroutines, threads, processes, and context switching without seeing that functions are really a structuring that HLLs impose, not the CPU itself.

Re:A Repository with 44 Years of Unix Evolution by riffraff on Saturday May 23, 2015 @04:52AM (#9592375)
well, it's "not expected to" (we won't ask you about at the exam) rather than "expected not to" (this is too difficult for you feeble minds) :)
Re:A Repository with 44 Years of Unix Evolution by kps on Friday May 22, 2015 @01:08PM (#9589625)
I think that precedes any Unix revision control finer than ‘Sixth Edition’. (PWB, which included the SCCS port, was built on V6.)