A few more ALLVM tidbits are now available

Mon 02/04/19   19:00  in  allvm

Posted on the ALLVM github organization, the allvm-meta [1] repository is now available— and because naming is hard it ended up being the repository with perhaps the least “meta” content.

Even so I’m excited to make this public and will give a brief overview below.

LLVM JIT in the BSD Kernel

ALLVM researches systems where ALL code is available as IR, and in the “big picture” plan this included the kernel as well as userspace with the compiler as a first-class component of the OS.

In this little code dump are most of the bits I used for my exploratory blitz towards getting an LLVM JIT as close to the metal as I could manage in a few weeks.

Unfortunately some of the patches for uclibc, uclibc++, and LLVM have been lost— but when I get a free weekend I think they’re in an old backup but it’ll take some work to dig through that.

Even so this is the work that caused the fun BSOD [6] I posted about at the time: as I recall I did something like scribbled LLVM IR all over system memory due to a silly mistake.

My solution was to shove enough of an LLVM JIT and hacked “runtime” support into a bsd kernel module that hopefully the bootloader or early kernel init could host.

This worked well enough that I was able to point it at bitcode for the FreeBSD kernel and successfully codegen the result.

It couldn’t quite execute the result, although I THINK that was largely a matter of rejiggering a number of things to pivot into it gracefully— not because the code was wrong.

I’ll hopefully find those pieces soon, and might not be ready for exploring but it’s at least in a better place than it was :).

I wrote an email to the ALLVM co-founders my advisor Vikram and Joshua Cranmer [7], which is a nice piece of “history” and the early excitement of the project!

You’ll find it in the allvm-meta repo, it describes my goals and status better than the summary above.

Here: ALLVM JIT Status Email [8]

Comments !