PDA and Squeak

Alejandro F. Reimondo aleReimondo at smalltalking.net
Wed Nov 3 06:01:56 UTC 2004


Hi Marten,

> a) The image did not work on my Ipaq 2210

I am running the image with an extension card;
 it is a "normal" image with little changes
 (I plan to upload a file with the changes soon).
It requires at least 17Mb free in the external
 backing store.

> b) The virtual machine seems to be much, much slower than
> the old machine ... I have here. But I was able to start the
> dynapad image - but it behaves not very well.

The current implementation is only a rearrangement
 of files and recompilation on the C side.
No changes in the Smalltalk side.

Make It Work Make It Right Make It Fast

I am trying to make it work,
 built with VMMaker
 and with FFI included
 (if posible to translate ASM
 code required by FFI ). [*]

cheers,
Ale.

[*] The code is a little asm expression that must
 be adapted to ARMV4 processor.
Any help will be appreciated.
ASM code for x86 machine follows:
------------------------------------------
/***************************************************************************
**/
/***************************************************************************
**/
int oldSP;
int oldBP;
int newSP;
int newBP;

/*  ffiCallAddress:
 Perform the actual function call. */
int ffiCallAddress(int fn)
{
#if 0
   {
     FILE *f = fopen("ffi.log","at");
     fprintf(f, "%x",fn);
     fflush(f);
     fclose(f);
   }
#endif
#ifdef _MSC_VER
 __asm {
  push ebx
  mov ebx, fn
  push ecx
  push edx
  push edi
  push esi
  push ebp
  /* mark the frame */
  mov ebp, esp
  /* alloca() ffiStackIndex size bytes */
  mov ecx, ffiArgIndex
  shl ecx, 2
  sub esp, ecx
  /* copy stack */
  mov edi, esp
  lea esi, ffiArgs
  shr ecx, 2
  cld
  rep movsd
  /* go calling */
  call ebx
  /* restore frame */
  mov esp, ebp
  /* store the return values */
  mov intReturnValue, eax
  mov intReturnValue2, edx
  fstp floatReturnValue
  /* restore register values */
  pop ebp
  pop esi
  pop edi
  pop edx
  pop ecx
  pop ebx
  /* done */
 }
#endif
#ifdef __GNUC__
 asm("
   movl %%ebp, _oldBP
   movl %%esp, _oldSP
  pushl %%ebx;
  pushl %%ecx;
  pushl %%edx;
  pushl %%edi;
  pushl %%esi;
  pushl %%ebp;
  /* mark the frame */
  movl %%esp, %%ebp
  /* alloca() ffiStackIndex size bytes */
  movl _ffiArgIndex, %%ecx;
  shll $2, %%ecx;
  subl %%ecx, %%esp
  /* copy stack */
  movl %%esp, %%edi;
  leal _ffiArgs, %%esi;
  shrl $2, %%ecx;
  cld;
  rep movsl;
  /* go calling */
  call *%%ebx
  /* restore frame */
  movl %%ebp, %%esp
  /* store the return values */
  movl %%eax, _intReturnValue
  movl %%edx, _intReturnValue2
  fstpl _floatReturnValue
  /* restore register values */
  popl %%ebp
  popl %%esi
  popl %%edi
  popl %%edx
  popl %%ecx
  popl %%ebx
movl %%ebp, _newBP
movl %%esp, _newSP
  ": /* no outputs */ : "ebx" (fn) : "eax" /* clobbered registers */);
  /* done */
#endif
#if 0
   {
     FILE *f = fopen("ffi.log","at");
     fprintf(f, "...ok\n");
     if(oldBP != newBP || oldSP != newSP) {
       fprintf(f,"oldSP=%x, oldBP=%x\nnewSP=%x, newBP=%x\n",oldSP,
oldBP,newSP,newBP);
     }
       fprintf(f,"SP=%x, BP=%x\n",newSP,newBP);
     fflush(f);
     fclose(f);
   }
#endif
 return intReturnValue;
}
------------------------------------------


----- Original Message ----- 
From: "Marten Feldtmann" <M.Feldtmann at t-online.de>
To: "Alejandro F. Reimondo" <aleReimondo at smalltalking.net>
Cc: "The general-purpose Squeak developers list"
<squeak-dev at lists.squeakfoundation.org>; <bryce at kampjes.demon.co.uk>;
<wallenberg at gmail.com>
Sent: Tuesday, November 02, 2004 6:38 PM
Subject: Re: PDA and Squeak


> I downloaded the stuff:
>
> a) The image did not work on my Ipaq 2210
> b) The virtual machine seems to be much, much slower than
> the old machine ... I have here. But I was able to start the
> dynapad image - but it behaves not very well.
>
> Just a first short view
>
> Marten




More information about the Squeak-dev mailing list