When NASA needs an operating system for a Mars lander does it go knocking on Bill Gates’ door? The answer is no. The newly arrived on the planet Phoenix Lander is powered by a variation of Linux running on a specially hardened CPU and motherboard produced by IBM.
The CPU may not sound very exciting, and certainly would not be of interest to the average computer gamer. The Rad6000 CPU is a RISC (Reduced Instruction Set CPU) that has been hardened to withstand the ravages of radiation in space. Built by IBM it clocks in at a screaming 33mhz. For those of you not familiar with the gobeldy —- that computer geeks espouse, 33mhz is about equivalent to the old and very obsolete Intel 386 processor that was all the rage a decade ago. You certainly could not run Microsoft Vista with this kind of speed.
As far as RAM is concerned NASA doesn’t need a lot, it is rumored that a scant 128 megabytes is all they need.
When it comes to software NASA need something that is bullet proof, and bullet proof software is what NASA is great at. It is not often that they make mistakes. At the heart of the Phoenix Lander is a variant of Linux, VxWorks, this is an embedded Operating System (that means it lives on a chip). It is designed in such a way that you don’t get the dreaded Microsoft ‘Blue Screen Of Death’, thats because it is pretty damn difficult to reach out to Mars and reboot the lander after the Operating System crashes. In the event of a serious problem VxWorks will reboot into a ‘safe mode’, and wait for the controllers on earth to reactivate it, or send a patch for the problem.
The Phoenix Lander is not autonomous, it needs to be told what to do, and when to do it, but because of the huge distances involved there is a 20 minute delay from the time a command is sent from Earth and the time it is received on Mars. For that reason alone it is necessary for the software to have inbuilt ‘self preservation’ tendencies.
NASA gets around the 20 minute time lag by sending a whole days worth of tasks at one time, I guess you could call it a daily ‘To Do’ list. This list is in the form of computer code written in a programming language called ‘C’. The NASA programmers and engineers sent approximately 1000 to 1500 instructions to the lander every day. One mistake in the code results in a day lost, or even worse damage to the equipment on the lander. I have been in the computer industry for over 30 years, and the industry standard for developing computer code is that the average programmer can write and test about 10 lines of code a day. In layman’s terms, if your computer program has 100 steps in it, it will take you 10 days to write and test it. NASA are doing what a regular programmer would take nearly 5 months to achieve in 24 hours!
I have nothing but respect for these people. Great job guys!
Simon Barrett
Article Update – Mike Deliman of Wind River was kind enough to grant me an interview. You can read it here.
Article Correction – WxWorks is a Unix derivative, not a Linux Derivative. My appologies for the connfusion – Simon
21 users commented in " Linux On Mars "
Follow-up comment rss or Leave a Trackback10 lines of code per day??? Granted, the people at Nasa are amazing, and I don’t want to detract from the amazing things they do every single day, but if a programmer writes 10 lines of a code in a day, tests it, and then calls it a day, he or she is going to get fired. Fast. 100 lines of fully tested code is slow. Maybe I am a faster programmer than I give myself credit for. Maybe I’m in a faster paced environment than what would be considered ‘average’. I call a good day of programming 500 lines of code, fully tested. Granted, NASA is putting out 2-3 times that, but I highly doubt they have only one person doing their coding and testing.
This of course is a major tangent from the point of the article, which otherwise was very informative. I just thought that the estimations of NASA’s code output versus the average programmer was WAY off.
where the hell did you get 10 loc/day?
Must be perl, then, and each line is a few hundred characters.
That 33 Mhz risc cpu can not be compared to an 386, remember that mhz != speed.
Mhz means cycles, not necessary instructions… Some instructions needs more than 100 cycles to be executed in a intel architecture.
In a risc cpu, things go much better.
vxworks is a version of UNIX, NOT linux… seriously – you can’t possibly know anything about linux or unix if you think they are the same thing!!
The wikipedia article you link to doesn’t even say it’s linux, it uses a proprietary licence and is a version of Unix plain and simple.
VxWorks is a hard real time OS, while Linux is not. If patched with Xenomai, Linux becomes hard real time OS, but still slightly slower than VxWorks. Xenomai patch contains “skins”. One of them is VxWorks skin which provides VxWorks API for easier porting to Linux platforms. VxWorks is real-time executive (kernel and applications are in the same memory space), while Linux has a monolithic kernel – kernel and applications are in different memory space. Difference between those two OSs is significant are they are not the same, eventhough API may be similar (POSIX). I agree with one, Windoze is not suitable for mission critical systems and whith it’s price should be avoided and replaced by desktop Linux.
that cpu is probably a mips R’family.
if so then it’s more powerfull than a sony playstation.
(that used a 33mhz R3000 – a 6000 would be a big architectural jump!)
I saw comments by Anonymous on the number of lines of code and have these comments…Being “brought up” with limited memory, no disk and SLOOOW CPUs in the 70s and 80s, I know of programmers who can do more in 10 QUALITY lines of code than the coders who hack together systems today can do in 500 lines. Back in those days, you had to write really tight code just to run in small memory systems and that could run fast with little or no disk. Tell that to today’s coders who have little or no consideration for code CPU performance, memory or disk usage. Many of them think if it clean compiles and runs one thread of logic under a debugger, it is ready for Beta testing…
10 lines per day? those engineers need to get a kick in their asses and get fired!
No wonder we are so screwed with NASA with dumb people like that. 10 lines of code per day? My gosh!!! What kind of monkeys are working at NASA? Obviously, an average human can code more than 400+ lines per day in C++, Perl, Python, Java.
For 10 lines of code per day, I think monkeys or some kind of low brain entity is doing that crappy job.
@Kevin:
I made that first commment that you are referring to. I completely agree that 20-30 years ago, 10 lines of QUALITY code could do an awful lot. That’s not in question. The point I (as well as a few other posters) am making is that 10 lines of code 30 years ago do not equal 10 lines of code today. 10 lines of code per day, using current-gen programming languages, will only serve to get you fired.
I am in complete agreement that with the CPU speed, RAM, and Disk Storage that is available today, many programmers have forgotten (or just never learned) about properly optimizing, or even attempting to optimize, their code. Bring up Big O with most programmers today and they are likely to just give you a dumb look, and go back to their Visual Basic.
VxWorks is NOT a variant of Linux … it is NOTHING like Linux. VxWorks draws its heritage from VRTX a 1980s based OS.
VxWorks is an RTOS. Linux is a computer OS (with a lot of application and device driver bloat). They are very different. This article is not accurate.
Phoenix uses VxWorks and runs a Rad6000 CPU (I think in a VME chassis). It is the replacement for a previous failed lander attempt.
Lastly RTLinux and all other Linuxes have slow RT performance … whereas real RTOSes (VxWorks and RTEMS) have RT responses in the 100s of nanoseconds to microsecond response times … somewhere around there …
Okay – Linux vs. Windows vs. RTOS folks: Simon already posted corrections to the “VxWorks is a form of Linux” comment. I’m sure Simon’s heard a fair share about this, because I have too!
I bear no grudge, in fact it’s kind of an honor to be mistaken as related to one of the most popular software packages on this planet. Then again, we are the most popular software on Mars!
Maybe 10 lines of code in C is an example usage of integrated assembler with AT&T syntax in C. Because that gives perfectly sense, and you must be 100% sure the code is corrent and won’t break anything, when you make a typo like cx instead of bx, it can lead to damage of machine…
1: Hooray NASA
2: To reiterate for the thousandth time, yes, if you only write and test 10 lines of code per day, you are in the wrong profession. Fortunately, someone will likely solve this problem for you.
As to ~~~~~~’s comments: What? Make sure the code is corrent? Is that a combination of correct / current? That does not give perfect sense.
Just clarifying what Xavi said… the Rad6000 CPU is enclosed in a VME chassis.
386 CPU’s were first introduced 22 years ago not a decade ago.
Wow, they used this because it is free. I too like linux……..
That’s really a fantastic post ! i added to my favourite blogs list..
I have been reading your blog last couple of weeks and enjoy every bit. Thanks
wow, wonderful images. it is great to see. i think it is photoshoped, but it’s amazing .
That’s really a fantastic post ! i added to my favorite blogs list..
“NASA are doing what a regular programmer would take nearly 5 months to achieve in 24 hours!”
That is an incredible feat to accomplish.
Leave A Reply