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 702F17EE25 for ; Mon, 4 Nov 2013 23:38:32 +0100 (CET) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of scott.dj@gmail.com) identity=pra; client-ip=209.85.192.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="scott.dj@gmail.com"; x-sender="scott.dj@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of scott.dj@gmail.com designates 209.85.192.176 as permitted sender) identity=mailfrom; client-ip=209.85.192.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="scott.dj@gmail.com"; x-sender="scott.dj@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-pd0-f176.google.com) identity=helo; client-ip=209.85.192.176; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="scott.dj@gmail.com"; x-sender="postmaster@mail-pd0-f176.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkEEAG4geFLRVcCwlWdsb2JhbABZgz9ThEmBILdxgWWBIggWDgEBAQEHDQkJEiqCJQEBAQMBAQI9ARsdAQMBCwYFBAc7IgEFDAEFARwGE4duAQMJBg2gBIxXgwmEHgoZJw0VT4kBAQEEDI9IBAeELgOVPYJNkB0YKYRRPA X-IPAS-Result: AkEEAG4geFLRVcCwlWdsb2JhbABZgz9ThEmBILdxgWWBIggWDgEBAQEHDQkJEiqCJQEBAQMBAQI9ARsdAQMBCwYFBAc7IgEFDAEFARwGE4duAQMJBg2gBIxXgwmEHgoZJw0VT4kBAQEEDI9IBAeELgOVPYJNkB0YKYRRPA X-IronPort-AV: E=Sophos;i="4.93,635,1378850400"; d="scan'208";a="33731167" Received: from mail-pd0-f176.google.com ([209.85.192.176]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 04 Nov 2013 23:38:31 +0100 Received: by mail-pd0-f176.google.com with SMTP id g10so7260688pdj.21 for ; Mon, 04 Nov 2013 14:38:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=n6ZDhRalV0HWs2jsJemJvZ0U0ZVxOjx0/1VSYqhctTk=; b=b9zQ6ylTZYb1nduFgXWmHwoJhH+OQ7rHc932zcuAtVrDH9/7ZEPLB1oFfjLMqIopO5 H9k9fSEet1GLZ391hK7t7aS7N1H/kQJbED+Zhi3RluST1lbAZc7z4hLAzN+jo/PuakDd fFicDGYoF2bIZVbFygQIDX9kA/g4WApCwkeZaXfdmMmgPl7oivuN6iVQVWgTW1hV5X0D +qmBVW0+qGucAx2Xpp0W80tcTYU+PcpuldgmM3NMloS7hPO2uNHiRcHEN+NPg/XTCaqB Kr4NmQ3tztAvdqiQwOENQaRt12hWgVkeOY7D5UkOZ3OjO9Hg4yvDYTcEtuHpYvQKBwzb oNug== MIME-Version: 1.0 X-Received: by 10.68.203.34 with SMTP id kn2mr19632140pbc.82.1383604709646; Mon, 04 Nov 2013 14:38:29 -0800 (PST) Received: by 10.70.56.36 with HTTP; Mon, 4 Nov 2013 14:38:29 -0800 (PST) In-Reply-To: <20131104203803.GA1057@frosties> References: <20131104131015.GA27957@frosties> <393565311ce19d3358ed3799df56bcda@whitequark.org> <20131104203803.GA1057@frosties> Date: Mon, 4 Nov 2013 22:38:29 +0000 Message-ID: From: David Scott To: Goswin von Brederlow Cc: Peter Zotov , caml-list@inria.fr Content-Type: multipart/alternative; boundary=047d7b10c8513a698904ea619302 Subject: Re: [Caml-list] Ocaml on RaspberryPi bare-metal crashes --047d7b10c8513a698904ea619302 Content-Type: text/plain; charset=ISO-8859-1 Hi, On Mon, Nov 4, 2013 at 8:38 PM, Goswin von Brederlow wrote: ... > 1) doing some kind of output (print_string or Printf.printf) uses > floating point stuff. I didn't have the FPU enabled yet so that threw > and undefined exception. Not sure if the float is used somewhere in > the IO layer or if that triggers something in the GC that uses floats. > Might not even be IO related at all but caused by allocating a heap > value. The simple tests that succeeded before all only used stack. > FWIW the port of mirage to kFreeBSD (where the ocaml program runs as a kernel module) hit a similar issue with floats. The workaround was to replace the floats with a fixed-point implementation: https://lists.cam.ac.uk/pipermail/cl-mirage/2012-August/msg00012.html https://lists.cam.ac.uk/pipermail/cl-mirage/2013-September/msg00013.html > 2) malloc() needs to return 8 byte aligned blocks or storing 64bit > values fails. Doing output initializes the stdout channel, which calls > lseek64 and stores the resultint int64_t. > > > So now I have ocaml running barebone on my RaspberryPi in a verry > minimal way. > Nice! > ToDo: > - LED module (turn on/off the OK LED) > - Framebuffer / Graphics modules > - Timer module > - implement free() > - Threads > - USB module > + keyboard > + mouse > + ethernet > - tcp/ip stack > I'm not sure how difficult USB will be, but once packets start flowing over the network interface you should be able to use the mirage TCP/IP stack. > - audio > - GPIO module > > If anyone is interested I can upload what I have so far to github. But > beware it is verry much a WIP. > I'd be interested in checking it out! :-) Cheers, Dave --047d7b10c8513a698904ea619302 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi,

On Mon, Nov 4, 2013 at 8:38 PM, Goswin von Brederlow &= lt;goswin-v-b@web.de= > wrote:
...=A0
1) doing some kind of output (print_strin= g or Printf.printf) uses
floating point stuff. I didn't have the FPU enabled yet so that threw and undefined exception. Not sure if the float is used somewhere in
the IO layer or if that triggers something in the GC that uses floats.
Might not even be IO related at all but caused by allocating a heap
value. The simple tests that succeeded before all only used stack.

FWIW the port of mirage to kFreeBSD (where the = ocaml program runs as a kernel module) hit a similar issue with floats. The= workaround was to replace the floats with a fixed-point implementation:





2) malloc() needs to return 8 byte aligned blocks or storing 64bit
values fails. Doing output initializes the stdout channel, which calls
lseek64 and stores the resultint int64_t.


So now I have ocaml running barebone on my RaspberryPi in a verry
minimal way.

Nice!
=A0
<= blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-l= eft-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;pa= dding-left:1ex"> ToDo:
- LED module (turn on/off the OK LED)
- Framebuffer / Graphics modules
- Timer module
- implement free()
- Threads
- USB module
=A0 + keyboard
=A0 + mouse
=A0 + ethernet
- tcp/ip stack

I'm not sure how dif= ficult USB will be, but once packets start flowing over the network interfa= ce you should be able to use the mirage TCP/IP stack.
=A0
- audio
- GPIO module

If anyone is interested I can upload what I have so far to github. But
beware it is verry much a WIP.

I'd = be interested in checking it out! :-)

Cheers,
Dave
--047d7b10c8513a698904ea619302--