caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jonathan Roewen <jonathan.roewen@gmail.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] The Bytecode Interpreter...
Date: Mon, 24 Oct 2005 19:48:00 +1300	[thread overview]
Message-ID: <ad8cfe7e0510232348r5e977c65kd83139f8fdd347a6@mail.gmail.com> (raw)
In-Reply-To: <20051024.151312.52118628.garrigue@math.nagoya-u.ac.jp>

Ok, so let me see if I can understand this all correctly. Let's assume
a linux-like environment.

When I compile a bytecode application, it uses the #! thing to execute
ocamlrun, with the app itself (I presume this is bytecode) following.
And this action is the exact same as typing: ocamlrun <bytecodeapp> at
the commandline instead of just ./<bytecodeapp>, right?

Then, the startup code in the bytecode interpreter (ocamlrun) tries to
load itself .. and if it turns out to be the interpreter itself, it
searches for the app as the command line argument, and opens that,
else opens itself (when invoked directly, not via ocamlrun), so that
it can access the bytecode in the file.

At this stage, we 1) don't need dlopen anywhere, and 2) only need
ocamlrun application somewhere for it to be executed.

If I were to use the toplevellib.cma, I'd then need dlopen; however,
the rest of the application flow is exactly the same, correct?

So, to get bytecode running on the bare metal, I'd just need to
implement some libc functionality for ocamlrun, possibly try tell
ocamlc to generate a different #! path to ocamlrun, and be able to
open the bytecode app file using fopen.

This is actually starting to sound doable ;-) Thank you all for your
valuable input to help me learn the intricacies of the ocaml bytecode
interpreter =)

Kindest Regards,

Jonathan Roewen


  reply	other threads:[~2005-10-24  6:48 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-21 10:01 Jonathan Roewen
2005-10-21 11:27 ` David MENTRE
2005-10-21 22:24   ` Jonathan Roewen
2005-10-21 23:49     ` Oliver Bandel
2005-10-22 21:33       ` Jonathan Roewen
2005-10-22  0:32     ` Jon Harrop
2005-10-22  0:39     ` Jacques Garrigue
2005-10-23  1:03   ` Jonathan Roewen
2005-10-23 10:21     ` Gerd Stolpmann
2005-10-24  5:38       ` Jonathan Roewen
2005-10-24  6:13         ` Jacques Garrigue
2005-10-24  6:48           ` Jonathan Roewen [this message]
2005-10-22  0:39 ` Jonathan Roewen
2005-10-26  0:33   ` Jonathan Roewen
2005-10-26  9:56 ` Jonathan Roewen
2005-10-26 10:20   ` Jonathan Roewen
2005-10-27 14:12   ` Damien Doligez
2005-10-28 21:41     ` Jonathan Roewen
2005-10-29 11:29       ` Gerd Stolpmann
2005-10-29 15:22         ` skaller
2005-10-30  0:41           ` Jonathan Roewen
2005-11-10 10:26         ` Damien Doligez

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=ad8cfe7e0510232348r5e977c65kd83139f8fdd347a6@mail.gmail.com \
    --to=jonathan.roewen@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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).