Matthew Garrett ([info]mjg59) wrote,
@ 2009-06-10 13:50:00
Previous Entry  Add to memories!  Tell a Friend  Next Entry
Entry tags:advogato, fedora

Palm Pre
I'm in the UK and even if I weren't I wouldn't be using a CDMA phone, but the Palm Pre is undoubtedly an interesting device and so I've spent a short while looking at the root filesystem that can be extracted from the downloadable ROM image. There's some interesting things there. Bear in mind that this could be some QA internal image, so chunks of what I talk about may be wrong - on the other hand it seems to have been produced in May, so it's probably pretty close to what's shipping.

Hardware

As others have figured out by now, the Pre is codenamed Castle and there's some references to another device called Pixie. This is presumably the Eos device that's expected to end up with AT&T. The other interesting thing is that the image contains modem firmware for both CDMA and UMTS. They're shipped as tarballs - extracting them gives you something that looks awfully like the firmware for the Qualcomm Gobi dual-CDMA/HSDPA chipset used in a bunch of modern laptops. The core firmware is an ELF object for 32-bit ARM. It's got references to Qualcomm in it and it's also got an embedded RSA signature which presumably cuts back on the potential for interesting hacking. The

/usr/bin/PmModemUpdater -e < /usr/lib/modem/castleumtsfw.tar

command, executed as root, should flash the UMTS firmware to the modem (castlecdma_evt1_fw.tar is the CDMA firmware). However it should be noted that the MSM6801A baseband used on the Pre seems to be a CDMA-only chip and there's no obvious place on the board for a SIM socket. My assumption is that the GSM models will have a very similar baseband with different radios. Unlocking the device will presumably be similarly difficult to the iphone - someone will need to find a flaw in the Qualcomm firmware that allows the network lock to be skipped. The PmModemFactory command will let you unlock the phone, but you'll need the appropriate code to do so and can (I guess) permanently lock it if you enter the wrong code too often.

The internal flash appears to present as mmc for some reason.

Software

A lot of the software on the Pre is GPLed, and Palm are therefore obliged to provide copies of the appropriate source code to anyone who receives the software (note that receiving the device is not required - if the software is downloadable then the source offer must be made available to anyone who receives the software). The source code is not currently downloadable - instead Palm have included a written offer to supply the source code on request. This satisfies the GPL, but I can't be bothered doing that for the moment so all of this is purely based on examining the binaries.

The full list of applications extracted from the open source information documented included is here.

General

The Pre appears to be an OpenEmbedded-based system. It uses ipkg for package management and the majority of the basic userspace apps are all from Busybox.

Kernel

The Pre's running 2.6.24, and there's various references to Windriver. There's an internal git repository codenamed rockhopper, which is a little odd - rockhopper's the codename for a MIPS-based NEC evaluation board. It's probably coincidental, given that there's only so many species of penguin available. The version string includes "joplin" - there's evidence of this in mailing list posts dating back to last year, so it's not clear whether "joplin" is the entire WebOS kernel project or a codename that covers both the castle and pixie platforms.

The hardware-specific drivers look well-integrated, for the most part using the standard kernel interfaces (backlight, led and so on) - this is a marked contrast to Android, which tends to go its own way in this respect. There's a driver for the OMAP DSP, the exmap code for analysing application memory usage, oprofile for detailed profiling analysis, some crypto code, a driver for an SDIO-attached Marvell wifi chipset and support for being a USB gadget (ie, something that appears as a USB device when plugged into a USB host). Side note - depending on whether the system is a castle or a pixie, the g_composite gadget driver is given a different ID to let the host OS differentiate between the two. castle will appear with a USB id of 0x8002, and pixie 0x8012.

There's nothing else very interesting looking about the kernel. The source code should reveal more.

Booting

The Pre uses upstart as its init application. In contrast to mainstream Linux distributions that still mostly use upstart in sysvinit emulation mode, the Pre appears to be almost entirely based on native upstart events. One of the things they've used this for is to automatically stop various services when the update service is started. Beyond that there's nothing exceptional here, but looking at etc/event.d does give insight into what's running on the device.

Userland

In contast to Android, the Pre uses the standard GNU C library and associated userland. Filesystem layout is pretty typical Linux, with / containing the low level binaries and /usr containing the rest of the OS. The only slightly weird thing is that various utilities exist in both their busybox and full forms, and I'm not entirely clear on why it's shipping things like fsck.ext4 though I guess you could use an ext4 sd card or something.

