Monday, September 01, 2008

You are not expected to understand this

I read a few pages of Digital Apollo every day. Interesting (even talks about the X-15 flight control systems) and thorough to the point of being ... very thorough :) But good discussions of the engineering trade offs made between pilot- or computer-in-control, and MTTF. The author also has some good quips (p.124):
It has become fashionable to denigrate the computers of the past with phrases like "we flew to the moon with less computing power than I have on my wristwatch," or "can you believe the entire Apollo program fit into a mere 36 k of memory?" Simply focusing on memory size, or the computer's speed, however, misses the important engineering accomplishments of the Apollo computer. For who among us would risk our lives on our desktop computers, with all their speed, accuracy, and memory, and rely on their working flawlessly for two straight weeks? The space shuttle flies with five redundant computers,. Any fully digital airliner has a minimum of three. Apollo had only one. It never failed in flight.
I have a little quibble with that. As we know from watching Apollo 13, there were actually two computers along for the ride (the astronauts moved the navigation data from the CM computer to the LM computer before shutting down the CM).

In any case, the author attributes the following to "Opening lines of Apollo software source code" (p. 145):
Quest oculus non vide, cor non delet
What the eye does not see, the heart does not regret
"A lot happens that we are not telling you about."
Which reminds me of the famous comment in the UNIX kernel code "You are not expected to understand this" (but the professor in our graduate level operating systems class insisted that we did for the exam :)

Dennis Ritchie explains what they meant by that famous comment on his Bell Labs website (scroll down about a screen). He mentions Lions commentary and source code, which were the textbook for our operating systems class. You can still buy it, or download it and all the source code (see end of the Wikipedia entry for Lions' book.

The famous quote is in the body of swtch() at line 2238. Lions explanation begins in Section 8.9 of his commentary with "The comment which begins here is not encouraging." It is an amazingly clever way to do process switching though.