can't get the Linux aaccli to work under 4.8-RELEASE, 4.9-RC1, 5.1-RELEASE

rysanek at fccps.cz rysanek at fccps.cz
Thu Oct 2 08:04:46 PDT 2003


> I'm not able to make the Linux aaccli work under any recent FreeBSD.

heck, seems like I got it, you need _both_

  options AAC_COMPAT_LINUX

   _and_

  options COMPAT_LINUX

because the linking of aac_linux.o (or whatever it's called) into the
kernel binary is dependent on COMPAT_LINUX - see /usr/src/sys/conf/files.
I guess removing the compat_linux tag from /usr/src/sys/conf/files would
work too.

As a side effect (really the main effect) of COMPAT_LINUX, the linux ABI
apparently becomes statically linked to the kernel, as opposed to modular,
which is the default with the stock install.


I had to find out the hard way. Being a newbie, I use instrumentation
wherever I should really use the kernel debugger. This time, I put several
watches at interesting points in the code - to see where the aac driver
thinks the ioctl handler entry point is and to see if the Linux ABI init
routine finds it in its input chain of ioctl handlers.


compat/linux/linux_ioctl.c:
===========================
linux_ioctl_register_handler()
{
        ...
        printf("FRR: registering linux ioctl handler at 0x%x\n",
               (unsigned int) h->func);
        ...
}


dev/aac/aac_linux.c:
====================
/* removed the 'static' keyword */
/*static struct linux_ioctl_handler aac_linux_handler =
{aac_linux_ioctl,*/
struct linux_ioctl_handler aac_linux_handler = {aac_linux_ioctl,
...


dev/aac/aac_pci.c:
==================
#include <machine/../linux/linux.h>
extern struct linux_ioctl_handler aac_linux_handler;

aac_pci_attach()
{
        ...
        printf("FRR: the aac linux ioctl handler is at 0x%x\n",
                (unsigned int) aac_linux_handler.func);
        ...
}


Now the linker yelled upon linking - it complained about
"unknown symbol aac_linux_handler".
That's where it started to dawn on me that I should fumble
in the Makefiles and config data.

I got it working a few minutes later.
At least, it works in 4.8. I have yet to test it in different
FreeBSD versions. I have to leave that for tomorrow.

Frank Rysanek



More information about the freebsd-questions mailing list