Audio is handled through pulseaudio, while media is handled by gstreamer. There's a large collection of codecs for the DSP including WMA and h.264, but no obvious ogg support despite libogg and libvorbis being mentioned in the list of open source software shipped. Future plans? Pulled partway through development? Unclear.

ipod emulation

The Pre pretends to be an ipod by switching into a different USB profile (and thus giving the right USB information) and setting up a filesystem that looks like an ipod. It provides a SysInfoExtended file that looks like an ipod. The only terribly interesting things about this are the list of formats (AIFF, MP3, WAV, AAC, AppleLossless, Audible, H.264, MPEG4 and H.264LC), the fact that it supports album art, the fact that it doesn't support Apple's DRM and that the firewire GUID looks like it's probably the same on all Pres. Could Apple break this support in a future version of itunes? Yes, but none of this support is hardcoded in the Pre's hardware - Palm could provide an update that matches. I don't see any real benefit to Apple in breaking the support, and if it could be shown that they were doing it deliberately then there could be potential legal issues.

The code actually looks generic enough that it could probably be made to emulate other USB mass-storage based media players if you wanted to. I have no idea why you'd want to.

misc

There's a PalmOS ROM image for use in the emulator. usr/share/accountservices contains some files with interesting links in - one of them gives a full dump of the PHP setup on a Palm server, which gives some indications of their internal network setup and other things that are probably harmless but companies usually get paranoid over. The flasher application is called Trenchcoat. There's setup code for traffic shaping support - I haven't checked whether this is for application QoS on the device or whether it's intended for use with tethering.

Binutils is shipped. The Pre has an ARM assembler installed by default. The mind faintly boggles. It looks like there's tethering support via the Bluetooth PAN profile (see usr/bin/PmConnectionManager) as well as via USB. IPC is dbus-based rather than using something custom like Android's binder.

Overall

I'm impressed. There's a few rough edges and some obvious short-term hacks, but overall the Pre has the appearance of being a well-engineered distribution. It's recognisably Linux in a way the Android isn't. Since it seems to be possible to gain root by entering the developer mode, I suspect that modifying the firmware image isn't especially difficult. It'll be interesting to see what happens when GSM ones appear.

There's some more information at the pre dev wiki.



(32 comments) - (Post a new comment)


[info]nedrichards
2009-06-10 02:50 pm UTC (link)
I'm pretty sure that in the palm context rockhopper would refer to an old Palm OS based Treo. They used to be codenamed after penguins.

(Reply to this)

ogg
(Anonymous)
2009-06-10 04:02 pm UTC (link)
Deliberately removing ogg support is the same Nokia has done with its Internet tablets. Unfortunately the problem probably is that they cannot buy Ogg codecs from any party which would then welcome the possible patent trolls that have obscure multimedia related patents. Hopefully Mozilla's Firefox 3.5 will finally bring Ogg to masses and the more coward companies can join.

(Reply to this) (Thread)

Re: ogg
(Anonymous)
2009-06-12 12:31 am UTC (link)
Even if you have an Ogg encoder, there are no tracks. The Ogg workflow is CD-based but most music is not even released on CD anymore. Any time you spend on Ogg since about 2003 is completely wasted. The one thing it is good for is ripping CD's into Linux.

I'm a music producer and songwriter and would never publish in Ogg. The power that Ogg places in the hands of the software developer is reserved to the music producer in ISO MP4. When you examine the issues, Ogg essentially enslaves music artists to software developers. Imagine how Richard Stallman reacts to being told he should compile software with MS Visual Studio, that is Ogg to me and other music producers and songwriters. It's just never going to happen. The kind of wrangling that surrounds GPL revisions also accompanied MPEG-2 becoming MPEG-4. Creative people did that at the turn of the century, which brought us ISO media in iTunes+iPod instead of proprietary.

Further, there is no support for Ogg in toolchains. It's a fantasy to promote it's use in music publishing. Pretending that listeners are going to transcode from ISO MP4 is also a type of nerd fantasy. Right now the Web browsers are building in MP4 support because there are billions of MP4 files to play on the Web and Flash is the most inefficient wayti do it. This battle is so long over.

(Reply to this) (Parent)(Thread)

Re: ogg
(Anonymous)
2009-06-12 08:22 am UTC (link)
"It's a fantasy to promote it's use in music publishing."

Yes, the plethora of ogg vorbis files on Jamendo.com, Magnatune.com, Mindawn.com, Wikipedia.org, CBC.ca, Spotify.com, archive.org, and elsewhere are indeed fantastical.

(Reply to this) (Parent)(Thread)

Re: ogg
(Anonymous)
2009-06-13 07:32 pm UTC (link)
Hey, wow, the nerd fantasy he referred to in the wild!

(Reply to this) (Parent)

Re: ogg
[info]hobbified
2009-06-12 09:54 am UTC (link)
The Ogg workflow is CD-based but most music is not even released on CD anymore.


Please stop pretending that you know anything about anything.

(Reply to this) (Parent)

Re: ogg
(Anonymous)
2009-06-12 11:41 am UTC (link)
Sorry, but you have all your technology and history messed up. However, I agree with "Flash is the most inefficient wayti do it" - just counting by the number of times my Web Browser dies of Flash attacks.

(Reply to this) (Parent)

Re: ogg
(Anonymous)
2009-06-12 04:04 pm UTC (link)
Virtually all sound in all video games has been encoded in ogg for years.

(Reply to this) (Parent)(Thread)

Re: ogg
[info]warlockd
2009-06-16 05:39 pm UTC (link)
Games use it because its patent free and clears though legal like butter though Rosie O'Donnell.

What I think the poster is trying to say is that OGG has a bad PR rep. You say MP4 you think "It plays on an iPod" I can call up any of the neises and nephews and they will all know what an MP4 is. Hell they know what DRM is, but the give blank stares with OGG.

Lets face it, you only use any of these compression formats after a clean uncompressed copy of the music is available to you. You don't re-encode all your old MP3 128bit's to OGG. Unless you don't want "The Man" to get his royalties:)

(Reply to this) (Parent)

Re: ogg
[info]pjc50
2009-06-23 08:38 am UTC (link)
"The power that Ogg places in the hands of the software developer is reserved to the music producer in ISO MP4."

I don't understand this statement.

(Reply to this) (Parent)

Re: ogg
[info]clango
2009-06-13 10:24 am UTC (link)
really wondering at this point if apple, and hence now jon at palm, uncovered a possible submarine patent on vorbis, given early evidence of itunes having ogg and flac support (presence of icons) and then later having it pulled.

(Reply to this) (Parent)

Root on MMC/SD
(Anonymous)
2009-06-10 04:22 pm UTC (link)
> The internal flash appears to present as mmc for some reason.

The reasons are pretty good if you think about it a bit longer. No need to have bad block handling for raw nand flash. SD is available in big capacities, quantaties and are cheap. Modern SoCs have more then one MMC/SD controller, typical three, so one can be used for internal storage, one for an external slot and maybe the last one with SDIO for wifi. Also most rom loader for this SoC's already support booting from such a card. (For S3C64x0 I'm sure and I think PXA3xx and OMAP3 should be no difference here.)

We planned and used the same for the canceled Openmoko GTA03 and the Samsung omnia devices also use 8 or 16GB SD cards as second internal storage.

regards
Stefan Schmidt

(Reply to this) (Thread)

Re: Root on MMC/SD
[info]turnselfoff
2009-06-11 12:47 am UTC (link)
the N810 also use a SD in chip form for its internal 2GB storage, in much the same place where the N800 has a second SdHC slot.

would have been fun if one could have pried the pre open and find a SD slot.

btw, the cpu used is much the same as the beagleboard, and it boots from SD, iirc...

(Reply to this) (Parent)(Thread)

Re: Root on MMC/SD
[info]fooishbar
2009-06-11 03:05 am UTC (link)
Pretty much the entire platform other than the baseband will be flawlessly supported out of the stock linux-omap kernel tree, but I wouldn't be expecting any easy way to flash a kernel the bootloader will actually be happy to load.

(Reply to this) (Parent)

useful?
(Anonymous)
2009-06-10 05:09 pm UTC (link)
Can it sync with Ubuntu out of the box though, or Windows-only?

(Reply to this) (Thread)

Re: useful?
[info]mjg59
2009-06-10 05:14 pm UTC (link)
It appears to speak syncml. The level to which Linux supports any kind of syncing depressed me enough that I stopped following the current status a while ago, but I'd expect you can get it working.

(Reply to this) (Parent)(Thread)

Re: useful?
(Anonymous)
2009-06-10 07:01 pm UTC (link)
I hear conduit head has syncml support. very much in-progress though.

-- Rob Taylor

(Reply to this) (Parent)(Thread)

Re: useful?
[info]turnselfoff
2009-06-11 01:35 am UTC (link)
quick guess is that its based of opensync...

(Reply to this) (Parent)(Thread)

Re: useful?
(Anonymous)
2009-06-11 09:12 am UTC (link)
no, using libsyncml

(Reply to this) (Parent)

Re: useful?
[info]burtonini.com
2009-06-11 06:48 am UTC (link)
SyncEvolution (which uses the Synthesis SyncML library) is working remarkably well these days and even has a pretty UI available. I'm using it to sync my Evolution to ScheduleWorld, which my phone then syncs from.

(Reply to this) (Parent)

Re: useful?
(Anonymous)
2009-06-16 10:28 pm UTC (link)
mjg59--what do you mean 'appears to support syncml'?? It's one thing for sync libs to be on the device. It's something else entirely for the apps on the device to have access to those libs so that they can be configured to use them. Or, at the least, for there to be a Syncing app on the Pre that will put/use the calendar app, for example. Just checking what you mean.

Regards,

Guy S.
System Admin
University of Wisconsin-Madison

(Reply to this) (Parent)(Thread)

Re: useful?
[info]mjg59
2009-06-16 11:09 pm UTC (link)
There's references to it in some of the OS methods. I can't actually run any of it, though, so obviously that's not a definitive statement.

(Reply to this) (Parent)

Re: useful?
(Anonymous)
2009-10-01 07:48 am UTC (link)
Is it realy right that the Palm Pre supports SyncML?!? I haven't read that anywhere! But I has already readed that the Pre DON'T supports SyncML ....

(Reply to this) (Parent)

Re: useful?
(Anonymous)
2009-06-13 07:34 pm UTC (link)
Linux is a fail desktop OS. Get something that works, momo.

(Reply to this) (Parent)


[info]fooishbar
2009-06-10 07:13 pm UTC (link)
The internal flash is probably eMMC.

(Reply to this)

in summary
(Anonymous)
2009-06-10 10:37 pm UTC (link)
So, in summary,

OpenEmbedded/busybox/ipkg, internal git repository, standard kernel interfaces for drivers, standard filesystem layout, use of oprofile, upstart, PluseAudio, GStreamer, D-Bus.

Wow, that must be one of the most (if not _the_ most) impressive embedded pristine firmware in terms of being close to mainstream.

(Reply to this) (Thread)

Re: in summary
[info]reddragdiva
2009-06-12 10:19 pm UTC (link)
Indeed. GNU/Linux rather than Android/Weirdshit/Linux.

(Reply to this) (Parent)

foleo...
[info]turnselfoff
2009-06-11 01:38 am UTC (link)
If i assume the git install is used to power synergy, i cant help feel that this should make a foleo like product running webos dead simple. And one impressive sync ability ysing git as well!

(Reply to this) (Thread)

Re: foleo...
(Anonymous)
2009-06-12 11:51 am UTC (link)
Linux devices and Linux Desktop: I always wonder why devices which are running Linux kernels offer such poor support for Linux users. Mail/contact/Calendar sync - why is it so hard to write a daemon that will work in all OS's that can then translate to the native apps for that platform - Linux mail folders and iCal files for Linux and OS X, Active Sync for Windows etc. That would have ot be more efficent than having a behemoth of an app like iTunes loaded for sync that then ties you to two intel based OS's only. Hell, as it's got a web server, why not just use WebDAV on the phone itself for Calander and Contact sync?
Maybe I want to sync my phone with My Mac at home, my PC when at work and my Ubuntu netbook when on the road.

(Reply to this) (Parent)(Thread)

Re: foleo...
(Anonymous)
2009-06-13 08:33 pm UTC (link)
Uh, because only like 1% of the users in the world are using Linux as a desktop OS and wasting time on them is.. well, a waste of time.

Besides, you use Linux so you can modify your operating system all you like, so go ahead and write your own support. You made your own bed, now lie in it. In the meantime, you can stop complaining about how terrible every other OS is and how great Linux is.

(Reply to this) (Parent)(Thread)

Re: foleo...
[info]realmotk
2009-06-26 04:22 am UTC (link)
Obvious troll is obvious

(Reply to this) (Parent)

dsp codecs
(Anonymous)
2009-06-13 07:27 pm UTC (link)
It's true that there are so many DSP codecs in /lib/dsp, but i'm not sure how many of them are actually in use. E.g. wma, wmv are not in the spec (http://www.palmpre.org/specs).

Apparently, the rootfs includes libgstffmpeg.so. I wonder for which codec they're utilizing ffmpeg.

(Reply to this)


(32 comments) - (Post a new comment)

Create an Account
Forgot your login or password?
Login w/ OpenID
English • Español • Deutsch • Русский…