caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Boot the OCaml system on a bare raspberry pi
@ 2015-10-10 18:19 Daniel Bünzli
  0 siblings, 0 replies; only message in thread
From: Daniel Bünzli @ 2015-10-10 18:19 UTC (permalink / raw)
  To: OCaml List

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









^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-10 18:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-10 18:19 [Caml-list] Boot the OCaml system on a bare raspberry pi Daniel Bünzli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).