Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 4696 invoked from network); 8 Mar 2006 23:50:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Mar 2006 23:50:03 -0000 Received: (qmail 27138 invoked by uid 500); 8 Mar 2006 23:49:59 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 27083 invoked by uid 500); 8 Mar 2006 23:49:59 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 27069 invoked by uid 99); 8 Mar 2006 23:49:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 15:49:58 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of weldonwjw@gmail.com designates 64.233.162.205 as permitted sender) Received: from [64.233.162.205] (HELO zproxy.gmail.com) (64.233.162.205) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Mar 2006 15:49:57 -0800 Received: by zproxy.gmail.com with SMTP id 12so329275nzp for ; Wed, 08 Mar 2006 15:49:37 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=VIQYyBTybe/0IekPDku80RqasuCB3ZK8pEl7G93JhNTX+JcmdkHDWt3fru0wOs/u4wQTVoKQYpmmKjMwLAZ2Cy4OCz+amuesX3rjTvXm8hja9cZ/1A0pic/F9u+hFQGNlg521NMg3Hf0RJd/NLGWuNH0F+UoPZvDGap69xWoxYU= Received: by 10.35.99.14 with SMTP id b14mr429233pym; Wed, 08 Mar 2006 15:49:36 -0800 (PST) Received: by 10.35.58.1 with HTTP; Wed, 8 Mar 2006 15:49:36 -0800 (PST) Message-ID: <4dd1f3f00603081549o6d47717er39296c53aa662960@mail.gmail.com> Date: Wed, 8 Mar 2006 15:49:36 -0800 From: "Weldon Washburn" To: harmony-dev@incubator.apache.org Subject: [jchevm] Harmony Class Lib does "Hello World" on a GNU Classpath JVM MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Archie, I can now run the below multithread Hello.java on JCHEVM using Apache Harmony Class Library. The output toggles between clumps of "Hello World" and clumps of "*" as WindowsXP schedules the two application threads. This is behavior I would expect. I use System.out.write() because System.out.println() does not work yet. A summary follows: Mods to JCHEVM to get it to work 1) I was not able to find the _JC_LIB_ENTRY that is intended for read/writing files. I gave up and "borrowed" JCNI_java_lang_VMThread_nativeSetPriority(). Instead of actually changing thread priority, it now does a "fprintf(stdout, "%s", &priority); fflush(stdout);" Perhaps you can tell me what native method I should be using. 2) I commented out some stuff in bootstrap.c that was dragging in specific gnu classpath *.class files like "Lgnu/classpath/Pointer;"=20 We should discuss the best solution for this item. Harmony Class Lib that were modified to get it to work: Runtime.java -- expected "wrapper" code. e.g., add VMRuntime.exit() to Runtime.exit() Method.java, Field.java, Constructor.java -- minor mods System.java -- added VMSystem.setOut, setErr... etc ThreadGroup.java -- wrappers Class.java -- wrappers Object.java -- wrappers String.java -- implemented a very simple intern() Thread.java -- added a bunch of fields that JCHEVM accesses, added code to start() to create ThreadGroup.root if it does not already exist Throwable.java -- wrappers ClassLoader.java -- commented out "abstract" keyword on class definition (too lazy to create a sub-class), added fields that JCHEVM accesses, added code getSystemClassLoader to actually create an object and stuff it in systemClassLoader if it does not already exist. added a bunch of wrapper code. OSMemory -- hacked out a bunch of stuff that was in the way OSFileSystem -- add an ugly hack in writeImpl() to revector chars to Thread.setPriority() One last item. I don't know which SVN repository to place this work in. Any suggestions? Thanks Weldon ########################## class Hello extends Thread { public static void main(String args[]) { byte [] ba =3D new byte[64]; ba [0] =3D 'H'; ba [1] =3D 'e'; ba [2] =3D 'l'; ba [3] =3D 'l'; ba [4] = =3D 'o'; ba [5] =3D ' '; ba [6] =3D 'W'; ba [7] =3D 'o'; ba [8] =3D 'r'; ba [9] = =3D 'l'; ba[10] =3D 'd'; ba[11] =3D ' '; Thread tr =3D new Hello(); tr.start();=09 while (true) { for (int qq =3D 0; qq < 12; qq++) { System.out.write(ba[qq]); } } } public void run() { while(true) { System.out.write('*'); } } } -- Weldon Washburn Intel Middleware Products Division