i386 chroot on amd64 platform (obsd 3.9)

2006-05-03 Thread Karel Gardas

Hello,

I've installed OpenBSD 3.9(amd64) on AMD64 box and now I thought about 
installing i386 OpenBSD minimal install into this installation just to be 
able to chroot from amd64 environment to i386 without a need to reboot 
computer. I tried this, but it seems at least on GENERIC kernels it's not 
supported:


# chroot `pwd`/i386/
chroot: /bin/ksh: Exec format error
# machine
amd64
# file i386/bin/ksh
i386/bin/ksh: ELF 32-bit LSB executable, Intel 80386, version 1, for 
OpenBSD, statically linked, stripped


is this way supported in different kernel configuration? Is it recommended 
by you OpenBSD folks? I'm asking since this is how I test software on both 
platforms on debian.


Thanks a lot,
Karel
--
Karel Gardas  [EMAIL PROTECTED]
ObjectSecurity Ltd.   http://www.objectsecurity.com



Re: i386 chroot on amd64 platform (obsd 3.9)

2006-05-03 Thread Nick Holland

Karel Gardas wrote:

Hello,

I've installed OpenBSD 3.9(amd64) on AMD64 box and now I thought about 
installing i386 OpenBSD minimal install into this installation just to 
be able to chroot from amd64 environment to i386 without a need to 
reboot computer. I tried this, but it seems at least on GENERIC kernels 
it's not supported:


# chroot `pwd`/i386/
chroot: /bin/ksh: Exec format error
# machine
amd64
# file i386/bin/ksh
i386/bin/ksh: ELF 32-bit LSB executable, Intel 80386, version 1, for 
OpenBSD, statically linked, stripped


OpenBSD/amd64 is a totally different platform than OpenBSD/i386.

Do you expect to be able to run sparc apps on alpha?

is this way supported in different kernel configuration? Is it 
recommended by you OpenBSD folks? I'm asking since this is how I test 
software on both platforms on debian.


And we all know OpenBSD is just another Linux variant.

Sounds like either they spent a lot of time putting in a compatibility
layer or very little time putting in 64 bit code support.  I'm guessing it
was something expedient to help compatibility with binary stuff that
wasn't available in 64 bit code.  You probably think this is a feature of
Debian.  As someone who watched the world spend over a decade running
8088 code and work around 8088 limitations (i.e., EMS)on 80286, 80386 and
80486 and later processors, I think this is a really bad idea.  I am SO
glad that OpenBSD has kept them separate.

Here's an interesting thought...wonder how one would handle the W^X on
your hypothetical OpenBSD/amd64-32.  Some code could use the NX bit,
others would have to play with the MMU...sounds unlikely to be done right.
ok, never mind...not that interesting at all.

Nick.



Re: i386 chroot on amd64 platform (obsd 3.9)

2006-05-03 Thread Karel Gardas

Nick Holland wrote:

Karel Gardas wrote:

Hello,

I've installed OpenBSD 3.9(amd64) on AMD64 box and now I thought about
installing i386 OpenBSD minimal install into this installation just to
be able to chroot from amd64 environment to i386 without a need to
reboot computer. I tried this, but it seems at least on GENERIC kernels
it's not supported:

# chroot `pwd`/i386/
chroot: /bin/ksh: Exec format error
# machine
amd64
# file i386/bin/ksh
i386/bin/ksh: ELF 32-bit LSB executable, Intel 80386, version 1, for
OpenBSD, statically linked, stripped


OpenBSD/amd64 is a totally different platform than OpenBSD/i386.

Do you expect to be able to run sparc apps on alpha?


No, but I just expect to run code of processor variant on processor which 
certainly support executing the code natively.



is this way supported in different kernel configuration? Is it
recommended by you OpenBSD folks? I'm asking since this is how I test
software on both platforms on debian.


And we all know OpenBSD is just another Linux variant.


Why such sarcasm? Is it forbidden to move from Linux to OpenBSD? I'm not 
aware of the fact that I would claim OBSD is just Linux variant in the 
paragraph above...



Sounds like either they spent a lot of time putting in a compatibility
layer or very little time putting in 64 bit code support.


Well, debian itself is quite clean. It provides AMD64 bit kernel with IA32 
support and pure AMD64 userland. It's up to the user to install IA32 bit 
chroot inside such environment, since kernel is ready to support it. 
Others (SuSE/RedHat IIRC) are mixing AMD64/IA32 user-land (at least 
libraries) together, i.e. in one system different dirs.


I'm guessing 
it was something expedient to help compatibility with binary stuff that 
wasn't available in 64 bit code.
 You probably think this is a feature of 
Debian.


Not at all, I think this is a feature of linux kernel on amd64 platform, 
hence my question if openbsd kernel supports the same.


As someone who watched the world spend over a decade running 
8088 code and work around 8088 limitations (i.e., EMS)on 80286, 80386 and 
80486 and later processors, I think this is a really bad idea.  I am SO 
glad that OpenBSD has kept them separate.


Here's an interesting thought...wonder how one would handle the W^X on 
your hypothetical OpenBSD/amd64-32.  Some code could use the NX bit, 
others would have to play with the MMU...sounds unlikely to be done 
right.


And that's exactly why I've been thinking about it, hence I asked here, 
otherwise I would plainly expected that ia32 is supported on amd64. :-)


Thanks!
Karel
--
Karel Gardas  [EMAIL PROTECTED]
ObjectSecurity Ltd.   http://www.objectsecurity.com