From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA04202; Tue, 29 May 2001 11:23:27 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id LAA03920 for ; Tue, 29 May 2001 11:23:26 +0200 (MET DST) Received: from mail48.fg.online.no ([148.122.161.48]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f4T9NPv24544 for ; Tue, 29 May 2001 11:23:25 +0200 (MET DST) Received: from online.no (ti34a08-0126.dialup.online.no [148.122.154.126]) by mail48.fg.online.no (8.9.3/8.9.3) with ESMTP id LAA12325 for ; Tue, 29 May 2001 11:23:23 +0200 (MET DST) Message-ID: <3B1366D0.8FAD3FEC@online.no> Date: Tue, 29 May 2001 11:07:28 +0200 From: Tore Lund X-Mailer: Mozilla 4.72 [en] (Windows NT 5.0; U) X-Accept-Language: en,pdf MIME-Version: 1.0 To: caml-list@pauillac.inria.fr Subject: [Caml-list] Porting to EPOC Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 . Maybe this would solve my problem if I knew the format of ? Grateful for any hint. -- Tore ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr