Linux on the palm

Linux on Palm Tungsten E

When it comes to the Linux kernel, there are many alternatives. For example, many PDAs running Linux use a heavily-patched version of the Linux kernel (such as uClinux for example). Since the OMAP processor is a full-featured CPU, and since we’re not that short on memory (32 Mb of RAM is far enough), we decided to use plain vanilla kernel (available from the well-known kernel.org website). However, it appeared that there was an OMAP-development tree being maintained. This tree is pushed up to the mainline kernel, so it doesn’t really matter which one we use. The later just let us benefit earlier from the latest patches.

How to build a kernel image ?

Unless you’re working on an ARM-powered machine you’ll first need to install a cross-compilation environment. Basically the idea is to build a specific version of GCC that will run on your platform (say PowerPC or x86 for example) and that will produce ARM binary code. Once you’ve installed this environment, you should have a lot of binaries starting by «arm-linux-» somewhere in your $PATH. When you’re done with this, just put «ARCH=arm CROSS_COMPILE=arm-linux-» before any «make» invocation.

Booting your kernel image

Once you’ve built your kernel image, just fetch the file arch/arm/boot/Image, and copy it into the garux directory. Then cd to garux root folder, and «make». You’ll obtain a nice .prc containing your image plus its associated bootloader. Please just make sure you’re Image is not bigger than a megabyte, otherwise Garux may have problems booting it.

Источник

Hack17.Run Linux on Your Palm

Although it’s not the Palm version of Linux that will no doubt blow our socks off when it eventually arrives, uClinux is a good way to play around with an alternative operating system on your Palm .

If you haven’t heard already, Palm is switching operating systems, and in the not-so-distant future, Palm-Powered will mean Linux-Powered, but with all the elegance and grace of the current Palm OS. It’s going to take a while, though. If you want to give Linux a whirl on a Palm right now, it’s quick and easy. You won’t get any of the graphical goodness you’ll eventually get with the future version of Palm OS, but you will have a chance to play around a bit and run this powerful operating system right on your little handheld.

Unfortunately, Linux doesn’t run on a lot of Palms. The good news is that it runs on a lot of older popular models, such as the IIIe, IIIx, V, Vx, and even some of the m series. You can usually find these Palms very cheaply [Hack #50] , so you can play around with this on the cheap. In fact, when I bought a used Palm Vx for $30, it included a USB-to-serial adapter, which was worth nearly the price I paid for both items!

Читайте также:  Locate files in linux

2.8.1. Boot Linux on Your Palm

The simplest way to get Linux running on a Palm is to pick a well-supported Palm, such as the Vx, and download a binary release of Linux from http://palm-linux.sourceforge.net/. At the time of this writing, they had versions that worked with the m500 as well as a bunch of older models. What you’ll get is a small PRC file (such as uClinuxPalm.prc ) that has the Linux distribution and a bootloader. Install the PRC on your Palm, and you’re just about ready to launch Linux.

I say just about, because you need a couple of things. First, you need to be prepared to sacrifice everything in your Palm’s storage. After you launch Linux, you’ll lose all your settings, appointments, contacts, and even installed applications. You can reset your Palm and go back into the Palm OS, but it will be as if you’d performed a hard reset.

Second, you need a way to talk to the Palm. Unfortunately, if you want to interact with the Linux operating system running on your Palm, you need to use a serial connection and a terminal program. So, you won’t be taking your Linux-powered Palm on the go with you. Here’s what you need to do to get this all working.

2.8.1.1. Setting up the serial connection.

If you’ve got a recent notebook computer, a Mac, or legacy-free PC, there’s a good chance you don’t have a classic serial port. However, there are many USB to serial adapters that can do the trick. The PalmConnect USB kit, shown in Figure 2-27, is a small dongle that will work for Windows and Linux users.

Figure 2-27. The PalmConnect USB kit

Although it ships with a CD-ROM, the PalmConnect hardware is of an old enough vintage that you should check http://www.palm.com to see if there are any updates to the driver (Mac OS X users will not be able to use the PalmConnect kit for this, since the Mac OS X drivers do not represent the device as a serial port). Also, Keyspan (http://www.keyspan.com) makes a variety of USB to Serial adapters that work with Windows, Mac OS X, and Linux.

Once you’ve installed the USB to serial adapter, you need to figure out where it lives. On Linux and Mac OS X, serial ports appear as files in the /dev directory. On Windows, they appear as COM ports. Table 2-2 shows some possible candidates for serial ports for systems with both USB to serial and built-in serial ports.

Источник

Linux on Palm Tungsten E

Linux is an OS on its own. It doesn’t need the PalmOS. Yet we just can’t launch Linux right at power-on, since the ROM isn’t writable. That’s why Linux is started from the PalmOS, like any other PalmOS application. But don’t be fooled : once you’ve started the kernel, ALL YOUR DATA WILL BE LOST. You just can’t hope to get your data back. That’s why we stronly advise you to make a full backup of your palm before giving Linux a try.

Choosing your installation method

  • Use the Tungsten’s RAM to host a ramdisk, that will contain the root filesystem. This solution is perfect if you just want to give Linux a try. You will only get the most basic tools, so don’t expect much from this solution. Yet it might be worth the try.
  • Use a MultiMedia Card to host the root filesystem. We recommend using this solution if you plan to use Linux on a more regular basis, or if you just want to check the full-featured solution. MMCs aren’t very expensive nowadays (in France you can get a 128MB one for 13 Euros), so you should consider getting one (and you’ll also be able to use them on the PalmOS).
Читайте также:  Настройка dns dhcp сервера linux

Using the RAM-only install

  • Backup your data. Yes, I’m repeating it : backup all your PalmOS data ! Linux will wipe it out (or, even worse, corrupt it).
  • Get the latest Garux_ramdisk.prc file from our released files section.
  • Upload it to your Palm (using Palm Desktop, Pilot-Link, or an MMC/SD Card).
  • On your Palm, simply click the «Garux» icon that appeared.
  • Once you’re done toying with Linux, reset your Palm and send it the backup you’ve just made. Even if your Palm might seem to work properly after reset, your data might be corrupted, so it’s mandatory to reinstall your backup.

Using the MMC install

  • Backup your data. Yes, I’m repeating it again and again: backup all your PalmOS data ! Linux will wipe out all your data (or, even worse, corrupt it).
  • Get the Garux_MMC.prc file from our released files section.
  • Upload it to your Palm (using Palm Desktop, Pilot-Link, or an MMC/SD Card.
  • On your Palm, simply click the «Garux» icon that appeared.
  • Once you’re done toying with Linux, reset your Palm and send it the backup you’ve just made. Even if your Palm might seem to work properly after reset, your data might be corrupted, so it’s mandatory to reinstall your backup.

Источник

Linux on Palm Tungsten E

In order to be able to boot Linux on the Palm, we need a loadlin-alike program that will wipe out the Palm OS from the RAM and then give the hand to the Linux kernel image we provide it with.

Why is it so specific ?

As explained, the bootloader has to be a Palm OS program. Unlike Linux which is a cross-platform software, our bootloader is platform-specific, since it has to be written for the Tungsten E platform, and for the Palm OS (version 5).

Coding for the Palm OS

In order to be able to compile software that will run on the Palm OS, we need a SDK. There is a free Palm OS SDK called prc-tools which uses the Gnu Compiler Collection. However, while newer Palm OS devices sport different kinds of processors (X-Scale, OMAP, etc. ), former one used to run a 68000 processor. In order to keep a binary compatibility, newer devices (among of which the Tungsten E) runs a 68k emulator. And even though, they are still faster than their predecessor because their CPUs are way faster (and also because the Palm OS itself doesn’t use emulation but is coded natively for the host CPU). However, Palm OS applications can be compiled natively for ARM : you’ll gain speed, but you’ll lose backward compatibility as a tradeoff.

What had already been done ?

A bootloader for the Palm OS had already been written, but for older Motorola 68k-powered Palm devices. This loader is distributed with the uClinux embedded linux distribution, but it’s also available here as a tarball. A few parts of this bootloader helped us, but most of it wasn’t useable, since 68ks are too different from ARMs.

Читайте также:  Ошибки при запуске linux mint

What have we done ?

  • In order to boot it, we obviously need to send a kernel image to the PalmOS. However, PalmOS databases cannot be bigger than 64Kbytes. This problem can be quite easily solved by splitting the kernel in 64Kb chunks, and re-joining them later on.
  • We needed to get out of the 68k emulator, because any application is started as if it was a 68k app. This is not so hard, because the Palm OS has provision for this : we just used the PceNativeCall function.
  • We had to setup the machine properly (i.e. turn off interrupts, turn off MMU, set up registers according to Linux expectancies). That was not a very hard job for two reasons : that’s fully documented, and anyway most of this can be copied from u-boot, which fully supports OMAPs
  • Last, but not least : we had to actually launch the kernel. That can sound dumb, but it was not as easy as it might have seemed. For this very simple reason : we had turned off the MMU. That’s why the kernel image address we had was no longer valid. Here is how we solved it : first of all, we disassembled the PalmOS itself so as to get an idea of the virtual to physical memory mapping. Thanks to a disassembly of the DAL.prc file (we cannot distribute this one because it’s copyrighted), we managed to find where the mapping was stored. Altering the memory mapping, we created a linear-mapped memory area that wasn’t used by the PalmOS in normal use, but that was still large enough to contain a kernel image plus a small piece of code. Before disabling the MMU we copied our kernel image to this location, plus the end of the bootloader. We then jumped to the end of the bootloader, and disabled the MMU. In effect, disabling the MMU must be done from a linear-mapped memory address, otherwise the PC isn’t valid once we stopped the MMU.

A few words about Garux

  • Garux is functional. We have had some output from a running Linux kernel through the LCD display, so we are positive about its functionality. However, it still has a few limitations (for example I’m not sure it will correctly boot images bigger than a megabyte (i.e. 8Mbit), because of the PalmOS heap size limit).
  • Because of the peculiar file structure of the PalmOS it’s not possible (or at least pretty awkward) to dissociate the bootloader from the kernel image : that’s why Garux needs the kernel image at compile time (in order to split it in 32000 bytes chunks and to join them in the .prc file).
  • Garux has a built-in machine detection algorithm that will prevent it from running the kernel if it is ran on another PalmOS device. This wasn’t meant at all to prevent our code from being reused, but since running Garux on a machine that is not a Tungsten|E would obviously lead to a crash we thought it was safer. If you wish to re-use some code from Garux for another Palm, you’re obviously welcome.

Источник

Оцените статью
Adblock
detector