Hi all,<br>
<br>
I am trying to port kaffe-1.1.7 on bsp15 running customized linux 2.6. The following are things which i have done:<br>
<br>
1) Added entries to <span style="color: rgb(0, 102, 0);">kaffe-1.1.7/config/config.alias</span> as<br>
<span style="color: rgb(153, 0, 0);">bsp15*) Khost_cpu=bsp15 ;; <span style="color: rgb(0, 0, 0);">inside the case</span> "$Khost_cpu"<br>
<span style="color: rgb(0, 0, 0);">2) Added corresponding entries to all <span style="color: rgb(0, 102, 0);">config.sub</span>'s<br>
3) Created folders </span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15</span> and
</span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/config/bsp15/linux<br>
<span style="color: rgb(0, 0, 0);">4) Added files <br>
- </span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">
atomic.h</span><br>
- </span></span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">
common.h</span><br>
- </span></span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">
threads.h</span><br>
</span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"> - </span></span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span>
<span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">sysdepCallMethod.h</span><br>
</span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"> - </span></span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span>
<span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/linux/<span style="color: rgb(255, 102, 102);">config.frag</span><br>
</span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"> - </span></span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span>
<span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/linux/<span style="color: rgb(255, 102, 102);">md.c</span><br>
</span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"> - </span></span></span><span style="color: rgb(0, 102, 0);">kaffe-1.1.7/</span>
<span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/linux/<span style="color: rgb(255, 102, 102);">md.h</span></span></span></span><span style="color: rgb(153, 0, 0);">
<span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"> <br>
<span style="color: rgb(0, 0, 0);">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.<br>
5) I have configured the kaffe with follwing configuration script:<br>
<span style="color: rgb(153, 0, 0);">./configure
--host=bsp15-linux --disable-gtk-peer --without-alsa --without-esd
--disable-direct-threading --with-staticlib --with-engine=intrp</span><br>
6) Cross compiled (<span style="color: rgb(153, 0, 0);">make</span>) with my bsp15 based tool chain (by setting CC, AR, NM and CXX).<br>
7) Installed.<br>
<br>
<span style="font-weight: bold;"><span style="font-weight: bold;">M</span>y problem</span>:<br>
1) It runs and loads classes upto (when run using -v option) <span style="color: rgb(102, 0, 0);">Loading java/lang/IllegalThreadStateException.class</span> and then stucks there without printing anything and without creating any exception (
<span style="color: rgb(102, 0, 0);">dump.txt</span> is attached).<br>
<br>
when i trace it with printf's, then it reveals that the system goes from<br>
<span style="color: rgb(102, 0, 0); font-style: italic;">main</span> to <span style="color: rgb(102, 0, 0); font-style: italic;">JNI_CreateJavaVM </span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 102, 0);">
kaffe-1</span><span style="color: rgb(102, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">.1.7/kaffe/kaffevm/jni/jni-base.c</span>)</span></span><span style="color: rgb(102, 0, 0); font-style: italic;">
</span><span style="color: rgb(102, 0, 0);"><span style="color: rgb(0, 0, 0);">to</span> <span style="font-style: italic;">initialiseKaffe </span><span style="color: rgb(0, 0, 0);">and returns safe from initialiseKaffe. After returning initialiseKaffe, it never goes past
<br>
<span style="color: rgb(102, 0, 0);">reftable = (jnirefs *)gc_malloc(sizeof(jnirefs) + sizeof(jref) * DEFAULT_JNIREFS_NUMBER,</span><br style="color: rgb(102, 0, 0);">
<span style="color: rgb(102, 0, 0);"> KGC_ALLOC_STATIC_THREADDATA); <span style="color: rgb(0, 0, 0);">(inside </span></span></span></span></span></span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 102, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">kaffe-1</span><span style="color: rgb(102, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">
.1.7/kaffe/kaffevm/jni/jni-base.c <span style="color: rgb(0, 0, 0);">just after returning from </span></span></span></span></span></span></span></span><span style="color: rgb(102, 0, 0);">initialiseKaffe<span style="color: rgb(0, 0, 0);">
)</span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(102, 0, 0);"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(102, 0, 0);"><span style="color: rgb(0, 0, 0);"></span><br>
<span style="color: rgb(0, 0, 0);">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.<br>
<br>
What may be the wrong? I am pasting my arch/platform dependent files below. Output file (dump.txt) is attached.<br>
<br>
Thanks and Regards,<br>
<br>
Rakesh Kumar Dhiman<br>
<br>
<span style="color: rgb(0, 0, 0);"></span></span><br>
</span></span></span><span style="color: rgb(102, 0, 0);"></span></span></span></span></span><span style="color: rgb(0, 102, 0); font-weight: bold; text-decoration: underline;">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0); font-weight: bold; text-decoration: underline;">
<span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">atomic.h<br>
</span></span></span></span><span style="color: rgb(0, 102, 0);"></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(255, 102, 102);">
</span></span></span></span>#define atomic_compare_and_exchange_val_acq(A, N, O) \<br>
({ \<br>
typeof(*A) ret = 0; \<br>
KTHREAD(suspendall)(); \<br>
\<br>
ret = *(A) ; \<br>
if (ret == (O)) { \<br>
*(A) = (N); \<br>
}
\<br>
KTHREAD(unsuspendall)(); \<br>
ret; \<br>
})<br>
<br>
#define COMPARE_AND_EXCHANGE(A,O,N) (atomic_compare_and_exchange_val_acq((A), (N), (O)) == (O))<br>
<br>
<span style="color: rgb(0, 102, 0); font-weight: bold; text-decoration: underline;">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0); font-weight: bold; text-decoration: underline;"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">common.h<br>
</span></span></span></span><span style="color: rgb(0, 0, 0);">/*<br>
* bsp15/common.h<br>
* Common bsp15 configuration information.<br>
*/<br>
<br>
#ifndef __bsp15_common_h<br>
#define __bsp15_common_h<br>
<br>
#include "generic/gentypes.h"<br>
#include "gtypes.h"<br>
<br>
/* The bsp15 never aligns to more than a 4 byte boundary. */<br>
#define ALIGNMENT_OF_SIZE(S) ((S) < 4 ? (S) : 4)<br>
<br>
#include "gccbuiltin.h"<br>
#include "katomic.h"<br>
#include "atomic.h"<br>
#include "generic/comparexch.h"<br>
#endif<br>
<br>
</span><span style="color: rgb(0, 102, 0); text-decoration: underline; font-weight: bold;">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0); text-decoration: underline; font-weight: bold;"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 102, 0);">config/bsp15/<span style="color: rgb(255, 102, 102);">threads.h<br>
</span></span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(255, 102, 102);"><span style="color: rgb(0, 0, 0);">#ifndef __bsp15_threads_h
<br>
#define __bsp15_threads_h<br>
#define THREADSTACKSIZE (64 * 1024)<br>
#define SP_OFFSET 4<br>
#endif<br>
<br>
</span></span></span></span></span><span style="color: rgb(0, 102, 0); font-weight: bold; text-decoration: underline;">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0); font-weight: bold; text-decoration: underline;">
<span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/linux/<span style="color: rgb(255, 102, 102);">config.frag<br>
</span></span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(255, 102, 102);"><span style="color: rgb(0, 0, 0);"><br>
# bsp15/Linux configuration <br>
<br>
CFLAGS="$CFLAGS -fsigned-char -fno-omit-frame-pointer"<br>
# if we use cross environment, following values may not be detected.<br>
if [ "$cross_compiling" = yes ]; then<br>
# ac_cv_func_memcmp_working=${ac_cv_func_memcmp_working='yes'}<br>
ac_cv_func_mmap_fixed_mapped=${ac_cv_func_mmap_fixed_mapped='yes'}<br>
# ac_cv_func_utime_null=${ac_cv_func_utime_null='yes'}<br>
ac_cv_c_char_unsigned=${ac_cv_c_char_unsigned='no'}<br>
fi</span></span></span></span></span><span style="color: rgb(153, 0, 0); font-weight: bold; text-decoration: underline;"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(255, 102, 102);">
<br>
</span></span></span></span><br>
<span style="color: rgb(0, 102, 0); text-decoration: underline; font-weight: bold;">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0); text-decoration: underline; font-weight: bold;"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 102, 0);">config/bsp15/linux/<span style="color: rgb(255, 102, 102);">md.c<br>
</span></span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(255, 102, 102);"><span style="color: rgb(0, 0, 0);">#include "
config.h"<br>
#include <malloc.h><br>
<br>
void<br>
init_md(void)<br>
{<br>
#if defined(M_MMAP_MAX) && defined(HAVE_MALLOPT)<br>
mallopt(M_MMAP_MAX, 0);<br>
#endif<br>
}</span></span></span></span></span><span style="color: rgb(153, 0, 0); text-decoration: underline; font-weight: bold;"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(255, 102, 102);">
<span style="color: rgb(0, 0, 0);"><span style="font-weight: bold;"><span style="text-decoration: underline;"><br>
</span></span></span><span style="text-decoration: underline;"><span style="font-weight: bold;"><br>
</span></span></span></span></span></span><span style="color: rgb(0, 102, 0); text-decoration: underline; font-weight: bold;">kaffe-1.1.7/</span><span style="color: rgb(153, 0, 0); text-decoration: underline; font-weight: bold;">
<span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);">config/bsp15/linux/<span style="color: rgb(255, 102, 102);">md.h</span></span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);">
<span style="color: rgb(0, 102, 0);"></span></span></span><br>
<span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"><span style="color: rgb(0, 0, 0);">#ifndef __bsp15_linux_md_h<br>
#define __bsp15_linux_md_h<br>
#include "bsp15/sysdepCallMethod.h" <br>
#include "bsp15/threads.h"<br>
#include "bsp15/common.h"<br>
#define SP_OFFSET 4<br>
#define SIGNAL_ARGS(sig, sc) int sig, struct sigcontext sc<br>
#endif<br>
</span> </span></span></span><span style="color: rgb(153, 0, 0);"><span style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 102, 0);"> </span></span></span>