SVR4 missing syscall

2000-11-20 Thread Walter C. Pelissero

I'm trying to run a SCO SVR4 executable on FreeBSD but I get a SIGSYS
(invalid system call) at the very beginning.  Here is the kdump:

 39525 ktrace   RET   ktrace 0
 39525 ktrace   CALL  sigprocmask(0x1,0x28061000,0x28061010)
 39525 ktrace   RET   sigprocmask 0
 39525 ktrace   CALL  sigprocmask(0x3,0x28061010,0)
 39525 ktrace   RET   sigprocmask 0
 39525 ktrace   CALL  sigprocmask(0x1,0x28061000,0x28061010)
 39525 ktrace   RET   sigprocmask 0
 39525 ktrace   CALL  sigprocmask(0x3,0x28061010,0)
 39525 ktrace   RET   sigprocmask 0
 39525 ktrace   CALL  sigprocmask(0x1,0x28061000,0x28061010)
 39525 ktrace   RET   sigprocmask 0
 39525 ktrace   CALL  sigprocmask(0x3,0x28061010,0)
 39525 ktrace   RET   sigprocmask 0
 39525 ktrace   CALL  execve(0xbfbff9a3,0xbfbff880,0xbfbff88c)
 39525 ktrace   NAMI  "./scobin"
 39525 ktrace   NAMI  "/compat/svr4/usr/lib/libc.so.1"
 39525 scobin   RET   execve 0
 39525 scobin   CALL  getuid
 39525 scobin   RET   getuid 1001/0x3e9
 39525 scobin   CALL  getuid
 39525 scobin   RET   getuid 1001/0x3e9
 39525 scobin   CALL  getgid
 39525 scobin   RET   getgid 0
 39525 scobin   CALL  getgid
 39525 scobin   RET   getgid 0
 39525 scobin   CALL  setlogin(0x72,0x805056c)
 39525 scobin   RET   setlogin 0
 39525 scobin   CALL  setlogin(0x28,0x280a9764)
 39525 scobin   RET   setlogin 0
 39525 scobin   CALL  break(0x8051580)
 39525 scobin   RET   break 0
 39525 scobin   CALL  setlogin(0x68,0x8049830)
 39525 scobin   RET   setlogin 0
 39525 scobin   CALL  getpid
 39525 scobin   RET   getpid 39525/0x9a65
 39525 scobin   CALL  old.lstat
 39525 scobin   PSIG  SIGSYS SIG_DFL
 39525 scobin   NAMI  "scobin.core"

Which call is it about?  I see an "old.lstat" but I couldn't find any
reference in the kernel source tree.  Is there any doc I could read to
see if I can hack this syscall in the emulator?

Thanks,

-- 
walter pelissero
http://www.pelissero.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: SVR4 missing syscall

2000-11-21 Thread Walter C. Pelissero

Mark Newton writes:
 > On Mon, Nov 20, 2000 at 05:05:39PM +, Walter C. Pelissero wrote:
 > 
 >  > I'm trying to run a SCO SVR4 executable on FreeBSD but I get a SIGSYS
 >  > (invalid system call) at the very beginning.  Here is the kdump:
 >  > Which call is it about?  I see an "old.lstat" but I couldn't find any
 >  > reference in the kernel source tree.  Is there any doc I could read to
 >  > see if I can hack this syscall in the emulator?
 > 
 > It's syscall 40, which is from XENIX.  Yay, Microsoft UNIX :-)
 > 
 > Do you know what the system call is supposed to actually do?

No idea, sorry.

 > With that info I can update the emulation to include it.

I wish I could do it for you.  If only someone could give me the right
hints on how to hack the IBCS2.

-- 
walter pelissero
http://www.pelissero.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: SVR4 missing syscall

2000-11-21 Thread Walter C. Pelissero

Dan Nelson writes:
 > In the last episode (Nov 20), Walter C. Pelissero said:
 > > I'm trying to run a SCO SVR4 executable on FreeBSD but I get a SIGSYS
 > > (invalid system call) at the very beginning.  Here is the kdump:
 > > 
 > > Which call is it about?  I see an "old.lstat" but I couldn't find any
 > > reference in the kernel source tree.  Is there any doc I could read
 > > to see if I can hack this syscall in the emulator?
 > 
 > old.lstat is syscall #40, which is the ibcs2_xenix syscall on SCO.

May I ask you where you got this information from?  I was grep-ing
around in the kernel source tree but I couldn't figure out that this
old.lstat is syscall #40, let alone that it was a Xenix syscall.

Is there any doc that can help me hacking this syscall into the ibcs2
emulator?

 > You can add hooks from the svr4 emulation code back to the ibcs2
 > code, but the svr4 module was really written for Solaris x86
 > instead of SCO. You'll have to make a lot of changes to get SCO
 > binaries to run under it.  I tried to get an SCO SVR4 binary to
 > work about 6 months ago but gave up and simply got the vendor to
 > send me a Linux binary instead. Runs fine under the Linuxulator :)

Are you telling me that the IBCS emulator is not really working?
Unfortunately I can't ask for a Linux version.
Have you ever had a look at the NetBSD one?  Is it usable?

Thanks for your help.

-- 
walter pelissero
http://www.pelissero.org


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: SVR4 missing syscall

2000-11-21 Thread Dan Nelson

Followups to -emulation, please

