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 5AB527F7AF for ; Sat, 10 Oct 2015 20:19:10 +0200 (CEST) IronPort-PHdr: 9a23:86ZarBILS9+zWa4nW9mcpTZWNBhigK39O0sv0rFitYgUIv7xwZ3uMQTl6Ol3ixeRBMOAu64C1Lud6vq9EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35jxiLH5oseOKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ6jiR6WaiCG439UdmQNjlIcCAHA6FT+X4ztmir8rOt0nieAa57YV7cxDBir6aZmTCjCHCEVMz9xpG3ejM19iORRvR+ntRh+64POeoiJNeNjc+XWfYVJFiJ6Qs9NWnkZUcuHZIwVAr9EZL4Aog== Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=daniel.buenzli@erratique.ch; spf=None smtp.mailfrom=daniel.buenzli@erratique.ch; spf=None smtp.helo=postmaster@smtp.webfaction.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=pra; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of daniel.buenzli@erratique.ch) identity=mailfrom; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="daniel.buenzli@erratique.ch"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@smtp.webfaction.com) identity=helo; client-ip=74.55.86.74; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="daniel.buenzli@erratique.ch"; x-sender="postmaster@smtp.webfaction.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CYAAAxVhlWnEpWN0peg3q+WAENgVohgnKCCoJZFAEBAQEBAQEBEAEBAQEBCAsJCSEugh+CMYELAiYCSRYbiCYECZ9rj3GUEoEijT2FDzGBFAWWE3qEH4ohhmMQknAfAQGCGAFQgVyIWgEBAQ X-IPAS-Result: A0CYAAAxVhlWnEpWN0peg3q+WAENgVohgnKCCoJZFAEBAQEBAQEBEAEBAQEBCAsJCSEugh+CMYELAiYCSRYbiCYECZ9rj3GUEoEijT2FDzGBFAWWE3qEH4ohhmMQknAfAQGCGAFQgVyIWgEBAQ X-IronPort-AV: E=Sophos;i="5.17,664,1437429600"; d="scan'208";a="150167545" Received: from mail6.webfaction.com (HELO smtp.webfaction.com) ([74.55.86.74]) by mail3-smtp-sop.national.inria.fr with ESMTP; 10 Oct 2015 20:19:09 +0200 Received: from [192.168.0.2] (cpc16-cmbg14-2-0-cust300.5-4.cable.virginm.net [86.6.157.45]) by smtp.webfaction.com (Postfix) with ESMTP id 8692C2079224 for ; Sat, 10 Oct 2015 18:19:07 +0000 (UTC) Date: Sat, 10 Oct 2015 19:19:05 +0100 From: =?utf-8?Q?Daniel_B=C3=BCnzli?= To: OCaml List Message-ID: X-Mailer: sparrow 1.6.4 (build 1178) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: [Caml-list] Boot the OCaml system on a bare raspberry pi Hello,=20=20=20 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 =E2=80=94 there's an example Rpi m= odule for the boring bits if you are lazy. The overall boot code is very sm= all for now but some more may be needed in the future to enable other hardw= are features; mmu, interrupts, multicore etc. or things I overlook =E2=80= =94 all this was done with a high degree of na=C3=AFvety=E2=80=A6 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:=20=20 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 communicat= ing boring dot poetry over the serial connection.=20=20 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 underst= and these environments. The project also has a minimal libc with only what's needed to run the OCam= l system on a bare machine. It will be eventually forked away and distribut= ed 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