Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: Ocaml Mailing List <caml-list@inria.fr>,
	"cl-mirage@lists.cam.ac.uk List" <cl-mirage@lists.cam.ac.uk>
Subject: Re: [Caml-list] Ocaml on an embedded arm system (no linux)
Date: Mon, 23 Sep 2013 17:10:12 -0400	[thread overview]
Message-ID: <24C4E9C9-EE7B-4D20-9F89-61EDC5BD2F88@recoil.org> (raw)
In-Reply-To: <20130923123029.GA25427@frosties>

On 23 Sep 2013, at 08:30, Goswin von Brederlow <goswin-v-b@web.de> 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.

-anil

  reply	other threads:[~2013-09-23 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-20 14:13 Dwight Schauer
2013-09-20 15:54 ` Gerd Stolpmann
2013-09-20 16:19   ` Dwight Schauer
2013-09-20 16:46     ` Gerd Stolpmann
2013-09-21 12:08     ` Jonathan Kimmitt
2013-09-23 12:30 ` Goswin von Brederlow
2013-09-23 21:10   ` Anil Madhavapeddy [this message]
2013-09-30 13:48     ` Goswin von Brederlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24C4E9C9-EE7B-4D20-9F89-61EDC5BD2F88@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=cl-mirage@lists.cam.ac.uk \
    --cc=goswin-v-b@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox