[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Caml-list] Ocaml on an embedded arm system (no linux)

On 23 Sep 2013, at 08:30, Goswin von Brederlow <goswin-v-b@xxxxxx> wrote:

> On Fri, Sep 20, 2013 at 09:13:26AM -0500, Dwight Schauer wrote:
>> Hi,
>> I'm looking at the feasibility of targetting a couple ARM processeors in a
>> similar manner to ocapic at its core.
>> ... 
>> The ARM processors I'm looking to target are:
>> STM32F407ZGT6 ARM Cortex-M4, 1MB Flash, 196KB RAM (Has floating point)
>> STM32F103RB ARM Cortex-M3, 128 KB Flash, 20K RAM (No floating point)
>> On both I'd like to be able to run bytecode both out of Flash and RAM.
>> (Primarily flash, but RAM for debugging).
>> Speed is on overly important as long as I can control when the garbage
>> collection is run (could be done in C in the multitasker?).
>> Dwight
> I'm looking at the same, but for seriously different specs.
> My interest would be to run ocaml apps on a Raspberry PI baremetal.
> Basically what openmirage does for the cloud (x86 VMs) but for
> Raspberry PI and similar dimensioned arm boards.

Mirage is just a collection of libraries that implement useful
kernel functionality (e.g. a TCP/IP stack), so you can quite easily
retarget it to bare metal rPis with a suitable mini operating system.

There are several such available (or just start from uBoot), and
then get a basic console working to get some output.  Dave Scott
has written a VNC library in OCaml that's available from his Github,
so you could work on some framebuffer rasterization after that.

The essential approach is to start in small steps: get serial console
working, then basic timer integration, and then hook in higher level
libraries from those.

(We're working on a Xen/ARM Mirage backend at the moment, but only
because we can't be bothered to write all the physical device drivers
that an rPi would need -- I'd be happy to merge in a "bare-metal"
ARM backend for the rPi as well).

> I'm familiar with the hardware side, how to boot, how to initialize
> the devices, how to get a picture to show on the HDMI and so on. What
> I lack is knowledge in creating a new runtime library for ocaml that
> runs directly on the hardware, or with just a verry thin hardware
> abstraction layer.

You don't really need a new runtime library; just a barebones C library.
Gabor Pali has a variant of Mirage that compiles into a FreeBSD kernel
module, for example, which operates in a similar "baremetal" environment.




Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.