caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Porting to EPOC
@ 2001-05-29  9:07 Tore Lund
  2001-05-29 12:00 ` Xavier Leroy
  0 siblings, 1 reply; 5+ messages in thread
From: Tore Lund @ 2001-05-29  9:07 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2001-05-29 15:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-29  9:07 [Caml-list] Porting to EPOC Tore Lund
2001-05-29 12:00 ` Xavier Leroy
2001-05-29 14:10   ` Tore Lund
2001-05-29 14:22     ` Alain Frisch
2001-05-29 14:59       ` Tore Lund

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).