[Mono-devel-list] Re: [Gtk-sharp-list] kernel support.

Carlos Perelló Marín carlos@pemas.net
18 Jun 2003 10:37:15 +0200


--=-1QYozPT0qpUTQUpV3LEY
Content-Type: multipart/mixed; boundary="=-skH2wyEHQwSq8f+jnQVW"


--=-skH2wyEHQwSq8f+jnQVW
Content-Type: text/plain; charset=iso-8859-15
Content-Transfer-Encoding: quoted-printable

El mar, 17-06-2003 a las 23:46, Dag Wieers escribi=F3:
> On 17 Jun 2003, Carlos [ISO-8859-1] Perell=F3 Mar=EDn wrote:
>=20
> > > And actually it is a workaround for shortcomings in the way binfmt_mi=
sc=20
> > > works. Whereas it has some overhead too. So the proper solution is to=
 have=20
> > > a binfmt_exe module in the kernel (that can be compiled seperately) o=
r=20
> > > make binfmt_misc able to make a difference between Windows executable=
s=20
> > > and .Net binaries.
> >=20
> > Hmmm I have wine and mono installed and that solution works for me, whe=
n
> > I execute a .NET binary it uses mono and when I execute any other
> > Windows binary it uses wine.
> >=20
> > I don't see where is the problem...
>=20
> Ok, now try to convince Red Hat, SuSE, TurboLinux, Mandrake, Lindows to=20
> fix their packages and release updates to their wine package now.=20
>=20
> And I'm sure you can overwrite what other packages do, but that's not a=20
> real clean solution and you may not have control what an upgrade will do.
>=20

I think that the solution does not change wine files, as you can read
with the attached file, it's only a modification inside binfmt-support

> "It works" doesn't necessarily make it the best solution. A shell wrapper=
=20
> works too.

It works for all .net executables and the user does not need to know
that she needs a wrapper to execute a mono program.

I think it's the best option :-P

Cheers.
>=20
> --   dag wieers,  dag@wieers.com,  http://dag.wieers.com/   --
> [Any errors in spelling, tact or fact are transmission errors]
>=20
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
--=20
Carlos Perell=F3 Mar=EDn
Debian GNU/Linux Sid (PowerPC)
Linux Registered User #121232
mailto:carlos@pemas.net || mailto:carlos@gnome.org
http://carlos.pemas.net
Valencia - Spain

--=-skH2wyEHQwSq8f+jnQVW
Content-Disposition: attachment; filename=detectors
Content-Type: message/rfc822; name=detectors

From: Colin Watson <cjwatson@debian.org>
To: Ove Kaaven
Cc: Alp Toker
Subject: Cooperation between Mono and Wine for binary formats
Date: 18 Jun 2003 10:34:51 +0200
Message-Id: <1055925291.661.6.camel@bilbo.pemas.net>
Mime-Version: 1.0
Content-Transfer-Encoding: quoted-printable

The following is a specification for extended binary format
specifications in binfmt-support. It is being written to support the
needs of the Mono packages. The .NET binary format is sufficiently
similar to that used by Wine for ordinary Win32 executables that the
decision on which to use is beyond the support provided by the
binfmt_misc kernel module and needs to be delegated to a userspace
process.

(This necessarily involves making things a little more convoluted, but I
hope not by too much. Bear with me.)


A new command-line option, and corresponding format file option, is
added, namely --detector. If this option is present, it is to be
followed by the full path to an executable. If all other conditions in a
binary format specification succeed, this executable will be run with
the path to the binary in question as its first argument before the
interpreter is considered for execution.

Several different detector/interpreter pairs may be present with
otherwise identical format strings. Each detector is run in turn, in a
currently unspecified order, until one succeeds, i.e. returns a zero
exit status. The corresponding interpreter will then be run as normal.
If several identical format strings are present with no detector, they
will be considered to have a detector of /bin/true which is run last of
all (this may help with transitions).

Implementation notes: If any detectors are present for a given
kernel-level format, then /usr/share/binfmt-support/run-detectors (or
similar) is called instead of the usual interpreter. This calls each
configured detector in turn and then execv()'s the first interpreter
that succeeds. If none succeed, it prints an error message and exits
non-zero.

As far as wine is concerned, the modification should be as follows: add
/usr/lib/wine/binfmt-detector-wine or similar with the Win32 format
detection code (Alp has the details of this, it's a few dozen lines of
C), and add 'detector /usr/lib/wine/binfmt-detector-wine' to
/usr/share/binfmts/wine.


The intention of all this is that users can run a random Windows
executable with the MZ magic string and it will be passed off
transparently to the appropriate interpreter, while keeping the
packaging as simple as possible and avoiding the need for extra bridging
packages (the original idea of having a single program that knows how to
tell between Win32 and .NET executables and hands them off accordingly
would have required an extra package and associated cruft in
dependencies/suggestions).

The Wine package doesn't need to be modified under this scheme in order
for Mono to work, due to the /bin/true shim for format strings without
detectors, so the transition can be quite painless. However, unless it
is modified, binfmt_misc will attempt to run Wine over .NET executables
if Mono is not installed.

--=-skH2wyEHQwSq8f+jnQVW--

--=-1QYozPT0qpUTQUpV3LEY
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmada
	digitalmente

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQA+8CS6EuPMamD5V9cRAuqtAJ9Z0uZyE80v1YCHysNvsma5vawuPQCghB07
+hhxLVElX9eHtUR7jIa2AJQ=
=MZU6
-----END PGP SIGNATURE-----

--=-1QYozPT0qpUTQUpV3LEY--