guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Feasibility of porting guile to Dreamcast?


From: Thien-Thi Nguyen
Subject: Re: Feasibility of porting guile to Dreamcast?
Date: Tue, 05 Feb 2002 20:29:41 -0800

   From: Colin McMillen <address@hidden>
   Date: Tue, 29 Jan 2002 10:47:54 -0600

   I'm interested in doing programming for the Sega Dreamcast console
   and was thinking of porting guile to DC as an initial project. (I'm
   eventually interested in game programming and would like to have a
   scheme interpreter available for scripting.)

   From what I understand, guile is written in C, so porting guile would
   hopefully just require a few makefile changes and a cross-compile
   with sh-elf-gcc. I figured before I got started with this, I'd ask
   the devel list if there are any subtleties or difficulties that I
   should be aware of before I start.

"sh" is a risc instruction set by hitachi iirc.  you need to make sure
longs are 32 bits (perhaps sh-elf-gcc enforces this restriction already)
and other things.  here is the relavent snippet from libguile/__scm.h:

/* {Architecture and compiler properties}
 *
 * Guile as of today can only work on systems which fulfill at least the
 * following requirements:
 * - long ints have at least 32 bits.
 *   Guile's type system is based on this assumption.
 * - long ints consist of at least four characters.
 *   It is assumed that cells, i. e. pairs of long ints, are eight character
 *   aligned, because three bits of a cell pointer are used for type data.
 * - sizeof (void*) == sizeof (long int)
 *   Pointers are stored in SCM objects, and sometimes SCM objects are passed
 *   as void*.  Thus, there has to be a one-to-one correspondence.
 * - numbers are encoded using two's complement.
 *   The implementation of the bitwise scheme level operations is based on
 *   this assumption.
 * - ... add more
 */

#if SIZEOF_UINTPTR_T != 0 && defined(UINTPTR_MAX) \
                          && defined(INTPTR_MAX) \
                          && defined(INTPTR_MIN)
/* Used as SCM if available, so we bundle related attributes to avoid possible
   type incon[st][oi]n[ae]nce later.  Word in tags.h.  */
#define HAVE_UINTPTR_T 1
#endif


(see also libguile/tags.h -- look for "Word".)

other things probably not easily available are posix support, etc.  what
kind of development have you done so far w/ sh-elf-gcc?  which libc do
you use?

thi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]