On 29 Jan 2016 1:03 pm, "Antti Kantee" <[email protected]> wrote: > > On 29/01/16 12:54, Patrick Welche wrote: >> >> In NetBSD source, /sys/rump/kern/Makefile.rumpkerncomp contains >> >> RUMPSYSEMUS= sys_cygwin sys_linux sys_sunos >> >> .if make(rumpdescribe) >> RUMPKERNCOMPS+= ${RUMPSYSEMUS} >> .endif >> >> which looks at a guess as if sys_linux isn't compiled into a rump >> kernel by default, but if it were, I might be able to test >> compat_linux code with rump? Is this a reasonable guess? What is going on? > > > Yes, but you also need a "Linux binary". Generating Linux binaries is easy if you're on Linux, but otherwise not so much. IIRC some years ago njoly@netbsd was testing compat_linux by using ljsyscall(*) as the "Linux binary". Using ljsyscall has the advantage of giving you the Linux syscall ABI on any system where ljsyscall runs. > > So essentially if you build and link rumpkern_sys_linux into a rump kernel, all local(?) syscalls get pre- and post-translation for the Linux ABI. At least that's how I seem to recall it worked. The hard part which I don't think I ever implemented satisfactorily was doing per-process syscall vector selection, and that's also why remote syscalls always go through the native NetBSD ABI. That is, unless my memory fails me, which seems to happen quite often these days ... > > *) https://github.com/justincormack/ljsyscall >
That sounds correct. Generating Linux binaries for rump would need a cross compiler setup which should be possible but I don't think anyone did it. Using ljsyscall is very easy, and I can help if you need some. It found a number of bugs in the emulation code. Justin
