From owner-freebsd-emulation@FreeBSD.ORG Fri Mar 9 20:04:00 2007 Return-Path: X-Original-To: freebsd-emulation@freebsd.org Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 7AAF916A404 for ; Fri, 9 Mar 2007 20:04:00 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id 2DED313C442 for ; Fri, 9 Mar 2007 20:03:58 +0000 (UTC) (envelope-from infofarmer@gmail.com) Received: by ug-out-1314.google.com with SMTP id 71so1380675ugh for ; Fri, 09 Mar 2007 12:03:57 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=s/23UaGWgDuo1ZvOv9I80I31AEUKe5amWBodJ86nlMsLKEmQB23mzLMdXjhU/Z22Kd5uyQopnP9AaGHdQDP0u7wkrjSmSN+JRpRir1O23nj/sdNxY3cHLSEQC40Bqme5fWt+S7eFB4yskcaXSyfoZ3o4G/2IgyrogOnAJ4eugUg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=VuwiXc7X4cz03hN1CXOv0XQPDM05+cWdxia8MEcUmitLVipMec9gc09UD5fFj4CYbsdlSZ6Zztao2WRRuRiFj7JsmZ/G64sE4Kt66GYfgiEc2C6+0c08wcNppu5s2C6hk4ESMtTYZR+3I2dEmewj87rcyX0zJ9JuRENMsRxhF4U= Received: by 10.114.194.1 with SMTP id r1mr669024waf.1173469069403; Fri, 09 Mar 2007 11:37:49 -0800 (PST) Received: by 10.114.201.2 with HTTP; Fri, 9 Mar 2007 11:37:49 -0800 (PST) Message-ID: Date: Fri, 9 Mar 2007 22:37:49 +0300 From: "Andrew Pantyukhin" Sender: infofarmer@gmail.com To: "Tijl Coosemans" In-Reply-To: <200703092024.23577.tijl@ulyssis.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <790a9fff0610132255k5c3b08fcrb550fa308d31752d@mail.gmail.com> <20070306150107.p9j3cmqzlkww48sk@webmail.leidinger.net> <200703092024.23577.tijl@ulyssis.org> X-Google-Sender-Auth: 4fed7c6acd6100b3 Cc: Alexander Leidinger , freebsd-emulation@freebsd.org, Scot Hetzel , gerald@freebsd.org Subject: Re: emulators/linux-wine: Help in porting to FreeBSD X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.5 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: Fri, 09 Mar 2007 20:04:00 -0000 On 3/9/07, Tijl Coosemans wrote: > On Tuesday 06 March 2007 15:01, Alexander Leidinger wrote: > > Quoting Scot Hetzel (from Sat, 14 Oct 2006 > > 00:55:17 -0500): > > > > > I'm trying to create a port for emulators/linux-wine, so that we can > > > at least have wine running on FreeBSD/amd64 using the linuxator. This > > > would then silence users who want wine (amd64/104311) to run under > > > FreeBSD/amd64. > > > > > > Currently, I am having a problem running linux-wine. When it is run > > > as either root or as a user I get the following error: > > > > > > $ /compat/linux/usr/bin/wine > > > wine: failed to initialize: /usr/lib/wine/ntdll.dll.so: failed to map > > > segment from shared object: Cannot allocate memory > > > > Do you get the same error with a recent current? I hope it may be > > fixed with the mmap changes. But it may also be the way the memory is > > laid out in FreeBSD vs. Linux. IIRC the native wine had a similar > > problem until someone fixed the code for wine on FreeBSD. But I'm not > > sure about this. > > This is a problem with the FreeBSD mmap. > > * The wine executable is loaded at 0x7bf00000. > * It reserves 0x00000000-0x60000000 and 0x80000000-(stack). > * Then a couple dlls are dlopen'ed (ntdll,kernel32,...). > * This fails because the freebsd mmap, when called without MAP_FIXED > and NULL for the addr argument, looks for free space after the > executable + maximum possible data segment (to preserve space for > brk(2) style allocations). The default maximum data segment size is > 512MiB, so mmap is looking for free space well beyond 0x80000000 > which isn't there. > > In current you could work around this by setting kern.maxdsiz="8M" or > so in /boot/loader.conf, but that probably causes problems for programs > that use brk(2). A better solutions would be to create a wrapper > program that reduces the data segment size with setrlimit(2) and then > runs wine with execv(3). > > Anyway, I don't think that will give you a better Wine than the native > version. FreeBSD devices are not the same as on Linux for instance. The question is what kind of wine we, poor windows addicts, can have on FreeBSD/amd64...