Subject: Re: Linking against Linux binary modules
To: Eric Haszlakiewicz <erh@nimenees.com>
From: Frank van der Linden <fvdl@netbsd.org>
List: current-users
Date: 09/29/2006 14:01:53
You could implement per-page emulation.. here's how it would work:

* Add a system call that attaches attributes (e.g. emulation values) to 
a range of mmapped pages (e.g. just a simple int)
* Store this information in the kernel (could be in vm_page, could be in 
the pmap)
* When a syscall happens, see if this process is using per-page 
emulation, and if so, check the userspace address from which it 
originated, look up the page, and check the emulation value. Adjust the 
system call path accordingly. Come to think of it, the emulation value 
could be attached to the mmapped vnode, which makes lookup a little 
easier, and it's unlikely that one file will contain both native and 
emulated code.

You'd still need to link the Linux pages against Linux shared libraries 
only, of course.

- Frank