lab 67 - Inferno emu on Palm Tungsten T3
Inferno emu on Palm Tungsten T3 (and under similar palm handhelds, see notes).
This lab collects some personal/informal notes that I took while setting up setup Inferno emu running hosted on a T3, the main reasons for doing this are:
- Wanted to experiment with Inferno
- Get tired of the 'traditional' way of using a computer and by extension a handheld (both POS and Linux), and wanting to employ my time in more useful things.
- after some time using Inferno i've noticed that it has all I need, and the pieces that Inferno doesn't have (ogg, mp3, etc.) can be borrowed from the host OS (Linux).
The first section covers the hardware available on the T3, the second section talks about how to setup Linux on the T3, and finishes talking about the setup of Inferno itself to perform some typical tasks, which includes brief notes on how to compile and run emu on T3.
In summary we can use:
- SD card support for storage
- a nice 320x480 TFT LCD for graphics
- audio support both for playing and recording
- and buttons and touchscreen for input
- networking: we have are usb (usbnet), IR (not tested, but should work) and BT (not working due to lack of specs).
It's important to note that T3 as the other palm handhelds have reset features that are useful to recover of some errors, you can read about at resets. Also the process of bringing back the T3 back to life, when not responding to resets is a guide to replug battery, i hope i will not need to flash it through JTAG.
Setting up Linux Booting
The procedure for booting Inferno can be sumarized in:
- boot POS (default from ROM) ->
- run Garux (from SD Card, 1st partition FAT16) ->
- start Linux (using rootfs from 1st partition of SD Card) ->
- start Inferno emu-fb (from a /etc/init.d/inferno script)
As Garux is run from Palm OS (POS), the SD card where garux is stored needs to be recognized from POS, which has a FAT16, hence maximum tested SD card size is 1Gb.
This 1Gb SD card can be partitioned the following way,
- part1 FAT16 30Mb, to store garux and the rootfs, kernel modules and other files needed to boot Linux.
- part2 ext3 970Mb, to store Inferno and media (audio,docs,...).
All the files and a small howto with instructions on how to boot Linux on a T3 can be found at t3 linux.
On the same place there's a guide to flash the SmallRom partition which holds the POS bootloader, to be able to suspend/resume the T3, otherwise you have to reset the handheld each time you want to power off and booting again takes it's time, this last guide talks also about networking the handheld and a computer using usbnet driver.
Setting up Inferno
Given the hardware available on T3 (and handhelds in general) it's wise to keep the system as small and simple as possible. So the hardware devices are managed by the linux kernel, which provices access to them through the /dev/ devices; /dev/fbX
for the graphics frame buffer, /dev/input/eventX for input events (touchscreen and keys) and /dev/dsp for audio. This devices can be managed by the emu-fb version written by Alexander Syschev for the iPAQ 3970 (arm) and pc platforms that was posted on the inferno-list see the 'Inferno emu with Linux framebuffer support' message and can be easily adapted to work with T3¸ see the 'using Inferno on Palm' message on inferno-list too.
The advantage is that you don't need an X server and all it's deps on such a small device you just launch the emu-fb from the console. On the drawbacks are that you loose the hability to lauch ps/pdf viewers like gv/xpdf, anyway I haven't found gv/postscript interpreters on Familiar, I guess it's too much bloated for small devices.
The audio support could be done by using the legacy OSS interface, there's emulation of it from ALSA, because many old programs still rely on it, which I send to the inferno-list with the subject 'devaudio for Linux' so audio support can be easily added.
The next thing was having a WM/GUI suitable for such small screen dimensions but by using the rio like wm/wm from caerwyn, works fine (update: after reading `Window Systems should be transparent' reverted to Inferno's wm, because it's easier to press buttons than borders).
And creating a nice guide file with the frequently launched commands, i.e. play music, raise/lower audio volume, toggle back-light, etc.
This guide can be opened with acme -c1 -l acme.dump, started by default from wmsetup.
Only recommendation is that to take advantage of the small screen space available is a good practice to keep the names of files/directories short so they can fit in one line in the Acme editor. And a nice thing is that you can even do snarfing and chording easily with the stylus.
If you haven't heard about rio, acme and plumber before, take a careful read to the Plan 9 papers in the REFERENCES section.
To finish I've put down also some notes/reminder about the state of this port on a TODO file.
9pod: kind of 9pod, like it was said some time ago on 9fans.
voip: (idea from the beginnings) one thing that I would like to be able to do is to be able to share the audio device '#A' with a remote computer (for start just one), this will allow me to be able to talk with other people, over the net, I know that there're are a lot of projects out there that already give you that, but I wanted something simple thus, the most simple that I could think was:
% styxlisten tcp!firulillo!styx export '#A';
% mount tcp!firulillo!styx /n/remote;
% stream /dev/audio /n/remote/audio;
The above example sort of works, only drawback is that sound is played slow on a 100Mb LAN connection between two Linux hosts running Inferno emu. So the next refinement could be to compress the data before sending it and decompress on receiving it: cat /n/local/home/salva/.mpd/music/misc/mymymy.mp3 |
os madplay -Q -o wave:- - | wav2iaf | auplay -
- A list of handhelds's running Linux, the status of the ports and hardware list can be consulted at supported handhelds
- This talk is about T3, changes to run Inferno emu on another handheld model will be left intentionally as an exercise to the interested reader.
|From inferno photos|