G1G1 Specifications

Specifications (G1G1)

# cat /proc/cpuinfo
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 10
model name      : Geode(TM) Integrated Processor by AMD PCS
stepping        : 2
cpu MHz         : 431.235
cache size      : 128 KB
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu de pse tsc msr cx8 sep pge cmov clflush mmx mmxext 3dnowext 3dnow
bogomips        : 863.76
clflush size    : 32
# cat /proc/meminfo
MemTotal:       233128 kB
MemFree:         23304 kB
Buffers:         39300 kB
Cached:          63444 kB
SwapCached:          0 kB
Active:          98544 kB
Inactive:        70560 kB
SwapTotal:           0 kB
SwapFree:            0 kB
Dirty:               0 kB
Writeback:           0 kB
AnonPages:       66376 kB
Mapped:          24800 kB
Slab:            33964 kB
SReclaimable:    18332 kB
SUnreclaim:      15632 kB
PageTables:        936 kB
NFS_Unstable:        0 kB
Bounce:              0 kB
CommitLimit:    116564 kB
Committed_AS:   148856 kB
VmallocTotal:   794596 kB
VmallocUsed:     17988 kB
VmallocChunk:   776280 kB
HugePages_Total:     0
HugePages_Free:      0
HugePages_Rsvd:      0
HugePages_Surp:      0
Hugepagesize:     4096 kB
# lspci
00:01.0 Host bridge: Advanced Micro Devices [AMD] Unknown device 0028 (rev 21)
00:01.1 VGA compatible controller: Advanced Micro Devices [AMD] Geode LX Video
00:01.2 Entertainment encryption device: Advanced Micro Devices [AMD] Geode LX AES Security Block
00:0c.0 FLASH memory: Marvell Technology Group Ltd. Unknown device 4100 (rev 10)
00:0c.1 SD Host controller: Marvell Technology Group Ltd. Unknown device 4101 (rev 10)
00:0c.2 Multimedia video controller: Marvell Technology Group Ltd. Unknown device 4102 (rev 10)
00:0f.0 ISA bridge: Advanced Micro Devices [AMD] CS5536 [Geode companion] ISA (rev 03)
00:0f.3 Multimedia audio controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] Audio (rev 01)
00:0f.4 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] OHC (rev 02)
00:0f.5 USB Controller: Advanced Micro Devices [AMD] CS5536 [Geode companion] EHC (rev 02)

Checkers on the OLPC

First, is there a checkers Activity? Looking at the Activities page on the OLPC wiki suggests no.   However, with the underlying Linux system, it is possible to configure an application for Linux, and then Sugarize the application to fit on the OLPC.

Where to go from here?  Well, the OLPC is not a terribly fast system.  But it is a vast improvement from systems of yesterday, my yesterday.  Earlier in life, our family computer was the well loved Commodore 64.  There was a treasure trove of games for it.

So, if you search for Commodore 64 and checkers, does anything come up?  Yes! So the trick will be to get VICE running on the OLPC using the Sugar interface.

Commodore 64 UI

The question is, are these games still relevant today?  I like to think that a better question is, are games today as relevant as the ones of yesterday?  Think about it – memory, CPU, and graphics were scarce then.  If you look at the quantity of C64 games, you’ll see that competition was fierce, even during the dawn of computing.  Play Loderunner or Jumpman on the C64 platform, and I assure you, you will be not want to stop.  This is where the pioneering innovation took place.

Build Process

The OLPC (-1) is a 32bit i586 machine, with a 400MHz CPU.  Selecting a build platform is important.  Since the G1G1 program was started in 2007, picking a distribution from around that time would be wise. To build VICE, we’ll use virtualization and Fedora 7 to create a compile host.

Fedora 7 Login

To compile VICE, we’ll use these options:


export LDFLAGS

sh ./configure                                                          


I came up with the above options after trying a few times.  The best place for the install is in /home/olpc.  Applications are called activities.  I put the rpath in place due to the fact we will probably need to add libraries.  After installing it (manually at first), I’ll see if the executable invokes:

[olpc@g1g1 ~]$ cd $HOME/Activities/VICE.activity/bin
[olpc@g1g1 bin]$ ldd x64 | grep "not found"
        libesd.so.0 => not found
        libungif.so.4 => not found
        libgif.so.4 => not found

So it looks as though we need to copy these files into our VICE library rpath.  Running the ldd command once more to check:

[olpc@g1g1 bin]$ ldd x64 | grep "not found"
        libaudiofile.so.0 => not found

So the libesd.so.0 file has a dependency too.  After copying the libaudiofile.so.0 library into the rpath, it comes back clean.

[olpc@g1g1 bin]$ ldd x64 | grep "not found"
[olpc@g1g1 bin]$

So now, our basic hierarchy looks like this:

[olpc@g1g1 bin]$ cd $HOME/Activities/VICE.activity
[olpc@g1g1 VICE.activity]$ ls -ald *
drwxrwxr-x 2 olpc olpc  4096 2010-09-08 14:48 bin
drwxrwxr-x 3 olpc olpc  4096 2010-09-08 14:30 lib
drwxrwxr-x 5 olpc olpc  4096 2010-09-05 13:47 share

For ease of development, I put the following Makefile in $HOME/Activities/VICE.activity:

[olpc@xo-14-64-13 VICE.activity]$ cat Makefile
ACTIVITY        :=      $(shell basename $(shell pwd) .activity)

        rm -fv $(HOME)/$(ACTIVITY).xo MANIFEST
        find ./ | sed 's,^./,$(ACTIVITY).activity/,g' > MANIFEST
        cd $(HOME)/Activities && zip -9 -r $(HOME)/$(ACTIVITY).xo $(ACTIVITY).activity

So by typing “make” while in $HOME/Activities/VICE.activity, I can then expect an
XO activity in $HOME (in this case $HOME/VICE.xo). As you can see, it also creates a MANIFEST
file as well.

Henceforth, $HOME/Activities/VICE.activity is will now be referred to $SUGAR_BUNDLE_PATH. This variable is set to whatever the running Activity is. In $SUGAR_BUNDLE_PATH, we will need an activity/ directory containing the following files: activity.info and VICE.svg (an icon).

[olpc@g1g1 VICE.activity]$ export SUGAR_BUNDLE_PATH=$HOME/Activities/VICE.activity
[olpc@g1g1 VICE.activity]$ cat $SUGAR_BUNDLE_PATH/activity/activity.info 
name = VICE
activity_version = 1
host_version = 1
bundle_id = net.foundationlaboratories.olpc.VICE
icon = VICE
exec = bin/activity.sh

Obviously we’ll need a “bin/activity.sh” script as well.

[olpc@g1g1 VICE.activity]$ cat bin/activity.sh
# Activity launcher for VICE.
# Variables and libsugarize.so are taken from the X-1 Activity.  Thank you 
# Bert Freudenberg for this wonderful activity:
#   http://wiki.laptop.org/go/X_Activity

export PATH

# pass activity options to libsugarize
while [ -n "$2" ] ; do
    case "$1" in
        -b | --bundle-id)     export SUGAR_BUNDLE_ID="$2" ;;
        -a | --activity-id)   export SUGAR_ACTIVITY_ID="$2" ;;
        -o | --object-id)     export SUGAR_OBJECT_ID="$2" ;;
        -u | --uri)           export SUGAR_URI="$2" ;;
        *) echo unknown argument $1 $2 ;;

# set vars and dirs in case we run in jhbuild 
    && export SUGAR_BUNDLE_PATH=`dirname $0|xargs dirname`
[ -z "$SUGAR_PROFILE" ] 
    && export SUGAR_PROFILE=default

umask 0002

# sugarize
export NET_WM_NAME="VICE C64 Emulator"
export LD_PRELOAD="$SUGAR_BUNDLE_PATH/lib/libsugarize.so"

x64 -VICIIdsize $*