Hello.
Solaris 64 bit should support anything from 32 bit applications that can be done from within Solaris 32.
SIGSYS means that a system call is not supported. This may have two reasons:
- The system call number you used is wrong. Example: syscall(123456)
- Your implementation of syscall() uses SYS_SYSCALL as system call and Solaris 8 does not support it (I do not believe this) instead of doing the system call directly. In this case you may try to implement the syscall() function in assembler.
Note: syscall(SYS_SYSCALL,x,y,...) is identical to syscall(x,y,...) but may be unsupported by some Solaris versions.
Martin
Hello again.
You may use the debugger (mdb) to open the core file generated by the SIGSYS trap:mdb core
Then you type::regs
to list the register values at the time of the trap (in hexadecimal form).
For Sparc machines (it is more complicated on x86 machines) g1 holds the system call number, o0 holds the first argument, o1 the second one ... o5 the 6th one. (For system calls with more than 6 arguments the 7th, 8th... argument are stored on the stack.)
If g1 is 0 you know that the system call is done indirectly using SYS_syscall so the arguments are shifted (see above) and o0 holds the system call number.
You can exit mdb using::quit
Martin
Sorry, I am deceive You.
I forgot to say that I use syscall() in 32 bit application in order to call custom kernel module, which is a 64 bit module (was compiled with -xarch=v9 option).
When I recompile one of my 32-bit applications as 64 bit, it works properly.
But I can't recompile all of needed applications (Not all of source code is available).
May be a favorable decision is in creation 32 bit module (compiled with -xarch=v9 or without -xarch )?
But when I am traying to load it, I receive massage:
can't load module: No such file or directory
Your loadable module (not your application) must be written in a way to support both 32 and 64 bit applications in this case. Looking at OpenSolaris's file "uts/common/syscall/pipe.c" I think the following code should work:
static struct modlsys modlsys = {
&mod_syscallops, "My system call", &my_system_call
};
#ifdef KERNEL_IS_64_BITS
static struct modlsys modlsys32 = {
&mod_syscallops32, "My system call (app is 32 bits)", &my_system_call
};
#endif
static struct modlinkage modlinkage = {
MODREV_1,
&modlsys,
#ifdef KERNEL_IS_64_BITS
&modlsys32,
#endif
NULL
};
Martin
... but when I add to my kernel module necessary code:
#ifdef _SYSCALL32_IMPL
static struct modlsys modlsys32 =
{
&mod_syscallops32,
"modify_bits 32-bit",/* module name */
&mysysent
};
#endif
I see that they are not compiled, because symbol _SYSCALL32_IMPL is not defined.
How to compile this code properly (with_SYSCALL32_IMPL definition)?