LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.
Sign In/My Account | View Cart   

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement


Listen Print Discuss Subscribe to Linux Subscribe to Newsletters

Porting Linux to the iPod

by Howard Wen
09/25/2003

Just as the name Linux on iPod suggests, now you can have Linux running on your iPod. With Linux on iPod, you can play (to a limited degree, as of this writing) MP3 and Ogg files under Linux on your iPod. This is possible thanks to the work of just one man, Bernard Leach, a 30 year old software engineer in Wiesbaden, Germany.

Practically speaking, though, why should one even bother with running Linux on an iPod? Its creator hopes that his accomplishment will help extend the functionality of this closed-system gadget by inspiring others to develop Linux-based applications for it.

The port uses uClinux, a Linux flavor designed for devices that lack a memory management unit (MMU). While the iPod has some MMU-type capabilities, they are not sufficient to support the Linux kernel. The code is released under the GNU General Public license.

Howard Wen recently interviewed Bernard about the project.

O'Reilly Network: Can you tell us a little bit about yourself and your background?

Bernard Leach: I'm actually from Melbourne, Australia and have only been here [in Germany] for the last two years. I previously worked as a software engineer for a company that develops cryptographic hardware.

ORN: What was your inspiration for porting the uClinux kernel to the iPod?

Related Reading

iPod: The Missing Manual

iPod: The Missing Manual
By J.D. Biersdorfer

Table of Contents (PDF)
Index (PDF)

BL: The inspiration to port Linux was the challenge itself! From what information I could find about the iPod, I could tell that it was more than capable of running Linux. I'd seen what people have managed to do without being able to modify the firmware. And I knew that being able to do so would open up many opportunities to add further functionality.

ORN: Did you develop or use any other tools to help pull off this port?

BL: In terms of software tools, the GNU compiler toolchain was essential to the port, not only for building the software to run on the iPod, but also for examining the existing software. Besides the toolchain, Perl, Vim and bc. On the non-software side, I spent a lot of time on Google looking for information.

ORN: What kind of modifications did you do to the uClinux kernel, if any, to get it onto the iPod?

BL: The kernel modifications to uClinux were quite minimal. To get the kernel to run, you basically need to supply code to manage a timer, some interrupt processing, and start-up code. Since there are quite a few other uClinux ports, this part is all fairly straightforward. Normally, you would also need a bootloader to get started, but I was able to take advantage of the existing loader in the original firmware. On top of that, you need to add drivers for the various I/O devices. Fortunately, Linux comes to the rescue here as well; drivers like the multi-platform EIDE driver just needed some register addresses defined in order to work. Similarly, the keyboard driver and framebuffer simply build on existing drivers.

ORN: What were the technical challenges you faced in developing this port?

BL: The real interesting challenges were really before I started the port. Since there is very little technical information available on the processor in the iPod, the real challenge was to work out how it all fit together. After that, the biggest challenge was always how to debug the code. Normally, you'd have a serial port available, but with the iPod there's nothing really available for debugging.

ORN: Regarding the inner workings of the iPod, what are the unique challenges in porting Linux to the iPod? Did you learn anything interesting about the iPod itself?

BL: With the basic port, there's nothing really anything unique about this particular port.

ORN: Take us through the basic step-by-step process of what you had to go through to figure out how to get this port working.

BL: In order to get the port working, there were a number of milestones I needed to reach: Working out the boot process, and building up a memory map sorting out the protocols for the various devices. Getting there wasn't so much of a step-by-step process. It was more akin to solving a puzzle where all the picture was worked on together. A lot of time was spent analyzing disassembled code, following code paths, noting special addresses, and slowly building up the big picture. Eventually, I had enough information to start testing some of the theories, and—slowly through these short, special-purpose programs—the remaining questions were resolved.

ORN: So, let's be clear: You didn't physically take apart an iPod to do any of this?

BL: No, I didn't take my iPod apart, but a number of other people did, which is how the major components were identified. From those dissections, I had the part numbers to search for the various data manuals for programming them.

ORN: What features do you plan to add to future versions of your port?

