Next Previous Contents

3. Compilation

Now on to some compilation fun!

3.1 RTLinux installation

We suggest you install a fresh copy of your favourite kernel in /usr/src. You'll probably want to leave your original kernel alone to fall back to if you'd like to return to a non-RTLinux system. There's a good installation guide supplied with RTLinux so we'll not re-invent the wheel here. Come back to this howto once you got RTLinux up and running. There are a few test applications provided. Please check these to see if your installation has been successful.

3.2 phantom driver compilation

Change to the location where you checked out or decrunched the driver sources to. Edit the Makefile in the source directory: The root directory of the rt_linux installation (RTL_DIR) should point to the place rtlinux sets a link to to (usually /usr/rtlinux in default configuration). Point RTLINUX to your rtlinux kernel directory (if you've set a link to it it would most likely be /usr/src/linux).

Now you will have to configure your phantom model. Currently there are several models supported, including the 1.5 premium model with 6DOF position sensing and 3DOF force feedback. 6DOF force feedback models currently are *NOT* supported - please write in if you'd like to change this :) Standard setting is the 1.0 version, so if you own the 1.5 or 3.0 hardware version, change to the kernel subdirectory and edit phantom_float.c. There's a line right at the bottom of the file, the parameter to change is &1_0 in default.

Type make and the sources and test applications should compile. If this is your first-time installation you need to run make dev as well (This will create the necessary devices in /dev).

If you've not already started RTLinux - do it now. To do that, call (the location where you installed it to)/bin/rtlinux start. RTLinux should 'boot' with the usual messages. There's a convenient script called in in the kernel subdir of your phantom driver module installation for you to use to insert the necessary RTL modules and the phantom module. Please be sure to change the module parameter to the value that applies to your hardware installation.

Examples for the DIP switches on the card. Switches read from left to right while viewing the card such that the text of the silkscreen is upright. Off Off Off Off = 0x0200 Off Off Off On = 0x0220 Off Off On Off = 0x0240 Off On Off Off = 0x0280 On Off Off Off = 0x0300 - recommended location On On On On = 0x03E0

PCI interface cards are autodetected.

You might also like to write a short startup script that you could also use to start your phantom at bootup time. I've included my solution as a guideline only (I know it's pretty lame - but hey - it works).

# small script to start phantom modules PHANTOMLOC="/home/jan/phantom_cvs/phantom" RTLKERNEL="/usr/src/rtlinux-3.0/" RTLINUX="/usr/rtlinux" # starting rtlinux $RTLINUX/bin/rtlinux start # enabling phantom module echo "Inserting modules" grep rtl_time /proc/modules || insmod rtl_time grep rtl_sched /proc/modules || insmod rtl_sched grep phantom /proc/modules && rmmod phantom insmod $PHANTOMLOC/modules/phantom.o ISA_base_0=0x300 # ISA_base_0=0x320 echo echo "mhm. probably went ok. Please check if phantom module is loaded:" echo lsmod

You could easily insert the necessary stuff to use it as a start|stop script, just look at e.g. the apache startscript in /etc/init.d/httpd ...


Next Previous Contents