[kaffe] Kaffe-1.1.7's New Port on bsp15/linux-2.6

Rakesh Dhiman rakeshatminix at gmail.com
Fri Sep 8 23:50:00 PDT 2006


Hi all,

I am trying to port kaffe-1.1.7 on bsp15 running customized linux 2.6. The
following are things which i have done:

1) Added entries to kaffe-1.1.7/config/config.alias as
    bsp15*)        Khost_cpu=bsp15 ;; inside the case "$Khost_cpu"
2) Added corresponding entries to all config.sub's
3) Created folders kaffe-1.1.7/config/bsp15 and kaffe-1.1.7
/config/bsp15/linux
4) Added files
               -  kaffe-1.1.7/config/bsp15/ atomic.h
               -  kaffe-1.1.7/config/bsp15/ common.h
               -  kaffe-1.1.7/config/bsp15/ threads.h
               -  kaffe-1.1.7/ config/bsp15/sysdepCallMethod.h
               -  kaffe-1.1.7/ config/bsp15/linux/config.frag
               -  kaffe-1.1.7/ config/bsp15/linux/md.c
               -  kaffe-1.1.7/ config/bsp15/linux/md.h
    The files are pasted below for reference. I have written my own
primitive sysdepCallMethod in C (Since i do not have support as far as
documentation to bsp15 architecture is concerned), which is running fine as
I have checked it thoroughly. I have not changed anything else in the
kaffe's code/config structure.
5) I have configured the kaffe with follwing configuration script:
               ./configure --host=bsp15-linux --disable-gtk-peer
--without-alsa --without-esd --disable-direct-threading --with-staticlib
--with-engine=intrp
6) Cross compiled (make) with my bsp15 based tool chain (by setting CC, AR,
NM and CXX).
7) Installed.

My problem:
1) It runs and loads classes upto (when run using -v option) Loading
java/lang/IllegalThreadStateException.class and then stucks there without
printing anything and without creating any exception ( dump.txt is pasted
below).

when i trace it with printf's, then it reveals that the system goes from
main to JNI_CreateJavaVM ( kaffe-1.1.7/kaffe/kaffevm/jni/jni-base.c)
to initialiseKaffe
and returns safe from initialiseKaffe. After returning initialiseKaffe, it
never goes past
reftable = (jnirefs *)gc_malloc(sizeof(jnirefs) + sizeof(jref) *
DEFAULT_JNIREFS_NUMBER,
             KGC_ALLOC_STATIC_THREADDATA); (inside
kaffe-1.1.7/kaffe/kaffevm/jni/jni-
base.c just after returning from initialiseKaffe )
I suspect something is wrong with my architecture/platform dependent
settings, such as SP_OFFSET etc (My bsp15/linux system doesn't run
kaffe-1.1.7/developers/sp_offset.c) to confirm it.

What may be the wrong? I am pasting my arch/platform dependent files and
output file (dump.txt) below..

Thanks and Regards,

Rakesh Kumar Dhiman


kaffe-1.1.7/ config/bsp15/atomic.h
 #define atomic_compare_and_exchange _val_acq(A, N, O) \
({                        \
    typeof(*A) ret = 0;                \
    KTHREAD(suspendall)();            \
                        \
    ret = *(A) ;                \
    if (ret == (O)) {                \
    *(A) = (N);                \
    }                        \
    KTHREAD(unsuspendall)();            \
    ret;                    \
})

#define COMPARE_AND_EXCHANGE(A,O,N)
(atomic_compare_and_exchange_val_acq((A), (N), (O)) == (O))

kaffe-1.1.7/ config/bsp15/common.h
/*
 * bsp15/common.h
 * Common bsp15 configuration information.
 */

#ifndef __bsp15_common_h
#define __bsp15_common_h

#include "generic/gentypes.h"
#include "gtypes.h"

/* The bsp15 never aligns to more than a 4 byte boundary. */
#define    ALIGNMENT_OF_SIZE(S)    ((S) < 4 ? (S) : 4)

#include "gccbuiltin.h"
#include "katomic.h"
#include "atomic.h"
#include "generic/comparexch.h"
#endif

kaffe-1.1.7/ config/bsp15/threads.h
#ifndef __bsp15_threads_h
#define __bsp15_threads_h
#define    THREADSTACKSIZE        (64 * 1024)
#define    SP_OFFSET        4
#endif

kaffe-1.1.7/ config/bsp15/linux/config.frag

# bsp15/Linux configuration

CFLAGS="$CFLAGS -fsigned-char -fno-omit-frame-pointer"
# if we use cross environment, following values may not be detected.
if [ "$cross_compiling" = yes ]; then
#  ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working='yes'}
  ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped='yes'}
#  ac_cv_func_utime_null=${ac_cv_func_utime_null='yes'}
  ac_cv_c_char_unsigned=${ac_cv_c_char_unsigned='no'}
fi

