# iBCS2 in FreeBSD 8 not working?



## danbi (Nov 28, 2010)

Upgraded an FreeBSD 6.4 server that was running CDS/ISIS to discover it is not working with 8-stable. It does not work with 8.0-release also.

`#  kldload ibcs2`
`#  kldload ibcs2_coff`
`$  ./isis`

```
Segmentation fault
```

The core file is empty..

Is there workaround?


----------



## DutchDaemon (Nov 29, 2010)

How did you upgrade? AFAIK you can't skip straight from 6.4 to 8.0 without going via 7.x first. Unless you wipe the system and start afresh with 8.x of course.


----------



## danbi (Nov 29, 2010)

I did skip from 6.4 to 8-stable in fact (almost 8.2) by booting from another current system, mounting the old boot drive to /mnt and overwriting it's content with

`# make installworld DESTDIR=/mnt`
`# make installkernel DESTDIR=/mnt`
`# mergemaster -D /mnt`

Then after booting in the new system, complete rebuild of 8-stable.

Have done this many, many times before and it would not break anything (in the base system). How would iBCS2 be different?

Another system I tried, 8.0-release was installed from scratch -- same result there as well.


----------



## DutchDaemon (Nov 29, 2010)

No idea, just tested on:


```
FreeBSD 8.1-STABLE FreeBSD 8.1-STABLE #0 r215039: Tue Nov  9 19:22:18 CET 2010     toor@:/usr/obj/usr/src/sys/KERNEL  i386
```

and both modules kldload'ed fine.


```
7    2 0xcc8f9000 b000     ibcs2.ko
 8    1 0xcc866000 3000     ibcs2_coff.ko
```

So where does *./isis* come from? Is it compiled against FreeBSD 8, or would you need COMPAT_6 to keep running it?


----------



## danbi (Nov 29, 2010)

The Unix version of CDS/ISIS comes from http://www.unesco.org/isis/files/winisis/unix/cds-isis.tar.

The executable is compiled for some System V platform, forgot which it was. The GENERIC kernel already has the COMPAT_FREEBSD6 option. That executable is from 1993.. very unlikely to know anything about FreeBSD libraries and such.


----------



## DutchDaemon (Nov 30, 2010)

Maybe you can try a truss(1) on the executable to see what it tries to call (and where it fails)? Unless the isis executable is totally dependent on its own local set of libraries it's bound to call _something_ in the environment that makes it choke.


----------



## fronclynne (Nov 30, 2010)

It is supposed to be SCO compatible (as with ibcs2.ko _et al_), though running file on the executables contained within gives: 
	
	



```
> file ./*
./doscopy:  MS Windows COFF Intel 80386 object file
./isis:     MS Windows COFF Intel 80386 object file
```
So I dunno what to say.


----------



## danbi (Nov 30, 2010)

On the system in question (8-stable) it gives

```
doscopy: 80386 COFF executable not stripped
isis:    80386 COFF executable not stripped
```
On an 8.0-release system it is


```
doscopy: MS Windows COFF Intel 80386 object file
isis:    MS Windows COFF Intel 80386 object file
```
On the 6.4 system, where it works, it is


```
doscopy: 80386 COFF executable not stripped
isis:    80386 COFF executable not stripped
```


----------



## danbi (Nov 30, 2010)

Trying with truss:

On 8-stable


```
$ kldstat
Id Refs Address    Size     Name
 1   31 0xc0400000 bd8a7c   kernel
 2    1 0xc0fd9000 c108     ahci.ko
 3    1 0xc5b3c000 8000     linprocfs.ko
 4    1 0xc5b44000 26000    linux.ko
 5    2 0xc5cd8000 b000     ibcs2.ko
 6    1 0xc5ce7000 3000     ibcs2_coff.ko
 7    1 0xcb6c5000 68000    radeon.ko
 8    1 0xcb628000 14000    drm.ko
$ truss ./isis
truss: execution type IBCS2 COFF is not supported -- using FreeBSD a.out: Unknown error: 0
SIGNAL 11 (SIGSEGV)
process exit, rval = 0
```

On 8.0-release


```
$ kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 b6e060   kernel
 3    2 0xcde40000 b000     ibcs2.ko
 4    1 0xcc718000 3000     ibcs2_coff.ko
$ truss ./isis
truss: execution type IBCS2 COFF is not supported -- using FreeBSD a.out: Unknown error: 0
SIGNAL 11 (SIGSEGV)
process exit, rval = 0
```

On an 6-stable (6.4) system, where it works:


