caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David MENTRE <dmentre@linux-france.org>
To: caml-list@inria.fr
Cc: Thomas Petazzoni <thomas.petazzoni@enix.org>, david.decotigny@free.fr
Subject: [hack] OCaml can be used to write kernel modules into KOS
Date: Sun, 16 Jan 2005 15:11:36 +0100	[thread overview]
Message-ID: <877jmdfopz.fsf@linux-france.org> (raw)

Hello,

For the fun, I have ported the asmrun/ directory of OCaml to a small
operating system, KOS (http://kos.enix.org/). This allows to run native
mode OCaml programs (i386 arch) as KOS kernel modules.

The binding is rather limited, it is more a quick & dirty hack:

 - no I/O;

 - no threads;

 - no access to KOS ressources;

 - no floats;

 - no int64;

 - due to lack of realloc, I have hacked the GC code and I'm pretty sure
   I have overlooked details;

 - other missing things I have forgotten...

Most of those missing functionalities could be implemented, either by
stealing code from glibc/gcc or by writing emulation code.  However I do
not plan to do that job. OCaml badly supports concurrent accesses due to
locking in GC (if I have understood correctly) so it can be of dubtious
use in an operating system. Note however that, as written, this code
could be used to write several /independent/ modules written in ocaml.

I have put modified source code at:
 http://www.linux-france.org/~dmentre/kos/module_ocaml_asmrun.tar.gz
(asmrun license: LGPL)

This tarball includes a diff that documents changes I've made on
original ocaml source code. It could be of some use if somebody wants to
do the same hack in another operating system.

Yours,
david
-- 
pub  1024D/A3AD7A2A 2004-10-03 David MENTRE <dmentre@linux-france.org>
 5996 CC46 4612 9CA4 3562  D7AC 6C67 9E96 A3AD 7A2A


                 reply	other threads:[~2005-01-16 14:11 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=877jmdfopz.fsf@linux-france.org \
    --to=dmentre@linux-france.org \
    --cc=caml-list@inria.fr \
    --cc=david.decotigny@free.fr \
    --cc=thomas.petazzoni@enix.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;
as well as URLs for NNTP newsgroup(s).