This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Using mips2java to compile xyzmodem library to java


Ø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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]