From owner-freebsd-questions@FreeBSD.ORG Thu Oct 2 08:04:46 2003 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18A3416A4B3 for ; Thu, 2 Oct 2003 08:04:46 -0700 (PDT) Received: from usti.fccps.cz (usti.fccps.cz [194.108.74.250]) by mx1.FreeBSD.org (Postfix) with ESMTP id A4B8443FEA for ; Thu, 2 Oct 2003 08:04:44 -0700 (PDT) (envelope-from rysanek@fccps.cz) Received: from usti.fccps.cz (usti.fccps.cz [127.0.0.1]) by usti.fccps.cz (8.12.8/8.12.8) with ESMTP id h92F4e6s004566; Thu, 2 Oct 2003 17:04:40 +0200 From: rysanek@fccps.cz Received: from localhost (frr@localhost) by usti.fccps.cz (8.12.8/8.12.8/Submit) with ESMTP id h92F4dKd004563; Thu, 2 Oct 2003 17:04:40 +0200 X-Authentication-Warning: usti.fccps.cz: frr owned process doing -bs Date: Thu, 2 Oct 2003 17:04:39 +0200 (CEST) X-X-Sender: To: Scott Long In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: questions@freebsd.org cc: Buki Subject: Re: can't get the Linux aaccli to work under 4.8-RELEASE, 4.9-RC1, 5.1-RELEASE X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2003 15:04:46 -0000 > 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 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