[gambit-list] Gambit and termite on an embedded system (Nintendo DS)?

Marc Feeley feeley at iro.umontreal.ca
Sun Oct 22 09:11:31 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 21-Oct-06, at 8:58 PM, Andrew Lentvorski wrote:

> Marc Feeley wrote:
>> It sounds like the development environment is rather minimal on  
>> the Nintendo DS.  Is there no C debugger you can use to know in  
>> which C function the system crashed?
>
> The system crashes here:
>       if (___NONNULLCHARSTRINGLIST_to_NONNULLUCS_2STRINGLIST
>             (argv,
>              &___program_startup_info.argv)
>           != ___FIX(___NO_ERR))
>
> You make an assumption that argv is a valid pointer even when argc  
> comes back with a 0.  It is certainly possible that having a NULL  
> argv violates the standard; I don't know the standard well enough.
>
> How do I have to get around this?  I am concerned that just  
> removing this call will leave ___program_startup_info.argv in a  
> state that will just push the crash further along.  I'd prefer to  
> stop the problem here so that the system can just proceed.

For now, just replace that with "___program_startup_info.argv =  
NULL;".  I'll try to come up with a better alternative.

> Marc Feeley wrote:
>
>
>> If the crash is in the Scheme code part of the runtime, something  
>> else you can do is add
>> #define ___DEBUG_HOST_CHANGES
>>
>
> That was way useful.
>
> I'm having some problems though.
>
> The system seems to be very tied to having a file system; fopen  
> error codes of 88 are giving it fits.  In trying to dig through  
> things, I'm finding that I get a crash somewhere after it tosses an  
> error from (I hope I type this in right as I can't cut and paste):
>
> *** ERROR IN ##main --
> (path-expand "~")
> *** Entering _io (subprocedure 445)
> *** Entering ##os-device-force-output (subprocedure 705)
> *** Entering _io (subprocedure 329)
> *** Entering
>
> And then it crashes.
>
> -a

It is expanding "~" (to get the user's home directory) to generate  
the path to the user's initialization file.  You probably don't have  
that on the Nintendo DS...  Normally this step is avoided when gsi by  
doing:

    gsi -f

You could modify gsi/_gsi.scm so that it does not search for the  
initialization file, for example you could remove:

                 (if (##not skip-initialization-file?)
                   (process-initialization-file))

That should get you to the next problem, but I think you are getting  
close to a working Gambit.

By the way, make sure you are using beta 20 because there were some  
problems in previous versions with program termination (when closing  
the predefined ports just before the final "exit").

Marc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (Darwin)

iD8DBQFFO24D//V9Zc2T/v4RAsKlAJ9OGDQm50JY8kzs3MHDt44dnbQBEgCfanU+
cIIA/VwPeV2HJBuHhm2yIXo=
=KNm1
-----END PGP SIGNATURE-----



More information about the Gambit-list mailing list