Hacker News new | past | comments | ask | show | jobs | submit login
Apollo program source code (ibiblio.org)
433 points by rjshade on April 25, 2012 | hide | past | favorite | 57 comments



Fun fact: the actual programs in the spacecraft were stored in core rope memory, an ancient memory technology made by (literally) weaving a fabric/rope, where the bits were physical rings of ferrite material.

http://en.wikipedia.org/wiki/Core_rope_memory


"Core" memory is resistant to cosmic rays. The state of a core bit will not change when bombarded by radiation in Outer Space. Can't say the same of solid state memory.

I worked on core memory computers in the 60's. You had 16K, tape drives (no disks) and FORTRAN. What a gas!


At a low level your correct, but you can use error correction and a lot of redundancy to prevent cosmic rays from corrupting solid state memory and still have a lot more than 16K of storage space for a long time.


...and radhard designs.


...which involve error correction and a lot of redundancy. But I assume you meant radhard electronics boxes, which lets you run whatever you want within a cosmic-ray shielded box.


you can do more than just improve on the boxing

https://en.wikipedia.org/wiki/Rad-hard#Radiation-hardening_t...


Just curious how they knew this given how young the computing industry was at the time that this was used.

Were there some "Well, that's interesting..." moments where we launched something and realized it was affected by cosmic rays?


Hubble, the ISS and other low-orbit satellites are affected by the South Atlantic Anamoly, which funnels down charged particles from the Van Allen belts.

(This /was/ a surprise to the folks who designed Hubble, but the spook satellite people apparently knew all about it . . . and didn't tell the Hubble folks, not even over beer or something. Great win for national security, guys </sarcasm>).


I didn't see an opening bracket for sarcasm so I assume it's before 'Great win'. Were they really surprised by this? Also are they same people that didn't know putting hard drives in space would fail because of the lack of air and had to replace them with SSDs?


I think it's just an understanding of how the underlying physics work. Alpha and beta radiation will cause bits to flip in solid-state devices, because the state is held with electrons. Whereas core rope memory stores that state as magnetic fields in ferrite cylinders. So radiation will basically just bounce right off the giant ferrite cores (giant relative to solid-state semiconductors, that is).

*I am not a physicist, someone correct me if I'm grossly wrong.


Hmm, it's more like any ionizing particle (charged) creates pairs electron/hole, many of them, so that the charge distribution in the pn junctions are altered. Sometimes gamma photons generate Compton electrons in the material that act as delta rays, to the same effect. Heavy particles can alter the crystal structure, inducing defects that may change its properties. Magnetic storage devices don't have polarised junctions and could withstand all this if they didn't include solid state electronics. Radiation hardening techniques and shielding can help a lot.


Its more a cause of the radiation ionizing the underlying semiconductor material. For instance when an electron tunnels into a transistor it can cause strange effects. Look up single event upset and single event latch-up for more information. The SEL is interesting as it causes a transistor to act as a double transistor and start drawing tons of power. At least that's how I understand it.


My guess is that radiation's effects on solid-state technology was well-known from nuclear tests.


"Some programmers nicknamed the finished product LOL memory, for Little Old Lady memory."

LOL.


In 1967, binutils was a person.


Huh? I don't get it.


Binutils are a set of utilities used by *nix systems.

http://en.wikipedia.org/wiki/Binutils


the person who builds the core rope memory


Aha. Binutils = compiler, linker, weaver, ....

I think this is one person who can legitimately say that he programs with a magnetized needle and a steady hand. http://xkcd.com/378/


Great! Texting LOL to my grandmother suddenly has a whole new meaning. I love it! She often complains her memory is getting old so it works even better!


Related: Magnetic Core Memory, the read/write version of Core Rope Memory. http://www.corememoryshield.com/report.html


Sort of an interplanetary quipu.

http://en.wikipedia.org/wiki/Quipu


C'mon, Notch, even Apollo supported interrupts:

http://www.ibiblio.org/apollo/hrst/archive/1678.pdf

"It is first appropriate to briefly describe the Apollo Guidance Computer (AGC). This processor is a general purpose, sequential, digital machine. Its word length is 16 bits including parity. The random access memory consists of 2048 words of destructive, read-write memory, called erasable, and 36,864 words of non- destructive read-only memory called fixed memory. The memor’y cycle time (MCT) is slightly less than 12 microseconds, with two MCI’s required to execute an add and four MCTs to execute a multiply. As is typical of real-time control computers, this machine has a set of special input-output channels with which it controls the spacecraft and observes the state of its environment. The interrupt structure consists of ten program interrupts with associated priorities, which are used for program control transfers. In addition, twenty-six counter interrupts with associated priorities allow for input-output servicing. The instruction set consists of forty-two regular instructions and nine involuntary instructions. Figure 1 indicates the number and diversity of systems with which the AGC interacts"

EDIT: Apparently, as of six or so hours ago, Notch has implemented cutting-edge 1970s technology ( http://dcpu.com/highnerd/dcpu16_1_3.txt ). :)



hmmm. so the "bugger words" at the end of, for example, http://www.ibiblio.org/apollo/listings/Colossus249/MAIN.agc.... are checksums - see http://books.google.cl/books?id=3fKzL0HfJp4C&pg=PA232...

anyone know the etymology? is it just a shortened form of "debugger"? is "bugger" not common slang in american english? or is this a joke?


Bugger is not common slang in American English. You can find people who will argue about that, but they don't get out much.


Bugger is not common, but also not uncommon American slang. It has rather lost it's original meaning. I have heard little old American ladies use it, probably having heard it in a movie, with the intention of a meaning derived from to bug (bother). I don't think any slang dictionary has ever caught up with this usage.


I've used bugger since the first of the Austin Powers movies. My friends and I used it until one of them married a South African girl and she made us stop being as it was incredibly impolite and rude apparently. I started again last year after watching Top Gear and then recently got yelled at by a new accounting manager who moved into the office across from my cubicle. Once again, I was being crude but in all honesty, for me, the word is no different than saying frag, frell, crude bunnies, etc.


Very commonly used in New Zealand, its used on TV with no problems, heres the iconic Toyota ad using the word bugger to good effect: http://www.youtube.com/watch?v=TKY_OysWu3k


I'm pretty sure it's a reference to Ender's Game. Also, the fact that Ender's Game was published in 1985 is of no import whatsoever.


It isn't short for debugger. A computer "bug" originated when a small moth (aka bug) was caught in a physical relay on the Mark II. http://en.wikipedia.org/wiki/Software_bug#Etymology

"Debugging" came from the action of trying to find where the bug is at in a program (or, in the original case, the machine)


Quick correction: if you read your link you'll see that glitches have been called bugs since the 1930s or earlier. The Mark II team didn't originate the term but they were very amused to see the literal manifestation.


The note by that moth in the log book says "First actual case of bug being found." Other text on that page reinforces the idea that the word "bug" was in use before that particular bug, not least the quote from Thomas Edison.


Most of this is code is available in machine-readable form in the VirtualAGC Google Code repository:

http://code.google.com/p/virtualagc/source/browse/#svn%2Ftru...


Now that the shuttle program has ended, it would be nice to get the supposedly perfect code produced by the On-board Shuttle Group as well. I wonder if a FOIA request has been made.


Anyone have an idea why there's sourcecode for (apparently) a pinball machine in there?

http://www.ibiblio.org/apollo/listings/Luminary099/PINBALL_G...

It's in the code repository for multiple Apollo's


If you read the code, it seems to suggest this is just the (fun) name of the lit display driving code.


I believe pinball was the name of their keyboard and display program (not an actual pinball machine)


Just in time for being ported to DCPU-16.


I lolled.


Exactly ...


A very interesting book, written by Frank O'Brien and published by Springer, The Apollo Guidance Computer: Architecture and Operation, is definitely worth the read. Fun fact: The unit weighed 70lbs (32kg).

The AGC has spawned a pretty active cult of hardware hackers that have built the AGC from scratch - including the core memory.


looking through some of those documents a couple things stand out to me: 1) learn your maths people if you want to do rocket science stuff 2) the amount and detail of the documentation they wrote back then is unreal 3) the simple webapps I write for big bucks at local megacorp pale in comparison to those programs that frickin landed people on the moon!


