Originally Published: Wednesday, 6 June 2001 Author: Mike Baker
Published to: develop_articles/Development Articles Page: 8/9 - [Printable]

OSDN Handheld Months: Installing Linux on a Casio E105

Linux.com Senior Developer Mike Baker takes us step-by-step through installing a Linux system on a MIPS-based Windows CE device. If pre-built distributions are not for you, then this article is.

  << Page 8 of 9  >>

X Server

What fun would a handheld with no keyboard be at the command line? We need X on this thing.

The X server in this case is a stripped down version referred to as kdrive. kdrive is supported as a standard part of the XFree86 source, so if you already have a copy there's no need to download another. If not, grab a copy from CVS with the following:

$ cvs -d:pserver:anoncvs@anoncvs.xfree86.org:/cvs login
(Logging in to anoncvs@anoncvs.xfree86.org)
CVS password: anoncvs
$ cvs -d:pserver:anoncvs@anoncvs.xfree86.org:/cvs co xc

Before the touch panel will work we need to swap a few files. Make a quick visit to ftp://ftp.ltc.com/pub/linux/mips/ and grab tp.c, tptrans.h and tpcal. All but the last file go in xc/programs/Xserver/hw/kdrive/Linux/ of your XFree86 sources. The last one, tpcal is the calibration program and goes on the compact flash card.

The next step is to adjust xc/config/cf/host.def to compile for the MIPS platform.

#define CrossCompiling YES
#define KDriveXServer YES
#define KdriveServerExtraDefines -DMAXSCREENS=2
#define TinyXServer YES
#define KDriveXServer YES
#define TouchScreen YES
#define BuildXinerama YES
#define ProjectRoot /usr/mipsel-linux/X11R6

#undef i386Architecture
#define MipsArchitecture

#undef TermcapLibrary

#undef OptimizedCDebugFlags
#define OptimizedCDebugFlags -O3
#define ServerCDebugFlags -O3
#undef StandardDefines
#define StandardDefines -DLinux -D__mips__ -D_POSIX_SOURCE \

-D_BSD_SOURCE -D_GNU_SOURCE -DX_LOCALE \

-mcpu=r4600 -mips2 -Wa,-m4100,--trap
#undef CcCmd
#undef LdCmd
#undef AsCmd

#define CcCmd mipsel-linux-gcc
#define LdCmd mipsel-linux-ld
#define AsCmd mipsel-linux-as

#define StdIncDir /usr/mipsel-linux/include
#define PreIncDir /usr/lib/gcc-lib/mipsel-linux/egcs-2.90.29/include
#define DoRanlibCmd YES
#define RanlibCmd mipsel-linux-ranlib
#undef ExtraLoadFlags
#define ExtraLoadFlags
#define FbNoPixelAddrCode

#undef LdPostLib
#define LdPostLib -L/usr/mipsel-linux/lib -L../../lib/zlib

#undef XfbdevServer
#define XfbdevServer YES
#undef BuildXprint
#define BuildXKB YES
#define BuildLBX NO
#define BuildFonts NO
#define BuildAppgroup NO
#define BuildRECORD NO
#define BuildDBE NO
#define BuildXCSecurity NO
#define ItsyCompilerBug YES
#define FontServerAccess NO
#define ServerXdmcpDefines /**/

#undef ExtensionOSDefines
#define ExtensionOSDefines
#define GzipFontCompression YES

#include <cross.rules>

After changing the host.def it's a simple matter of running make World install -iks from the xc directory to compile the XFree86 sources. After the compile you'll find the binaries in /usr/mipsel-linux/X11R6. You'll still have to copy them over to the compact flash card. When X loads on the CE device it'll be looking for /usr/mipsel-linux/X11R6 -- it's one of the downsides to cross compiling; symlink mipsel-linux to usr to keep your sanity.

Don't worry too much about copying things to the compact flash yet. We've still got a few more things to compile. For instance, unless you're particularly thrilled with twm I'd strongly suggest building Blackbox.





  << Page 8 of 9  >>