From owner-freebsd-emulation@freebsd.org Sat Sep 26 11:50:42 2015 Return-Path: Delivered-To: freebsd-emulation@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41511A09B16 for ; Sat, 26 Sep 2015 11:50:42 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from mail.ebusiness-leidinger.de (mail.ebusiness-leidinger.de [217.11.53.44]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C310C1634 for ; Sat, 26 Sep 2015 11:50:41 +0000 (UTC) (envelope-from alexander@leidinger.net) Received: from outgoing.leidinger.net (p57BB90BE.dip0.t-ipconnect.de [87.187.144.190]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mail.ebusiness-leidinger.de (Postfix) with ESMTPSA id 9B5D383EE80 for ; Sat, 26 Sep 2015 13:44:36 +0200 (CEST) Received: from webmail.leidinger.net (webmail.Leidinger.net [IPv6:fd73:10c7:2053:1::3:102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by outgoing.leidinger.net (Postfix) with ESMTPS id B684C7286 for ; Sat, 26 Sep 2015 13:44:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=leidinger.net; s=outgoing-alex; t=1443267873; bh=MTvcsp3AAret/RunWEz6CGGuvQ32BQMV0LPoNfZ5EBA=; h=Date:From:To:Subject:In-Reply-To; b=z3eI+U9NaxOjwFVRsXB0FIpvE/ifV9SY7RW3pVYu1fk+LbEfqiAMywqeYzQ1wuRFZ LRcvWIph20g/2IlJwpme6D2hP/+hLQNU65j87CKQXDT2HYXn3FYoEd5KeV3BMMRvi7 Z2uOg3KB/ZoK9CSXcDMvs8II/cWsLRRnAv7Azj9iT+LmEdGZPNcOKf+3B0VLniWlEk Qlp0uB1vhacWf7Wy7OmR4Fl7GOb+XrV5QhNXRXPBFgzm4m6L04Fh97sVDizlV3SYDm mKy/TIO7e+m+E4nuyqY0TI4CNW45nQmfup1u3y0sZQKqypQkMj/ZK4elfiuRHedyE2 LfiImlexgSZEQ== Received: (from www@localhost) by webmail.leidinger.net (8.15.2/8.14.4/Submit) id t8QBiXUF054395 for freebsd-emulation@freebsd.org; Sat, 26 Sep 2015 13:44:33 +0200 (CEST) (envelope-from Alexander@leidinger.net) X-Authentication-Warning: webmail.leidinger.net: www set sender to Alexander@leidinger.net using -f Received: from 217.197.101.97 ([217.197.101.97]) by webmail.leidinger.net (Horde Framework) with HTTP; Sat, 26 Sep 2015 13:44:33 +0200 Date: Sat, 26 Sep 2015 13:44:33 +0200 Message-ID: <20150926134433.Horde.dywx79dLiTk9Z_UmyvgIU7-@webmail.leidinger.net> From: Alexander Leidinger To: freebsd-emulation@freebsd.org Subject: Re: /dev for Linux binaries in freebsd In-Reply-To: <20150924195443.1805e50d@Papi> User-Agent: Horde Application Framework 5 Content-Type: text/plain; charset=utf-8; format=flowed; DelSp=Yes MIME-Version: 1.0 Content-Disposition: inline X-EBL-MailScanner-Information: Please contact the ISP for more information X-EBL-MailScanner-ID: 9B5D383EE80.A5C23 X-EBL-MailScanner: Found to be clean X-EBL-MailScanner-SpamCheck: not spam, spamhaus-ZEN, SpamAssassin (not cached, score=-0.023, required 6, autolearn=disabled, DKIM_SIGNED 0.10, DKIM_VALID -0.10, DKIM_VALID_AU -0.10, TW_EV 0.08) X-EBL-MailScanner-From: alexander@leidinger.net X-EBL-MailScanner-Watermark: 1443872681.25046@jhECoY1iTX+W0MRD+KQV/A X-EBL-Spam-Status: No X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.20 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: Sat, 26 Sep 2015 11:50:42 -0000 Quoting Mario Lobo (from Thu, 24 Sep 2015 19:54:43 -0300): > I was trying to find out where a linux binary will look for the /dev > directory. > > I tried to link the device I need to /compat/linux/dev but that didn't > work. This is expected. Do not create links to the real /dev there, you will create a loop (see below). > How can a linux binary see the devices (serial ports, usb, etc) of the > system? The behavior under the assumption that you haven't chrooted into /compat/linux is: A linux program will ask the kernel for /dev/xyz. The kernel knows that it is a linux program, and as such it will first look for /compat/linux/dev/xyz. If the kernel doesn't find the device there, it will look for /dev/xyz. As such you should not touch /compat/linux/dev at all, it will "fall-through" to the real /dev. Maybe your real problem is not that you can't access the right /dev/ entry, but that the devide doesn't understand what the linux program wants to do. You can use ktrace or dtrace to check what the program tries to do. You should see in the output what the real patch is it tries to reach and what kind or errno it get's when it tries to access it. If you chroot into /compat/linux, you need to mount devfs in additionally to /compat/linux/dev. Bye, Alexander. -- http://www.Leidinger.net Alexander@Leidinger.net: PGP 0xC773696B3BAC17DC http://www.FreeBSD.org netchild@FreeBSD.org : PGP 0xC773696B3BAC17DC