BL: At the kernel level, most of the features have been implemented to some extent. Now it's more about getting the drivers to work better or in new ways. I'd also like to get the new HFS+ driver in so Mac iPods can run the port without a reformat.

ORN: Was providing FireWire support difficult? If so, why?

BL: The FireWire was something I intentionally put off because I thought it would be quite hard. Since the initial release of the port, I have managed to add support for FireWire and my suspicions were certainly justified. Getting the FireWire going was one of the hardest parts of the project!

There were a number of reasons: Firstly, I only had a vague understanding of the protocol and how it worked. Secondly, the support in Linux is pretty flaky. I can crash my machine just loading and unloading the sbp2 module. And, finally, the documentation for the Texas Instruments chip on the iPod is pretty vague in certain areas.

Just recently, thanks to the guys at SiK.com, I got the hardware together to test connecting a CompactFlash reader to the iPod. So far, I've only had limited success, but it's getting there. Once I get that working, I plan to write a small application that will let me copy digital images from CompactFlash cards to the iPod.

ORN: What sorts of contributions could your work use from outsiders willing to volunteer their skills?

BL: I'd welcome contributions to any part of the port. Up until now, almost all of what I've done has been a part of my learning process. I've worked with a kernel before, but for this port I needed to create a number of different types of drivers, all of which were new to me.

The FireWire is the last major I/O driver missing, but power management support, accomplished by throttling the CPU speed, is another important area yet to be addressed. So far, I've been quite focused on getting the core kernel services working, but as people look to get "real" applications running, higher-level services need to be developed; most obvious here is a working GUI layer. Porting one of the lightweight GUIs, such as Microwindows or PicoGUI, would be a good start.

ORN: What advice do you have for those who might want to modify the port you created?

Other Linux Interviews

Through Project Looking Glass with Hideya Kawahara

Freedom, Innovation, and Convenience: The RMS Interview

Scribus: Open Source Desktop Publishing

Stratagus: Open Source Strategy Games

Keeping the Myths Alive

BL: For people looking at modifying the port, I would say, "jump in!" There are certainly many areas which need work. I would suggest to take the time to get to understand the current source. Also, join in on the mailing list to share with others what you are working on.

ORN: Any advice on the kind of applications—which would technically work best under your port—that others should try to develop for the iPod? What should be avoided, at this point?

BL: The iPod is a music device and so, not surprisingly, audio applications are ideal. At the moment, performance is still an issue. High performance audio decoding is one area that really needs work, but the biggest barrier at the moment is a working user interface layer.

ORN: Have you played with the new iPod models that were recently released? Are they any different in terms of hacking?

BL: The new iPods look really nice! I haven't had a proper play with one yet, but I've been looking at the new firmware to see how they might differ. Generally, it looks like some of the hardware has been hooked up a little differently, but it doesn't look like there will be any problems with getting the Linux port running on them.

From the hardware perspective, the recording feature discovered by the guys at ipodding.com looks really interesting. The core chip on the iPod has always supported audio input so it's nice that they have added it. Depending on what software support they add in the standard firmware, there might be a call for extra functionality running under Linux.

ORN: So what have you been listening to lately on your iPod?

BL: Not a lot of new music, unfortunately. The last album I bought was 100th Window by Massive Attack, which is quite cool. Just for the record, "Dumb" by Garbage was the first MP3 to play under Linux on the iPod!

Howard Wen is a freelance writer who has contributed frequently to O'Reilly Network and written for Salon.com, Playboy.com, and Wired, among others.


Return to the Linux DevCenter.


Have a question about Linux on the iPod? Talk back here.
You must be logged in to the O'Reilly Network to post a talkback.
Post Comment
Full Threads Oldest First

