(Or, what Dwight Schauer figured out to do in order to run SwiftX with
WINE on Linux)
What this page is not:
A tutorial, help, or support page for SwiftX™.
A tutorial, help, or support page for WINE.
A tutorial, help, or support page for Linux.
If you expect to find this page useful, you must understand why I
stated what this page is not. If I have to explain to you my
reasoning, then this page will be of little use to you.
That aside, I hope you find this page useful and can apply the
information to improve your own software development system. I'm
assuming you are reading this page because you desire to run SwiftX™
with WINE on Linux. Other WINE platforms such as FreeBSD and Solaris may work as well, but at
this time I will not make any attempt to explain the specifics required
for those systems.
From my experience WINE
installation setup and success varies between versions and across Linux platforms. I happen to be
using Wine 20030318 on Gentoo Linux
1.4.2.8 so you may run into issues that I did not run into.
This HOW-TO is preliminary, but covers solutions to the main problems I
ran into when trying to run SwiftX with WINE on Linux. I took the
obligatory screenshot,
which, of course, does not prove anything.
Copyright
How to run SwiftX™ with WINE on Linux is
Copyright (C) 2003 by Dwight A. Schauer. It is licensed under the
terms of the The
GNU Free Documentation License.
Disclaimer
If you use this HOW-TO to run SwiftX on your Linux (or other WINE
capable system) then you agree to not hold me liable for any thing that
goes wrong as a result of it. I offer no warranty or guarantee
that any of this will work on your system.
Basic requirements:
- Linux is already installed on your computer and is running well.
- WINE is already installed and you know how to configure it, run
programs it it, and you are adept at running software packages in
environments that they were not designed to run in.
- You have a SwiftX license available to use on your computer.
- You are familiar with installing SwiftX, and know what the
installation screens look like.
- You know how to develop software using SwiftX, and are
familiar with project setup.
- You know a little bit about bash shell programming. (Some
knowledge of C is useful as well).
I had no problem fulfilling the above requirements, but I did run into
a few issues trying to use SwiftX on WINE. I'll address the
solutions after I explain the issues. If you understand these
issues, the solutions may make sense to you. After reading through
these, then install SwiftX as you would any other Windows program with
WINE, and use my solutions for the issues I ran into as you see fit.
The issues (these have solutions):
- During the install, the license agreement came up blank.
- Inability to open projects, or launch them using the SwiftX
project files.
- Direct I/O Port access required by the parallel port BDM
that SwiftX was using, which in my case was SwiftX ColdFire 3.1.12.
- When an editor is invoked from SwiftX, it is assumed that the
underlying filesystem is case-insensitive in respect to filenames and
paths. Since Linux filesystems are case sensitive, this is problematic.
- Colors were terrible, and the color selection dialog had all
blank pallette entries, forcing guesswork, which made picking sane
colors difficult at best.
- The default font did not look good.
- SwiftX did not recognize any serial ports to use for the serial
XTL.
- Some serial XTL operations timed out or resulted in protocol
errors.
Issue #2 was interesting. I could not get WINE to launch the SWX files,
and I could not figure out how to load them from a running SwiftX. I
tried running SwiftX from the directory the project was in, but that did
not work.
For issue #3 I configured WINE to allow access to the parallel ports. I
then had to run SwiftX with WINE as root. I considered this an
unacceptable solution. Both for security/stability reasons and newly
created/generated file ownership issues.
The solutions:
- Blank license agreement - No short term solution needed here, you
should have already agreed to it when you installed SwiftX on a Windows
platform.
- Inability to open projects - I ended up writing project launch
scripts that would start SwiftX from the top level directory that SwiftX
was installed in, the directory that SwiftX and Projects are in. In my
SwiftX development environment, my projects don't reside in the Projects
directory, so I used this for the project launch scripts. I'll discuss
these scripts in more detail later on.
- Direct I/O Port access - I wrote a small utility that I named AllowDirectPortIO that
is setuid root. It sets up port permissions, then drops root privleges
and run the command specified on it's command line. The launched process
inherits the port permissions so direct port access is allowed. I was
then able to turn off port access in the WINE config file, and it still
worked.
- Editor launching assuming case insensitive file system - I wrote
a small editor launcher script that uses winepath. More on that in a bit.
- Bad colors - I added a custom color table to the project launch
script. At first I jotted down a cheat sheet for the pallete, but it was
missing simple stuff like black and white, so that method was not very
useful.
- The default font did not look good - This is not really a SwiftX
with WINE related problem. Many apps on WINE don't pick a decent default
font. The solution in this case is to use the SwiftX menu item
Options->Font and choose a more suitable font.
- SwiftX did not recognize any serial ports to use for the serial
XTL - This problem seems to mainly be WINE issue. I can't get any USB
RS-232 adapters to work. This is problematic on host systems that do not
have legacy serial ports. On-board COM1 seems to work. I've had
limited success with On-board COM2. You should check the [serialports]
section in .wine/config and make sure that your serial ports are
configured properly for use with WINE.
- Some serial XTL operations timed out or resulted in protocol
errors - From what I could tell this is an XON/XOFF and other control
character processing issue. Running "stty -F /dev/ttyS0 raw" prior to
launching SwiftX seemed to fix this problem.
Project Launch Script
This still needs some work, to be smarter about paths.
The project loader script, I called it project_loader and put in
Projects.
#!/bin/bash
cd /PATH/TO/WHERE/SWIFTX/IS/INSTALLED
allowdirectportio.lpt
\
wine SwiftX/Bin/Sf.exe \
include Projects/colors.f \
include Projects/$(basename
$0).f # include the project file based on symlink
For each project, I made a symbolic link to the project loader script
in Projects. To launch a project, I run the sym link. I also
made a .f file for the project and put that in Projects as well.
Sample project.f file:
include SwiftX/XComp/ColdFire/SwiftX \
Change as needed to fit your cross compiler
cd PATH/TO/WHERE/MY/PROJECT/IS/ \ Relative to the top level
SwiftX directory
project" NAME OF PROJECT HERE" \ Change as needed to the name of your
project
Editor Launch Script
This script will have to be completed to work with to your editor.
#!/bin/bash
WineLib=/usr/lib/wine/lib
WinePath=/usr/lib/wine/bin/winepath
edit_path=$(LD_LIBRARY_PATH="${WineLib}" ${WinePath} ${1})
echo Wine: ${1}
echo Unix: ${edit_path}
echo Line: ${2}
# Launch editor here, using ${edit_path} for file, and ${2} for line
number
# I use an X based text editor. If you use a text terminal based one
# then you may need to launch a terminal here
exit 0
In SwiftX under Options->Editor point to the editor launch script.
The editor options need to be set to "%f %l" in order to work correctly.
That is "percent f space percent l" with no surrounding quotes.
Custom color table
I called this file COLORS.F and put it in my Projects directory.
CREATE CUSTOM-COLOR-TABLE
\ TEXT BACKGROUND
$000000 , $FFFFFF , \ normal
$FFFFFF , $000000 , \ inverse
$FF0000 , $FFFFFF , \ bright
$0000FF , $FFFFFF , \ bold
CUSTOM-COLOR-TABLE SET-COLORS
Running SwiftX with WINE
After setting everything up, I am now able to launch a SwiftX project,
compile and debug code. I can also interact with the target, and edit
words directly from the SwiftX window. I've not used it all that long in
this configuration, so I don't know of other possible issues that I may
run into.
Possible outstanding issues
- I have not used many of the buttons or menu items, so there may
be WINE related problems that I am unaware of.
- Saving options using the menu does not always work.
Acknowlegements
Thanks to:
Ron Oliver, for tracking down the solution to the
color issue for me.
Rick VanNorman, for providing the color table
solution to Ron.
Dan Sandahl, for helping me work around the project
loading issue.
Leon Wagner, for letting me know that SwiftX ran on
Linux with WINE.
Noel Henson, for encouraging me to figure out
how to run SwiftX with WINE.
John K. Stevenson, also for encouraging me to get
moving on this.
Related Web sites
Linux
I/O port programming mini-HOWTO: Using I/O ports in C programs
SwiftX Archive
Questions, Comments, or Suggestions concerning any of this? Send an
email to swiftx_at_teegra_dot_net
and I'll try to address them.

$Id: index.html,v 1.16 2003/04/12 16:46:59 das Exp $