Google Groups Home
Help | Sign in
Message from discussion Bytecode object files structure
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Pierre-Etienne Meunier  
View profile
 More options Nov 13 2006, 6:41 am
Newsgroups: fa.caml
From: Pierre-Etienne Meunier <pierreetienne.meun...@ens-lyon.fr>
Date: Mon, 13 Nov 2006 11:41:53 UTC
Local: Mon, Nov 13 2006 6:41 am
Subject: Re: [Caml-list] Bytecode object files structure
Hello,

I'd like to write an assembler, to be able to understand how the vm really
works. I've to work on this for a school project (a compiler, I want it to
output caml bytecode object files).

I've understood that the data part, after the code itself, was generated using
output_value (I didn't know this function before).  What I don't get now are
the cu_reloc, cu_primitives and cu_imports fields of the compilation_unit
type.

If you can help on this,
Thanks
P.E. Meunier

On Monday 13 November 2006 11:53, Xavier Clerc wrote:

> Hello,

> As I read a substancial part of the ocaml source code, I may help you
> understanding file formats.
> Could you be more precise about what you are particularly interested
> in :
>    - file type : bytecode file, cmo file, cmi file ?
>    - code or data section of these files ?

> May I also ask you what you are trying to do using these elements ?

> Cordially,

> Xavier Clerc

> Le 12 nov. 06 à 15:42, Pierre-Etienne Meunier a écrit :
> > Hi,

> > I'm trying to decrypt .cmo files produced by simple programs, such as
> > 1+1;;
> > or
> > print_string "string";;
> > or
> > List.length [1;2;3;4;5];;

> > According to the source of Ocaml, there's something called the
> > "cmo_magic_number", systematically written at the beginning of
> > all .cmo
> > files. Does it have a real function for executing the programs, or
> > is it just
> > a way to make sure the file contains ocaml bytecode ?

> > Then, there's the address of what seems to be the last bytecode
> > instruction.
> > Then, the bytecode instructions, as documented in opcodes.ml.

> > After that, I can't understand anything : there vaguely seems to be
> > some
> > information related to linking or so... What is the precise
> > structure of this
> > part ? Is there some kind of a bytecode assembler ?

> > Thanks,
> > P.E. Meunier (pierreetienne.meun...@ens-lyon.fr)

> > _______________________________________________
> > Caml-list mailing list. Subscription management:
> > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> > Archives: http://caml.inria.fr
> > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> > Bug reports: http://caml.inria.fr/bin/caml-bugs

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google