Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 17 Oct 2008 16:27:38 +0200
From:      Alexander Leidinger <Alexander@Leidinger.net>
To:        Miroslav Lachman <000.fbsd@quip.cz>
Cc:        freebsd-jail@freebsd.org
Subject:   Re: Compilation question 64bit, 32 bit
Message-ID:  <20081017162738.10251xmx8c2i8dlw@webmail.leidinger.net>
In-Reply-To: <48F85F53.8040005@quip.cz>
References:  <9251237E-8054-4B52-BFF7-B3B67189FABC@gmail.com> <20081017104321.18262zf6lz4uk7c4@webmail.leidinger.net> <48F85F53.8040005@quip.cz>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Miroslav Lachman <000.fbsd@quip.cz> (from Fri, 17 Oct 2008 =20
11:48:03 +0200):

> Alexander Leidinger wrote:
>> Quoting Jose Amengual <jose.amengual@gmail.com> (from Thu, 16 Oct =20
>> 2008  08:43:15 -0300):
>>
>>> Hi Guys.
>>>
>>> The other day I install a server with jails with FreeBSD 7 32 bit =20
>>> in  a 64 bit capable processor.
>>>
>>> After I install I start wondering some things that I point out here :
>>>
>>> Any benefit to install 64 bit vs 32 bit with the purpose of use jails ?
>>
>>
>> It depends. If you want to use more than 4G: yes.
>>
>>> Can I install a 32 bit FreeBSD and create 64 bit jails ? ( using  =20
>>> ezjail or downloading the full 64 bit source to create the jail ).
>>
>>
>> No.
>>
>>> Can I install 32 bit FreeBSD and then made a make world and change =20
>>>  it to 64 bit ? ( is recommended ?)
>>
>>
>> IIRC this depends upon your FreeBSD version. I think in CURRENT  =20
>> there's code which supports that now. No guarantees.
>>
>>> Can I install a FreeBSD 64 bit and create 32 bit jails ?
>>
>>
>> Sort of. You can install a 32bit world into the jail and make sure  =20
>> 32bit support is activated in the kernel. The 32bit programs will =20
>> then  run just fine in the jail (but 64bit ones should run fine =20
>> too). It's  the same way as you can run linux programs in a jail.
>
> Do you mean installing whole 32bit world instead of 64bit, for =20
> example from =20
> ftp.freebsd.cz:/pub/FreeBSD/releases/i386/7.0-RELEASE/base/ or just =20
> /lib32 /usr/lib32 libraries?

I haven't tested it myself. I know that it is possible. It may need =20
some twiddling. I haven't carefully looked at the kernel code, but as =20
it uses the same infrastructure as the linuxulator (see =20
compat/ia32/ia32_sysvec.c), it should be able to run with a plain i386 =20
world (maybe you have to make a link /libexec/ld-elf32.so.1 -> =20
/libexec/ld-elf.so.1 as the compat32 stuff is trying to access this... =20
or maybe even moving ld-elf.so.1 to a different name and linking to =20
the new name, in case this may cause some kind of loop in the kernel).

> Will it be possible in this (32bit) jail to install ports marked as =20
> arch i386 only, or some voodoo is needed to trick the ports system?

As the compiler is responsible to create the XXbit stuff, and you are =20
using the 32bit compiler, it should be possible. Investigate the stuff =20
which is used to change the uname output on the ports build cluster. =20
This will be needed. Not all ports may work, in this case either fix =20
the port, or use a package. Some ports will never be able to work (use =20
of features which are not available in compat32).

> What do you mean by "32bit support in kernel"? Is it just options   =20
> COMPAT_IA32 as is in amd64 GENERIC or anything else?

COMPAT_IA32

> I am interested in running 32bit ports on amd64 bit machine.

If you mean 64bit jail instead of machine: should be possible. If not: =20
mixing without restrictions is not possible. It's an all or nothing =20
approach for the userland.

Bye,
Alexander.

--=20
If society fits you comfortably enough, you call it freedom.
=09=09-- Robert Frost

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID =3D B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID =3D 72077137



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