Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Porting to EPOC
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Tore Lund <tl001@o...>
Subject: [Caml-list] Porting to EPOC
I am trying to port the OCaml runtime to EPOC.  If you don't know EPOC,
this is the operating system in recent Psion PDAs and a growing number
of mobile phones.  

Development for EPOC is normally done in a PC emulator using VC++.  Once
everything works you use a setup where GCC is called upon to produce
code for the target machine (which has an ARM processor).  Thus, porting
to EPOC actually means porting to two different platforms: emulator and
target.

So far I have compiled ocamlrun with an extra module of my own that
allows the program to be started from EPOC.  Once the program is
running, I want to call caml_main() with the name of a bytecode
executable.  What will hopefully happen then is that the bytecode file
will be loaded, initializations will be performed, and after that I will
be able to call some ML function each time the user presses a key.  This
ought to work somehow.

However, the ML code must necessarily call EPOC functions in order to
perform output and the like.  Suppose I have a function epocfunc() in my
startup EPOC module, how can I tell ocamlc that epocfunc() is a legal
function?  The systematic way to go about it is of course to port ocamlc
to EPOC as well and then do things by the book, but I had really hoped
to avoid this (especially since two ports are required).  And none of
the -custom, -make-runtime or -output-obj switches seem to address this
situation.

So, is there a way to make the Win32 version of ocamlc produce bytecode
that is machine-independent and that calls epocfunc()?  One thing that
might work is to make a C file with a dummy epocfunc(), put it in the
byterun directory and then recompile everything (for Win32).  That would
presumably make ocamlc accept epocfunc() as a primitive.  But this is
really a dirty trick, and I had hoped for a less messy way to do it.

I notice there is an undocumented compiler switch -use-prims <file>. 
Maybe this would solve my problem if I knew the format of <file>?

Grateful for any hint.
-- 
    Tore

-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr