From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 In-Reply-To: <1dd94a0c1dc12f5ec3b51d38dc0fa017@proxima.alt.za> References: <13426df10902010926x15ef8e95o67851f2f4c67af0e@mail.gmail.com> <1dd94a0c1dc12f5ec3b51d38dc0fa017@proxima.alt.za> Date: Sun, 1 Feb 2009 12:14:26 -0800 Message-ID: <13426df10902011214i5e02a024h85da1a97bbe3ddc4@mail.gmail.com> From: ron minnich To: lucio@proxima.alt.za, Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [9fans] Dynamic loading et al (Was: Pegasus 2.6 is released) Topicbox-Message-UUID: 916f65f8-ead4-11e9-9d60-3106f5b1d025 On Sun, Feb 1, 2009 at 10:42 AM, 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