Once your psion boots into linux, you have a basic, functional linux system. This section discusses some of the more useful things you can do, or get set up, as they might pertain to PsiLinux, but this document is not meant to be a tutorial on linux - in other words, if you have a specific problem, or task you want to do, you might consult the linux literature (man pages, HOWTO's, etc.) on the issue.
If your /proc filesystem is not mounted automatically, mount
it: mount -t proc /proc /proc
. You can then ls /proc
if you want.
If your compactflash partitions are not mounted automatically, you can mount
them:
mount -t msdos /dev/hda1 /mnt/disk1
where /mnt/disk1,2 are used as examples of places where you might mount these
partitions. If the above actions do not happen automatically for your system,
you could set up those actions to happen at bootup using an /etc/rc.d file of some sort.
mount -t ext2 /dev/hda2 /mnt/disk2
You can also do dmesg
to see the system messages, or
perhaps more primitively: dmesg < /mnt/dmesg.txt
. cat
/var/log/messages
can also be useful and fun to take a look at, assuming
system logging is set up.
The keyboard is same as for Psion 5.
Keyboard features. The Psion keyboard is very different from the standard PC keyboard. At the moment, the flavor of linux kernel you download sets the type of keyboard (UK, US, or DE). We use the following special key assignments (UK keyboard):
Psion |
Fn |
Menu |
Fn-T |
Fn-Del |
Menu-1 |
Ctrl-Menu-, |
Ctrl-Menu-Del |
Fn-Space |
Fn-Esc |
PC |
AltGr |
Alt |
| |
` (backtick) |
Alt-F1 (VC1, etc.) |
SysRq |
Reboot |
Backlight on/off |
Power on/off |
Changing these default keys using the "loadkeys" and a keymap file might make these special keys inoperable (the newest kernel has supposedly fixed that). "dumpkeys > filename" will dump out a set of key mappings that you can take a look at. "loadkeys filename" will then load in that keymap (with whatever modifications you have made to it). You have trouble saving your special keys functionality, you can comment out or delete the lines for the special keys (e.g., the space key) to preserve their special functions (e.g., the backlight).
The Shift, Ctrl, Alt, and AltGr keys are "sticky" by default. They behave as illustrated in the following example:
Sequence |
Normal |
Sticky |
CONFIG_SMART_SLOCK |
|
|
no |
yes |
Shift down, up, A |
a |
A |
A |
Shift down, up, down, up, A |
a |
a |
a |
Shift down, A, A, Shift up |
A A |
A a |
A A |
"Fn M" or "Fn ." will lighten or darken the screen as for EPOC (although there seem to be lingering problems with the screen colors (or video modes).
The psion will likely start several terminals that can be selected using "Menu 1", "Menu 2", etc. You can go back and forth between the various screens at will, and so multiprocess (unlike Windoze).
You can change the font and font size using the "consolechars" program (assuming
your system has this installed). (I find the default fontsize to be too
small.) The fonts are in the "/usr/share/consolefonts" directory. For
example,
consolechars -f default8x9
will change the font to increasingly larger sizes, and
consolechars -f default8x16
consolechars -f lat4u-19
consolechars -d
will change to the default font. Each console has to be set independently. You
might set your favorite font in your ~/.profile
file.
Use fbset -a 2bpp
, fbset -a 4bpp
, or fbset -a
mono
to set the framebuffer depth. As of March 2002, the colormaps of
the framebuffer may still need fixing. I think the system default is 4bpp,
which appears to be faded when it comes up; change to 2bpp for
now. (lynx
seems to work better in mono.) You must have the
/etc/fb.modes
configured. This file might consist
of:
#Video modes for Psion 5mx
mode "default"
# D: 3472.222 MHz, H: 5425.347 kHz, V: 22605.613 Hz
geometry 640 240 640 240 4
timings 288 0 0 0 0 0 0
grayscale true
endmode
mode "4bpp"
# D: 3472.222 MHz, H: 5425.347 kHz, V: 22605.613 Hz
geometry 640 240 640 240 4
timings 288 0 0 0 0 0 0
grayscale true
endmode
mode "2bpp"
# D: 3472.222 MHz, H: 5425.347 kHz, V: 22605.613 Hz
geometry 640 240 640 240 2
timings 288 0 0 0 0 0 0
accel true
grayscale false
endmode
mode "mono"
# D: 3472.222 MHz, H: 5425.347 kHz, V: 22605.613 Hz
geometry 640 240
640 240 1
timings 288 0 0 0 0 0 0
accel true
grayscale false
endmode
RESET. The screen can be refreshed by typing "reset". A "reset" can sometimes be very effective at curing what ails your psion.
BC/DC. bc
is a simple line calculator type thing - try
man bc
. dc
is
similar, but more reverse polish like. Calculate pi to arbitrary many
decimals; if that isn't useful, what is?
EDITORS. In the editor department, PsiLinux is still rather limited.
vi
(vim
)
certainly works, as does zile
, a slimmed-down emacs clone (emacs
itself could be installed, if you wanted to use the diskspace for it). However, the
touchscreen is does not work for any of the console editors, so you can't point and click
your way along with an editor. X is now supported supported, however, together
with the touchscreen and all of the X applications, including more advanced
editors.
COMPILERS. The *.deb files for the compilers gcc, g77 can be installed and they work o.k., although a little slowly. You need available disk space to install these.
REBOOTING. One can now easily reboot the psion without
having to use the paper clip to press the secret button for a hard reset.
"Ctrl Menu Del" or shutdown -r now
will both probably work, and
properly (maybe... at least it can be set up to work properly) shutdown the
linux system. NOTE that you will lose everything from memory on the EPOC side
of things - all of your set up parameters, serial port settings, the date and
time, etc.
USING LYNX. lynx
, a simple terminal-based web browser, seems
to be set up to use colors which are not available for the psion. I tried to set
things up in /etc/lynx.conf
so that the colors
are black and white. You can also change the frame buffer color depth
to "mono" using fbset -a mono
. lynx
may work better
with mono. You can browse www.nytimes.com and download a package or two
from ftp.debian.org. Also check
out: The BBC News PDA Page.
Also check out the browsers that work in X.
X. The X window system can now be installed on the 5MX - see the section on this installation. Installation of X brings with it all of the X applications.
PRINTING. There is nothing to stop you from installing the lpr package,
setting up the PPP network connection to the desktop computer (see below), and
then setting up network printing through the desktop. This will require running
the lpd printer daemon, and setting up the /etc/printcap
file. With
this you can print from your psion to the printers that are connected (local or
network) to your desktop computer.
However, a simpler way to print a file is: dd if=filename | rsh desktop
'lpr -'
.
Perhaps better for a 115200 baud connection:
gzip -c filename | rsh desktop 'gunzip -c | lpr -'
Or perhaps gzip -c filename | rsh desktop 'gunzip -c | enscript
--filter-stdin=-'
(and so forth...).
Connections to both a modem using PPP, or to the desktop computer using minicom,
seem to work fine (115200 baud). The serial port is /dev/ttyAM1
;
it works just like any other serial port.
The IR serial port also works; one can communicate back and
forth via minicom, and set up a PPP connection over this port to e.g., a
notebook computer. You can then rcp files back and forth out of thin
air! Woohoo! There seems to be some confusion about which port the IR is - I
was successful only when using /dev/ircomm0
. 115200 baud is,
of course, preferred.
The PPP configuration can be made following the description of PPP given below.
To enable the infrared connection, one executesirattach
/dev/ttyAM0 -s 1
on the psion, and irattach /dev/ttyS1 -s 1
on
the other machine (if ttyS1 was recognized at boot up of the notebook computer
as the IR device). There is also likely to be a /etc/init.d/irda
startup script on the notebook computer that you could use. The
-s 1
flag enables system logging. Even though ttyAM0
or ttyS1 are used to make the IR attachment, /dev/ircomm0
is still the serial port to use on either notebook computer or psion. The
command irdadump
, which is a standard tool, can help in debugging
the connection - it will show, at the lowest level, when the remote IR
signal is picked up or not. NOTE that the use of IR is meant to consume
a considerable amount of power; turn it off by killing the irattach
process when it is not in use.
The serial connections, PPP, and rsh involve running a getty on the
serial ports, either on the notebook or on
the psion. getty 115200 /dev/ttyAM1
or getty 115200 /dev/ircomm0
on the psion, or agetty 115200
/dev/ttyS0
or agetty 115200 /dev/ircomm0
on the remote
computer. These getty's are probably best started up in the
/etc/inittab
file, because they need to be "respawned". You can
restart init so that it rereads this file without rebooting by "init q".
Some distributions come with gsmlib, that allows you to send SMS and manipulate your cell phone phone book. For more information about gsmlib see: http://www.pxh.de/fs/gsmlib/.
For real amusement, it may be possible that the IR and normal serial connections can be bound together as one in order to double the bandwidth of the serial connection. See the IR HOWTO (and let us know if you got this to work!).
This subsection contains two sub-subsections on
1. CONNECTING THE PSION TO THE DESKTOP
2. CONNECTING THE PSION TO THE INTERNET USING AN EXTERNAL MODEM.
Read the Linux PPP howto:
http://www.linux.org/docs/ldp/howto/PPP-HOWTO/index.html.
There is also helpful documentation about Ipaq PPP at: http://ipaq.secret.org.uk/.
As an example, PPP can be configured with telnetd. However, rsh
may be preferable to telnet, because then you can efficiently copy things between
the psion and desktop using rcp
. Install the rsh client and
servers if you want rsh
; rsh
is preferable to ssh
for psion-computer connections because it does not have
the overhead of ssh encryption. [NOTE: installing packages with shells, daemons
and so on with dpkg, will sometimes make a directory /etc/pam.d; you are to delete
this directory, because if it exists you will not be able to login!! Boot to single
user mode if you forget, and delete the directory.]
To connect your Psion to your computer:
Have something like this for the /etc/ppp/options
file on the Psion:
-detach
defaultroute
noauth
nocrtscts
lock
lcp-echo-interval 5
lcp-echo-failure 3
/dev/ttyAM1
115200
/dev/ircomm0
for IRDA)
Then add the ppp user to your Psion's /etc/passwd
file:
echo "ppp:*:101:101:PPP User:/etc/ppp:/usr/sbin/pppd" >> /etc/passwd
And make sure pppd is executable for user ppp:
chmod a+x /etc/sbin/pppd
To get telnetd running, add the required entry to the /etc/passwd
file:
echo "telnetd:*:101:101::/usr/lib/telnetd:/bin/false" >> /etc/passwd
Then add the telnetd entry to the /etc/inetd.conf
file:
echo "telnet stream tcp nowait telnetd.telnetd /usr/sbin/tcpd \
/usr/sbin/in.telnetd" >> /etc/inetd.conf
You will need to run a getty on e.g., /dev/ttyAM1
to enable
logins to the Psion by telnet or ppp. The getty gives you the login prompt when you connect
over the serial port. The command getty 115200 /dev/ttyAM1
- or
/dev/ircomm0
- will start a getty on the serial port. It may be
preferrable to start the getty on the serial port in the /etc/inittab
file.
Finally add your computer's PPP IP address to /etc/hosts
on the
Psion to make telnet login happen faster:
echo "# This makes the telnet login to psion faster
192.168.1.100 gateway" >> /etc/hosts
/etc/ppp/peers/psion
file:
-detach
noauth
nocrtscts
lock
local
connect '/usr/sbin/chat -v -t3 ogin--ogin: ppp'
/dev/ttyS0
115200
192.168.1.100:192.168.1.101
Then just type pppd call psion
on your computer to connect to Psion.
[You may prefer to start up the ppp connection from the psion, rather than
from the desktop computer - but that might not be a security risk you want
to take.]
To access the internet from your Psion through the desktop computer, you need
to add routing, masquerading, and NAT [I don't know what these are either...but
it works, so who am I to complain?]
to your desktop:
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE
then you can browse the internet from your psion using dillo
or
lynx
. Be aware that your desktop kernel must be compiled to
support these things; default RedHat kernels support this.
Either a standard external modem or an external infrared modem (e.g., Psion's nifty external travel modem - the Diamond Mako travel modems are apparently identical to the Psion travel modems) will work for using your psion to connect to the internet over the telephone lines.
With its installation via dpkg (or ipkg?), PPP is pretty much all set up and
ready to go with an external telephone modem. Edit the files
/etc/chatscripts/provider
, /etc/ppp/peers/provider
, and
/etc/ppp/pap-secrets
to include your own ppp information, or run the script
pppconfig
, which should come with PPP. PPP is started and stopped
using pon
and poff
. (I made a
script "ppp-on" that starts pon
, dumps its messages to
/dev/null
, and puts it in
the background.) You may also need to modify the /etc/resolv.conf
file, to
give your nameserver IP numbers. You might be able to pick up
an infrared Psion (or Diamond Mako) travel modem from ebay.com for US$55-US$70); it works just
fine in PsiLinux with very little fuss - relink /dev/modem
to
/dev/ircomm0
and use baud rate 115200.
Most of the configuration of linux is set up in the /etc directory. Be sure the
/etc/pam.d
directory does not exist, or you will have to use a
password. Check out your /etc/rc.d
and /etc/inittab
files. Also cron
files are there; cron
works fine,
assuming your clock is set correctly. You may also have a
/etc/halt
file that gives to procedure for shutting down the
system.
N.B.: This section is made out of date with the later kernels that
support the hardware rtc.
The resetting of the clock with every reboot is particularly annoying.
With every reboot the psion's time get sets
back to 1 January 1999 at 5 pm. There might
be a way of writing the time to a file that would be written at shutdown
and read at boot up by both the psion and linux; you might lose a few seconds
with every reboot, but that would not be too bad. Work is in progress on this
issue. You can read some notes on this subject, including a crude system
for keeping track of the time when rebooting between EPOC and linux at this timekeeping
page. The page includes a couple of OPL programs for writing system
time to a file in EPOC, as well as setting the system time from a file. There
is also an awk script that will let you set the linux system time interactively,
rather than try to remember the esoteric date
format.
dpkg
or ipkg
. So if you want
to install the package mdate_1.0.1-3.deb
[a utility for reporting Mayan
dates] first get the package from debian.org, making sure it is an ARM binary,
copy it to the psion, and execute dpkg -i mdate_1.0.1-3.deb
.
Remove it by dpkg -r mdate
. In some cases, the distribution
builder has hacked out large elements of the dpkg system to better compact
the distribution, and dpkg
will complain, sometimes failing to
install things altogether, or installing the binaries but failing to configure
things. In the former case, you can manually make whatever file or directories
are missing and try to procede that way (i.e., put on your hacking cap.) In the
latter case, you have probably successfully installed the binaries, so what are
you complaining about? dpkg
will also install a great deal of
metadata - you may want to find this stuff and delete it to save on disk space.The psilinux kernel now supports a minimal sound support, although it seems to need some additional development. The development is needed either in the driver for sound or in other aspects of the kernel (floating point?). Sound can be played on the psion, and it will be recognizable/audible/ discernable, but there seems to be considerable distortion. The sound device is /dev/dsp. Ordinary *.au files can be played by "cat file.au > /dev/dsp". The use of a mixer is not yet supported.
Recording is not yet supported (except in EPOC, of course).
A better bet for playing sound is to install the sox package, which has the command "play", so that "play file.au" will play the file. The psion's sound system is rather limited, of course, only supporting sampling of up to 8kHz. Sound files native to the psion can also be played - they are "*.al" files, so that "play -t al psionsoundfile" will play them. So you could record sound under EPOC, and then play them back under psilinux without trouble. Presumably, once recording is working in psilinux, the "rec" command from sox will allow recording of sound.
There seems to be some problem with sound files having to do with either the processing capabilities of the psion cpu or the floating point emulation. Technically one should be able to play *.wav files, for example, with "play file.wav". However, the psion seems to be incapable of doing the conversion of *.wav files to play them. Further, "sox file.wav file.au" will fail to convert the *wav file to *.au file, even for very small *.wav files - the psion will go into overload trying to do the conversion ad infinitum (or until ^C is hit). Thus, some of the problems with psilinux sound may not be entirely due to the sound driver.
The psilinux kernel is very close, if not there, to being able to be put in sleep mode and having a daemon running (an ipaqalarm/uschedule system) that will cause the psion to wake up and play a sound, e.g., for a morning alarm.