[LLVMdev] LLVM JIT on a Baremetal x86 Machine !!!

James Molloy james.molloy at arm.com
Wed Oct 26 06:20:16 PDT 2011


Hi Mian,

I have actually done this. I wrote a safe bytecode which compiles down to
LLVM IR, and had baremetal applications running using it.

Code here:
http://www.quokforge.org/projects/horizon/repository/revisions/master/show/h
orizon/Baremetal

My method was to compile for hosted linux, then modify the resulting code to
run baremetal. For me, this involved rewriting "syscall" instructions to
"int $X" as everything was running in supervisor mode and "syscall" only
works from user mode.

Apart from that there's just a load of stubs to implement. Pretty easy
really.

Cheers,

James


-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Mian M. Hamayun
Sent: 26 October 2011 14:12
To: llvmdev at cs.uiuc.edu
Subject: [LLVMdev] LLVM JIT on a Baremetal x86 Machine !!!

Dear All,

I have tested a few examples of LLVM-JIT Framework on Linux x86 Machine.
So generating functions on the fly and then executing them is OK on 
linux i.e. i686-pc-linux-gnu

My question is:

Can we use the LLVM-JIT on a baremetal x86 machine ? Actually my target 
is a virtual machine, and I need some dynamic code generation support. I 
intend to use LLVM-JIT (if possible) for this purpose.

Furthermore if it is possible, then how much effort would be required ? 
And where should I start looking for doing this kind of port.

Thanks for your help.

--
Hamayun
Grenoble, France.







More information about the llvm-dev mailing list