Showing messages 1 through 13 of 13.

  • What can be put in ipod thanks to Linux?
    2003-09-28 09:31:01  anonymous2 [Reply | View]

    Here I have a little list of useful things you could have
    on your iPod thanks to Linux porting:

    a) WebServer to submit files.
    b) Smb
    c) mplayer to decode ra.
    d) ogg and all the other protocols you desire.
    e) pictures viewer.
    f) email reader.

  • Not just Ogg
    2003-09-26 23:30:39  anonymous2 [Reply | View]

    Forget Ogg files, Agenda, watch, and other Linux tools. I wonder if it can actually run Emacs.
  • Interesting
    2003-09-26 10:37:27  anonymous2 [Reply | View]

    Interesting exercise, but what is the point? Why would I want to run Linux, when all I want to do is listen to my music, which iPod does very nicely w/o going through all this hassle.
    • Interesting
      2003-09-27 02:21:06  anonymous2 [Reply | View]

      Did you read the article?

      The authour of the project mentioned a killer application:

      When you are on vacation and not carrying a notebook, you can use your iPod to offload all the digital photos you take.
    • Ogg, of course.
      2003-09-26 11:34:17  anonymous2 [Reply | View]

      The factory version of the Ipod won't play my
      Ogg files. What good is it without Ogg support?

      That aside, it's a compact portable computer
      that just happens to be marketed as a music
      player. Whatever you program it to do, you
      get the benefit of its mass-produced low(ish)
      price. So your question is, why in the world
      would anyone want a computer the size of an
      iPod?

      Lots of people wouldn't pay $300 for a
      lousy music player, but would happily pay that
      for something they find actally useful.
      • Ogg, of course.
        2003-09-26 13:27:58  anonymous2 [Reply | View]

        Ogg? Who uses that other than FSF drones?
        • Ogg, of course.
          2003-09-29 20:04:08  anonymous2 [Reply | View]

          Yes, just like anyone who doesn't want to be tied down to .doc or Internet Explorer must be an "FSF drone". :-P
        • Ogg, of course.
          2003-09-27 03:44:25  anonymous2 [Reply | View]

          Ogg is patent free technology while Mp3 is not. So if you are company whatever using iPOD you may be sued because of using patented technology (I dont think that private users will be sued ever but who knows). Also Ogg is a but superior technology compared to mp3! Also maybe newer and MUCH better formats will be crated n the future so you will have Linux to plaer for that etc. And for general purposes as well, which is not targeted for iPOD by its creator can be possible witjh a general purpose OS running inside it!
          • Fee fie foe FUD
            2003-09-29 13:21:24  anonymous2 [Reply | View]

            Doesn't matter if MP3 is patented. Apple has already paid any fees involved. "company whatever using iPOD" will not be sued. Are you worried that Intel might come along and sue you for using a PC? It's pretty much the same thing.

            AAC is also superior technology to MP3, and the iPod was updated very easily to play that, without the massive overhead of Linux. If a superior format becomes more commonplace, I have no doubt the iPod will be updated to play it.
            • Fee fie foe FUD
              2003-09-30 06:25:58  anonymous2 [Reply | View]

              Apple paid a lot of money in licensing for the mpeg-4 which is used in AAC. They are not about to support Ogg Vorbis which happens to be superior to AAC except at bitrates lower than 128.

              I own an iPod but I would pay Apple another $100 to include Ogg Vorbis support.
          • Ogg, of course.
            2003-09-29 10:01:59  anonymous2 [Reply | View]

            Well Betamax was better than VHS. We saw what happened there.
            • Ogg, of course.
              2003-09-30 08:42:07  anonymous2 [Reply | View]

              Yes, but Betamax was also proprietary, as is Mini-Disc, and we are seeing what's happening to them.
              • Ogg, of course.
                2004-01-14 10:39:08  anonymous2 [Reply | View]

                There's more to it than just the system being proprietary. Some economic issues generally known as network externalities. Look into it, some quite fascinating stuff.


Tagged Articles

Be the first to post this article to del.icio.us

Sponsored Resources

  • Inside Lightroom
Advertisement
O'Reilly Media
© 2008, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Privacy Policy
Contacts
Authors
Press Room
Jobs
User Groups
Academic Solutions
Newsletters
Writing for O'Reilly
RSS Feeds
Other O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com
Sponsored Sites
Inside Aperture
Inside Lightroom
Inside Port 25
InsideRIA
java.net