```
$ kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 8b3ea0   kernel
 2    1 0xc0cb4000 64934    acpi.ko
 3    2 0xc8de1000 a000     ibcs2.ko
 4    1 0xc676a000 3000     ibcs2_coff.ko
$ truss ./isis
truss: execution type IBCS2 COFF is not supported -- using FreeBSD a.out: Unknown error: 0
truss: execution type IBCS2 COFF is not supported -- using FreeBSD a.out: Invalid argument
old.sigprocmask(0x4,0x5059e)                     = 0 (0x0)
old.sigprocmask(0x7,0x5059e)                     = 0 (0x0)
old.sigprocmask(0xb,0x5059e)                     = 0 (0x0)
old.sigprocmask(0xa,0x5059e)                     = 0 (0x0)
old.sigprocmask(0x8,0x5068e)                     = 0 (0x0)
old.sigprocmask(0x3,0x50616)                     = 0 (0x0)
old.sigprocmask(0x2,0x5065a)                     = 0 (0x0)
old.getkerninfo(0x3,0x0)                         = -1 (0xffffffff)
break(0x40ddcc)                                  = 0 (0x0)
sendmsg(0x0,0xbfbfe728)                          = 0 (0x0)
sendmsg(0x0,0xbfbfe6ec)                          = 0 (0x0)
sendmsg(0x1,0xbfbfe728)                          = 0 (0x0)
sendmsg(0x1,0xbfbfe6ec)                          = 0 (0x0)
fork()                                           = 40132 (0x9cc4)
old.sigprocmask(0x2,0x1)                         = 329306 (0x5065a)
old.sigprocmask(0x3,0x1)                         = 329238 (0x50616)
wait4(0xbfbfe4a4,0x2d,0xbfbfe509)                = 40132 (0x9cc4)
old.sigprocmask(0x2,0x5065a)                     = 1 (0x1)
old.sigprocmask(0x3,0x50616)                     = 1 (0x1)
open("SYSPAR.PAR",O_RDWR,0666)                   ERR#2 'No such file or directory'
open("SYSPAR.PAR",O_RDONLY,0666)                 ERR#2 'No such file or directory'
open("ISISUC.TAB",O_RDWR,0666)                   ERR#2 'No such file or directory'
open("ISISUC.TAB",O_RDONLY,0666)                 ERR#2 'No such file or directory'

write(2,"\n",1)                                  = 1 (0x1)
pascal: Can not open file
write(2,"pascal: Can not open file\n",26)        = 26 (0x1a)
        file: ISISUC.TAB
write(2,"        file: ISISUC.TAB\n",25)         = 25 (0x19)

write(1,"\^[=\^[[3v\^[[0q\n",11)                 = 11 (0xb)
Error occurred at 0002CF64 line 301 in procedure sysinit
write(1,"Error occurred at 0002CF64 line "...,57) = 57 (0x39)
Last called from 00000659 line 195 in program isismain
write(1,"Last called from 00000659 line 1"...,55) = 55 (0x37)
Last called from 000000ED
write(1,"Last called from 000000ED\n",26)        = 26 (0x1a)
exit(0x1)                                       
process exit, rval = 256
```

The later gave errors, because the environment isn't there (but works otherwise), although the OS still claims this executable format is not supported...


----------



## michaelrmgreen (Dec 16, 2010)

Hello danbi - I've got a SCO binary that segfaults in 8.1 like yourself. Have you made any progress?


```
parkrow4# uname -a
FreeBSD parkrow4.blank.blank 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:55:53 UTC 2010     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

parkrow4# kldstat
Id Refs Address    Size     Name
 1    8 0xc0400000 bb5504   kernel
 2    2 0xc0fb6000 cc94     ibcs2.ko
 3    1 0xc0fc3000 3028     ibcs2_coff.ko

parkrow4# file foxpro.pr
foxpro.pr: 80386 COFF executable

parkrow4# truss ./foxpro.pr
truss: execution type IBCS2 COFF is not supported -- using FreeBSD a.out: Unknown error: 0
SIGNAL 11 (SIGSEGV)
process exit, rval = 0
```


----------



## wblock@ (Dec 16, 2010)

Can't say I understand all the issues, but ore/isis from the tar archive runs, well, tries to run here:


