GSOC2011
2011-03-21 10:00:47 GMT
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
Hi Andrey,
We would more than happy to work with you and receive your proposal to work on this item.
There are several possible approaches to this problem, do you have any thoughts about which you’d like to take?
Thanks for your interest,
Deano
From: Andrey Sokolov [mailto:keremet <at> solaris.kirov.ru]
Sent: 21 March 2011 10:01
To: oi-dev <at> openindiana.org
Subject: [oi-dev] GSOC2011
I'd like to participate in "Linux binary support without zones" project. Is it possible?
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
Hi Deano,
I would like to write a program that will convert linux binaries to opensolaris binaries. The program will change dynamic relocation records. I did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I have converted a simple linux binary to opensolaris binary using hex editor.
Hi Andrey,
We would more than happy to work with you and receive your proposal to work on this item.
There are several possible approaches to this problem, do you have any thoughts about which you’d like to take?
Thanks for your interest,
Deano
From: Andrey Sokolov [mailto:keremet <at> solaris.kirov.ru]
Sent: 21 March 2011 10:01
To: oi-dev <at> openindiana.org
Subject: [oi-dev] GSOC2011
I'd like to participate in "Linux binary support without zones" project. Is it possible?
_______________________________________________
oi-dev mailing list
oi-dev <at> openindiana.org
http://openindiana.org/mailman/listinfo/oi-dev
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
Hi Andrey,
That look very interesting,
A mentor who knows much more about this topic (I don’t I’m afraid) will be I’m sure in touch soon J
Thanks,
Deano
From: Andrey Sokolov [mailto:keremet <at> solaris.kirov.ru]
Sent: 21 March 2011 11:55
To: OpenIndiana Developer mailing list
Subject: Re: [oi-dev] GSOC2011
Hi Deano,
I would like to write a program that will convert linux binaries to opensolaris binaries. The program will change dynamic relocation records. I did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I have converted a simple linux binary to opensolaris binary using hex editor.
2011/3/21 Deano <deano <at> rattie.demon.co.uk>
Hi Andrey,
We would more than happy to work with you and receive your proposal to work on this item.
There are several possible approaches to this problem, do you have any thoughts about which you’d like to take?
Thanks for your interest,
Deano
From: Andrey Sokolov [mailto:keremet <at> solaris.kirov.ru]
Sent: 21 March 2011 10:01
To: oi-dev <at> openindiana.org
Subject: [oi-dev] GSOC2011
I'd like to participate in "Linux binary support without zones" project. Is it possible?
_______________________________________________
oi-dev mailing list
oi-dev <at> openindiana.org
http://openindiana.org/mailman/listinfo/oi-dev
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
Hi Deano,It seems to me like an Illumos.org project.
I would like to write a program that will convert linux binaries to opensolaris binaries. The program will change dynamic relocation records. I did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I have converted a simple linux binary to opensolaris binary using hex editor.I'd like to participate in "Linux binary support without zones" project. Is it possible?
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
On 03/21/11 12:54 PM, Andrey Sokolov wrote:Sorry all, It was OI-Dev thread.Hi Deano,
I would like to write a program that will convert linux binaries to opensolaris binaries. The program will change dynamic relocation records. I did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I have converted a simple linux binary to opensolaris binary using hex editor.
_______________________________________________ oi-dev mailing list oi-dev <at> openindiana.org http://openindiana.org/mailman/listinfo/oi-dev
On Mon, Mar 21, 2011 at 1:54 PM, Andrey Sokolov <keremet <at> solaris.kirov.ru> wrote: > Hi Deano, > > I would like to write a program that will convert linux binaries to > opensolaris binaries. The program will change dynamic relocation records. I > did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I > have converted a simple linux binary to opensolaris binary using hex editor. > Instead of [destructively] change the Linux binary in order to run it under Solaris, wouldn't it be better to do the job on the fly via dynamic linker ? Linux binaries conveniently use /lib/ld-linux.so.1 (as opposed to /lib/ld.so.1 for Solaris). So one would imaging that if you will provide a /lib/ld-linux.so.1 that knows how to fix the relocations that would get you what you need, w/o touch the binaries. Does it make sense ? -- -- Regards, Cyril
On Mon, 2011-03-21 at 16:16 +0200, Cyril Plisko wrote: > On Mon, Mar 21, 2011 at 1:54 PM, Andrey Sokolov > <keremet <at> solaris.kirov.ru> wrote: > > Hi Deano, > > > > I would like to write a program that will convert linux binaries to > > opensolaris binaries. The program will change dynamic relocation records. I > > did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I > > have converted a simple linux binary to opensolaris binary using hex editor. > > > > > Instead of [destructively] change the Linux binary in order to run it > under Solaris, > wouldn't it be better to do the job on the fly via dynamic linker ? > Linux binaries conveniently use /lib/ld-linux.so.1 (as opposed to > /lib/ld.so.1 for > Solaris). So one would imaging that if you will provide a > /lib/ld-linux.so.1 that > knows how to fix the relocations that would get you what you need, w/o touch > the binaries. Does it make sense ? This was pretty much my idea on the topic. There may be a need for a system call translation as well. Still, I think the *first* attempt should stick to library interfaces, and as much as possible reuse the lib interfaces we already have. There are likely some interfaces that will need "work" to make them function in a more linux friendly fashion. In a world where we had truly achieved success here, it would be possible to run, e.g. skype, without having to resort to branded zones. (Admittedly skype is a "hard" program to support, but it's a particular itch I want to see scratched.- Garrett
Cyril Plisko wrote: > On Mon, Mar 21, 2011 at 1:54 PM, Andrey Sokolov > <keremet <at> solaris.kirov.ru> wrote: >> Hi Deano, >> >> I would like to write a program that will convert linux binaries to >> opensolaris binaries. The program will change dynamic relocation records. I >> did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 I >> have converted a simple linux binary to opensolaris binary using hex editor. >> > > > Instead of [destructively] change the Linux binary in order to run it > under Solaris, > wouldn't it be better to do the job on the fly via dynamic linker ? > Linux binaries conveniently use /lib/ld-linux.so.1 (as opposed to > /lib/ld.so.1 for > Solaris). So one would imaging that if you will provide a > /lib/ld-linux.so.1 that > knows how to fix the relocations that would get you what you need, w/o touch > the binaries. Does it make sense ? Might want to look back at any info which still exists on "lxrun" which worked in a not dissimilar way, and also see if there's any info about Sun's Solaris 10 Janus project still knocking around (which may be useful even though you are not proposing the same route). -- -- Andrew
On Mon, Mar 21, 2011 at 12:55 PM, Andrew Gabriel <illumos <at> cucumber.demon.co.uk> wrote: > Cyril Plisko wrote: >> >> On Mon, Mar 21, 2011 at 1:54 PM, Andrey Sokolov >> <keremet <at> solaris.kirov.ru> wrote: >>> >>> Hi Deano, >>> >>> I would like to write a program that will convert linux binaries to >>> opensolaris binaries. The program will change dynamic relocation records. >>> I >>> did a little experiment: http://forum.os-solaris.ru/index.php?topic=223.0 >>> I >>> have converted a simple linux binary to opensolaris binary using hex >>> editor. >>> >> >> >> Instead of [destructively] change the Linux binary in order to run it >> under Solaris, >> wouldn't it be better to do the job on the fly via dynamic linker ? >> Linux binaries conveniently use /lib/ld-linux.so.1 (as opposed to >> /lib/ld.so.1 for >> Solaris). So one would imaging that if you will provide a >> /lib/ld-linux.so.1 that >> knows how to fix the relocations that would get you what you need, w/o >> touch >> the binaries. Does it make sense ? > > Might want to look back at any info which still exists on "lxrun" which > worked in a not dissimilar way, and also see if there's any info about Sun's > Solaris 10 Janus project still knocking around (which may be useful even > though you are not proposing the same route). > lxrun still works for older Linux binaries, but it used the rather ugly method of userspace syscall emulation by trapping SIGSEGV. Applications receive this signal when they cause a general protection fault by making an invalid system call using the traditional i386 INT 0x80 (the syscall vectors used by Linux happen to be unused on Solaris). I'm not sure what happens when applications try to use SYSENTER instead. BrandZ just implemented the Linux system calls instead, which works well, but obviously requires extensive kernel support. While we can bring it back into illumos fairly easily, it is still incomplete and also suffers from the fact that Linux has had some changes in the time it's gone unmaintained. Modern Linux applications as they do not embed system calls in their executables [1], so we do not have to perform syscall translation if we don't want to. They expect a code segment containing functions with stable interfaces to be mapped when they are run, and use those functions to perform syscalls. On Linux this segment is actually provided by the kernel (as a sort of "virtual library" named "linux-gate.so.1") and this allows the syscall implementations to be replaced easily [2]. illumos can provide this functionality as a real library or in the dynamic loader. If we want Linux executables to load native shared libraries (which would be really really cool), the dynamic loader would also need to support redirecting Linux application libc calls to GNU libc or wrappers around the native libc to handle interface and structure differences. Your suggestion to modify Linux executables on disk is an interesting one (reminds me of a similar but far too ambitious project for Win32 executables) and I'd like to hear more. I have investigated the options here (actually started some work on a modified dynamic loader that lives at ld-linux.so.2) and would be happy assist you. BTW, developer <at> lists.illumos.org is better for future discussion, and I have CC'ed it. [1] Some exceptions exist in closed software, often intended to discourage reverse engineering. [2] See the description of __kernel_vsyscall here: http://articles.manugarg.com/systemcallinlinux2_6.html -Albert
Albert Lee <trisk <at> opensolaris.org> wrote: > lxrun still works for older Linux binaries, but it used the rather > ugly method of userspace syscall emulation by trapping SIGSEGV. > Applications receive this signal when they cause a general protection > fault by making an invalid system call using the traditional i386 INT > 0x80 (the syscall vectors used by Linux happen to be unused on > Solaris). I'm not sure what happens when applications try to use > SYSENTER instead. > BrandZ just implemented the Linux system calls instead, which works > well, but obviously requires extensive kernel support. While we can > bring it back into illumos fairly easily, it is still incomplete and > also suffers from the fact that Linux has had some changes in the time > it's gone unmaintained. LKP exists before BrandZ amd Sun did buy a license from SCO for LKP. > If we want Linux executables to load native shared libraries (which > would be really really cool), the dynamic loader would also need to > support redirecting Linux application libc calls to GNU libc or > wrappers around the native libc to handle interface and structure > differences. Being generally able to run Linux binaries may be a security risk as there are plenty of attacks that rely on being able to run Linux binaries. Sun on the other side did introduce BrandZ instead of LKP in order to avoid rnning Linux binariers to become too simple - Sun was in fear that this could harm the stand of Solaris. In general, something like LKP should be nice as it allows e.g. pipes between Solaris binaries and Linux binaries. I would however make the general ability to run Linux binaries a configurable option. This could be made global via /etc/system and process group specific via privileges. Jörg -- -- EMail:joerg <at> schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin js <at> cs.tu-berlin.de (uni) joerg.schilling <at> fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/ URL: http://cdrecord.berlios.de/private/ ftp://ftp.berlios.de/pub/schily
Sun on the other side did introduce BrandZ instead of LKP in order to avoid
rnning Linux binariers to become too simple - Sun was in fear that this could
harm the stand of Solaris.
_______________________________________________ Developer mailing list Developer <at> lists.illumos.org http://lists.illumos.org/m/listinfo/developer
On Mon, 2011-03-21 at 13:00 +0300, Andrey Sokolov wrote: > I'd like to participate in "Linux binary support without zones" > project. Is it possible? > _______________________________________________ > oi-dev mailing list > oi-dev <at> openindiana.org > http://openindiana.org/mailman/listinfo/oi-dev Yes. I've thought a bit about this problem, and recommend we have a chat at some point. I'd recommend you start by filling out those parts of the application template that you can already do, and then lets take some time to talk further. - Garrett
RSS Feed