Subject: Re: Linking against Linux binary modules
To: Christos Zoulas <christos@astron.com>
From: Eric Haszlakiewicz <erh@nimenees.com>
List: current-users
Date: 09/28/2006 12:53:27
On Thu, Sep 28, 2006 at 12:46:20PM +0000, Christos Zoulas wrote:
> In article <20060928114656.GA9756@panix.com>,
> Thor Lancelot Simon <tls@rek.tjls.com> wrote:
> >How, for example, do you intend to solve the problem that many functions
> >in the C library in Linux have the same name, but different signatures
> >than their NetBSD counterparts?
>
> It is also sizes of structs. You'll need to wrap most of them with small
> translation shims and then call the real linux code. Same for syscalls that
> do not have the same numbers. Finally you need to fake other ELF library
> dependencies.
Right, but you only have to do that for the linux functions that you use
from NetBSD code. Then the shim does:
foo_shim()
{
convert args
syscall to switch emul mode to linux
call linux func
syscall to switch emul mode back to netbsd
convert return values
}
but anything the linux func calls would be just other linux funcs.
i.e. basically the exact same thing the in-kernel emul code does, but the
other way around.
eric