Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Jul 2004 07:12:10 +1000
From:      John Birrell <jb@cimlogic.com.au>
To:        Anish Mistry <mistry.7@osu.edu>
Cc:        freebsd-current@freebsd.org
Subject:   Re: FreeBSD and wine mmap
Message-ID:  <20040729211209.GH34260@freebsd3.cimlogic.com.au>
In-Reply-To: <200407291004.19726.mistry.7@osu.edu>
References:  <200407271731.12282.mistry.7@osu.edu> <20040729053355.GG34260@freebsd3.cimlogic.com.au> <200407291004.19726.mistry.7@osu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Jul 29, 2004 at 10:04:12AM -0400, Anish Mistry wrote:
> I should have a bit of time, once I get the acpi_fuji driver cleaned up and 
> Nate or Mark can import it.  Which direction capitan? :)

Look in /usr/src/sys/vm/vm_mmap.c:mmap() for the comment:

    /*
     * XXX for non-fixed mappings where no hint is provided or
     * the hint would fall in the potential heap space,
     * place it after the end of the largest possible heap.
     *
     * There should really be a pmap call to determine a reasonable
     * location.
     */

The code currently maps memory without a fixed address above the highest
address that the process has used.

The problem with Wine is that it needs to reserve the top half of the
process address space for use like older versions of Windows. When Wine
starts up, it goes through and grabs that memory as soon as it can, then
it proceeds to dynamically load it's libraries (the Unix shared libraries
that implement the functions in the DLLs). The first load fails because
the library can't be mapped above the highest address used.

What you need to do is take the hint from the comment above and write a
pmap function to determine a reasonable location. You could say that
a reasonable location is above the highest address used, if there is
space up there. Otherwise find a hole in the address space.

-- 
John Birrell



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040729211209.GH34260>