How They Built the Software of Apollo 11
LinuxScribe tips a piece up at Linux.com with inside details on the design and construction of the Apollo 11 code. There are some analogies to open source development but they are slim. MIT drafted the code — to run on the Apollo Guidance Computer, a device with less grunt than an IBM XT — it had 2K of memory and a 1-MHz clock speed. It was an amazing machine for its time. NASA engineers tested, polished, simulated, and refined the code. "The software was programmed on IBM punch cards. They had 80-columns and were 'assembled' to instruction binary on mainframes... and it took hours. ... During the mission, most of the software code couldn't be changed because it was hard-coded into the hardware, like ROM today... But during pre-launch design simulations, problems that came up in the code could sometimes be finessed by... computer engineers using a small amount of erasable memory that was available for the programs. The software used a low-level assembly language and was controlled using pairs or segments of numbers entered into a square-shaped, numeric-only keyboard called a Display and Keyboard Unit... The two-digit codes stood for 'nouns' or 'verbs,' and were used to enter commands or data, such as spacecraft docking angles or time spans for operations." Reader Smark adds, "The Google Code Blog announced today that the Virtual AGC and AGS project has transcribed the Command Module and Lunar Excursion Module code used during the Apollo 11 moon landing. The code is viewable at the VirtualAGC Google Code Page."
Wow. They sure went out of their way to fake the moon landing. I bet the source-code is fake too :-P
Y
I think I just had a geekgasm.
My ism, it's full of beliefs.
For Vista, the following steps may need to be performed manually after installation:
1.
2.
-- README.txt
Wow, even rocket scientists don't know how to make code work on Vista.
As some one old enough to enter raw hex in to a hex keypad on a machine with an LED display having hand assembled the code in the back of her math exercise book during a math lesson (when I should have been learning stats) this doesn't sound too different.
...was the first flight to land in terrain where the descent trajectory had to be designed to avoid high altitude terrain. By that I mean they had to fly over a mountain, then into a valley for the landing.
The terrain model in the PNGS had five vectors in memory to represent terrain. Back in those days, RAM was expensive.
http://michaelsmith.id.au
this is clearly a horrible case of bloatware
intellectual property law is philosophically incoherent. it is your moral duty to ignore it or sabotage it
"The Apollo's Guidance Computer was a snail-like 1.024 MHz in comparison, and it's external signaling was half that -- actually measured in Hz (1/1000th of 1 MHz, much as 1 MHz is 1/1000 of 1 GHz)." FAIL!
"Absorbing your worst..."
When you consider how many shitty programmers there are now who use variable names that take up nearly 2k.
http://embedded.com/columns/technicalinsights/218401508?pgno=1
"Calculating trajectories for Apollo program"
"Jack Crenshaw describes what he and team members did to research trajectories for the Apollo missions."
no, there are no analogies to open source anything here. collaboration != open source.
can we please have an article about computing where someone isn't droning on and on about open source at any opportunity? it's annoying that any attempt to discuss anything is sabotaged by open source zealotry. it's like having someone who has to interject crap about their religion into every conversation.
I found a fascinating audio explanation of how the guidance computer deals with deviation. Well worth the listen (only a couple of minutes long).
I've watched these videos on the different engineering challenges faced by the Apollo program well before this 40th anniversary... but now's as good a time to revisit them as any:
http://www.videosift.com/video/Moon-Machines-The-Navigation-Computer-1-5
http://www.videosift.com/video/Moon-Machines-Command-Module
http://www.videosift.com/video/Moon-Machines-Space-Suits-1-5
http://www.videosift.com/video/Moon-Machines-Lunar-Rover-1-5
http://www.videosift.com/video/Moon-Machines-Saturn-V-1-5
Even people that believe in pre-destiny look both ways before crossing the street.
In those days we had to program the computer the size of a school bus strapped to our backs while trudging through the waist deep snow, for five miles one way, uphill both ways, without mittens while the politicians were whipping us yelling, "you don't want the Ruskies to win, do you?", those were the days boys. Now these young whippersnappers are using laptops with 8 Gigs of RAM and still could not write a simple javascript engine with a just in time debugger without creating a buffer overflow vulnerability while fed very long unicode strings.... bah... now get off my lawn.
sed -e 's/Chuck Norris/Rajnikant/g' joke > fact
When I wrote my own equivalent program in C= BASIC, you weren't in a lunar module at all -- you were on foot. There was no fuel, but you had a time limit. You'd been poisoned, you see, and you had to get to hospital, quick. Go too slow, you don't reach the hospital in time, die. Go too fast, run into a wall, die.
I was a very strange child.
Got them moderator blues I blieve I walk out the do', With these mod-points I been gettin', I 'most never post no mo'
Considering how simple by today's terms the computer was, plus the fact that it couldn't handle all the input anyway leaving the astronauts to essentially land the craft without any assistance. Not to say the computers didn't help with all the other extraordinary feats that were accomplished, but it goes to show that relying solely on computers especially in essentially untested conditions can be dangerous and foolish.
The musings of just another geek and his junk.
Wow essentially man landed on the moon with the computing power of a 2600.
Where is it? There's something about subversion, then an URL which doesn't work. There can't be more than a few K of source - why not just provide a link for people who don't have subversion installed on their phones/PCs etc?
Shoehorning a piece of software into an "open source" angle really doesn't do any justice to open source or the software you're writing about.
Instead of writing about open source software, write about good software that happens to be open source. If there is really good software where we know something about the code, like this Apollo software, then write about that. Discuss the collaborative development the engineers did, talk about the open source clone over at Google Code, but calling this "like opensource but only for NASA" is a massive distraction.
Journey to the Moon: The History of the Apollo Guidance Computer
by Eldon C. Hall
ISBN: 156347185X
If anyone is ever in the Mountain View area the Computer History Museum has one of them on display.
Richard Feynman's book 'What Do You Care What Other People Think?' also mentions the software development scheme used for space shuttle hardware in the context of the Rogers Commission report on the Challenger accident.
ISBN: 0393320928
The History Channel was running space history stories all day Sunday, and in one of them about Apollo 11 (IIRC it was the show "Modern Machines") they said that a pocket calculator had more power than the 180 lb onboard Apollo computer. Integrated citcuts were very primitive, containing less than 100 transistors each (according to wikipedia).
An XT was far more powerful than a pocket calculator. Your cell phone is more powerful than an IBM-XT.
When they were landing on the moon, the computer was in the process of crashing - it had computational overloads that it couldn't handle. On top of this, they almost ran out of feul.
I was seventeen and at work when the Eagle landed, I journaled that night yesterday.
Free Martian Whores!
1: Download the excellent sim Orbiter:
http://orbit.medphys.ucl.ac.uk/
2: Download the Apollo addon NASSP:
http://nassp.sourceforge.net/wiki/Main_Page
3: Download the virtual AGC/AGC software:
http://www.ibiblio.org/apollo/
4: ?????
(Literally, spend hours trying to figure out how to fly, how to get into orbit, reading the detailed manuals, etc etc etc)
5: Profit!
A lot of the problems we see with software today are due to the complexity of the hardware and software systems on which it is built. For the most part there are way too many variable to keep in your head at once to make sure they are all coherent.
In future missions, astronauts reportedly plan to bring along many thousands of times more on board computing power than previous eras by "not forgetting their mobile phones".
Available here
Singularity: a belief in the "God" idea with the "demiurge" relation inverted.
Next time you think you have a tight deadline:
"Final exam (for the advanced student)
Prior to the descent of Apollo 14's LM to the lunar surface, a short in the LM control panel caused the abort switch to be triggered intermittently. If this actually happened during the landing, an abort would have automatically occurred (meaning that the lower stage of the LM would have been jettisoned and the upper stage would have blasted back into space). No landing would have been possible, and the astronauts would have faced the grave situation of needing rescue by the command module. It was therefore necessary, in the orbit or two before descent, for the some of the software designers to work out a fix for this problem that allowed a software lockout of the abort switch during the initial phase of the descent, but also allowed reenabling the abort switch later in the descent, in case the astronauts needed to use it. They did, in fact, work out such a fix. Your mission, should you choose to accept it, is this: Work out such a fix and send it to me. Remember, your fix can only involve erasable memory, since the core-rope containing the program cannot be altered. The fix needs to be keyed in at the DSKY by the astronauts. You have about 90 minutes to figure it out. Go!"
http://www.ibiblio.org/apollo/index.html#Final_exam_for_the_advanced_student_
A few years ago I read an excellent article on how NASA develops software for the space shuttle. It focuses on the development process. The article is quite long, but well written, informative and entertaining. Read it here: http://www.fastcompany.com/magazine/06/writestuff.html?page=0%2C3
Let's give praise for the great game simulating the lunar landing experience. Running out of fuel was such a sick feeling - watching your module helplessly smash into the surface.
"No matter where you go, there you are." -- Buckaroo Banzai
G and P codes. People who work with CNCs are already familiar with the keypad/ LCD method you describe.
I had a base 2K of RAM and a 1 mhz processor on my Sinclair ZX81 too, and I could play lunar lander (with what we called graphics back then on the whopping 16K expansion).
My father in law worked for Boeing in the late 60's and was part of the team of Engineers that built hardware and coded for the LEM. His first experience with code.
One of his later jobs was QA for every line of code in the fire control computer for Seawolf.
Professional Politicians are not the solution, they ARE the problem.
Its fascinating how history repeats itself. I mean 40 years after the Wright Brother's first flight, the US government was still trying to recreate the feat.
Seastead this.
C and BASIC are very different languages.
My father was a young electrical engineer working on Apollo.
I remember watching Apollo 13 with him (the movie, not the actual mission). It was a long stream of, "I remember him..." and "this is what they didn't include in the movie..."
In 2K in 1969!
But in the 21st century microsoft have decided that a 1Ghz processor (thats 1000 times faster than the apollo CPU) in a netbook is not enough for poor Windows 7 to run more than 3 applications at a time. Gimme a friggin break! FFS , what kind of idiots are calling themselves systems programmers these days.
Well Hal, once upon a time...
My ism, it's full of beliefs.
The part that is most amazing to me is that the software was was spitting errors the whole time the LEM was landing. It seems like that would make it awfully difficult to concentrate on landing when you're basically getting out-of-memory exceptions the whole way down. I think that they wound up landing with something like 17 seconds of fuel left. It's really a wonder we made it as far as we did on that technology.
very good idea
I know I'm lazy, but is there a flash / javscript simulation of the AGC?
let's just forget that whole 'on topic' thing and dig a little into what is really bothering you. how about wombats? do you like wombats?
There is one dude who built a working replica of the AGC and let it run the original flight software:
http://klabs.org/history/build_agc/
Lots of good information in those PDFs. Also very interesting that the AGC already ran some simple real-time capable multitasked OS. Simple, but still with a lot of modern ideas in it.
[--- PGP key and more on http://www.root42.de ---]
Though not primarily about the code or machine structure, the recently published book "Digital Apollo: Human and Machine in Spaceflight" by David A. Mindell (Amazon) has lots of interesting insights into the design decisions and tradeoffs that led to the Apollo software being discussed here.
In particular, it explores debates that might now seem quaint as to whether computers could be programmed to make the decisions necessary to reliably fly and land a spacecraft, and especially, what the right tradeoffs are between direct human control, fully automatic operation, and intermediate modes in which the computers provide the human with higher level abstractions than the raw hardware. Ultimately, for the moon landings, it seems to be this intermediate design point that proved compelling: when Armstrong "overrode" the automatic guidance to choose a landing spot, he was not directly controlling each thruster or the main descent rocket; rather, he was instructing a program to reposition the craft, change speeds, etc., and the computer adjusted the various thrusters and engines appropriately.
There's also a quite good discussion of the famous 1202 errors that almost caused an abort, and of how they related to what was then the very novel and robust architecture of the software created by MIT and the Instrumentation Lab. The book also provides lots of interesting information about scheduling issues (nobody noticed until relatively late in the game that software would be important or difficult), some about hardware architecture (the so-called "ropes" that carried the code in a form that we would think of as ROM today). Overall, a good book for those interested in details.
I had the pleasure to meet John Schinas, one of the programmers tasked with LEM landing and orbital code and the entrepreneur behind a company my wife had the pleasure to work for. An absolute genius.
As I hear the story, he was given the task to write the code and was asked how many team members he'd need, he demurred, saying that he'd just do it himself. Program managers said it was impossible for a person to write 100,000 lines of machine code without error, and after he did it, nevertheless tasked backup personnel to scrutinize the code line by line. They didn't find anything.
Really nice guy, too.
-Styopa
You mean like the usage profile of the slashdotted server?
Table-ized A.I.
I think the use of core rope memory for program storage was fascinating. I guess you really have to be sure of your code. That kind of commitment is kinda scary. http://en.wikipedia.org/wiki/Core_rope_memory
The Block II AGC had 2,048 WORDS of memory, not 2,048 bytes. A word on the AGC is 15 bits + 1 bit parity. So, the AGC actually has 4 KiB of erasable memory, or 3.75 KiB not counting parity.
Also, keep in mind that this was just data memory, not program memory. A lot of early 8-bit micros loaded their programs into RAM from cassette or paper tape, so the total memory available for data is reduced.
The AGC had 36 KWords of read-only program memory which was woven into core-rope memory by the same "little old ladies" that sewed the suits together.
I was watching "From the Earth to Moon", the entire series, there on Saturday and it was all great.
But I especially enjoyed the Apollo 8 episode, where they had dramatized Grumman Engineering's development of the Lunar Module.
From a software engineer's perspective, I thought to myself that there must be a huge amount to learn about the design process, interface design and large scale project management among other things from the whole Apollo project - and I was wondering if there was a book that explored all this.
After the programme was over I actually ordered "Digital Apollo" from Amazon. Maybe that's it? Any other suggestions?
Genesis 1:32 And God typed
While the article was good, many people will want likely want to read NASA's online book about computers in space travel, covering computers back in the Gemini program through to the space shuttle and unmanned probes. Fascinating stuff:
http://history.nasa.gov/computers/contents.html
I think I've just fallen in love with the parent poster. Female, biker, embedded systems designer. Now, one small problem, how does a 50+ male become an attractive lesbian?
From scarped cliff or quarried stone she cries "A thousand types are gone, I care for nothing, no not one."
There were a fair number of errors in the article. The code was not open source by any stretch of the imagination. You needed security clearance to see it. Keying in a patch is not the same as contributing to open source.
The main development computer was the IBM 7094, a 1-2 MFLOP machine, depending on the model. It had 32K (not 64K) 36 bit word memory, putting it around 200K characters. It was not 12 hours to do a compile, probably only a few minutes, but it took 12 hours to get your results back from a batch process. Your program had to wait its run.
Actually running your program on the Apollo Guidance Computer took months, because the memory (ROM) was hand woven by little old ladies from a textile mill (really!). A 1 was a core. A zero was the absence of a core.
http://www.fastcompany.com/node/28121/print
General Relativity: Space-time tells matter where to go; Matter tells space-time what shape to be.
This guy wins the ubergeek crown of all time. He actually built a fully functional version of an AGC out of discrete IC chips. Granted, it is not a true AGC clone, since the exact chips could not be procured in 2000-2004, but he did build a functional workalike of the AGC out of individual TTL chips, and wrote two software emulators, and got his modernized hardware reproduction AGC to run actual original AGC machine code software.
Ah, but will it fly and successfully land the Lunar Lander simulator (http://games.slashdot.org/article.pl?sid=09/07/20/1447236)?
"Computer Scientists can count to 1024 on their fingers" (non-mutant, non-mutilatated, human computer scientists)
Since we now have the "how they did it", let's game this into: Suppose that some big-a$$ set of rockets
Quickest here to Mars for the least energy output using the Apollo AGC wins...
...Open Source isn't the only answer -- but it's almost always a better value than the alternatives...
"There are some analogies to open source development but they are slim."
aww, poor kid.
Just calling it ROM doesn't quite convey the level of tech. It was also known as little old lady memory because it was literally copper wire and ferrite cores woven together by little old ladies.
JFK's challenge was to land a man on the Moon *and* bring him safely back to Earth. Just landing on the Moon wasn't enough!
Here's a very good article from the IET about the AGC hardware: http://kn.theiet.org/magazine/issues/0912/smart-apollo-0912.cfm
> Maybe as a country, we have just lost our 'will' to do things?
Partly. But it is also rational. Remember why we did it in the first place. We had to beat the 'Godless Commies' to the moon so we were willing to spend whatever it took and men with balls of steel were willing to climb into rushed spacecraft. And we won a major engagement of the Cold War with only three casualties. When the historians finally settle on things it is likely that Kennedy's Apollo and Reagan's Strategic Defense Initiative will be remembered as major contributors (the other two major ones being Reagan's "Focus of Evil" and "Tear Down this Wall" speeches) to the failure of the Soviet Union so it was worth the investment. After we planted the flag the game changed. The stated goal was to land on the moon and return, we had never set a goal of building a moonbase or anything more permanent. It was no longer worth spending such a large percentage of the US Federal budget, the need to take such risk dropped, etc.
I have long said we went to the moon fifty years before we were ready and because of that we will probably lose another fifty years before returning. Because after the moon landings none of the things we should have been doing to work our way to the moon the 'right' way were/are inspiring enough to sustain the political support needed to do them as big government NASA style jobs. So we will now have to wait until the tech gets developed enough that private industry can do it as part of profitable ventures. And we are seeing the first signs of that finally getting going. But it will be at least fifty years before any of the private ventures can work their way back to the moon.
And there IS profit to be made 'out there' so go we will. Private companies are already making real coin in the launching business. NASA is trying to outsource suppling the ISS, mostly because they wish they were rid of the white elephant but whatever.
Democrat delenda est
This article from MATLAB News & Notes that came out on the 30th anniversary is pretty interesting - there are some nice details in it about the original system. It was co-authored by Dick Gran, one of the engineers who helped design the real thing. I saw Dick Gran give a talk on this subject and it was really interesting. Full disclosure: I work for the MathWorks.