```
% pwd
/tmp/isis/ore
% ls
doscopy	isis
% file doscopy
doscopy: MS Windows COFF Intel 80386 object file
% file isis
isis: MS Windows COFF Intel 80386 object file
% ./isis
(obviously-wrong garbled output removed, it's a term setting or character set problem, along with lots of "not founds")
./isis: 137: Syntax error: ")" unexpected
% truss ./isis
__sysctl(0xbfbfe3e4,0x2,0xbfbfe3ec,0xbfbfe3f0,0x0,0x0) = 0 (0x0)
mmap(0x0,320,PROT_READ|PROT_WRITE,MAP_ANON,-1,0x0) = 868868096 (0x33c9e000)
munmap(0x33c9e000,320)                           = 0 (0x0)
__sysctl(0xbfbfe448,0x2,0x33c94f1c,0xbfbfe450,0x0,0x0) = 0 (0x0)
mmap(0x0,32768,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,-1,0x0) = 868868096 (0x33c9e000)
issetugid(0x33c8d047,0xbfbfe90c,0x104,0x0,0x0,0x0) = 0 (0x0)
open("/etc/libmap.conf",O_RDONLY,0666)           ERR#2 'No such file or directory'
...
% uname -a
FreeBSD lightning 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Wed Dec 15 12:35:57 MST 2010     root@lightning:/usr/obj/usr/src/sys/LIGHTNING  i386
```

Possibly important: ibcs modules included in kernel (via "include GENERIC"), not kldloaded.  Note also i386, not 64-bit.


----------



## danbi (Dec 17, 2010)

You must load both ibcs2 and ibcs2_coff for this to work. Unfortunately, all my (few) i386 systems are not yet upgraded past the initial report. There is no support for these binaries in amd64 FreeBSD.


----------



## Pmaster (Jun 25, 2012)

*Foxpro 2.6 for SCO no longer works*

So up until FreeBSD 7.4 I have had no problems with installing SCO's version of Foxpro 2.6 on FreeBSD.  But starting with version 8, it no longer works. I get a segmentation fault each time I try to run it.  

Hoping it was temporary and that it would be fixed with 9.0, I waited. Last night I tried 9.0 and unfortunately, it still doesn't work.

I have a 20+ year old Foxpro application that I have sold to hundreds of customers nationwide and re-writing it is not really an option. I really need to get this working again in FreeBSD, or will have to resort to sticking with 7.4.

If anyone can help, I would really appreciate it.

Thanks,
Peter


----------



## tingo (Jun 27, 2012)

Hmm, wasn't there something on the mailing list about sysv / SCO Openserver emulation and bit rot? Like last year, or the year before?


----------



## wblock@ (Jun 27, 2012)

Yes, I remember that too.  Probably within the last year, but seems like less.


----------



## michaelrmgreen (Jun 27, 2012)

@Pmaster. I have the same problem. I have decided to try Harbour as an alternative to FoxPro. My experiments so far have been reasonably successful and haven't entailed a rewrite.

[Edit] I've just looked at this: http://www.freebsd.org/cgi/ports.cgi?query=harbour&stype=all
and I notice the version has just bumped. I was using 2.0. Give it a whirl.


----------



## Pmaster (Oct 25, 2013)

*Thanks to a member in hackers@*

Thanks to a member of the FreeBSD-Hackers mailing list, SCO's FoxPro for Unix is now working on FreeBSD 9.1 and 9.2.


----------



## ske (Apr 2, 2016)

I think you are referring to the following solution on the mailing list:

https://lists.freebsd.org/pipermail/freebsd-hackers/2013-October/043615.html

I'm adding it here to make it easier to find. It would have made it easier for me, when I was looking.

The solution was to run `sysctl security.bsd.map_at_zero=1` or add
security.bsd.map_at_zero=1 to /etc/sysctl.conf.

There also seems to be a problem report matching his:
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=153243


----------



## Houdhey (Jul 4, 2019)

Hello,

I'm trying to install the perl script in order to make my icbs files running :


			https://www.at-vantage.com/foxfiles/foxp_install.txt
		


On my computer running FreeBSD12.0 but I meet a problem when I run it, it shows "Module IBCS2 not loaded" or something like that.
When I check the files, only ibcs2_coff  file is created, not  ibcs2.ko 

How to fix this please?


----------



## SirDice (Jul 4, 2019)

As far as I know the IBCS2 support has been removed.


----------



## Houdhey (Jul 4, 2019)

Thanks for your answer. I will try an emulator then.


----------



## Houdhey (Jul 5, 2019)

Hello,

I'm trying to install the linux abi 2.4.18.0 patch, but it takes a long time in the Terminal. 
I've put the patch file in the same directory as Foxpro.
I've used this line in foxpro folder  (  /usr/local/lib/foxpro/ ) : 
*patch -p0 linux-abi-2.4.18.0.patch*

But it doesn't answer and stays winking without applying the patch.

Do you know how to install it?


----------



## SirDice (Jul 5, 2019)

Houdhey said:


> But it doesn't answer and stays winking without applying the patch.


You're not using the patch(1) command correctly.


----------



## Houdhey (Jul 5, 2019)

Thanks for your quick answer.

I'm sorry I'm new in the world of FreeBSD/Unix/Linux 

Do you know how I should write my patch line?  
I've also tried to write  patch without nothing, but still the same problem.


----------

