On Sun, Feb 1, 2009 at 10:42 AM,  <lu...@proxima.alt.za> wrote:
>> This is what I'm doing on bg/p now. I've got a small program that
>> reads in an elf binary, sets up the argv/env/aux vector(ppc thing) and
>> jumps to main. It works. I use libmach.
>
> Can you share documentation and code?  Although I would have to limit
> my experimentation to the 386 platform rather than the PPC.

--rw-r--r-- M 1614 rminnich sys 7183 Feb  1 15:06
/n/sources/contrib/rminnich/bgp/machcnk.c

There is stuff in there specific to bgp, as you can see. This is
derived from gpl'ed code fore coreboot but I was able to use the
wonderful libmach -- which does need a few more changes, I have a
private copy with an enhancement I doubt you will need. It's pretty
simple code and you won't need the devsegment stuff -- that's a very
bgp-specific requirement -- you can just malloc code for text and
data, and you can just use the plan 9 heap, whereas bgp needs a
different heap. Long story.

>
> And what do you use to generate the ELF code?  Static or dynamic?

The BGP toolchain, which produces statically linked binaries.

I am also supporting limited linux emulation on BGP but in kernel. The
notes approach is higher overhead than I want to pay. The open and
write of /dev/cnk is what flips a process into "linux system call
interface" mode. The only mmap I support is for anon memory.

thanks

ron

Reply via email to