kaffe-1.1.7/ config/bsp15/linux/md.c
#include " config.h"
#include <malloc.h>

void
init_md(void)
{
#if defined(M_MMAP_MAX) && defined(HAVE_MALLOPT)
    mallopt(M_MMAP_MAX, 0);
#endif
}

kaffe-1.1.7/ config/bsp15/linux/md.h
#ifndef __bsp15_linux_md_h
#define __bsp15_linux_md_h
#include "bsp15/sysdepCallMethod.h"
#include "bsp15/threads.h"
#include "bsp15/common.h"
#define SP_OFFSET 4
#define    SIGNAL_ARGS(sig, sc) int sig, struct sigcontext sc
#endif

Output file (dump.txt)
bsp15 # kaffe -v HelloWorld
HugeTLB file system not mounted: No such device

mainThreadStackSize is 1048576 /* This is coming due to my printf's in file
value for pagesize is 16384     * kaffe-1.1.7
/kaffe/kaffevm/systems/unix-pthreads/signal.c
value for jtid is 2147482664    * from inside "detectStackBoundaries"
function under
value for jtid is 2147482664    * "#elif defined(SA_ONSTACK) &&
defined(HAVE_SIGALTSTACK)
guessPointer is 2147467264      *  &&
!defined(KAFFEMD_BUGGY_STACK_OVERFLOW)"
guessPointer is 2147467264

I am in else                    * This comes from same function's #else
under while(1) loop,
                                * just before "guessPointer += pageSize;"
statement
                                * which means my stack grows down. */




Illegal read access to 0x80000000 from user PC 0x242adc; psw=0xa00f0
TID= 575 (kaffe-bin); ASID= 81
TLBS:
Asid Virtual  --> Physical Size Flags                DTS
   0 80000000 --> 00000000 256M  V  S  R          UC SDRAM
  81 002f4000 --> 02c48000  16K  V     R AA       UC SDRAM
  81 0038c000 --> 0261c000  16K  V     R AA       UC SDRAM
  81 00310000 --> 02bcc000  16K  V     R AA       UC SDRAM
  81 00388000 --> 02618000  16K  V     R AA       UC SDRAM
  81 00490000 --> 026fc000  16K  V     R AA       UC SDRAM
  81 00240000 --> 02d28000  16K  V     R AA       UC SDRAM
  81 002f0000 --> 02bec000  16K  V     R AA       UC SDRAM
  81 0031c000 --> 030a0000  16K  V     R AA       UC SDRAM
  81 00358000 --> 02698000  16K  V     R AA       UC SDRAM
  81 00398000 --> 02858000  16K  V     R AA       UC SDRAM
  81 002e8000 --> 02c2c000  16K  V     R AA       UC SDRAM
  81 00360000 --> 03f00000  16K  V     R AA       UC SDRAM
  81 00314000 --> 02b80000  16K  V     R AA       UC SDRAM
  81 002e4000 --> 02c28000  16K  V     R AA       UC SDRAM
  81 0030c000 --> 02a44000  16K  V     R AA       UC SDRAM
Asid Virtual  --> Physical Size Flags                DTS
   0 80000000 --> 00000000 256M  V  S  R       KW  C SDRAM
   0 ffc00000 --> ffc00000   4M  V  S  R       KW UC   PIO
  81 0052c000 --> 021e0000  16K  V     R AA AW KW  C SDRAM
  81 90068000 --> 10000000  16K  V  S  R       KW UC  PCIA
  81 00530000 --> 02674000  16K  V     R AA AW KW  C SDRAM
  81 00518000 --> 022dc000  16K  V     R AA AW KW  C SDRAM
  81 2aaa8000 --> 0275c000  16K  V     R AA AW KW  C SDRAM
  81 0051c000 --> 028c4000  16K  V     R AA AW KW  C SDRAM
  81 00534000 --> 03410000  16K  V     R AA AW KW  C SDRAM
  81 004b0000 --> 02860000  16K  V     R AA        C SDRAM
  81 90070000 --> 10000000  16K  V  S  R       KW UC  PCIA
  81 9006c000 --> 10000000  16K  V  S  R       KW UC  PCIA
  81 00538000 --> 04d3c000  16K  V     R AA AW KW  C SDRAM
  81 00514000 --> 02678000  16K  V     R AA AW KW  C SDRAM
  81 00528000 --> 02670000  16K  V     R AA AW KW  C SDRAM
  81 00554000 --> 02a4c000  16K  V     R AA AW KW  C SDRAM

