Subject: Re: Linking against Linux binary modules
To: Eric Haszlakiewicz <>
From: David Laight <>
List: current-users
Date: 09/28/2006 21:23:12
On Thu, Sep 28, 2006 at 12:53:27PM -0500, Eric Haszlakiewicz wrote:
> 	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
> }

That won't work for all system calls - I strongly suspect that some linux
libraries (and programs) contain the asm statements for the actual trap.
So the kernel would need to know the PC ranges for the different emulations.
(and the thought of on-stack asm shims......)


David Laight: