public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* GCJ Porting for RTEMS Status Report
@ 2011-06-12 17:15 Jie Liu
  2011-06-13  9:14 ` Andrew Haley
  0 siblings, 1 reply; 3+ messages in thread
From: Jie Liu @ 2011-06-12 17:15 UTC (permalink / raw)
  To: RTEMS Mailing List, java; +Cc: Joel Sherrill

Hi,

First, let us look at an HelloWorld example with exception and thread,
the HelloWorld.java is:
public class HelloWorld{
   public static void main(String args[]){
      ThreadTest t=new ThreadTest();
      Thread t1=new Thread(t);
      System.out.println("GCJ For RTEMS in Java!---in HelloWorld.java");
      try{
        System.out.println(args[100]+"for raise an exception");
      }catch(Exception e){
        System.out.println(e.getMessage()+"---in an Exception");
      }
      t1.start();
    }
}
class ThreadTest extends Thread{
  public void run(){
    System.out.println("ThreadTest from HelloWorld!---in a new thread");
  }
}

Compiling it using cross gcj and linking with rtems system, we get a
HelloWorld.exe. And then, run it on qemu as:
qemu -m 512 -boot a -cpu 486 -fda /home/rtems/qemu/pc386_fda -hda
fat:/home/rtems/qemu/hd -monitor null -nographic -serial stdio
--no-reboot

The output is:
Initialized console on port COM1 9600-8-N-1
GCJ For RTEMS in Java!---in HelloWorld.java
100---in an Exception
ThreadTest from HelloWorld!---in a new thread
EXECUTIVE SHUTDOWN! Any key to reboot...

Is this interesting?

In the last few months, I have
--Porting bdwgc to RTEMS/I386
--Use RTEMS’s pthread for GCJ Porting
--Fix many many problems in compiling, linking and running
--Have a cross gdb environment for source code level debug
and next step I will
-- Start focusing on running the testsuite and fix encountered problem
-- Move to other architectures and repeat this progress
--Submitting patches to related community

If you are interested in, welcome! Do not hesitate to contact me. :)

Best Regards,
Jie

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

* Re: GCJ Porting for RTEMS Status Report
  2011-06-12 17:15 GCJ Porting for RTEMS Status Report Jie Liu
@ 2011-06-13  9:14 ` Andrew Haley
  2011-06-13 22:12   ` Franklin Chou
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Haley @ 2011-06-13  9:14 UTC (permalink / raw)
  To: java

On 12/06/11 18:15, Jie Liu wrote:
> Hi,
> 
> First, let us look at an HelloWorld example with exception and thread,
> the HelloWorld.java is:
> public class HelloWorld{
>    public static void main(String args[]){
>       ThreadTest t=new ThreadTest();
>       Thread t1=new Thread(t);
>       System.out.println("GCJ For RTEMS in Java!---in HelloWorld.java");
>       try{
>         System.out.println(args[100]+"for raise an exception");
>       }catch(Exception e){
>         System.out.println(e.getMessage()+"---in an Exception");
>       }
>       t1.start();
>     }
> }
> class ThreadTest extends Thread{
>   public void run(){
>     System.out.println("ThreadTest from HelloWorld!---in a new thread");
>   }
> }
> 
> Compiling it using cross gcj and linking with rtems system, we get a
> HelloWorld.exe. And then, run it on qemu as:
> qemu -m 512 -boot a -cpu 486 -fda /home/rtems/qemu/pc386_fda -hda
> fat:/home/rtems/qemu/hd -monitor null -nographic -serial stdio
> --no-reboot
> 
> The output is:
> Initialized console on port COM1 9600-8-N-1
> GCJ For RTEMS in Java!---in HelloWorld.java
> 100---in an Exception
> ThreadTest from HelloWorld!---in a new thread
> EXECUTIVE SHUTDOWN! Any key to reboot...
> 
> Is this interesting?
> 
> In the last few months, I have
> --Porting bdwgc to RTEMS/I386
> --Use RTEMSÂ’s pthread for GCJ Porting
> --Fix many many problems in compiling, linking and running
> --Have a cross gdb environment for source code level debug
> and next step I will
> -- Start focusing on running the testsuite and fix encountered problem
> -- Move to other architectures and repeat this progress
> --Submitting patches to related community
> 
> If you are interested in, welcome! Do not hesitate to contact me. :)

All good stuff.

Thanks,
Andrew.

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

* Re: GCJ Porting for RTEMS Status Report
  2011-06-13  9:14 ` Andrew Haley
@ 2011-06-13 22:12   ` Franklin Chou
  0 siblings, 0 replies; 3+ messages in thread
From: Franklin Chou @ 2011-06-13 22:12 UTC (permalink / raw)
  To: Andrew Haley; +Cc: java

Thank you for the quick reply but I don't think they are relevant to the 
question I am asking.

You see the code that you have provided compiles (using gcj) perfectly 
fine. But the code I am using contains String.split() method which the 
attached code does not have. The .split() is causing a runtime error 
where the program terminates with:

Exception in thread "main" java.lang.Error: Not implemented
       <<No stacktrace available>>

I understand that Andrew had a similar problem which he brought up in 
the 2005 post, but after reading it I still have no idea how to go about 
linking regexp to the jre. If anyone can shed some light on this 
particular issue. That'd be great. Also I'd love to help testing, giving 
bug reports etc. I do use linux both through Cygwin and through a 
dedicated box every day.

Franklin


On 6/13/2011 5:14 AM, Andrew Haley wrote:
> public class HelloWorld{
>>      public static void main(String args[]){
>>         ThreadTest t=new ThreadTest();
>>         Thread t1=new Thread(t);
>>         System.out.println("GCJ For RTEMS in Java!---in HelloWorld.java");
>>         try{
>>           System.out.println(args[100]+"for raise an exception");
>>         }catch(Exception e){
>>           System.out.println(e.getMessage()+"---in an Exception");
>>         }
>>         t1.start();
>>       }
>>  }
>>  class ThreadTest extends Thread{
>>     public void run(){
>>       System.out.println("ThreadTest from HelloWorld!---in a new thread");
>>     }
>>  }

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

end of thread, other threads:[~2011-06-13 22:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-12 17:15 GCJ Porting for RTEMS Status Report Jie Liu
2011-06-13  9:14 ` Andrew Haley
2011-06-13 22:12   ` Franklin Chou

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 read-only IMAP folder(s) and NNTP newsgroup(s).