========= Exception Context at 0x82c3bce0 =========

 psw  = 0x000a00f0    pse= 0x00000000

 epcr = (0x00242adc, 0x00242ae0, 0x00242ae4)

 preg    = (0x00001406, 0x00001402)
 ccr     = (0x000000ef, 0x000000ef)
 cpse    = (0x00000000, 0x00000000)
 mstat0  = (0x900008c1, 0x80000543)
 mstat1  = (0x800004f9, 0x800004f7)
 mstat2  = (0x800004c1, 0x80000579)
 mvadr0  = (0x80000000, 0x00514bfc)
 mvadr1  = (0x00514700, 0x00514370)
 mvadr2  = (0x00514398, 0x00514340)
 mstdtl0 = (0x00310e90, 0x00359384)
 mstdtl1 = (0x00310e90, 0x00359384)
 mstdtl2 = (0x7ffff350, 0x00359384)
 mstdth0 = (0x00000000, 0x00363af4)
 mstdth1 = (0x80000000, 0x00363af4)
 mstdth2 = (0x00516d80, 0x00363af4)

 r00 = (0x00000000, 0x00000008)
 r01 = (0x00030002, 0x0f00145f)
 r02 = (0x7ffffa08, 0x800081ac)
 r03 = (0x00288c38, 0x00000004)
 r04 = (0x82c3b84f, 0xfffffff1)
 r05 = (0x0000006e, 0x0000006e)
 r06 = (0x00000069, 0x00000069)
 r07 = (0x00000020, 0x00000020)
 r08 = (0x00000065, 0x00000065)
 r09 = (0x00000073, 0x00000073)
 r10 = (0x0000006c, 0x0000006c)
 r11 = (0x0000000a, 0x0000000a)
 r12 = (0x00000020, 0x00000020)
 r13 = (0x00000000, 0x82c3b99c)
 r14 = (0x00000000, 0x00000000)
 r15 = (0x0052f620, 0x0052f620)
 r16 = (0x7ffffc08, 0x7ffffc08)
 r17 = (0x7ffffc08, 0x00000000)
 r18 = (0x00000002, 0x00000000)
 r19 = (0x00000002, 0x0000000c)
 r20 = (0x00000002, 0x8000ec20)
 r21 = (0x00000002, 0x00000003)
 r22 = (0x00000002, 0x00000008)
 r23 = (0x00000002, 0x000000a0)
 r24 = (0xffffffff, 0x00000000)
 r25 = (0xffffffff, 0x00000000)
 r26 = (0x7ffff86c, 0x00000000)
 r27 = (0x00000075, 0x00000003)
 r28 = (0x7ffff388, 0x0000000f)
 r29 = (0x00000001, 0x00000000)
 r30 = (0xffffff83, 0x00000000)
 r31 = (0x0052a600, 0x0052a600)
 r32 = (0x0000000d, 0x82b77de8)
 r33 = (0x00000000, 0x00000001)
 r34 = (0x0000000d, 0xffffc000)
 r35 = (0x0000056e, 0x87c5a738)
 r36 = (0x805f6920, 0x00000190)
 r37 = (0x805f6948, 0x87c5a6f8)
 r38 = (0x00000000, 0x00000001)
 r39 = (0xf0fe63ff, 0x0005f000)
 r40 = (0x0000000d, 0x00000000)
 r41 = (0x82c3c000, 0x00000000)
 r42 = (0x00000001, 0x00000000)
 r43 = (0x00000000, 0x00000000)
 r44 = (0x00000001, 0x00000000)
 r45 = (0x000a00f0, 0x00398af0)
 r46 = (0x00398af4, 0x7ffff2e0)
 r47 = (0x00398af8, 0x002f1bd8)
 r48 = (0x00398af0, 0x00000000)
 r49 = (0x0000005f, 0x00001000)
 r50 = (0x0f00145f, 0x00001000)
 r51 = (0xf0fe63ff, 0x00000000)
 r52 = (0x00000000, 0x001cb801)
 r53 = (0xffffffff, 0x00000af0)
 r54 = (0x00310e90, 0x0000000c)
 r55 = (0x80000000, 0x00000000)
 r56 = (0x7ffffd44, 0x00000000)
 r57 = (0x7ffffd34, 0x03e00288)
 r58 = (0x7ffffe29, 0xb0807998)
 r59 = (0x00000001, 0x13e001bc)
 r60 = (0x80000000, 0x2aaa800b)
 r61 = (0x00004000, 0x7ffff390)
 r62 = (0x00000000, 0x00000000)
 r63 = (0x00242aa0, 0x00100520)

Loading java/lang/Object.class(/usr/local/kaffe/jre/lib/glibj.zip)
[compressed]
Loading java/io/Serializable.class(/usr/local/kaffe/jre/lib/glibj.zip)
[compressed]

  /**********************************
   * and goes on loading classes upto
   **********************************/

Loading
gnu/java/security/provider/DefaultPolicy.class(/usr/local/kaffe/jre/lib/glibj.zip)
[compressed]
Loading
java/lang/IllegalThreadStateException.class(/usr/local/kaffe/jre/lib/glibj.zip)
[compressed]

/******** And then remains stucked here
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://kaffe.org/pipermail/kaffe/attachments/20060909/ca048651/attachment-0004.htm 


More information about the kaffe mailing list