In the last episode (Nov 21), Walter C. Pelissero said:
> Dan Nelson writes:
> > In the last episode (Nov 20), Walter C. Pelissero said:
> > > I'm trying to run a SCO SVR4 executable on FreeBSD but I get a
> > > SIGSYS (invalid system call) at the very beginning.  Here is the
> > > kdump:
> > > 
> > > Which call is it about?  I see an "old.lstat" but I couldn't find
> > > any reference in the kernel source tree.  Is there any doc I
> > > could read to see if I can hack this syscall in the emulator?
> > 
> > old.lstat is syscall #40, which is the ibcs2_xenix syscall on SCO.
> 
> May I ask you where you got this information from?  I was grep-ing
> around in the kernel source tree but I couldn't figure out that this
> old.lstat is syscall #40, let alone that it was a Xenix syscall.

Take a look at /sys/kern/syscalls.master.  Any syscall with the word
"old" in it has been phased out and gets a COMPAT flag.  So you would
look for a "COMPAT ... lstat" line, which happens to be #40.
 
> Is there any doc that can help me hacking this syscall into the ibcs2
> emulator?
> 
> > You can add hooks from the svr4 emulation code back to the ibcs2
> > code, but the svr4 module was really written for Solaris x86
> > instead of SCO. You'll have to make a lot of changes to get SCO
> > binaries to run under it.  I tried to get an SCO SVR4 binary to
> > work about 6 months ago but gave up and simply got the vendor to
> > send me a Linux binary instead. Runs fine under the Linuxulator :)
> 
> Are you telling me that the IBCS emulator is not really working?
> Unfortunately I can't ask for a Linux version. Have you ever had a
> look at the NetBSD one?  Is it usable?

If you have access to NetBSD binaries, get them.  FreeBSD should be
able to run static NetBSD, OpenBSD, and BSD/OS binaries natively; no
emulation layer required.

The iBCS2 emulator works great; I've run all sorts of SCO 3.2v4.2
binaries on FreeBSD with it.  Your problem is that SCO 5.* doesn't use
iBCS2 anymore; it uses svr4 binaries.  Even more of a problem is that
SCO binaries rely heavily on old SCO syscalls.  You end up having to
link in the whole iBCS2 module, AND recode a bunch of syscalls that are
different between Solaris and SCO (since our svr4 emulator was written
for Solaris).  And you have to do all of this in the dark because SCO
doesn't release any information about their kernel.  I couldn't even
find a list of syscalls and their arguments.  I had to grep through
include files and try and reverse-engineer everything.

If you want more background, take a look at the thread starting at

http://www.freebsd.org/cgi/getmsg.cgi?fetch=28280+0+/usr/local/www/db/text/1999/freebsd-emulation/19990509.freebsd-emulation

I have patches for a June 30 -current that implement enough SCO stuff
to make /bin/sh work (but /bin/ls dies), if you're interested.

-- 
Dan Nelson
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: SVR4 missing syscall

2000-11-23 Thread Sergey Babkin

"Walter C. Pelissero" wrote:
> 
> I'm trying to run a SCO SVR4 executable on FreeBSD but I get a SIGSYS
> (invalid system call) at the very beginning.  Here is the kdump:
> 
>  39525 ktrace   RET   ktrace 0
>  39525 ktrace   CALL  sigprocmask(0x1,0x28061000,0x28061010)
>  39525 ktrace   RET   sigprocmask 0
>  39525 ktrace   CALL  sigprocmask(0x3,0x28061010,0)
>  39525 ktrace   RET   sigprocmask 0
>  39525 ktrace   CALL  sigprocmask(0x1,0x28061000,0x28061010)
>  39525 ktrace   RET   sigprocmask 0
>  39525 ktrace   CALL  sigprocmask(0x3,0x28061010,0)
>  39525 ktrace   RET   sigprocmask 0
>  39525 ktrace   CALL  sigprocmask(0x1,0x28061000,0x28061010)
>  39525 ktrace   RET   sigprocmask 0
>  39525 ktrace   CALL  sigprocmask(0x3,0x28061010,0)
>  39525 ktrace   RET   sigprocmask 0
>  39525 ktrace   CALL  execve(0xbfbff9a3,0xbfbff880,0xbfbff88c)
>  39525 ktrace   NAMI  "./scobin"
>  39525 ktrace   NAMI  "/compat/svr4/usr/lib/libc.so.1"
>  39525 scobin   RET   execve 0
>  39525 scobin   CALL  getuid
>  39525 scobin   RET   getuid 1001/0x3e9
>  39525 scobin   CALL  getuid
>  39525 scobin   RET   getuid 1001/0x3e9
>  39525 scobin   CALL  getgid
>  39525 scobin   RET   getgid 0
>  39525 scobin   CALL  getgid
>  39525 scobin   RET   getgid 0
>  39525 scobin   CALL  setlogin(0x72,0x805056c)
>  39525 scobin   RET   setlogin 0
>  39525 scobin   CALL  setlogin(0x28,0x280a9764)
>  39525 scobin   RET   setlogin 0
>  39525 scobin   CALL  break(0x8051580)
>  39525 scobin   RET   break 0
>  39525 scobin   CALL  setlogin(0x68,0x8049830)
>  39525 scobin   RET   setlogin 0
>  39525 scobin   CALL  getpid
>  39525 scobin   RET   getpid 39525/0x9a65
>  39525 scobin   CALL  old.lstat
>  39525 scobin   PSIG  SIGSYS SIG_DFL
>  39525 scobin   NAMI  "scobin.core"
> 
> Which call is it about?  I see an "old.lstat" but I couldn't find any

I believe old.ldstat is the name of BSD syscall with the same number.
The other syscall names are also not SVR4 but BSD, kdump has the
same problem with Linux binaries too.

-SB


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message