Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Scott <scott.dj@gmail.com>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: Peter Zotov <whitequark@whitequark.org>, caml-list@inria.fr
Subject: Re: [Caml-list] Ocaml on RaspberryPi bare-metal crashes
Date: Mon, 4 Nov 2013 22:38:29 +0000	[thread overview]
Message-ID: <CAG_esB33D+-xLA1LWueRkdY379_4j0TM+MSmdCFNhKV7Y+LJRw@mail.gmail.com> (raw)
In-Reply-To: <20131104203803.GA1057@frosties>

[-- Attachment #1: Type: text/plain, Size: 1695 bytes --]

Hi,

On Mon, Nov 4, 2013 at 8:38 PM, Goswin von Brederlow <goswin-v-b@web.de>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

[-- Attachment #2: Type: text/html, Size: 3090 bytes --]

      reply	other threads:[~2013-11-04 22:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-04 13:10 Goswin von Brederlow
2013-11-04 13:41 ` Peter Zotov
2013-11-04 20:38   ` Goswin von Brederlow
2013-11-04 22:38     ` David Scott [this message]

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=CAG_esB33D+-xLA1LWueRkdY379_4j0TM+MSmdCFNhKV7Y+LJRw@mail.gmail.com \
    --to=scott.dj@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=goswin-v-b@web.de \
    --cc=whitequark@whitequark.org \
    /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