Porting Wine to FreeBSD

Wine is an open source implementation of a Windows application environment, which allows running Windows programs on other operating systems.

It is a complex piece of software, that relies on various parts of the underlying operating system. This page is meant to collect various bits of information about Wine on FreeBSD to assist in porting.

Status

On FreeBSD 7.0 and later versions, Wine should work for most user applications. Games tend to be more problematic, but it's worth trying.

For FreeBSD 6.3 and later a kernel patch is available below.

Sound output is often garbled. If that happens to you, in winecfg, at the bottom of the sound tab, try to set hardware acceleration to emulation instead of full.

If you run into bugs, feel free to file a bug report in the Wine bugzilla and mention the version of FreeBSD you're using.

Open Tasks

More Wine Bug Reports

Work In Progress

Wine Loader mmap Problem

An executable loaded in memory basically consists of a read-only (code) segment and a writable data segment. The address after the data segment is called the break and you can change it (allocating/deallocating) with brk(2) and sbrk(2). There's a limit on the size of the data segment (which can be set system-wide with kern.maxdsiz in /boot/loader.conf). The default value is 512M. Mmap on freebsd preserves this space and looks for free space after datasegment+maxdsiz. This works quite well for every normal unix program. The wine executable however is linked with:

This basically means the executable is located at 0x7bf00000. So, if maxdsiz is 512M, wine can't mmap the shared heap at 0x80000000 for instance (unless it would use MAP_FIXED, but that's too risky, because if maxdsiz is something smaller, libs can be mmap'ed there).

Until a better solution is found, the current workaround is reduce the data segment size to 32M.

Related bug reports: wine/5732, kern/94413

See also: http://www.winehq.org/pipermail/wine-devel/2007-September/059426.html

Ptrace race

There's a race in the FreeBSD ptrace(2) implementation that causes Wine to hang sometimes. A typical example is winedbg hanging.

More info: http://lists.freebsd.org/pipermail/freebsd-hackers/2007-August/021430.html

Patches

Patching FreeBSD 6.3-RELEASE and 6-STABLE: attachment:patch-fbsd-6

Patching Wine (optional): attachment:patch-kthread

Mailing Lists

You can use one of the following mailing lists:

Wine (last edited 2008-02-05 14:57:28 by TijlCoosemans)