caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jonathan Roewen <jonathan.roewen@gmail.com>
To: Richard Jones <rich@annexia.org>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] enumerations & ioctls
Date: Fri, 1 Jul 2005 15:18:27 +1200	[thread overview]
Message-ID: <ad8cfe7e05063020182cf2a41b@mail.gmail.com> (raw)
In-Reply-To: <20050630130647.GA27372@furbychan.cocan.org>

> A bigger worry is how this is all going to get linked together.  Do
> you link your device drivers, OS and programs together into a static
> binary?  Does the ioctl call cross over a memory/program boundary?  Do
> you want to add variants later, after the programs have been compiled,
> or when you load new device drivers?

That's a good point. I was thinking of either using a) Asmdynlink
module (not sure how it completely works yet), or b) hacking the
bytecode interpreter into the kernel (or trying that old JIT code).

There's no memory bounds (basically, everything shall run in the
kernel address space). Things I know I need to consider is a)
preventing loaded code from calling functions in certain kernel
interfaces, and b) verifying that loaded code hasn't been modified in
any way, and c) there are no calls to ocaml external functions.

I think I would want to load variants with the device driver.

The model I'd imagine is something like:

type 'a character_device = {
  read:unit -> char;
  write: char -> unit;
  ioctl: 'a -> unit;
  controls: 'a;
}

The problem I have is I don't know how I could have different types
for 'a, and stick them all into a data structure. This is why I
thought polymorphic variants could fit the bill (though the
documentation on them is a bit complex to understand).

Jonathan


      reply	other threads:[~2005-07-01  3:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-30 11:14 Jonathan Roewen
2005-06-30 13:06 ` Richard Jones
2005-07-01  3:18   ` Jonathan Roewen [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=ad8cfe7e05063020182cf2a41b@mail.gmail.com \
    --to=jonathan.roewen@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=rich@annexia.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).