My favorite is the DSKY emulator: http://www.ibiblio.org/apollo/yaDSKY.html I used to use it as my desktop clock for a while.


With the power of open source, "many eyes make all bugs shallow".

Wouldn't be a hoot if someone ran this through a simulator, and discovered a bug that had eluded NASA?


I'd need a lot of convincing it wasn't rather a bug in the simulator. An attainable amount of convincing, but it would be my first thought.


Why?

Bugs in code made it into space. These are documented.


Because the odds are that the simulator with which someone will run around yelling about the bug they found (which will get them links on HN and other fun perks) will have had less than 1% of the time spent on creating it than the code that was actually sent into space, and on the balance, given the observation of a defect in the combined simulator+Apollo code the highest probability locus is the new, untested code that was probably rushed out for publicity's sake and had no lives ever depend on it.

You seem to have misinterpreted my post as me saying I would never believe it was a bug in the Apollo code, despite me making very sure to explicitly disclaim that.


If it was anything remotely like the team handling the shuttle code[1], I doubt it.

[1]: http://www.fastcompany.com/magazine/06/writestuff.html


I would not take an even bet that there is any meaningful bugs in that code that NASA was not already aware of.


Here's a nice detailed study of the 1201/1202 alarm that caused the AGC to reboot while Apollo 11 was landing:

http://www.hq.nasa.gov/alsj/a11/a11.1201-pa.html


.. what about voyager program? you could then actually test the live system )


Who's going to implement this in-browser in javascript?


I bet a lot of folks under the Iron Curtain would have loved to have had access to these documents back in the day.


Maybe they had... or maybe the NASA/MIT code is based on code originally obtained from behind the iron curtain.


If this stuff interests you, I highly recommend David Mindell's Digital Apollo.


so who is going to be the first to convert this all to DCPU?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: