A Talmud for Source Code: Introducing the Bootloader Blog Wiki

16 October 2008

My first two posts here have been…abstract. I've tried to explain why I think learning physical computing is important and how I think writing this blog can help. But now, it's time to get our hands dirty. To dive into actual code and real hardware.

To get us started on that front, I'd like to introduce a piece of infrastructure: the Bootloader Blog Wiki. Now this is no traditional wiki. The goal of the Bootloader Blog Wiki is to take the big hard chunks of code at the heart of physical computing projects and immerse them in an acidic bath of commentary, annotation, and discussion in order to break them down and make them easier to digest.

Now a normal wiki is too generic a tool to fully accomplish this goal. What we need is a wiki that is native to source code. The wiki should let us add commentary while still keeping the code at the center. It should help us navigate through the many files that make up the code, linking them together to make the conceptual connections and technical dependencies clearer. It should relate to the code as the Talmud does to the Bible: surrounding it with new layers of understanding, explicating its relevance and utility in our daily lives and struggles.

To meet these principles, I've done the following: I took the Arduino source code and stuck it in a directory of this server. Then I wrote a simple Ruby and Javascript app for annotating it. I've made the app as simple and easy to use as I know how.

Here's how it works. You start by navigating to a particular page. For example, hardware/cores/arduino/wiring_digital.c is a good place to start as it's the spiritual center of the Arduino library.

On that page, you'll see a file browser that lets you navigate to other files within the Arduino source code. Right now, only the core Arduino library is available, but, over time, I'll add the avr-gcc sources and other relevant libraries.

More importantly, you'll also see the full content of the indicated page from the Arduino source (from the newly released version 0012). The source is all nicely decorated with line numbers and I hope to get syntax highlighting working soon.

Now, here's where it really gets interesting. If you click on any line of the source, a text box will pop up offering you the chance to write an annotation for the highlighted line. You write your question, link, explanation, whatever in that box and hit save. The page will reload and now you'll see your annotation prominently displayed.

You can take a look at an example here: HardwareSerial.h#line_25. That comment comes from an investigation I've been conducting into into the new Print base class that the Arduino team introduced with version 0012 to consolidate an overlapping set of print code spread across a few other parts of the project. I'll have a post on that topic to come shortly and a series of comments like this one will play a prominent role in it.

Eventually, I may add more sophisticated features like annotation editing, RSS feeds of changes, and user accounts. But for now, I invite you to come play with the Wiki as it is. Fill it up with your questions or quirky bits of knowledge gleaned from hard experience. Or just follow along with my adventures trying to figure things out for myself. I'll share the fruits of my struggles here, but if you want to see and participate in the process yourself, you're more than welcome. You're invited.

A New Altair

02 October 2008

In January 1975, Popular Electronics ran a cover story about a new computer for hobbyists. The Altair 8800 came as a kit and cost $439 (the equivalent of $1,778.58 in today's dollars). It came with no on-board memory. You programmed it by entering Intel 8080 opcodes by hand via a series of switches on the front panel. Buying 4k of memory, the ability to read in programs from paper tape, and a teletype interface would increase the price 6 fold. You had to solder the thing together by hand. By comparison with the big university and corporate mainframes it was basically useless.

But Popular Electronics was the Make Magazine of its day and engineering schools had begun to require their graduates to learn some programming, so Forest Mims and Ed Roberts, the two guys in Albuquerque who'd put the Altair together, figured they could probably sell a few hundred in the first year to this emerging group of hackers avant la lettre.

They took 1,000 orders in the first month. Six months after the release they'd sold 5,000. By October of that year their company had 90 employees.

Why was the Altair such a runaway success? After all, by comparison to the cutting edge computers of its day, it was underpowered and extremely difficult to work with. The answer is ownership. The Altair offered bourgeoning hackers their first chance at a computer that would be fully and completely theirs. They could take it home, throw it up on their work bench, take it apart, put it back together and try to get it to do totally new unimagined things. They could program their Altairs to play Fool on the Hill through a transistor radio. They could build a board to let the Altair drive a color TV in Times Square. They could start a small company to sell programming languages for it. They could get together with their fellow Altair owners to share programs and cool hacks.

This last point can't be emphasized enough. The Altair crystallized growing local groups of DIY computer enthusiasts like the Homebrew Computer Club in Silicon Valley. It gave them an outlet for their energies and an example of what could be done. It made them believe that their incredible fantasy of having their own computers might really come true.

And after that, there was no stopping them. This new generation of hackers dedicated itself with an almost religious zeal to spreading the idea of computer ownership across the world. They invented the personal computer — a whole industry dedicated to the notion that computers could make life better and work easier for everyone, not just huge institutions. The Homebrew Computer club alone included the founders of Apple, Ozborne (builders of the first portable), and a raft of other industry pioneers.

Today, the world of physical computing closely resembles the personal computer industry circa 1975. We've been around for a few years struggling around the edges with tools and products that were designed, priced, and packaged for serious industry, but we haven't made any money and we haven't moved the world. That's about to change.

Recently, our Altair arrived. It's called the Arduino. This is 2008 so instead of being built by two engineers in Albuquerque, it was built by an open source international cabal of programmers and professors.

A lot of people complain that it's underpowered and overpriced (even though it only costs $8.64 in 1975 dollars). But you don't need special hardware to program it. It lets you do all the basic tasks with just a line or two of perfectly comprehensible code. And there's a thriving community of people busily using it to do all the useless, fun, creative things they'd always dreamed of if only they could get their hands on a computer that could sense and control the world around it. They're using it to teach houseplants to call for help if they need watering. And they're using it to play music on glasses of water.

If the Arduino is the Altair of physical computing then what will be its VisiCalc? What will be the killer application that makes the physical computer of the future a necessity for business. If the Arduino is the Altair, what will physical computing's Mac look like? I don't think anyone today knows the answers to these questions.

But the answers are coming. In the next few years, physical computing has as much of a shot at changing the world as technologies ever get. And this is the time to get involved. Unlike the web, personal computer, and green energy industries, physical computing is a space where two guys in a garage can come along and invent something that will touch billions of people around the world without anyone else's permission. That's because what's needed in physical computing is not advanced research, massive infrastructure investment, or huge production facilities. What's needed is close attention to applying the existing technology to solving human-scale problems. Microcontrollers and sensors, CNC milling machines and laser cutters, GPS devices and accelerometers need to be transformed into tools that regular people can use to improve their daily lives: to make themselves more connected to the people and places around them, to entertain, educate, and distract them.

Getting Started

01 October 2008

Getting started is the hardest part.

There's always something easier. Check email. Go to work. Do laundry. And there's always reasons you're not ready. You don't have the tools. You don't have the time. You don't really know what it is.

For the last few years, that's how I've felt about my it — learning physical computing, hardware hacking, microcontroller programming, BEAM bots, etc. — ever since I first stumbled across NYU ITP and the Arduino and thought: that's me; that's what I want to be making. I'd worked at the MJT. And been obsessed with the Lord of the Rings movie miniatures. And with the work of the McCoys. Then: ITP, Arduino, these were it. They were how I could do it. How I could finally make the things I'd been seeing in my head.

And so I set out to learn about them. I started meeting once a week with similarly minded friends and tinkering. I subscribed to new blogs and read them. I collected links. I bought books. I went to user groups. All the things you do when you're starting a new hobby.

'Hobby'. I hate that word. It's so condescending. Like this passionate interest is a cute little horse with yarn for hair that a toddler might ride.

Starting today this isn't a hobby anymore. It's a quest. It's a jihad. It's a commitment. I am going to understand this stuff beyond the hobby level. I'm going to fight my way through the impenetrable layers of bad documentation, illegible data sheets, and expensive books to learn how this stuff really works, to achieve some amount of mastery. I'm going to become fluent in C and C++. I'm going to visit all the twisty passages of the ATmega168 architecture and every dusty corner of the Arduino software library. I'm going to learn how solenoids work and relays, and I'm going to use them to build actual projects. I'm going to learn to really read schematics. I'm going to remember the Right Hand Rule.

And along the way, I promise to do what I can to make getting started easier for you. I'll write down the secret details that all the experts know but never share. I'll write simpler clearer explanations of how the hardware works and the software. I'll write about my frustrations and failures. And I'll write about all the projects and people that inspired me to make this more than hobby.