From owner-freebsd-questions@FreeBSD.ORG Thu Dec 2 21:08:42 2004 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 B6CEF16A4CE for ; Thu, 2 Dec 2004 21:08:42 +0000 (GMT) Received: from 9.hellooperator.net (cpc3-cdif2-3-0-cust202.cdif.cable.ntl.com [81.103.32.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4F27743D5C for ; Thu, 2 Dec 2004 21:08:42 +0000 (GMT) (envelope-from rasputin@hellooperator.net) Received: from rasputin by 9.hellooperator.net with local (Exim 4.43) id 1CZyBt-0002SI-4Q; Thu, 02 Dec 2004 21:08:41 +0000 Date: Thu, 2 Dec 2004 21:08:41 +0000 From: Dick Davies To: Mikko Heiskanen Message-ID: <20041202210840.GB23230@lb.tenfour> References: <1102005825.4361.16.camel@whitecortex.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1102005825.4361.16.camel@whitecortex.net> User-Agent: Mutt/1.4.2.1i Sender: Dick Davies cc: FreeBSD Questions Subject: Re: linux emulation X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Dick Davies List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Dec 2004 21:08:42 -0000 * Mikko Heiskanen [1244 16:44]: > I've been wondering about this some time now. > The linux compatibility layer (kernel module + linux_base -port) > is told to be able to run linux binaries. The handbook even describes > for a couple of heavy-duty applications how this is done. > However, after reading that part of the handbook and googling around the > net, I haven't the slightest idea how I'm supposed to run such program. Same as any other binary. > Let's say I have a program. Should I put it in /compat/linux/somewhere, > run it like /compat/linux/somewhere/executable and it just somehow > works? Or should I chroot to /compat/linux? > How does FreeBSD know when to use linuxemu? A Linux binary looks different to a native one. The system notices and kicks off the emulation layer. (effectively you have a different system call table for each emulated OS, if that means anything to you). There's a detailed explanation of NetBSDs way of doing this (I expect FreeBSDs is very similar) in a six part onlamp series starting at: http://www.onlamp.com/lpt/a/2623 -- And if you think you're going to bleed all over me you're even wronger than you normally be - The Specials, 'Little Bitch' Rasputin :: Jack of All Trades - Master of Nuns