Installing/Configuring FoxPro 2.6 for Unix and Linux
by Dennis Allen
Installing and configuring FoxPro for Unix and Linux systems is a little different than a DOS system. This tip sheet was created to cover the some of the basics.
Before I begin, I'd like to thank everyone over the years on Unix and MS Developer forums. Special thanks to John Sandell and George Carden for helping me get over the major hurtles. Also thanks to Malcolm Gambles for help on the linux-abi project.
Now using SCO binaries on Linux, such as FoxPro, requires several steps. First, you need to install the necessary modules to handle SCO binaries (see "Running SCO binaries on Linux"). You need to define where your terminfo database is located (see "Locating Terminfo database") and add your Linux compatible terminfo definition (see "Terminfo Files"). Since it is a Linux system, you must have the correct file names (see "File Names/Directories") and correct file/directory permissions (see "File Permissions").
The next step involves installing and configuring your copy of FoxPro (see "Manual Installation"). You need to set your CONFIG.FPU to the Unix/Linux environment (see "CONFIG.FPU"). Finally, you'll need to adjust your FoxPro 2.6 code for the Unix/Linux environment (see "Programming Changes").
All information contained on this sheet is provided as is. There are no warranties, expressed or implied. The author and contributors may not be held liable for any damages, including any lost profits or other incidental or consequential damages arising out of or inability to use this information. Use of this information constitutes acceptance of this disclaimer. You should always double check any information before acting upon it.
This sheet contains references and/or links to other sites or to third party suppliers of goods and/or services. Such references or links should not be considered as an endorsement by the sponsors of this web site.
Compiled FoxPro 2.6 for DOS *.APP and *.FXP files will run on FoxPro 2.6 for Unix (development or runtime). You may, however, have to adjust your code to handle Unix and Linux. The following describes some of these changes:
CHR(7)
On Linux kernel 2.2 systems using iBCS, bell output results in a "SIG: sigpending lied" message. To reduce these messages use:
IF .NOT. _UNIX
?? CHR(7)
ENDIF
Oh, FoxPro produces it's own bell output. Typically when [Ctrl]-[F] searches result in 'Not found'. While you may not be able to avoid them, use [Ctrl]-"]" to clear (refresh) the screen of these SIG messages.
Note: You can eliminate these SIG messages by fixing the underlining Linux bug (see "Fixing iBCS module").
Clear/Refresh Screen
As just stated bell output, file not found, RUN command executing a shell script, print spooler, all can produce various messages. Messages not part of the regular FoxPro screen. Annoying as these messages are, the ONLY way to remove them is to use [Ctrl]-"]" to clear (refresh) the screen. If you use FoxPro for Unix, you will be refreshing the screen a lot.
DATE()
See TIME().
DIR
In Unix, you have to be explicit with your DIR command. In other words, the command [DIR /dmail4] will show nothing. You have to use the command [DIR /dmail4/*.dbf].
DRIVESPACE()
On my RedHat 6.0 Linux system, DRIVESPACE() gives a huge negative number. Even it's ABS() value is strange. Don't trust it.
Esc
On Unix, [Esc] is the escape character. When you press [Esc], Unix presumes that something is going to follow. Only after a pause in time will LASTKEY() register 27.
Like [Esc], [Ctrl]-[Q] will also terminate a READ. But [Ctrl]-[Q] returns LASTKEY() = 17. I suggest using ON KEY LABEL CTRL-Q KEYBOARD CHR(27) PLAIN. Simply tell people to use [Ctrl]-[Q] as well as [Esc]. Then you don't have to chase down [LASTKEY() = 27] code and appending [.OR. LASTKEY() = 17].
FILE()
Remember that FoxPro simply cannot reference any Unix name/directory containing an uppercase character. So even if the file "/home/README" exists, the function FILE("/home/README") will always return false (see "File Names/Directories").
FOPEN()
Found this problem while doing a demonstration. Had a FOPEN(SYS(2019)) with SYS(2019) empty (no CONFIG.FPU file defined). Well, FoxPro returned a FOPEN value of 7. FEOF(7) returned a value of .f. and FGETS(7) just started to read random stuff off the hard drive. Until FoxPro shutdown completely.
To avoid this problem, simply make sure you never call FOPEN with an empty variable.
GETENV()
Always define your environment variables in uppercase. The Unix shell commands:
foxterm = at386a ; export foxterm
FOXTERM = at386a ; export FOXTERM
...define two different GETENV() variables, foxterm and FOXTERM. In other words, Unix is case sensitive.
GETFILE()
Depending on what directory you start, and what directory you select your file, GETFILE() might return a strange directory. As an example, I got the following from my GETFILE():
D = "C:\\MNT\WIN98\DMAIL4\MAL.FXP"
I found the easiest way to clean up this path is using:
D = FULLPATH(SYS(2027,D))
This will convert the file path to Unix, then back to the MS-DOS file naming convention.
MODIFY COMMAND
Some editing keys might work a little different on a Unix system. Instead of [Shift] arrow keys, use [Ctrl]-[P], arrow keys, then [Ctrl]-[P] again. Instead of [Ctrl]-[Home], use [Ctrl]-[Y] [B]. For window zoom, use [Ctrl]-[Y] [U] (see keyboard equivalents).
On my RedHat 6.0 Linux system, I have my FAT32 Windows 98 partition mounted as a (vfat) table (see "File Names/Directories"). I can actually run a FoxPro application from the vfat table. I have full read/write access. Even tried packing and reindexing. Seemed to work fine.
Well, one problem. If I do a MODIFY COMMAND, for some reason a [Save] will result in 'Cannot create file'. The solution is to [Save As] to a temporary file, then [Save As] to the original file. To avoid the problem, I suggest storing your FoxPro application either on a FAT16 partition or a Linux table.
Mouse Cursor
The mouse cursor does not work on Linux. I've talked to the author of the Linux ncurses. To fix the mouse cursor, he needs to know how the SCO mouse drivers were designed. If anyone has this information, or knows who does, please contact me at I'd greatly appreciate it.
ON KEY LABEL F10 KEYBOARD CHR(23) PLAIN
There's nothing wrong with using OKL F10. Just remember, [F10] is the Unix system menu wakeup key. A Unix version of the DOS [Alt] key. Don't use it if you need access to the system menu (SET SYSMENU OFF).
ON KEY LABEL ALT+P DO TEST_PRINT
In Unix, the [F10] key is used instead of the [Alt] key. Therefore, OKL ALT won't work. You have two choices: You can change your OKL ALT code to OKL SHIFT or OKL CTRL. Another choice is to redirect your keyboard stroke, as in ON KEY LABEL CTRL+S KEYBOARD "{ALT+S}". Just don't use keystrokes like OKL CTRL+Y or OKL CTRL+P. Avoid conflicts with alternate keyboard assignments (see keyboard equivalents).
PACK, DELETE TAG ALL/INDEX ON
Commands like PACK or combinations like DELETE TAG ALL and INDEX ON will create new files, and thus change file permissions. Make sure the user who performs these tasks has the correct file permission rights.
For example, [umask 000] in your FoxPro startup script will allow you to recreate files without locking out the other users in the same group (see "file permissions").
PRINTSTATUS()/SYS(13)
As far as I know, every available printer returns a PRINTSTATUS() of true. Whether a printer is actually hooked up or not.
PRTINFO()
Unlike other OS platforms, where PRTINFO(1) = -1, my RedHat 6.0 Linux returns PRTINFO(1) = 1. Prefix any test of PRTINFO() with _WINDOWS.
RENAME
Found this problem while doing a demonstration. I was trying to run a FoxPro 2.6 application stored on my Windows 98 FAT32 drive. Yes, both the application and data were stored on the vfat partition. Well, RENAME would return error 1153 [Attempt to Move file to a different drive].
I didn't see this problem with a 2Gig vfat table. Of course now it's a 4Gig table. I can offer only two solutions. Either change your [RENAME old TO new] to [COPY FILE old TO new / DELETE old], or move your application to a Linux partition.
SET CLOCK ON
See TIME().
SET PRINT TO
You can SET PRINT TO either a standard print device (PRN, LPT1, etc.), or a Unix/Linux print device (/dev/lp0).
If you perform a SET PRINT TO PRN, the public variable _PRN needs to be set to the Unix/Linux print spooler. You can define _PRN in either code or in your CONFIG.FPU. In Linux, _PRN needs to equal 'lpr -s' or 'lpr -Pprinter -h'.
Couple of _PRN notes: Setting the Linux _PRN to either 'lp -s' or 'lpr -s' could result in 'lpstat command failed'. Since _PRN works with spooled output, issuing SET PRINT TO closes the spooler. Blank pages might get ejected between spool opening and closings.
Printer note: On my Linux system, printer output produces a SIG message. Use [Ctrl]-"]" to clear (refresh) the screen of this SIG message.
Here's a printer tip I got from Dale Chesser for quick and dirty pass-through printing under Linux:
Create a shell script called /bin/passth containing the following:
#!/bin/bash
tmpfile=`mktemp /tmp/XXXXXX`
cat > $tmpfile
tput mc5
cat $tmpfile
tput mc4
rm $tmpfile
The above script will work on most (not all) systems. Make the above script executable:
chmod +x /bin/passth
Then just set _PRN="/bin/passth" wherever necessary in your programs.
SET SCOREBOARD OFF
If you SET SCOREBOARD ON, an input error might prompt with (Press SPACEBAR to continue). On my RedHat 6.0 Linux, I can't see this response message. To avoid the problem, I've added a new feature to my applications. The user can now define an environment variable STATUS=OFF, which does a SET SCOREBOARD OFF.
Shell script
I have a couple of applications that create and execute batch files. While I'm in the process of converting these routines to handle Unix shell scripts, I have already learned a couple of things:
First, a MODIFY FILE or a FCREATE/FPUTS will create a file with linefeeds and carriage returns. Carriage returns are ok for source code, but not for scripts. Use the following Unix command to remove carriage returns:
cat temp.bat | tr -d '\r' > temp2.bat
Second, you need to be able to execute this script. Use the Unix command:
chmod a+x temp2.bat
Which brings one last point. Executing the Unix command [temp2.bat] does NOT execute the script. Unlike MS-DOS, Unix doesn't search the current directory for a specified file. You need to be explicit, as in [/home/temp/temp2.bat], or at least [./temp2.bat].
SYS(30)
SYS(30) is suppose to return the Unix login name. Doesn't work on my RedHat 6.0 Linux. Don't count on it. If available, use getenv('USER') instead. Some systems might use getenv('LOGNAME').
SYS(31)
If the process (RUN command) terminates normally, the function will return the exit code (in string format). If the process was killed, the signal number of the signal that killed the process is returned.
SYS(32)
SYS(32) detects whether scancode is ON or OFF. See scancode.
SYS(2000,'')
There are some SYS() functions that will force a shutdown. Especially true for SYS(2000,''). Use FILE() instead of !SYS(2000,'')== "".
Oh, if you use SYS(2000,'',1), use ADIR() instead. For example, if you have DO WHILE !EMPTY(SYS(2000,'',1)), use =ADIR(FLD,'') / FOR D = 1 TO ALEN(FLD,1).
SYS(2027,'')
FoxPro, in general, wants to work with file paths using MS-DOS conventions. Certain instances, however, require Unix naming conventions. Use SYS(2027,'') to convert a MS-DOS path to a Unix path.
Warning: FoxPro cannot reference any Unix name/directory containing an uppercase character. See File Names/Directories.
TIME()
On a non-SCO Unix machine the DATE() and TIME() maybe four to five hours ahead of the computer's clock. Depends on your machine's Greenwich Meridian Time (GMT). The solution is simple. If your shell is /bin/sh, you need to modify the .profile (or .bash_profile) in your home directory to include:
TZ=CST6CDT ;export TZ
...where CST is the timezone, 6 is the GMT offset, and CDT is the daylight savings time zone. On my machine, for example, I had to use TZ=EST5EDT.
If your shell is /bin/csh, you need to modify .cshrc in your home directory, to include:
setenv TZ CST6CDT
USE
If you get 'File too large' or files cannot be written beyond a certain size, you need to increase Unix's ulimit. System administrators, see ulimit.
Luis Alberto Reyna of Argentina sent me a tip. If you get 'too many files open', edit the file /proc/sys/fs/file-max (might be /proc/sys/kernel/file-max in RH 5.1). Increase the file count. If the count is 4800, increase it to 6000. No need to reboot, the solution is immediate.
Using SCO binaries on Linux, such as FoxPro, depends on the version of the kernel. For kernel versions 2.2 and before, you need to install the iBCS module. For kernel versions 2.4 thru 2.6, you need to install the linux-abi kernel patch. For kernel versions not covered by either iBCS or linux-abi, you have one other option: Use a DOS emulator to run FoxPro 2.6 for DOS (a compiled FoxPro 2.6 for Unix FXP file will run on FoxPro 2.6 for DOS).
For people still using the Linux kernel versions 2.2 and prior, the following section will explain how to install the iBCS module. If you are using the Linux kernel versions 2.4 thru 2.6, skip to the linux-abi section. If you want to find out how to use FoxPro 2.6 for DOS, skip to the DOS emulator section.
Note: To determine you kernel version, simply execute [uname -a].
If you're running the Linux kernel 2.2, need to install the iBCS component of the kernel. If a [lsmod] command fails to show this component, you need to add it. The easiest way is to create a /etc/rc.d/rc.modules file (executed upon boot) containing the following two lines:
#!/bin/sh
insmod /lib/modules/2.2.9-19mdk/misc/iBCS.o
Note: The location of your iBCS.o module shouldn't be too much different. Also remember to set rc.modules to the correct file permission [chmod 755 rc.modules].
In the section on programming changes, I discussed several FoxPro coding methods to reduce the occurrence of the message "SIG: sigpending lied". This message is from a bug in the iBCS component of the Linux kernel. Well, Piotr Kasprzyk actually found this bug and showed me how to fix it.
First, check for a /usr/src/linux/ibcs directory. If this directory doesn't exist, you might want to reinstall your Linux. In the list of installation components, add kernel development.
If you can't reinstall Linux, you can get the source file (229 KB) for ibcs2 (latest version 2 of kernel) by downloading:
ftp://tsx-11.mit.edu/pub/linux/BETA/ibcs2/ibcs-2.1-981105.tar.gz
You would unpack this compressed tar file in /usr/src/linux:
mkdir /usr/src/linux
cd /usr/src/linux
tar zxvf /tmp/ibcs-2.1-981105.tar.gz
Once you have the iBCS source code, change to the ibcs/iBCSemul directory:
cd /usr/src/linux/ibcs/iBCSemul
Next, run "vi" to edit the file signal.c:
vi /usr/src/linux/ibcs/iBCSemul/signal.c
Type "/" and "function deactivate_signal()", then [Enter]. You should find "function deactivate_signal()" around line 95. Enter the [Insert] mode. Before the spin_unlock_irq command, add the following line:
recalc_sigpending(task);
This function should then look like:
Void
deactivate_signal(struct task_struct *task, int signum)
{
spin_lock_irq(&task->sigmask_lock);
sigdelset(&task->signal, signum);
recalc_sigpending(task);
spin_unlock_irq(&task->sigmask_lock);
}
Press [Esc] to exit the insert mode, then type ":wq" to save your change. Change to the ibcs directory:
cd /usr/src/linux/ibcs
You'll need to edit the CONFIG file. If one doesn't exist, create one (example for i386 platform):
cp CONFIG.i386 CONFIG
Run "vi" (or another editor) to edit the file "CONFIG". On the first page, find KERNEL and make sure KERNEL=/usr/src/linux. After much frustration, I found out you can't compile the iBCS module unless KERNEL has been defined.
From the ibcs directory, you can now compile a new iBCS module with the following two commands:
make
make install
During the compile, you'll see a lot of messages. If either make command bombs right away, something is missing or wasn't set right. A missing /include/linux/modversions.h file, for example, means you didn't set the CONFIG file's KERNEL option.
Note: Depending on your system, the original iBCS CONFIG file may not be configured at all. If that is the case, you may have to copy CONFIG.i386 over CONFIG. You'd then have to tweak the CONFIG file until it suits your needs. If you have only one Pentium, for example, change "SMP=yes" to "SMP=no". Oh, don't forget to set KERNEL=usr/src/linux.
To check if you did create a new iBCS module, do the following:
cd /lib/modules/2.2.9-19mdk/misc
ls -l iBCS*
Depending on your system, your misc directory may be different. You should see two files. The file iBCS.o is the original component, the file iBCS is the newest. You can load and test your new module:
rmmod iBCS # Remove any loaded module
insmod iBCS # Install a new one
Now run FoxPro and test it. If you no longer see any "SIG: sigpending lied" message, change the file /etc/rc.d/rc.modules to reference this new iBCS component.
Note: Rebuilding a Linux module is not easy. Sometimes only the source code that comes with your Linux will work.
When launching FoxPro under iBCS, you might see the message "iBCS: SCO tape ioctl func=0 arg=0". This message either gets displayed or logged in the file /var/log/messages. This problem can also occur when your terminal goes unused for some period of time and somebody wants remote access to FoxPro.
Luis Alberto Reyna of Argentina (betoreynahotmail.com) ran into this problem using iBCS. His solution is to remove the offending line of code from the associated iBCS module.
First, change to the ibcs/iBCSemul directory:
cd /usr/src/linux/ibcs/iBCSemul
Next, run "vi" (or another editor) to edit the file ioctl.c:
vi ioctl.c
In the file ioctl.c, around line 1167, look for the following code:
#endif
default:
printk (KERN_ERR "iBCS: SCO tape ioctl func=%d arg=%x
unsupported\n", func & 0xff, (int) arg);
return -EINVAL;
}
Simply delete (or comment out) the printk command (the lines between default and return). Type ":wq" to save your change. Change to the ibcs directory:
cd /usr/src/linux/ibcs
The final steps will be to recompile your iBCS module (see "Fixing iBCS module").
If you are running the Linux kernel 2.4.15 thru 2.6, your kernel needs the linux-abi patch. iBCS is no longer compatible.
RedHat 7.3 thru 8.0 already comes with a working linux-abi patch. Run "vi" to edit the file /etc/rc.d/rc.local:
vi /etc/rc.d/rc.local
Scroll to the end of the file, press [Ins] and add the following lines:
insmod /lib/modules/2.4.18-14/kernel/abi/util/abi-util.o
insmod /lib/modules/2.4.18-14/kernel/arch/i386/kernel/lcall7.o
insmod /lib/modules/2.4.18-14/kernel/abi/svr4/abi-svr4.o
insmod /lib/modules/2.4.18-14/kernel/abi/cxenix/abi-cxenix.o
insmod /lib/modules/2.4.18-14/kernel/abi/ibcs/abi-ibcs.o
insmod /lib/modules/2.4.18-14/kernel/abi/sco/abi-sco.o
insmod /lib/modules/2.4.18-14/kernel/fs/binfmt_coff.o
insmod /lib/modules/2.4.18-14/kernel/fs/binfmt_xout.o
(where 2.4.18-14 is the installed kernel version). Press [Esc] to exit the insert mode, then type ":wq" to save your changes.
Note: If you ever recompile your kernel, you'll need to edit these insmod commands to point to your new linux-abi modules. The command [ls /lib/modules/2.4.18-14/kernel/abi/util/abi-util.* -l], for example, would show both the old and new versions of the module [abi-util].
Note: RedHat 8.0 has new system fonts, incompatible with FoxPro. For details, see 'Installing FPU on RedHat 8.0'.
On most distributed versions of Linux, the kernel has been modified and will not accept the linux-abi patch. Therefore, to install the linux-abi patch you also need to install a clean kernel.
First, you need to download the latest linux-abi patch. Then you need to download the corresponding Linux kernel. For the latest linux-abi patches, search the linux-abi project on the sourceforge.net web site, http://sourceforge.net/tracker/?group_id=13130&atid=313130.
For the latest Linux kernel, search the http://www.kernel.org web site. If the main web site is down, check for mirror sites.
Now I'm not going to go into all the possible options of recompiling a Linux kernel. There are plenty of Linux how-to books available. I'm just going to cover the basics.
The first thing I do is logon to my Linux system as root and at the # prompt (text mode). If you can't boot up in text mode, edit /etc/inittab. Find 5:initdefault, change it to 3:initdefault, then reboot.
Now check for the directory /usr/src/linux. If it does not exist, run startx. Within your KDE, use the system configuration to install your kernel source code. Also find and install the GNU patch utility. Once you installed the source code, you can logout out of KDE to the # prompt.
To install and patch your kernel, execute the following commands:
cp /usr/src/linux/.config /root
cd /usr/src
rm -rf linux
tar zxvf /root/linux-2.6.11-rc1.tar.gz
mv linux linux-2.6.11-rc1
ln -s /usr/src/linux-2.6.11-rc1 /usr/src/linux
This set of commands saves a copy of your current configuration file (.config),
installs your new kernel 2.6.11-rc1, and sets usr/src/linux to point to the new
kernel. The mv command was used in case the tar command created /usr/src/linux
instead of /usr/src/linux-2.6.11-rc1. To install the linux-abi patch, execute
the following commands:
cd /usr/src/linux
bunzip2 /root/linux-abi-2.6.1-rc11.diff.bz2
patch -p1 < /root/linux-abi-2.6.11-rc1.diff
Note: This patch cannot work from /usr/src, using patch -p0. It has to run from /usr/src/linux, using patch -p1.
Now you need to configure your system. Execute the following commands:
cd /usr/src/linux
make mrproper
make distclean
cp /root/.config .
make oldconfig
A typical "clean" kernel contain many more drivers then a distribution kernel. The "make oldconfig" command will show what drivers got added. When you get to any linux-abi related prompt, just press "y". If you're doing a 2.6 kernel recompile, I suggest also pressing "y" to any kallsyms related prompt.
Write down what else got added. Then execute the following command:
make menuconfig
It's not enough to say "n" to a new feature, sometimes you must remove the calling section. For example, my first time 2.4 kernel recompile bombed on the new network driver. Even after I said "n" to the new driver from [make oldconfig]. So in [make menuconfig] I had to remove the whole calling section on that network driver.
To simplify things, my system would never use video drivers, ham-radio, or DVB, so I used [make menuconfig] to remove their support altogether. Once you saved your .config file, execute the following commands:
make dep
make clean
make bzImage
make modules
make modules_install
make install
This set of commands creates a new kernel (vmlinuz, System.Map, initrd.img) and installs them into the /boot directory and your lilo. When you reboot, you should have a new entry in /etc/lilo.conf.
If you get a compile error message, write it down. Then perform another [make menuconfig], remove the call to the offending driver, and execute these commands again. You might have to do this several times before you get a clean compile.
Note: For the 2.6 kernel, make dep is no longer needed. I also found that the 2.6 kernel is too big to boot on a floppy anymore. Not without moving most of the kernel into modules, anyways.
If you are not familiar with compiling kernels, there are plenty of Linux how-to books available. You might want to check the file called http://www.kernel.org/pub/linux/kernel/README
If you want more information on linux-abi, visit the linux-abi project, the Malcolm Gambles web site. There is also an excellent linux-abi tutorial by Brian K. White on the AP Lawrence web site.
When launching FoxPro under linux-abi, you might see the message "abi: SCO tape ioctl func=0 arg=0". This message either gets displayed or logged in the file /var/log/messages. This problem can also occur when your terminal goes unused for some period of time and somebody wants remote access to FoxPro.
Jason (jasonp_hypertechskyinet.net) ran into this problem using linux-abi. His solution is to remove the offending line of code from a couple of sco modules.
First, change to the abi/sco directory:
cd /usr/src/linux/abi/sco
Next, run "vi" (or another editor) to edit the file ioctl.c:
vi ioctl.c
Type "/" and "printk", then [Enter]. You should see the following printk command:
printk(KERN_DEBUG "sco: ioctl[%d, %lx[%s], 0x%p) unsupported\n", fd,
ioctl_num, class_str, arg);
Simply delete (or comment out) the printk command (both lines that make up the command). Type ":wq" to save your change. Next, run "vi" (or another editor) to edit the file tapeio.c:
vi tapeio.c
Again, type "/" and "printk", then [Enter]. When you find the same printk command, delete (or comment out) the printk command and ":wq" to save the file. The final step is to recompile your kernel (see "Recompiling the kernel").
Edwin Beecher (edwinarnet.com.ar), from Argentina, offers another solution:
I've read the man pages of insmod, rmmod and lsmod and find something very interesting in the man pages of syslog about the printk function.
So this is a "cheat" to fix the abi SCO tape error without recompiling your kernel (in Red Hat 8).
What do you need?
The file abi-sco.o, located in /lib/modules/2.4.18-14/kernel/abi/sco/
2. A hexadecimal editor, NOT A PLAIN TEXT EDITOR. If you have one in Linux, excellent, if you don't (like me) you can copy this file to a Windows environment, make the modifications with you favorite hexadecimal editor and copy it back to Linux.
3. Of course, you must be root to do this. Important: make a copy of the original abi-sco.o file in case of trouble.
Here we go. Open the abi-sco.o file with your hexadecimal editor and find the following string:
abi: SCO tape ioctl
You'll see something like this:
002200 ·····························<7>sco: ioctl(%d, %lx[%s], 0x%p)
002240 unsupported·················<3>iBCS: SCO termios ioctl %d un
002280 supported····················<3>abi: SCO tape ioctl func=%d a
0022C0 rg=%x unsupported············<3>vtkbd.c: vtkd ioctl 0x%02x un
002300 supported···6·······L·······N·······Y·······[·······]·······c···
Now, change the number "3" before the "abi" word to a number "6", so it must see like this:
002200 ·····························<7>sco: ioctl(%d, %lx[%s], 0x%p)
002240 unsupported·················<3>iBCS: SCO termios ioctl %d un
002280 supported····················<6>abi: SCO tape ioctl func=%d a
0022C0 rg=%x unsupported············<3>vtkbd.c: vtkd ioctl 0x%02x un
002300 supported···6·······L·······N·······Y·······[·······]·······c···
Save the file with another name and put it back in Linux in the /lib/modules/2.4.18-14/kernel/abi/sco/ directory (you can use another location if you want).
If you use the same name, rename the original file BEFORE.
Let suppose that the new file is called abi-new.o
Now we have to remove from memory the abi-sco module. Type the following:
rmmod abi-sco
If you get an error, someone is working with fox, so you can use the lsmod command:
lsmod | more
If nobody is working, you will see a "0"(zero) in the "Used by" column of the abi-sco module, otherwise you will know how many people is in fox, so "kill" them for a while :)
If you have removed the abi-sco module from memory, now you can load the new module:
insmod abi-new.o (or the name you've used)
That's all, now go to any terminal and execute fox in the command line.
You won't see the abi: SCO tape error in the console.
To finish you work you must edit the file rc.local that is located in /etc/rc.d and change the "abi-sco" line with the name of the new file.
cd /etc/rc.d
vi rc.local
Comment the old line and add a new line, like this:
....
....
insmod /lib/modules/2.4.18-14/kernel/abi/ibcs/abi-ibcs.o
# insmod /lib/modules/2.4.18-14/kernel/abi/sco/abi-sco.o
insmod /lib/modules/2.4.18-14/kernel/abi/sco/abi-new.o
insmod /lib/modules/2.4.18-14/kernel/fs/binfmt_coff.o
....
....
Save you rc.local file.
Why we changed a number "3" with a number "6"? See the man pages of the syslog command ( man syslog ) and see the DESCRIPTION SECTION. You'll find the answer.
Support for linux-abi continues, but sporadically. You might not be able to find a patch for your kernel. That doesn't mean you're dead in the water. You might want to explore using a DOS emulator and run FoxPro 2.6 for DOS. The nice thing about a FoxPro 2.6 compiled FXP or APP file is that it should work on any OS platform. As long as you adjust the code for DOS, for example, you can take a FoxPro 2.6 for Unix FXP file and run it with FoxPro 2.6 for DOS. And, unlike Linux, you should be able to get your mouse cursor to work.
There are several DOS emulators for Linux. The following explains the package called dosemu:
If all you want to do is run FoxPro 2.6 for DOS in a X console window, you can download the dosemu and freedos binaries from the web site http://www.dosemu.org. dosemu is the DOS emulator and freedos is the actual DOS (dosemu has the ability to run a regular copy of MS-DOS, but freedos was designed to work with dosemu).
Download the following files:
- dosemu-freedos-<version>-bin.tgz
A tarball containing a collection of suitable FreeDos binaries, patched to fit DOSEMU needs.
- dosemu-<version>-bin.tgz
A tarball containing the recent DOSEMU binaries, together with a user local configuration setup.
Select a directory to install both packages (your $HOME directory for example). In that directory, execute:
tar -zxf dosemu-freedos-bin.tgz
tar -zxf dosemu-<version>-bin.tgz
A dosemu subdirectory will be created. To run dosemu from a X console, execute:
cd ./dosemu
./xdosemu
If you're just running the current terminal or console, execute:
cd ./dosemu
./dosemu
You will get prompted (once) that you have read the liability disclaimer and after you agree, dosemu will boot freedos and give you a command prompt.
Remember, that you can't use <Ctrl>-C _within_ DOS to exit _from_ DOS.
For this you need to execute 'exitemu' or, when using xdosemu,
<Ctrl><Alt><PgDn>.
As I said, the easiest way to get dosemu working on your machine is to use the ready-to-use dosemu binaries. If you're not using an X console, however, you might want to install the RPM versions. Go to the web site http://rpm.pbone.net and search for 'dosemu' and 'dosemu-freedos'. Select the latest dosemu and freedos RPM files for your particular version of Linux.
You'll also need to search for a rpm package called 'libsvga'. Installing this package resolves any 'missing mouse.c file' messages, giving you a mouse cursor at the regular console. Again, select the latest version for your particular version of Linux. Use an application like the KDE RPMdrake to revolve references and install all RPM packages. When installing you might get (MISSING KEY) messages, but it should work.
Once you install the RPM files, just type 'dosemu' from any directory on the console. From the regular console, you might get a message like '[liblow.c] /dev/gpmctl: no such file or directory', but dosemu should still work. If the mouse cursor still doesn't work, you need to adjust the dosemu configuration file.
To configure dosemu, find a copy of ./dosemu/conf/dosemurc or /etc/dosemu.conf. Copy it to your $HOME directory as .dosemurc. If [echo $HOME] is /root, for example, then [cp /etc/dosemu.conf /root/.dosemurc].
Mouse cursor
To adjust the mouse cursor, run [vi .dosemurc]. Perform a '/' search for 'mouse'. You should find the following commands:
# $_mouse_internal = (on)
# $_mouse = ""
# $_mouse_dev = ""
Delete the '#' comment marks. Use [Ins] and [Esc] to adjust these settings. On my system, I changed them to read:
$_mouse_internal = (on)
$_mouse = "ps2"
$_mouse_dev = "/dev/input/mice"
You're system might be a little different (read the comments or check the file /usr/share/doc/dosemu-1.2.1/README.TXT). Perform an [Esc], then save your work with [wq] at the vi ':' prompt. Run dosemu. If you're mouse cursor doesn't work, 'exitemu' and try different settings.
Printer
If the printer doesn't work, adjust the dosemu printer settings. Again, do a [vi .dosemurc]. Perform a '/' search for 'printer'. You should find the following commands:
# $_printer = ""
# $_printer_command = ""
Delete the '#' comment markers. Use the [Ins] and [Esc] to adjust these settings. $_printer is for the actual name of the printer (the one you used when you installed your Linux). $_printer_command is what you want to execute. On my system, I changed them to read:
$_printer = "printer"
$_printer_command = "lpr"
Again, you're system might be a little different (read the comments or check the file /usr/share/doc/dosemu-1.2.1/README.TXT). Perform an [Esc], then save your work with [wq] at the vi ': ' prompt. Run dosemu. Try to print something. If you're printer doesn't work, 'exitemu' and try different settings.
When you invoke dosemu, you should be at the freedos C prompt. You should be on drive C, drive D defined as your $HOME directory. freedos comes with a basic set of DOS commands, plus a few extras (run HELP). freedos also has a C:\CONFIG.SYS and a C:\AUTOEXEC.BAT.
To make room for FoxPro, I would EDIT CONFIG.SYS to make sure FILES=65. I would also EDIT AUTOEXEC.BAT, setting the right environment variables (I like to add c:\foxpro26 to my PATH). If you have Windows/DOS partitions on your machine, you can define them in the AUTOEXEC.BAT. For example, I've added the following commands to my AUTOEXEC.BAT:
lredir h: linux\fs\mnt\win_c
lredir i: linux\fs\mnt\win_c2
My Linux system already has windows FAT32 partitions mounted as /mnt/win_c and /mnt/win_c2, with read/write/execute privileges. The lredir commands simply define drives H and I as these mount points. If you want, you could use [lredir l: linux\fs] to define drive L as the entire Linux partition.
Now remember, you'll be running FoxPro 2.6 for DOS. In your code, _DOS will be true, _UNIX will be false.
SET PRINT TO LPT1 works, so don't add any _PRN = 'lpr' or _LPT1 = 'lpr' to your CONFIG.FP.
You're still running Linux, however, so your [Alt] key may not work. Or the [Alt] key may be switched with [F10] key. In my applications, set the environment variable SYSMENU = SHOW. That way, your system menu is always available.
Other keystrokes might not work. [Ctrl]-[Q] or [Ctrl]-[W], for example. Check the keystrokes. I believe dosemu is driven by terminfo files, so you might be able to change them (see the READ.ME files).
Oh, if someone can tell me the terminfo file used with the distributed dosemu binary for the X console, please let me know. That terminfo screen seems the closest to the real FoxPro 2.6 for DOS.
Conclusion
When it comes to configuring, I've just scratched the surface. If you installed RPM files, the directory usr/share/doc/dosemu-1.2.1 should be full of README text files. These documents will tell you how to set up dosemu to run with another version of DOS, how to configure dosemu and freedos for your input/output device, how to change terminfo files, etc. If you can't find these files, check the web site http://dosemu.sourceforge.net/docs/. The README files might be buried in the left-hand frame, but they should be there. Also check the web site http://sourceforge.net/projects/dosemu/. The sourceforge projects site has a message forum, in case you need help setting up dosemu.
A final note: When I last exited my KDE and tried to run dosemu from the regular console, my dosemu locked up. In the event of a lockup, hit the [Windows] key and start another session. Run the dosemu command dosdebug. You should see some diagnostic text. Type 'kill' and wait a minute. You should then be able to resume that other session.
Before you can run FoxPro for Unix on a non-SCO version of Unix, you must tell FoxPro where to find the terminfo database. On a Linux system, you must create a symlink. Execute the following command:
ln -s /usr/share/terminfo /usr/lib/terminfo
When FoxPro searches for the directory /usr/lib/terminfo, it will find the directory /usr/share/terminfo. You only need to execute this command once.
Note: Although your terminfo directory is located, your terminfo definition still needs to be defined and your terminfo file compiled (see "Manual Installation" and "Terminfo Files").
As I already learned, the first time you install FoxPro for Unix, your disks will get "branded". That is, permanently stamped with your name and organization. Tough, especially if you misspelled. To avoid branding, I suggest working with backup disks. There are a couple of methods to create backup disks. One way is to use dd:
dd if=/dev/fd0 of=/home/tmp1 bs=36b
... where /dev/fd0 is your floppy drive. Here we created a file called /home/tmp1 containing the image of disk one. To create a new disk one, simply reverse the destinations:
dd if=/home/tmp1 of=/dev/fd0 bs=36b
You can manually install the standard Microsoft FoxPro 2.6 for Unix (or associated runtime) diskettes on a Non-SCO Unix or Linux system. First, check for an uncompress command. If executing [uncompress] results in "command not found", you need to add it. The easiest way is to create a /usr/bin/uncompress file containing the following line:
gunzip $1
Note: Remember to set /usr/bin/uncompress to the correct file permission [chmod 755 /usr/bin/uncompress].
Assuming you already have either iBCS or linux-abi in your kernel and linked /usr/share/terminfo to /usr/lib/terminfo (see previous sections), execute the following commands:
mkdir /usr/lib/foxpro
cd /usr/lib/foxpro
tar xvf /dev/fd0 ./tmp/readme
tar xvf /dev/fd0 ./tmp/extract
./tmp/extract /dev/fd0
... where /dev/fd0 is your floppy drive. For the FoxPro runtime, extract the file rtreadme, not readme.
You may get a prompt to add entries to the terminfo database (see terminfo files). If these SCO terminfo definitions fail to get added, you can manually add them with the command:
tic /usr/lib/foxpro/terminfo.src
You may or may not get the startup script /usr/bin/foxpro. You should get the startup script /usr/bin/fox. The FoxPro runtime would give you the startup script /usr/bin/foxr. This startup script will need to be adjusted. Use the following script as a template:
PROGDIR=/usr/lib/foxpro
#
# This is the script which invokes the binary program 'foxpro.pr'.
#
umask 000
PATH=$PROGDIR:$PATH
export PATH
TZ=EST5EDT
export TZ
FOXTERM=at386a
export FOXTERM
exec $PROGDIR/foxpro.pr "$@"
Check to make sure PROGDIR on line 1 has no prefix characters. The manual installation might prefix PROGDIR with garbage characters.
For the FoxPro runtime startup script /usr/bin/foxr, use foxr.pr instead of foxpro.pr.
To the startup script, I added the umask command. The umask command specifies the default protection for newly created files. In our case, umask=000 will give new files full read, write, and execution permission (see file permission).
To the original script, I added the TZ variable. It sets the FoxPro date/time clock to Eastern Standard Time (your time zone may differ).
To the original script, I also added the FOXTERM variable (if not found, FoxPro uses the variable TERM). FOXTERM is set to at386a, a Linux compatible terminfo definition (see "Terminfo Files"). To use at386a, download a copy of at386a.src and execute:
tic at386a.src
This tic command will compile the definition at386a, adding it to your terminfo database. Now you should be ready to try out FoxPro.
As I said in the beginning, compiled FoxPro 2.6 for DOS *.APP and *.FXP files will run on a FoxPro 2.6 for Unix runtime. A copy of my FPU runtime is available on the freeware section of my web site, here. To manually extract this FPU runtime, called foxrun.tar, execute the command:
tar -xvpP -f foxrun.tar
This tar file will extract foxr.exe, foxr.pr and associated files into the directory /usr/lib/foxpro. The startup script file foxr should be extracted into the directory /usr/bin.
Terminfo note: The startup script foxr sets the environment variable FOXTERM to at386a, a Linux compatible terminfo definition. To use at386a, you need to execute the following command:
tic /usr/lib/foxpro/at386a.src
This tic command will compile the definition at386a, adding it to your terminfo database. Assuming you already have either iBCS or linux-abi in your kernel (see previous sections) and have linked /usr/share/terminfo to /usr/lib/terminfo (see "Locating Terminfo Database"), you should be ready. To test the FPU runtime, simply execute foxr.
I've only had one reported problem with my FPU runtime. Someone couldn't send standard output via =fopen('/dev/stdout',12).
Now my FoxPro runtimes are really stand-alone applications. Compiled one-line programs whose only purpose is to launch other FoxPro programs. In the case of the FPU runtime, foxr.exe is only needed for runtime distribution. The solution to the standard output problem is to bypass foxr.exe and call foxr.pr directly. In the /usr/bin/foxr script, simply change foxr.exe to foxr.pr.
Peter Elsner (peterservplex.com) successfully installed FoxPro 2.6 for Unix on FreeBSD. Peter sent me a FreeBSD compatible terminfo file (see terminfo files). He also sent me the following installation script, illustrating the steps necessary to install FPU on FreeBSD:
#!/bin/sh
# install.sh script for installing FoxPro 2.6a for SCO Unix on FreeBSD 4.0.
# Author: Peter Elsner <peterservplex.com>
# Date Created: 7/11/2000
# Date Last Modified: 7/12/2000
#
# The author would like to thank the following people for their contribution
# in making SCO's FoxPro 2.6a for Unix functional on FreeBSD 4.0-RELEASE.
#
# Bill W Smith Jr <billservplex.com>
# For his work in getting the fansi FOXTERM to work
# and getting colors.
#
# Dennis Allen <dennisdennisallen.com>
# For his info on FoxPro running on Linux. It was very helpful.
#
# Chorny S.I. <sergrelay.dtcom.dp.ua>
# For his copy of the terminfo.db files (in particular fansi).
# NOTE: From the fansi binary file, I was able to convert it
# back to fansi.src using the tconv command with the -b option.
#
# Hampton Finger <locnarlocnar.net>
# For his knowledge of FreeBSD.
#
# Place fansi.src, fpu26_FreeBSD.tar.gz, terminfo.tar.gz and this
# install.sh file in your /tmp directory. Then run ./install.sh AS ROOT!!!
#
# THE SCRIPT STARTS HERE
#
echo 'Creating FoxPro directory under /usr/lib'
if [ ! -f /usr/lib/foxpro/foxpro.pr ]
then
mkdir /usr/lib/foxpro
echo 'Done'
else
echo '/usr/lib/foxpro already exists...'
exit 1
fi
echo 'Copying FoxPro tar file to /usr/lib/foxpro'
cp /tmp/fpu26_FreeBSD.tar.gz /usr/lib/foxpro
echo 'Done'
echo 'Untarring FoxPro tar file'
cd /usr/lib/foxpro
tar xzf fpu26_FreeBSD.tar.gz
echo 'Done'
echo 'Creating dependencies'
# Check to see if these directories exist. Create if they don't.
if [ ! -d /usr/compat/ibcs2 ]
then
mkdir /usr/compat/ibcs2
fi
if [ ! -d /usr/compat/ibcs2/dev ]
then
mkdir /usr/compat/ibcs2/dev
fi
# Move the null (empty file) from /usr/lib/foxpro to /usr/compat/ibcs2/dev/
cd /usr/lib/foxpro
mv null /usr/compat/ibcs2/dev
# Assign links...
cd /usr/compat/ibcs2/dev
ln -fs /dev/null X0R
ln -fs socksys nfsd
ln -fs /dev/null socksys
echo 'Done'
# Check for the existance of a terminfo directory in /usr/lib.
if [ ! -d /usr/lib/terminfo ]
then
mkdir /usr/lib/terminfo
cp /tmp/terminfo.tar.gz /usr/lib/terminfo
cd /usr/lib/terminfo
tar xzf terminfo.tar.gz
fi
# Check for the existance of /usr/lib/terminfo/f directory.
if [ ! -d /usr/lib/terminfo/f ]
then
mkdir /usr/lib/terminfo/f
fi
echo 'Compiling fansi.src into terminfo.db'
mv /tmp/fansi.src /usr/lib/terminfo/f
if [ ! -f /usr/bin/tic ]
then
mv /usr/lib/foxpro/tic /usr/bin
fi
cd /usr/lib/terminfo/f
tic fansi.src
# Now check to see if ibcs2 modules are already loaded in the kernel.
cd /usr/compat/ibcs2/dev
kldstat > kldstat.txt
grep 'ibcs2.ko' kldstat.txt > ibcs2.txt
if [ -s "ibcs2.txt" ]
then
echo 'ibcs2 already installed!'
else
kldload ibcs2.ko
kldload ibcs2_coff.ko
echo 'You must edit /etc/rc.conf and add IBCS2_ENABLE="YES"'
echo 'Then reboot your FreeBSD server.'
fi
rm kldstat.txt
rm ibcs2.txt
echo 'Done'
if [ ! -d /usr/local/bin ]
then
mkdir /usr/local/bin
fi
mv /usr/lib/foxpro/stfox /usr/local/bin
cp /usr/lib/foxpro/foxpro /usr/local/bin
cd /usr/lib/foxpro
echo 'FoxPro 2.6a has been successfully installed on your FreeBSD system'
echo 'To run FoxPro, type stfox at the prompt'
exit 0
If you need to investigate FPU on FreeBSD 4.0, talk to Peter Elsner (peterservplex.com) or check out the FreeBSD forum.
As I understand it, RedHat 8.0 has new system fonts. These new fonts are not compatible with older applications, like [make menuconfig] and FoxPro. You need to edit /etc/sysconfig/i18n. First save off a copy, then edit i18n:
cp /etc/sysconfig/i18n /etc/sysconfig/orig-i18n
vi /etc/sysconfig/i18n
Delete all text, then enter [insert] mode and add the following lines:
LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_US"
Press [Esc] to exit the insert mode, then type ":wq" to save your
changes. Changes won't take effect until you reboot.
Alejandro Fernández (foxlinuxalejandrofernandez.com.ar) successfully installed FoxPro 2.6 for Unix on slackware 7.x/8.x. He also sent me a slackware 7.x/8.x compatible terminfo file (see terminfo files).
To make his system compatible with both FoxPro and sco foxbase+, he changed the character set from 850 to 437. To do that, he added the following to his startup script:
# ....
# ....
# 437
if [ $TERM = linux ]
then
echo -e -n '\033(K'
fi
exec $PROGDIR/foxpro.pr +pc -i -t "$@"
Gustavo Olarte <tavolarteyahoo.com> could not get a Terminfo to work in Spanish, but found a
solution. You can initialize FoxPro program with +pc parameters
Ej: foxpro.pr +pc
In the terminal emulator windows or Linux use codepage 437
FoxPro redefine automatic margins and fonts and I can write Spanish
characters now like Ñ ñ á é etc ......
I use putty terminal emulator for windows and Linux too.
Here is how Ed Reed (Aesec) Ed.Reedaesec.com installed Linux-abi on Susie:
Disable REGPARM option ("Use register arguments (EXPERIMENTAL)") near the bottom of the Processor Type and Features option page in "make config" or "make xconfig" or whatever you're using. That option is not compatible with Linux-ABI. Then remake your kernel.
SuSE ships with that option turned on by default, so "make cloneconfig" leaves it turned on.
That's the most likely issue if you've not changed other non-ABI related options.
My ritual:
Start with a clean kernel source: make mrproper
Apply the patch, ignoring white space: patch -p1 -l
<wherever-the-patch-file-is>
Watch for any failed messages. Look at any *.rej files created for failed patches and see where in the original file the patch would have been applied - usually when arch/i386/kernel/traps.c fails because the patch doesn't know about some SuSE added code immediately following the lines it's trying to match - but that's why you used "-l" on the patch command, to have it ignore those issues.
Clone the running configuration: make cloneconfig
Set the Linux-ABI configuration options: make xconfig
* turn off REGPARM (as above)
* turn on Linux-ABI options on "Executable file formats" page
- Enable "Extended Linux-ABI support..."
- enable module for ALL the binary options, including x.out, and the related
x.out segmented binary support (don't think I need them now, but may in near
future)
- enable Late probing of personality...
- enable Include prints for syscall tracking (because I've used that in the past for debugging)
* OPTIONAL: change the kernel version identifier - on the General Setup
page, "Local version - append to kernel release: -whatever" - this will make it so the patched kernel you make will be installed separately from the default kernel, so you can choose which one you want to boot. Usually, I just append -abi to the end of whatever is there, so "-default" becomes "-default-abi" or "-smp" becomes "-smp-abi".
make the kernel: make
Watch for compilation errors and resolve them.
make install the modules: make modules_install
This has to be done so the modules will be in place when the initrd is run in the next step
make install the kernel: make install
reboot
Test your app.
.
Note: SuSE kernels frequently include features that aren't yet part of the mainstream kernels, so you may find a feature in SuSE's 2.6.15 kernels that don't show up in the mainline kernel until 2.6.16, for instance. If you can't resolve problems with patches (say, if patch can't find where to apply a patch) or compilation (missing member names from a structure definition that used to work, for instance), the best advice for you is to post a note to the Help forum at <https://sourceforge.net/forum/forum.php?forum_id=41354> that includes the version of the kernel you're trying to use (uname -r), the distribution it's from (Red Hat, SuSE, Debian, whatever) and the name of the patch file you're trying to apply. Hopefully, someone else will post a patch file for the specific version of the kernel you're using.
Note, too, that SuSE kernel version numbering includes an indication of the patch level they've provided. For instance, SuSE 10 comes with kernel version 2.6.13-15, but after you apply updates they provide (via YAST Online Update or Red Carpet / ZEN, the kernel may be numbered 2.6.13-15.8. Usually, update patches don't affect the Linux-ABI patch and you can use the baseline patch file (the one for SuSE 10 is linux-abi-2.6.13-suse.diff.r2) will work for the -15.7, -15.8, etc.
updates, too.
Frank Quirk (quirkfswbell.net) successfully installed FoxPro 2.6 for Unix on United Linux. According to Frank:
'I brought up my AccountiX on United Linux. This is SCO Linux 4.0. I can bring the package up on F1 - F6 using the at386b emulation. The package can be brought up the X windows without a FOXTERM. I would guess that the X windows are running in ansi the same as the console on SCO Unix. You can bring up multiple windows on the windows. I would guess that you could have multiple sessions with multiple windows open. In United Linux the file to put the insmods is boot.local rather than rc.local. This also runs without the SCO Libraries so there is no problem with the SCO claims. Oh, you do not have to have the en_US entries. And I will look into the mouse cursor as this should work.'
John Contento (contentjix.netcom.com) successfully installed FoxPro 2.6 for Unix on wyse60 terminals. He also sent me the following notes:
You need to set the tabs on otherwise the input will look a little weird, the cursor will jump around some. You need to set the init tabs=on under the setup screen in f2 in order for it to save the tab information (otherwise when you power off the terminal it resets the tabs to blank and you have to reset them again).
Also here's a wiring diagram to get dtr (hardware flow control) to make linux reset the terminal to a login prompt. Resets the terminal without having to reboot the server. This works on a rocketport from control but should work with any db-25 serial connection. I know this wiring isn't standard but I've got it running on around 30 terminals total with no problems. Hope this is helpful to someone. John
wyse60 host
2 3 \
3 2 / send & receive
7 7 signal ground
20 5 hardware flow control
4 8 resets terminal to login w/power cycle
From the manual installation section, the startup script initialized the environment variable FOXTERM to at386a. at386a is a Linux compatible terminfo definition. This definition is stored in the terminfo source file at386a.src. To use at386a, download a copy of at386a.src and execute:
tic at386a.src
This tic command compiled the at386a terminfo definition found in the source file, adding it to your terminfo database. The following is a list of customized terminfo source files:
at386.src, a Linux console terminfo file created by John Sandell
at386a.src, a Linux console terminfo file created by John Sandell, modified by Dennis Allen
at386b.src, a Linux console terminfo file by Dennis Allen (at386a.src without tic -c errors)
fansi.src, a FreeBSD terminfo file by Peter Elsner
kde1fox.zip, KDE1/KDE2 terminfo files by Jon
lin.src, a slackware 7.x/8.x Linux console terminfo file by Alejandro Fernández
Note: To help you customize, I created terminfo.prg, a simple FoxPro program that will compare two terminfo source files.
For other variants of Unix, you may need to try other terminfo files. The terminfo database itself contains a vast set of definitions from which to choose. SCO FoxPro for Unix also comes with the following set of SCO terminfo definitions, found in the source file called terminfo.src:
wy60fox, wy60-25fox, wy60fox-pc, wy50fox, wy325fox, wyse325fox
wy325wfox, wy325-25fox, ansifox, ansicfox
To add these definitions to your terminfo database, execute the command:
tic /usr/lib/foxpro/terminfo.src
To try out a new terminfo definition, simply change FOXTERM. For example, to use the definition called ansifox, execute:
FOXTERM=ansifox ; export FOXTERM
Oh, if you are using C shell, you'll need to use the setenv command instead of the export command. Otherwise, you're ready to run FoxPro and test your new terminfo definition.
Note: If you plan to change FOXTERM on the fly, remember to remove any FOXTERM line from your FoxPro startup script. Oh, I did hear of a guy who couldn't get FOXTERM to change. Using the FoxPro command ?GETENV('FOXTERM'), he finally figured out he had several layers of FOXTERM commands buried in his scripts.
If your terminfo definition is just slightly off, it may be the system fonts. As I understand it, RedHat 8.0 has new system fonts. These new fonts are not compatible with older applications, like [make menuconfig] and FoxPro. You need to edit /etc/sysconfig/i18n:
cp /etc/sysconfig/i18n /etc/sysconfig/orig-i18n
vi /etc/sysconfig/i18n
Delete all text, then enter [insert] mode and add the following lines:
LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_US"
Press [Esc] to exit the insert mode, then type ":wq" to save your
changes. Changes won't take effect until you reboot. Who knows? You might find
that editing /etc/sysconfig/i18n is easier than changing terminfo definitions.
Once you find a terminfo definition that works reasonably well on your system, you will probably want to adjust it. After all, no terminfo definition is perfect.
Suppose, for example, you wanted to try adjust the terminfo definition xterm for your X Windows system. Make a copy of the source code by executing the command:
infocmp -l /usr/lib/terminfo/x/xterm > xtermfox.src
Edit this terminfo source file. The first thing you need to change is line 2. Change 'xterm' to 'xtermfox'. That way, you can compile the definition xtermfox, not overwrite the original definition xterm. Next, change the line count from 24 to 25. FoxPro needs 25 lines. Now compile xtermfox with the command:
tic xtermfox.src
Once you set FOXTERM to xtermfox, you will be ready to test the new terminfo definition.
For any given terminal, FoxPro will look for input escape sequences. The following lists the basic key definitions:
kf0 Function key 10
kf1 - kf10 Function Keys 1..10
kf13 - kf22 Shift Function Keys 1..10
kf25 - kf34 Ctrl Function Keys 1..10
kf37 - kf46 Shift-Ctrl Function Keys 1..10
kcub1 Left Arrow
kcud1 Down Arrow
kcuf1 Right Arrow
kcuu1 Up Arrow
khome Home
kend End
knp Page Down
kpp Page Up
kich1 Insert
kdch1 Delete
kbs Backspace
kcbt BackTab
kcan Escape
khlp Help Key (F1)
kcpy Copy Key for Edit-Copy accelerator, (^C)
knxt Key Next: move right one word, Ctrl-rightarow
kprv Key Previous: move left one word, Ctrl-leftarrow
kfnd Key Find: Edit-Find accelerator (^F)
krpl Key Replace: Replace and find again accelerator
krdo Key Redo: Edit-Redo accelerator (^R)
kund Key Undo: Edit-Undo accelerator (^Z)
krfr Key Refresh: Re-paint the screen, (^])
kcmd Key Command: Special Key lead-in, (^Y)
kCMD Key Shift Command: Shift Toggle, (^P)
kLFT Key Shift Left Arrow: Selects one char to left
kRIT Key Shift Right Arrow: Selects one char to right
kHOM Key Shift Home: Selects to beginning of line
kEND Key Shift End: Selects to end of line
kNXT Key Shift Next: (Shift-Ctrl-rightarrow)
kPRV Key Shift Previous: (Shift-Ctrl-leftarrow)
One way to find out what keystroke your terminal produces is by executing the following:
stty -echo ; cat -v ; stty echo
This command echos most keystrokes back to the console. Use [Ctrl]-[D] to exit. If you run across another way to determine keystrokes, please let me know.
My advice is to use the old error and trial method. Say, for example, that the backspace key doesn't work in xtermfox. But backspace does work in at386a. Well, a look in at386a.src shows kbs=\177. Simply find kbs in xtermfox.src, change it to \177, then compile with the tic command.
Terminfo files wanted: If you do fix an existing terminfo definition, or can create a new working terminfo (for whatever terminal or Unix variant), send me a copy. I'd be more than happy to post it on my web site. Make it available to everyone.
Here's a foxterm solution from Michael Weisbrot:
In my user director it seems I have no FOXTERM set but FoxPro works great.
The root has problems. Can’t type the letter s for example. I included mapchan –n in the .profile and
now it works.
You can put some terminals, for example, the Wyse 60, into PC scancode mode, which means that a numeric code is sent to the computer each time a key is pressed down, and each time a key is let up. If your UNIX system is running on SCO UNIX System V 3.4 or higher, scancode mode is supported.
When a terminal is in scancode mode, FoxPro is able to detect any sequence it could detect coming from the PC console. It can tell the difference between all Ctrl key combinations and special keys. With the terminal in PC scancode mode, a terminal user can use the same keystroke or combination of keystrokes as a console user.
If the terminfo entry for your terminal has the sequences for entering and exiting scancode mode (smsc and rmsc), FoxPro will put it into scancode mode automatically when you start the program. For information on terminal types that support scancode mode, consult your terminal documentation.
If your serial terminal cannot be set to go into scancode mode, you can overcome its keyboard restrictions with the system of keystroke equivalents in FoxPro. For each unreliable keystroke, FoxPro provides a key sequence that will work on any serial terminal. The system works, in general, as follows:
To simulate pressing the Shift key by itself (as used in text selection, for example), type Ctrl+P. To FoxPro, this action is equivalent to holding down the Shift key on the console.
To simulate releasing the Shift key, either type another Ctrl+P or type any other sequence to complete the action on the selected text (such as the sequences for Cut or Copy).
To simulate a lead-in to all other unreliable key sequences, type Ctrl+Y. In general, you will type Ctrl+Y, release both keys, and type another single character. For example, Ctrl+Y followed by the number 3 simulates F3.
On Unix, [Esc] is the escape character. When you press [Esc], Unix presumes that something is going to follow. If nothing follows, after a time, then [Esc] will register with FoxPro.
All keystrokes used commonly in FoxPro are summarized in the table that follows. There are three columns: Action, a description of the action that FoxPro takes; Console, the key sequence that produces that action on the console (and on serial terminals that are capable of emitting the sequence); and Terminal, the alternate key sequence that can be used on any ASCII terminal.
Browse Window
Action Console Terminal
====== ======== ========
Change active partition Ctrl+H Ctrl+Y, H
Append a blank record Ctrl+N Ctrl+N
Toggle record delete Ctrl+T Ctrl+T
Dialogs
Action Console Terminal
====== ======== ========
Select default text button Ctrl+Enter Ctrl+W or Ctrl+J
Expression Builder
Action Console Terminal
====== ======== ========
Choose database popup Ctrl+B Ctrl+B
Display date functions Ctrl+D Ctrl+D
Verify expression Ctrl+E Ctrl+E
Choose fields list Ctrl+F Ctrl+F
Display logical functions Ctrl+L Ctrl+L
Display math functions Ctrl+M Ctrl+Y, M
Choose variables list Ctrl+R Ctrl+R
Display string functions Ctrl+S Ctrl+S
Filer
Action Console Terminal
====== ======== ========
Tag all files or dirs Ctrl+A Ctrl+A
Copy tagged files or dirs Ctrl+C Ctrl+C
Delete tagged files or dirs Ctrl+D Ctrl+D
Edit tagged files Ctrl+E Ctrl+E
Find text in tagged files Ctrl+F Ctrl+F
Change current directory Ctrl+H Ctrl+H
Make a subdirectory Ctrl+K Ctrl+K
Display file tree panel Ctrl+L Ctrl+L
Untag all files or dirs Ctrl+N Ctrl+N
Move tagged files or dirs Ctrl+O Ctrl+O
Rename tagged files or dirs Ctrl+R Ctrl+R
Change tagged files' attrs Ctrl+T Ctrl+T
Invert file or dir's tags Ctrl+V Ctrl+V
Tag multiple files Shift+Spacebar Ctrl+P, Spacebar
Interface
Action Console Terminal
====== ======== ========
ESC (abort current action) Ctrl+Q Ctrl+Q
Exit and save Ctrl+W Ctrl+W
Exit without saving Esc Esc
HELP F1 Ctrl+Y, 1
SET F2 Ctrl+Y, 2
LIST F3 Ctrl+Y, 3
DIR F4 Ctrl+Y, 4
DISP STRU F5 Ctrl+Y, 5
DISP STAT F6 Ctrl+Y, 6
DIP MEM F7 Ctrl+Y, 7
DISP F8 Ctrl+Y, 8
APPEND F9 Ctrl+Y, 9
ALT; activate/de-active sys F10 Ctrl+Y, 0
Activate/de-activate sys Alt Ctrl+Y, 0
Keyboard Macros
Action Console Terminal
====== ======== ========
Clear all current macros Ctrl+A Ctrl+A
Clear selected macros Ctrl+C Ctrl+C
Make macro set the default Ctrl+D Ctrl+D
Edit existing macro Ctrl+E Ctrl+E
Record a macro Ctrl+M Ctrl+Y, M
Create new macro Ctrl+N Ctrl+N
Restore a set of macros Ctrl+R Ctrl+R
Save current macros Ctrl+S Ctrl+S
Shortcut to create macros Shift+F10 Ctrl+P,Ctrl+Y, 0
Label Designer
Action Console Terminal
====== ======== ========
Create an expression Ctrl+E Ctrl+E
Preview the labels Ctrl+I Ctrl+Y, I
Specify label size Ctrl+L Ctrl+L
Save label environment Ctrl+N Ctrl+N
Specify style for label Ctrl+Y Ctrl+Y
Menu Builder
Action Console Terminal
====== ======== ========
Delete an item Ctrl+E Ctrl+E
Insert a menu item Ctrl+I Ctrl+Y, I
Program Execution
Action Console Terminal
====== ======== ========
Execute a program Ctrl+D Ctrl+D
Resume program execution Ctrl+M Ctrl+Y, M
Project Manager
Action Console Terminal
====== ======== ========
Add file to project Ctrl+A Ctrl+A
Build the project Ctrl+B Ctrl+B
Exclude a project file Ctrl+C Ctrl+C
Edit a project Ctrl+E Ctrl+E
Display info for project Ctrl+I Ctrl+Y, I
Display project info Ctrl+J Ctrl+J
Display Build Option dialog Ctrl+O Ctrl+O
Show project errors Ctrl+S Ctrl+S
Remove file from project Ctrl+V Ctrl+V
Record Search
Action Console Terminal
====== ======== ========
Continue finding a record Ctrl+K Ctrl+K
Report Writer
Action Console Terminal
====== ======== ========
Create a box Ctrl+B Ctrl+B
Add a field Ctrl+F Ctrl+F
Bring object to front Ctrl+G Ctrl+G
Preview report Ctrl+I Ctrl+Y, I
Move object to back Ctrl+J Ctrl+J
Add a line Ctrl+N Ctrl+N
Remove a line Ctrl+O Ctrl+O
Add text Ctrl+T Ctrl+T
Resize object Ctrl+Spacebar Ctrl+Y, Spacebar
Select multiple objects Shift+Spacebar Ctrl+P, Spacebar
RQBE
Action Console Terminal
====== ======== ========
Execute the query Ctrl+Q Ctrl+Q
Show SELECT command Ctrl+S Ctrl+S
Screen Builder
Action Console Terminal
====== ======== ========
Create a box Ctrl+B Ctrl+B
Add a field Ctrl+F Ctrl+F
Bring object to front Ctrl+G Ctrl+G
Create push buttons Ctrl+H Ctrl+H
Create invisible buttons Ctrl+I Ctrl+Y, I
Move object to back Ctrl+J Ctrl+J
Create a check box Ctrl+K Ctrl+K
Create a list Ctrl+L Ctrl+L
Create radio buttons Ctrl+N Ctrl+N
Create a popup Ctrl+O Ctrl+O
Open all snippets Ctrl+S Ctrl+S
Add text Ctrl+T Ctrl+T
Resize object Ctrl+Spacebar Ctrl+Y, Spacebar
Text Editing
Action Console Terminal
====== ======== ========
Select all text Ctrl+A Ctrl+A
Copy selected text Ctrl+C Ctrl+C
Replace and find again Ctrl+E Ctrl+E
Display Find dialog Ctrl+F Ctrl+F
Find again Ctrl+G Ctrl+G
Redo text editing Ctrl+R Ctrl+R
Undo text editing Ctrl+U Ctrl+U
Paste copied text Ctrl+V Ctrl+V
Cut selected text Ctrl+X Ctrl+X
Move right Right arrow Right arrow
Move left Left arrow Left arrow
Move up one line Up arrow Up arrow
Move down one line Down arrow Down arrow
Move up one window Pg up Ctrl+Y, R
Move down one window Pg Dn Ctrl+Y, C
Move to start line Home Ctrl+Y, S
Move to end line End Ctrl+Y, D
Move one word right Ctrl+Right arrow Ctrl+Y, F
Move one word left Ctrl+Left arrow Ctrl+Y, A
Move to start file Ctrl+Home Ctrl+Y, B
Move to end of file Ctrl+End Ctrl+Y, E
Selects one character left Shift+Left arrow Ctrl+P, Lft arrw
Selects one character right Shift+Right arrow Ctrl+P, Rgt arrw
Selects one line up Shift+Up arrow Ctrl+P, Up arrow
Selects one line down Shift+Down arrow Ctrl+P, Dn arrow
Selects to start of word Shift+Ctrl+lft arw Ctrl+P, Ctrl+Y,F
Selects to end of word Shift+Ctrl+rgt arw Ctrl+P, Ctrl+Y,A
Selects to start of file Shift+Ctrl+Home Ctrl+P, Ctrl+Y,E
Selects to end of file Shift+Ctrl+End Ctrl+P, Ctrl+Y,B
Trace Window
Action Console Terminal
====== ======== ========
Clear program breakpoints Ctrl+B Ctrl+B
Open a program Ctrl+E Ctrl+E
Toggle line numbers on/off Ctrl+L Ctrl+L
Specify program speed Ctrl+R Ctrl+R
Window Manipulation
Action Console Terminal
====== ======== ========
Cycle between open windows Ctrl+F1 Ctrl+Y, O
Bring Command window up Ctrl+F2 Ctrl+Y, N
Move current window Ctrl+F7 Ctrl+Y, V
Size current window Ctrl+F8 Ctrl+Y, W
Zoom window to minimum Ctrl+F9 Ctrl+Y, L
Zoom window to maximum Ctrl+F10 Ctrl+Y, U
Hide all windows Ctrl+Alt+Shift Ctrl+Y, X
A while back, I installed RedHat-Mandrake 7.0 Linux. This installation automatically mounted my Windows 98 C: drive as a vfat table. When I tried to test a FoxPro application on this drive, however, I would get an invalid path error. I figured out why.
My Windows 98 C: drive was mounted as /mnt/DOS_hda1. In FoxPro, this directory is seen as C:\MNT\DOS_HDA1. When converted to a Unix path, however, it becomes /mnt/dos_hda1. Of course /mnt/dos_hda1 doesn't exist. My application would try to use this non-existent path and produce an error. The solution was to unmount /mnt/DOS_hda1 and to remount as /mnt/win_c (see next section).
From this example we can conclude that FoxPro simply cannot reference any Unix directory containing an uppercase character. In fact, FoxPro cannot reference any Unix file with a name containing an uppercase character. Files and directories from a Windows 98 mounted drive are not a problem, however, since uppercase characters are automatically converted to lowercase.
If you are unzipping a pkzip file, use [unzip -L filename] to unzip filenames into lowercase.
If you have a directory with uppercase or mixed upper/lowercased character file names, use the following command to convert all file names to lowercase:
for f in * ; do mv $f $( echo $f | tr A-Z a-z ) ; done
As I said, my RH-MDK 7.0 didn't mount my Windows drive correctly. RH 8.0 didn't mount my Windows 98 C: drive at all. If you don't have a fsconf utility, then you'll have to edit your /etc/fstab file. Perform a [vi /etc/fstab]. Enter the [Insert] mode and add the line:
/dev/hda1 /mnt/win_c vfat rw,suid,umask=000,noexec 0 0
Press [Esc] to exit the insert mode, then type ":wq" to save your change. Remember to [mkdir /mnt/win_c] before you reboot.
In UNIX, all files and directories have a set of permissions that determine who can read, edit, and (in the case of program files) execute them. Read, write and execute privileges are extended to three types of users: the owner of the file, the owner's group, and all other users on the system.
To install a FoxPro application, a system administrator should create a separate group. All users, needing to run the FoxPro application, would belong to that group. The application's directory, and all database files within it, must be given read/write permission to the group. FoxPro, and associated startup script, must also be given read/execute permission to the group.
Note: If you have trouble modifying a database file for which you have the proper permissions, keep in mind that you need write permission to not only the database file itself, but also its associated files, such as index or memo files.
Say I wanted to install the application dMAIL4. As the user root, I'd first create a group called mail. I'd define all the users, wishing to run dmail4, to belong to group mail.
I would make sure that FoxPro itself, and it's startup script, had read/execute permission by the group mail. I'd also check to make sure the FoxPro startup script had the command umask=000. After all, any file created by one user has to be available to all users in the group (see FoxPro startup script).
I'd then use the following steps to install the dmail4 application:
mkdir /home/dmail4
chgrp mail /home/dmail4
chmod u+rw,g+srw,o+rw /home/dmail4
cp /mnt/win98/dmail4/*.prg /home/dmail4
cp /mnt/win98/dmail4/*.fxp /home/dmail4
cp /mnt/win98/dmail4/scr.* /home/dmail4
cp /mnt/win98/dmail4/*.man /home/dmail4
cd /home/dmail4
chmod g+r-wx *
Let me explain these steps. First, I created the directory /home/dmail4. Then I made the directory available to the group mail.
The chmod command gives everyone in the group mail the ability to read/write in our directory. In case you were wondering, the g+s in the chmod command does have a purpose. Whenever anyone creates a file in /home/dmail4, that file's group will be defined by our directory itself, regardless of the user's primary group.
The next set of commands simply copies our application files into our directory. The final chmod command will mark these program files as read-only. To prevent a user from accidentally changing or recompiling code.
Before proceeding, I'd like to talk about that last chmod command. While it does protect your program files somewhat from tampering, it cannot prevent users from deleting them. Which may or may not be a problem. After all, it's just as easy to delete a database file as it is to delete a program file.
If you're really serious about protecting your program files, however, you could use the following command:
chmod +t /home/dmail4
This command turns on the sticky bit to our directory. For any file in our directory, only the owner has permission to delete it.
The drawback to this command is that ALL files in our directory would work with way, database files included. So if user xyz was the first to run dmail4, creating the initial database files, then only user xyz could delete them. Not good. I believe the only way to use the stick bit is to store the database files in a separate directory. In my applications, it would be a simple matter to set the environment variable DATA=/home/dmail4/data.
In my applications, certain functions (reindexing, packing, initializing, etc.) must be done in single-user mode. To switch to single-user mode, everyone has to exit the application.
If you are working with programs and files on the Linux box, the system administrator can find out who hasn't exited the program with the command:
ps aux | grep fox
If the system administrator has to, he can kill the user process or processes. With everyone out of the system, he can then reindex, pack, or whatever.
A note from John G. Sandell (jsandellatt.net): The only problem I have encountered when the system administrator kills a user FoxPro process is a left-over file lock, and only then if the user was in one of the set exclusive on modules. This happens once a year or less. The file then can't be re-opened. The solution is to rename both the *.dbf and the *.cdx files to a new name using the UNIX mv command, then do a UNIX cp back to the original names. Takes a minute. Easier than trying to find the lock file.
A command line switch consists of a hyphen, followed by an upper- or lower-case letter, optionally followed by any additional information that may be needed (such as file or path name). No embedded spaces are allowed. These switches are passed directly to the FoxPro shell script that starts FoxPro and override any environment variables that may configure the same FoxPro operation (for example, you can override the FOXPROCFG environment variable with -c).
The table that follows lists the startup switches and their effects.
Startup Switches
Switch Effect
------ ------
-c/<pathname>/<file> Specify configuration file
-e Disable the mouse
-i Treat input device as serial terminal
-o Treat output device as serial terminal.
-t Suppress FoxPro sign-on screen
Specify Configuration File
You can specify the name of the configuration file to be used with the -c startup switch. If you do not include the <file>, FoxPro looks for an existing CONFIG.FPU.
This is equivalent to setting the environment variable FOXPROCFG. However, if the environment variable exists, this switch overrides the variable's effect.
Disable the Mouse
The -e switch prevents the use of a mouse in FoxPro. Use this switch if you want to use the console as a text-based serial terminal without a mouse.
Note: The FoxPro readme file mentions that -e also disables SCO event queue management. To be used in non SCO systems.
Treat Input Device as Serial Terminal
When you use -i, FoxPro treats the input device as a serial terminal. This disables the PC keyboard scan codes, even if they are supported by the system console or terminal. This switch can be useful in debugging and allows FoxPro to run on operating systems that cannot process keyboard scan codes.
Treat Output Device as Serial Terminal
When the -o command line switch is included, FoxPro treats the output device as a serial terminal and uses terminfo for screen information. When -o is included, FoxPro does not write directly to video memory, even on the system console.
Suppress Sign-On Screen
You can prevent the display of the sign-on screen by including the optional -t switch.
This switch has no equivalent CONFIG.FPU statement.
Here are a couple of CONFIG.FPU commands you may need to add to your Unix/Linux system:
_PRN = "lpr"
SET PRINT TO PRN uses the spooler defined in public variable _PRN. The default is "lp -s". Linux needs _PRN to equal "lpr -s" or "lpr -Pprinter -h". That goes for _LPT1 and _LPT2 as well.
To see if you have lp or lpr, either use the command "lpstat -t" or the command "lpc status" (not sure which).
VOLUME C = /home/temp
If you created /home/temp/dmail4, this volume command will result in FULLPATH('') = "C:\DMAIL4".
Warning: If you do use VOLUME C, remember that ALL FoxPro files must reside under drive C. For example, if you define RESOURCE = /foxrun/foxuser.dbf, FoxPro will think foxuser.dbf resides in c:\foxrun. Which translates into /home/temp/foxrun.
Installing a SCO product, like FoxPro, on a non-SCO operating system is not always easy. The following is a list of error messages you might encounter, with hints on how to deal with them.
Error: Character Fonts
As I understand it, RedHat 8.0 has new system fonts. These new fonts are not compatible with older applications, like [make menuconfig] and FoxPro. You need to edit /etc/sysconfig/i18n. First save off a copy, then edit i18n:
cp /etc/sysconfig/i18n /etc/sysconfig/orig-i18n
vi /etc/sysconfig/i18n
Delete all text, then enter [insert] mode and add the following lines:
LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_US"
Press [Esc] to exit the insert mode, then type ":wq" to save your
changes. Changes won't take effect until you reboot.
Error: Cannot create program work space: file access denied
Efrain Castro P. tried to run the foxr as a regular user and got this error. His solution:
$foxr -t 2> myprogram.fxp
Error: Cannot execute MODIFY COMM
I suspect you got access privilege problems with the network/drive mounts. Remember, FoxBase/FoxPro needs read/write/execute privileges to all the directories (database, working and temporary) as well as the files within them. Check all your FoxBase/FoxPro environment variables, PROGWORK, EDITWORK, SORTWORK, TEMP, TMPFILES, TMPWORK, etc. for their locations. Perhaps FoxBase/FoxPro can't find a specified directory and is just defaulting to a temporary directory with little access (see "File Permissions").
Error: File Directory problem. See Error: INODE NUMBER > 65535.
Error: FoxPro.pr: cannot execute binary file: Exec format error
To run SCO binaries on Linux, you need to install additional modules. If you have a kernel versions 2.2 and before, you need to install the iBCS module. For kernel version 2.4, you need to install the linux-abi kernel patch. For other kernel versions, you might have to run a DOS emulator and use FoxPro 2.6 for DOS. To determine your kernel version, execute [uname -a] (see "Using SCO binaries on Linux").
Error: FoxPro.pr: cannot execute: Permission denied
Your file, foxpro.pr, does not have file execute permission. Try a chmod a+rx foxpro.pr (see "File Permissions").
Error: INODE NUMBER > 65,535
Problem: When it starts, the FoxPro application might think it is in a different directory. Or the application will destroy opened files in a random way: data for one file is written into another, wrong files got deleted from time to time, etc.
The problem has to do with drives > 30Gig. Since FoxPro is a SCO binary, it uses the inode-number of open files to keep track of which files are already open. But it only sees the last 16 bit of the 32bit inode number. From time to time it opens a file with an inode-number that has the same 16-bit-value as another open file.
The easiest solution is to move your application to a directory with an INODE NUMBER < 65,535 (ls –i). Also make sure any directory referenced by FoxPro also has a low INODE number. There is a patch, but it's only in the alpha stage. To read further on this problem, see the thread on sourceforge.net linux-abi project.
Error: libc: setlocal: LC_TYPE: unable to open /etc/default/lang
libc: setlocal: LC_TYPE: unable to open /etc/default/lang
libc: setlocal: LC_NUMERIC: unable to open /etc/default/lang
libc: setlocal: LC_TIME: unable to open /etc/default/lang
libc: setlocal: LC_COLLATE: unable to open /etc/default/lang
libc: setlocal: LC_MESSAGES: unable to open /etc/default/lang
libc: setlocal: LC_MONETARY: unable to open /etc/default/lang
You see these messages the first time you launch FoxPro. Annoying, but not
fatal. You can, however, reduce the number of messages. Use "vi" to
create /etc/default/lang. Add the following lines:
LANG="en_US"
LC_ALL="en_US"
LINGUAS="en_US"
Press [Esc] to exit the insert mode, then type ":wq" to save your change.
Nacho Lamas nachopilicarrera.com was able to completely remove these messages, at least under RedHat 9.0, by adding the line
LANG=en_US.8859 (or LANG=en_US.850) to /etc/default/lang (please
note the lack of brackets). The proposed 'english_us.ascii', as well as C,C_C,etc., made my copy of FoxPro complain.
Error: linux-abi-2.4.18
The linux-abi patch in linux-abi-2.4.18.0.patch.gz seems to have a svr4 compiler bug. Looking into it. Strangely enough, the linux-abi 2.4.18 patch found in RedHat 8.0 seems fine.
Error: Not enough memory to allocate name table
You have a pre-2.4.15 kernel linux-abi patch (see "Installing linux-abi").
Error: SCO tape ioctl func=0 arg=0
When launching FoxPro with either iBCS or linux-abi, you might see the message "SCO tape ioctl func=0 arg=0". Prefixed by either "iBCS:" or "abi:". This message either gets displayed or logged in the file /var/log/messages. This problem can also occur when your terminal goes unused for some period of time and somebody wants remote access to FoxPro.
The solution is to remove the offending message and recompile the associated module. For iBCS users, see "Fixing iBCS: SCO tape error". For linux-abi users, see "Fixing abi: SCO tape error".
Error: Segmentation Fault
I've been told that a segmentation fault is like a kill process that hasn't completed yet. Something like a Windows General Protection Fault.
If you're using iBCS, the problem is probably a module that didn't get recompiled correctly. I would first try using your original iBCS module (see "Installing iBCS module"). Next, I'd try to upgrade to the latest iBCS2 code (see "Fixing iBCS module"). Finally, I would upgrade to a 2.4 kernel and use linux-abi (see "Installing linux-abi").
If you're using the linux-abi patch, the kernel and linux-abi patch must the same version. I had one user install FoxPro on RedHat 8.0, which already had linux-abi. He added insmod calls to his bootup script. For some reason he then decided to recompile the kernel. When he recompiled, he made new linux-abi modules. The insmod calls in his bootup script, however, were still pointing at the original modules. If you recompile your kernel, edit any insmod commands to point to the new linux-abi modules. The command [ls /lib/modules/2.4.18-14/kernel/abi/util/abi-util.* -l], for example, shows both the old and new versions of the module [abi-util].
SuSE Note: As I understand it, Linux-ABI is NOT compatible with the REGPARM option, which is the default configuration on several Linux 2.6 distributions (including SuSE). You would get seg faults from running your app if REGPARM is turned on.
Error: System lockup, Caldera Linux
One person reported this problem. He solved it be editing /etc/initab, changing ID:5 to ID:3 (boot to the command prompt).
Error: terminfo file not found
First, you need to define where your terminfo database is located (see "Locating Terminfo database"). Next, you need to compile your Linux compatible terminfo source file (see "Terminfo Files"). Finally, your startup script needs to define FOXTERM for an existing terminfo definition (see "Manual installation").
Error: too many files open
Luis Alberto Reyna of Argentina sent me a tip. If you get 'too many files open', edit the file /proc/sys/fs/file-max (might be /proc/sys/kernel/file-max in RH 5.1). Increase the file count. If the count is 4800, increase it to 6000. No need to reboot, the solution should be immediate.
Error: Wyse 60 terminal, extra tabs.
John Contento had a problem with his Wyse 60 terminal. At the command window, every 5th character typed would have an extra space in it. During program execution, the cursor wouldn't line up correctly from field to field.
John solved the problem. The wy60fox terminfo file that comes with FoxPro worked just fine. He needed a change in the Wyse 60 setup screens. After you enter the terminal setup you need to hit f6 (it's labeled tabs) and then hit backspace to default the tabs.
People always ask me where to purchase a copy of FoxPro. You might try either
ebay.com or amazon.com.
Keep checking the ebay stores. Copies float on and off that site all the time. Also try one of the
following:
EMS Professional Software
Retro Tools CC Systems, a Florida consulting firm: (727) 596-1460. FoxPro for Unix.
If all else fails, you can ask for a copy of FPU on the Microsoft
FoxPro forum or the google newsgroup microsoft.public.fox.programmer.exchange.
In the event you can't find a development copy for your operating system, don't despair. A FoxPro 2.6 for DOS/Windows compiled FXP or APP file will work just fine in FoxPro 2.6 for DOS, FoxPro 2.6 for Windows, FoxPro 2.6 for Macintosh, or FoxPro 2.6 for Unix. All you need is a runtime. An example of a runtime can be found in the freeware section of this web site.
I hope you have found this tip sheet useful. If you have a tip to add, drop me an email (
For additional information, you could check other web sites such as Universal Thread or Visual FoxPro Wikis. You could also try the Microsoft FoxPro forum or the google newsgroup microsoft.public.fox.programmer.exchange.
If you need to investigate FPU on Linux, contact Frank Quirk (quirkfswbell.net). Frank converted SBT Vision Point accounting software, called AccountiX to run on Linux.
If you need to investigate FPU on FreeBSD, talk to Peter Elsner (peterservplex.com) or check out the FreeBSD forum.
If you need help running other SCO binaries on Linux, check out the linux-abi project, the Malcolm Gambles web site, or the AP Lawrence web site.
For help investigating DOS emulators, check out the documentation on dosemu.
[Return to Top]
[Go to Home Page]
Copyright © 2013 Dennis Allen.
This web page was last updated 09/04/18