On 18/02/15 19:30, Justin Cormack wrote: > Ok now I dont have the fosdem plague I have been working on > "frankenlibc".
For all I know, you were patient zero ;) > The idea is to make a stub libc that has enough functionality to allow > you to compile the upstream fiber version of rumpuser. This provides > standard libc functions that are used, eg string.h, and the malloc > implementation that we use in baremetal, and some other functions that > are needed. It also provides an assembler implementation of the > swapcontext functions that are used for threading. One suggestion: don't use or depend on libc naming schemes. The reason I explicitly didn't provide string.h etc. in -baremetal was to avoid the -xen tailspin where modules both provide for libc and depend on it (or would that be an immelmann?). Two weeks ago I started work on the interfaces between the MI bits (e.g. scheduler and lwp.c) and the platform (e.g. -xen and -baremetal). However, I noticed that I also need some partial type system in that interface (e.g. size_t), and couldn't quite make up my mind on how to do it. Then came the fosdem plague. > This then leaves a very minimal number of per platform functions that > need to be implemented, many of which are optional: > > clock_gettime > clock_nanosleep > exit > getrandom - optional random numbers > mmap - to allocate pages (maybe with alignment requirements) > munmap > raise - mainly used for abort > putchar - console > getenv Sounds about right. But again, assuming you didn't use the libc names just for demonstration purposes, I'd prefer names which are not the same as libc names. > Initially I am doing a Linux implementation which does direct > syscalls, which was the original idea so you need not link in host > libc. However it should be quite simple to add support for baremetal > and Xen as it basically just needs init and the page allocation to be > done. This has the advantage that the platforms will be much more > similar. Yes, that will be very cool. I'm definitely quite tired of having more or less the same code in three different places. Earlier, I was worried that -posix might be an outlier, but from your description it looks like with "frankenlibc" -posix will fit into the same model as -xen and -baremetal. > I have written most of it now except the init code and a build script, > so hoping to have something working in a day or so to demonstrate this > is a sane way of doing it. Ah, cool, I'll wait for that before restarting with -xen and -baremetal. ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk _______________________________________________ rumpkernel-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/rumpkernel-users
