From owner-freebsd-current@FreeBSD.ORG Fri Jun 17 18:21:18 2005 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CD14F16A41F for ; Fri, 17 Jun 2005 18:21:18 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7A39543D1D for ; Fri, 17 Jun 2005 18:21:18 +0000 (GMT) (envelope-from peadar.edwards@gmail.com) Received: by zproxy.gmail.com with SMTP id 12so488779nzp for ; Fri, 17 Jun 2005 11:21:18 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=c0GGkVDZqYaiSPvzAm0X3rKIhQIF5jW7HtSsdSiMec8rMfzEYJ87R4rgvMy3OvPqgxeeMywwX4PshtCIUfakV+JDqiSjqJ7vl0XhslvhDCJThjvybMYCZh11K143tGm5jpOPv9sHjT+Wi1ME8wHHBjwn+lVUIAOy+zNADQMi2qU= Received: by 10.36.222.73 with SMTP id u73mr922752nzg; Fri, 17 Jun 2005 11:21:17 -0700 (PDT) Received: by 10.36.68.15 with HTTP; Fri, 17 Jun 2005 11:21:17 -0700 (PDT) Message-ID: <34cb7c840506171121cd0437f@mail.gmail.com> Date: Fri, 17 Jun 2005 19:21:17 +0100 From: Peter Edwards To: Maxim.Sobolev@portaone.com In-Reply-To: <42B31247.9010603@portaone.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050617180232.GA25818@freefall.freebsd.org> <42B31247.9010603@portaone.com> Cc: Peter Edwards , current@freebsd.org Subject: Re: Towards a working "wine". [long] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Peter Edwards List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Jun 2005 18:21:18 -0000 On 6/17/05, Maxim Sobolev wrote: > Peter Edwards wrote: > > Y'all, > > > > I wanted to run a substantial windows app using "wine", and failed > > miserably. Looking around, it appears to be an acknowledged fact > > that wine is borked on FreeBSD, so I did some hacking about. > > > > The problems I found are centered around address space allocation: > > Wine is inevitably somewhat sensitive to address space layout, > > seeing as it has to present the Win32 binaries with a reasonably > > familiar environment. (All this assumes standard kernel, etc. Fixed > > addresses are the order of the day) > > > > Problem 1: > > > > When starting up, Wine needs to mmap stuff at address 0x80000000, > > but does so without using MAP_FIXED: I think the intention is that > > the code involved should be "best effort" to map to the hint address > > supplied to mmap(), rather than an all-or-nothing thing. > > > > FreeBSD's mmap sees this as an address in the data segment (see > > problem 2 below), and shifts the hint along to an address past > > there. There appears to be a MAP_TRYFIXED flag that wine uses on > > some systems that affords the hint more weight, which is pretty > > trivial to implement (see wine_mmap.txt). That was enough to get > > my app running, but not for long. >=20 > Well, there is really no point of adding another MAP_TRYFIXED flag, > since wine can call mmap(2) with MAP_FIXED and then if that fails try to > call mmap(2) without it and deal with consequences. This will provide > the same functionality but you won't get dependency on particular > FreeBSD version to get MAP_TRYFIXED define. >=20 Nope: MAP_FIXED will unconditionally overwrite any existing mapping at the requested address.