I have written a kernel driver for a particular piece of hardware (a
pc104 board that I am connecting to the TS7800) that we are using. The
driver code has been compiled with the GNU EABI compiler as this was
the compiler that was used to build the stock 2.6.21-ts kernel which
I'm using on my 7800. The driver works great and when tested with a
static user-land binary compiled with the EABI compiler, I can
exercise all the exposed functions to my hardware (via `ioctl').
Now, I need to write a user-land application that uses this driver but
also needs to link to shared object files (.so libraries). My
understanding (verified through empirical testing) is that the EABI
compiler can only create static binaries, so I am using the OABI
compiler to build my user-land application. The problem I am
experiencing is that when I call into my driver from the user land
code that is compiled with the OABI compiler my driver is returning an
error to the ioctl system call because the passed in command argument
is invalid, only for ioctl's that take an argument. The arguments to
the ioctl calls for my driver are pointers to structures that get
filled in by the driver code. Part of the encoding of an ioctl command
takes into account the size of this buffer (you can verify this by
looking at linux/ioctl.h which ultimately points you to asm/ioctl.h).
Assuming my structure that I am passing by pointer to ioctl is called
`foo', it turns out that calling sizeof(foo) for the EABI compiler
returns 11 bytes (which is correct) but for the OABI compiler
sizeof(foo) returns 12 bytes.
This `sizeof' discrepancy completely explains why my driver will not
accept the ioctl calls from the OABI compiled user-land code. But now
I am stuck. Does anyone have any advice on what I can do here? My
kernel driver needs to be built with the EABI compiler as that is how
the kernel was built. My user-land code needs to link to shared object
files which forces me into using the OABI compiler. But the OABI and
EABI compilers are inconsistent/incompatible with respect to (at
least) the `sizeof' on my struct. Is there a version of the EABI
compiler that can create dynamically linked binaries? As this would be
my preferred choice because I have a little more flexibility in user-
land than I do in the kernel and for this production application I
would rather stick with the stock/supported TS kernel on the 7800. Any
thoughts?
Thanks in advance,
Tom.
PS- Ronald, I am copying you as Grant, one of your tech support
engineers, mentioned that you would be best to help me with this but
that you were not available by phone today. Any help you can provide
via email is greatly appreciated.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|