Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Daniel Bünzli" <daniel.buenzli@erratique.ch>
To: OCaml List <caml-list@inria.fr>
Subject: [Caml-list] Boot the OCaml system on a bare raspberry pi
Date: Sat, 10 Oct 2015 19:19:05 +0100	[thread overview]
Message-ID: <AE5CDC128AAD4B2D99EA21C5F90437EF@erratique.ch> (raw)

Hello,   

I made a setup to boot a raspberry pi 2 directly into the OCaml system. The focus was to use the minimal amount of assembly and C to be able to call `caml_startup` and let the rest up to you — there's an example Rpi module for the boring bits if you are lazy. The overall boot code is very small for now but some more may be needed in the future to enable other hardware features; mmu, interrupts, multicore etc. or things I overlook — all this was done with a high degree of naïvety…

I hope this can make it an easy and reproducible starting point for others to have some bare metal programming fun in their preferred system language. This is available here:  

  http://erratique.ch/software/rpi-boot-ocaml

Follow the instructions in the linked README, they should lead you to build a kernel displaying the OCaml logo on the connected display and communicating boring dot poetry over the serial connection.  

The setup builds a bare ARMv7 OCaml cross compiler inside an opam switch by following the tracks of the opam-android project [1]. Now to scale and and make it a pleasant programming experience we "only" need multiarch support in opam switches and fix the package's build systems and merlin to understand these environments.

The project also has a minimal libc with only what's needed to run the OCaml system on a bare machine. It will be eventually forked away and distributed as a separate package (n.b. it seems to currently have a few quirks with the snprintf implementation I stole from somewhere else).

Best,

Daniel

P.S. Prior art: https://github.com/mrvn/ocaml-rpi

[1] https://github.com/whitequark/opam-android









                 reply	other threads:[~2015-10-10 18:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=AE5CDC128AAD4B2D99EA21C5F90437EF@erratique.ch \
    --to=daniel.buenzli@erratique.ch \
    --cc=caml-list@inria.fr \
    /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