From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 196B77EE49 for ; Mon, 23 Sep 2013 23:10:21 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=pra; client-ip=89.16.177.154; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=mailfrom; client-ip=89.16.177.154; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@dark.recoil.org) identity=helo; client-ip=89.16.177.154; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="postmaster@dark.recoil.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnkJAHytQFJZELGadGdsb2JhbABZsUKTeIE5DgEMFQg8giUBAQQBOj8FCwsYLlcGE4dzAwkKsiIiiVWPZQeDHoEAA5d8lTcg X-IPAS-Result: AnkJAHytQFJZELGadGdsb2JhbABZsUKTeIE5DgEMFQg8giUBAQQBOj8FCwsYLlcGE4dzAwkKsiIiiVWPZQeDHoEAA5d8lTcg X-IronPort-AV: E=Sophos;i="4.90,965,1371074400"; d="scan'208";a="27825361" Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) ([89.16.177.154]) by mail3-smtp-sop.national.inria.fr with SMTP; 23 Sep 2013 23:10:20 +0200 Received: (qmail 8304 invoked by uid 634); 23 Sep 2013 21:10:18 -0000 X-Spam-Level: * X-Spam-Check-By: dark.recoil.org Received: from 209-117-69-2.ptr.hilton.com (HELO [172.28.175.222]) (209.117.69.2) (smtp-auth username remote@recoil.org, mechanism cram-md5) by dark.recoil.org (qpsmtpd/0.84) with ESMTPA; Mon, 23 Sep 2013 22:10:18 +0100 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.0 \(1811\)) From: Anil Madhavapeddy In-Reply-To: <20130923123029.GA25427@frosties> Date: Mon, 23 Sep 2013 17:10:12 -0400 Cc: Ocaml Mailing List , "cl-mirage@lists.cam.ac.uk List" Content-Transfer-Encoding: 7bit Message-Id: <24C4E9C9-EE7B-4D20-9F89-61EDC5BD2F88@recoil.org> References: <20130923123029.GA25427@frosties> To: Goswin von Brederlow X-Mailer: Apple Mail (2.1811) X-Virus-Checked: Checked by ClamAV on dark.recoil.org Subject: Re: [Caml-list] Ocaml on an embedded arm system (no linux) On 23 Sep 2013, at 08:30, Goswin von Brederlow 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