On Thu, 28 Oct 1999, Todd L. Miller wrote:
>       I had considered it while writing the console/consoled classes.
> If console is implemented in such a fashion that it can be passed around
> as a stream, everything just happens right.  The shell (or init, etc) sets
> up the necessary redirections to make System.in/out/err work.  If an
> application wants to use the console, they can use reflection to
> find out if System.in/out/err is actually a console.
> 
> [cut]
>
> details; you'd also need some way of getting static classes out of the
> classloader so that they can be properly adjusted.  (eg:
>       jls = forkClassLoader.getClass( "java.lang.System" );
>         jls.setOut( shellRedirect );
>       jls.setIn( shellRedirect );
>       jls.setErr( shellRedirect );)
> 
Right! But, I think that the problem persist (or probably I've not
well understood your description). I mean, let us suppose that I write a "Java
Shell" using my Linux/JDK. This shell will make use of System.in and System.out
and, inside its code, there will be a lot of "invokestatic" on System.in and
System.out. Now, let us suppose that I want to run this shell inside JOS,
without making any patches to the code (suppose that I have only the bytecode).
What's happen ? I mean, it is necessary that the "invokestatic" on System.in
and System.out work in the current console! Using classloader forking,
you are able to start another "System" class (which can be used from the
running application, if it is patched), but you need to change the
"invokestatic" into "invokevirtual" referring to the new "System" class. But my
idea, is to allowing the direct execution on JOS of a bytecode compiled (and
running) on a traditional JVM/JDK.

Are you agree ?

Bye,
        Corrado.
--
======================================================
Eng. Corrado Santoro - PhD Student

Unversity of Catania - Engineering Faculty
Institute of Computer Science and Telecommunications
Viale A. Doria, 6 - 95125 CATANIA (ITALY)

Tel: +39 095 7382365           Fax: +39 095 7382397

EMail: [EMAIL PROTECTED]
Personal Home Page:
            http://www.cdc.unict.it/~csanto

ARCA Mobile Agent Framework Home Page:
            http://netra.cdc.unict.it/ARCA
======================================================

_______________________________________________
Kernel maillist  -  [EMAIL PROTECTED]
http://jos.org/mailman/listinfo/kernel

Reply via email to