From owner-freebsd-emulation@FreeBSD.ORG Mon Feb 18 13:24:05 2013 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F51A444 for ; Mon, 18 Feb 2013 13:24:05 +0000 (UTC) (envelope-from mailinglists@martinlaabs.de) Received: from relay03.alfahosting-server.de (relay03.alfahosting-server.de [109.237.142.239]) by mx1.freebsd.org (Postfix) with ESMTP id 121C7BEF for ; Mon, 18 Feb 2013 13:24:04 +0000 (UTC) Received: by relay02.alfahosting-server.de (Postfix, from userid 1001) id 32CDD32C2566; Mon, 18 Feb 2013 14:00:42 +0100 (CET) X-Spam-DCC: : X-Spam-Level: X-Spam-Status: No, score=0.0 required=7.0 tests=BAYES_50 autolearn=disabled version=3.2.5 Received: from alfa3018.alfahosting-server.de (alfa3018.alfahosting-server.de [109.237.140.30]) by relay02.alfahosting-server.de (Postfix) with ESMTP id 9881232C177E for ; Mon, 18 Feb 2013 14:00:40 +0100 (CET) Received: from pc.martinlaabs.de (p54B34931.dip.t-dialin.net [84.179.73.49]) by alfa3018.alfahosting-server.de (Postfix) with ESMTPSA id 64C0C515DB25 for ; Mon, 18 Feb 2013 14:00:40 +0100 (CET) Message-ID: <512225F7.8030904@martinlaabs.de> Date: Mon, 18 Feb 2013 14:00:39 +0100 From: Martin Laabs User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: freebsd-emulation@freebsd.org Subject: Adding a linux ioctl translation Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Status: No X-Virus-Checker-Version: clamassassin 1.2.4 with ClamAV 0.97.3/16692/Mon Feb 18 02:07:01 2013 X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2013 13:24:05 -0000 Hi, I try to add some new ioctl in the linuxulator. These ioctls are for the joystick driver I am currently writing. I tried to modify the linux_ioctl.h and linux_ioctl.c in the kernel but up to know I had no success. I still get the dmesg output about unimplemented ioctls: inux: pid 2830 (linux_jstest): ioctl fd=3, cmd=0x6a01 ('j',1) is not implemented linux(2830): ioctl(3, 80016a11, *) linux: pid 2830 (linux_jstest): ioctl fd=3, cmd=0x6a11 ('j',17) is not implemented linux(2830): ioctl(3, 80016a12, *) linux: pid 2830 (linux_jstest): ioctl fd=3, cmd=0x6a12 ('j',18) is not implemented linux(2830): ioctl(3, 80806a13, *) linux: pid 2830 (linux_jstest): ioctl fd=3, cmd=0x6a13 ('j',19) is not implemented I did the following: 1. Add the original ioctls to the linux_ioctl.h #define LINUX_JSIOCGVERSION 0x6a01 /*0x80046a01*/ #define LINUX_JSIOCGAXES 0x6a11 /*0x80016a11*/ #define LINUX_JSIOCGBUTTONS 0x6a12 /*0x80016a12*/ #define LINUX_JSIOCGNAME 0x6a13 /*0x80006a13*/ #define LINUX_JS_MIN 0x6a01 #define LINUX_JS_MAX 0x6a13 2. Modified the linux_ioctl.c by adding: static linux_ioctl_function_t linux_ioctl_joystick; [...] static struct linux_ioctl_handler joystick_handler = {linux_ioctl_joystick, LINUX_JS_MIN, LINUX_JS_MAX }; [...] DATA_SET(linux_ioctl_handler_set, joystick_handler); static int linux_ioctl_joystick(struct thread *td, struct linux_ioctl_args *args) { int error; error = 0; printf(ARGS(ioctl, "%d, %04lx, *"), args->fd, \ (unsigned long)args->cmd); switch (args->cmd) { case LINUX_JSIOCGVERSION: args->cmd = JSIOCGVERSION; break; case LINUX_JSIOCGAXES: args->cmd = JSIOCGAXES; break; case LINUX_JSIOCGBUTTONS: args->cmd = JSIOCGBUTTONS; break; case LINUX_JSIOCGNAME: args->cmd = JSIOCGNAME(0); break; default: return (ENOIOCTL); } error = sys_ioctl(td, (struct ioctl_args *)args); return (error); } 3. Recompile linux.ko, restart the system Unfortunately this did not what it should. I still get the message about the unimplemented ioctl. What did I miss? Thank you, Martin Laabs