This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: Using mips2java to compile xyzmodem library to java
- From: Adam Megacz <adam at megacz dot com>
- To: Øyvind Harboe <oyvind dot harboe at zylin dot com>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 20 Nov 2003 03:46:21 -0800
- Subject: Re: Using mips2java to compile xyzmodem library to java
- Organization: Myself
- References: <1069230101.19547.24.camel@famine>
Øyvind Harboe <oyvind.harboe@zylin.com> writes:
> My eyes popped when I read about mips2java.
Hey thanks!
> Can I do this with mips2java?
If you have the C/C++ source code, it runs on POSIXy OSes, and doesn't
assume little endian, the answer is probably "yes".
> - I'm slightly familiar with newlib from my embedded experiences, but
> what interface exists between newlib and the underlying operating system
> and?
The MIPS SYSCALL instruction. We implement the SYSCALLs that newlib needs.
> - How do I create APIs to the generated code?
That's not too clean right now, but basically Java code can write to
arbitrary regions in the MIPS address space, and the MIPS code can
"pause" itself (return control to the Java caller). This is crude,
but enough to implement whatever functionality you need. See
xwt/src/org/xwt/translators/Freetype.java for an example. We're
working on something better.
> - compile a GCC MIPS toolchain w/newlib. Ouch.
Download XWT and type 'make JVM'. This will automatically download,
configure, and build all the appropriate software (cross-gcc, newlib,
etc). This works on Linux and Mac OS X. Untested on other build
platforms.
> - pass in command line arguments
Yep, the Java class has main(String[]) that passes the String[] as
argv/argc.
> - exposes an InputStream for stdout/stderr
Yep.
> - exposes an OutputStream for stdin
Yep.
> - some way of terminating the app
Hrm, never thought of that one. I don't think we give you a way to
kill the app; the app has to terminate itself. This feature could be
added, but it's not a high priority for us right now.
- a
--
"Education is not filling a bucket but lighting a fire." -- WB Yeats