Welcome to
 Welcome to riocar.org! Friday, August 6th 
Main Menu
· Web Links
· Downloads
· BBS/Forums
· Lens Compare
· Boot Logos
· Button Guide
· Developer Info
· Drive Upgrade
· FAQ
· Geek Guide
· Photo Gallery


  
rio car dot org Developer Information



Category: Main -> The Development Environment

 
·   Setting Up a Cross-Compiler
·   Compiling on Win32
·   Compiling on Solaris 8
·   Flashing a Kernel via Ethernet
·   Debian Distro for Dummies
·   A Few Words About the Empeg Linux Environment

 
·  Setting Up a Cross-Compiler
 (Entry last updated on January 12th, 2002)

In order to get started compiling your own kernels or developing your own applications, you'll probably need to set up an ARM Linux toolchain. It is certainly possible to set up a development environment directly on your Empeg, much in the same way it's possible to dig out of prison with a soup spoon. However, the preferred method of most developers who value their time is to set up a cross-compiler on a Linux PC.

Those who have an i386 Linux box can save themselves the trouble of building a toolchain from scratch by downloading this precompiled toolchain built by Mark Lord. Simply extract the toolchain to a path such as /usr/local/arm and put the bin subdirectory into your path.

For those who are running on another platform, or want to customize their toolchain in any way, Mark has also provided a starter kit for building your own toolchain from the freely available GNU packages.

Now that you've got a cross-compiler set up, you're ready to write the next killer app for the Empeg!

Toolchains provided by Mark Lord

Back to Top
·  Compiling on Win32
 (Entry last updated on January 14th, 2002)

Utilizing CygWin and the contents of this archive one can theoretically get applications and kernels to compile on the Win32 platform.

I did get it working once, but there was 
some faffing about with CRLF's (use TextPad to get
rid of them). 

See attached Makefile. 

Peter 
The archive contains some diffs against gcc and a Makefile which should get you going.

Contributed by Peter Hartley

Back to Top
·  Compiling on Solaris 8
 (Entry last updated on January 29th, 2002)

For the hordes of you that are clamoring to cross-compile empeg binaries on your Sun machines, a Sparc Solaris 8 package has been made available.

Cross-compiler package provided by Bitt Faulk

Back to Top
·  Flashing a Kernel via Ethernet
 (Entry last updated on January 14th, 2002)

By default, the only way to flash a kernel onto your Empeg is via the serial cable using the download.c program. However, recent updates and some creative hacking have brought about the ability to flash kernels over Ethernet, which will save us all a lot of time.

You need an ftp daemon installed, but by default the Hijack kernels have an ftpd in the kernel. How convenient!

Follow these instructions to get Ethernet flashing enabled on your player.

(1) Prepare the player: this needs to be done just once:
-- install the developer software image
-- install a Hijack kernel (v119+ recommended) the "hard way", and reboot.
-- login over the serial port (hit 'q').
-- type this command:rw && mknod /dev/flash_kernel b 60 8 && ro && sync && exit

(2) Once you have done the prep work (once ever per Empeg unit.. dunno if upgrades will wipe it out or not), you can flash new (Hijack!) kernels at will using FTP:

-- ftp empeg
-- put zImage /dev/kernel_flash
-- quit

(3) wait 10 seconds (the flash write may happen asynchronously).

(4) reboot the empeg from the Hijack menu, or by cycling the power.

For those who would like to automate the process, this shell script will upload the kernel to your Empeg, then download it and compare them to make sure the kernel was written properly. If something goes wrong, just try again. You'll probably have to edit at least the $IPADDRESS variable in the script.

Now just think of all the coding you can get done in the time saved by flashing over Ethernet instead of serial!

Contributed by Mark Lord

Back to Top
·  Debian Distro for Dummies
 (Entry last updated on January 14th, 2002)


FYI, here's a (reasonably detailed, IMHO) note on how to get a full-blown Debian distribution working on the Empeg, without (greatly) messing with the player itself.

As many might agree, it's easiest (and clean) to host the entire file-system on an NFS server, which the Empeg can mount and chroot into. I use a Red Hat Linux 7.2 "box" (a Sony VAIO) as the NFS server. The entire procedure is fairly simple, as described below, and can be extrapolated to a local disk install as well.

Please note that the word "download" wherever used is tantamount to "get your hands on by hook or by crook". Moreover, the character '#' has been used to mean the root shell prompt, as well as a comment character in this description.

DISCLAIMER: PLEASE USE AT YOUR OWN RISK. NO LIABILITIES WHATSOEVER ARE ASSUMED ON MY PART AND I SHALL NOT BE HELD RESPONSIBLE FOR ANY DAMAGE OR LOSS(ES) CAUSED TO YOU IF YOU CHOOSE TO FOLLOW INSTRUCTIONS DESCRIBED HERE.

Let us assume that you would be downloading the Debian ARM distribution from ftp.debian.org . Here are the steps:

0. The NFS Server

Designate a directory, say, "/export/debian", on the NFS server. This directory will be exported read-write, with no root squashing, to the Empeg. Security issues are NOT addressed here! For example, on a typical Linux box, the /etc/exports will look like:

        /export/debian    empeg.somedomain(rw,no_root_squash) 

"empeg.somedomain" should be replaced by the IP address or host name of the Empeg on your network.

Please remember to make sure that NFS is working properly before proceeding. Laws of paranoia and Heisenberg's principle dictate that the NFS server be restarted, and any firewalling be appropriately taken into account.

1. Downloading the Debian base file-system and packages

Next, we need to download the base file-system, which is a ~15.5 MB compressed tar-ball. The location is

        /debian/dists/potato/main/disks-arm/2.2.25-2001-06-10/base2_2.tgz 

on ftp.debian.org .

Unpack this archive in /export/debian, preserving permissions.

        # tar -C /export/empeg -xpzvf /base2_2.tgz 

Make a directory /export/debian/packages, where you can (should) download Debian packages that you intend to install for use on the Empeg. Look under

        /debian/dists/potato/main/binary-arm/ 

on ftp.debian.org for packages too numerous to mention here. You might want to download the following file and figure out which package you need (you can see package dependencies too):

        /debian/dists/potato/main/binary-arm/Packages.gz 

Needless to say, the telnet daemon and the ftp daemon would be nice to download. All packages you download should be kept in /export/debian/packages.

2. Onto the Empeg


  • Through a serial connection to the Empeg, drop to the shell (type 'q').
  • Mount the root file-system read-write.

            # rw 
  • Create a directory /mnt/debian, where we shall be NFS mounting the above mentioned file-system.

            # mkdir -p /mnt/debian 
  • Mount the NFS file-system. Assuming your NFS server is called linux.somedomain, you need to do the following:

            # mount -t nfs -o rw,nolock linux.somedomain:/export/debian /mnt/debian 
  • Type `ls /mnt/debian' to make sure that the NFS mount worked.
  • Mount the proc file-system on /mnt/debian/proc

            # mount -t proc proc /mnt/debian/proc 
  • Type `ls /mnt/debian/proc' to make sure that the mount worked.
  • Since the base file-system we created above does NOT have Empeg specific devices in /dev, we do the following:

            # cd /dev 

            # tar -cpvf /mnt/debian/tmp/devices.tar . 

3. chroot


  • The Empeg does not have the chroot command to begin with, but it should be present at this point in /mnt/debian/usr/sbin. We can create a simple script called "/sbin/debian" this way:


    cat > /sbin/debian
    #! /bin/sh
    # -- begin --
    HOME=/root
    export HOME
    echo "empeg" > /proc/sys/kernel/hostname

    # You might or might not want to put this here.
    # mount -t proc proc /mnt/debian/proc

    /mnt/debian/usr/sbin/chroot /mnt/debian /bin/sh -l
    # -- end --
    ^D
  • We run the above script, which will (hopefully) put us into a nice ARM Linux environment. If the script does not work for some reason, try a simple chroot:

            # /mnt/debian/usr/sbin/chroot /mnt/debian /bin/sh -l 
  • Unpack /tmp/devices.tar, preserving permissions:


            # tar -C /dev -xpvf /tmp/debian.tar 
  • It's a good idea to add a user at this point, and also set the root password (note that this will be done in the chroot'ed environment).

  • At this point the system should appear to be fully functional. More packages can be installed by using "dpkg". (Remember that we have debian packages downloaded in what now appears as /packages). If you choose to install telnetd and ftpd, you would need to run /usr/sbin/inetd (unless you install versions of these daemons which are not "controlled" by inetd).

  • Also, please note that an out of the box Apache will NOT run with an out of the box Empeg kernel (including the development version) because Apache wants System V IPC, which is not compiled in (and loadable module support is not enabled). However, this can be remedied.

  • Finally, the system is "ready" (whatever that means). You can tweak it, for example, make /sbin/debian do more stuff, like running `inetd' or `login', and so on. You can "arrange" for rc scripts to be run in the chroot'ed environment if needed.

Contributed by Amit Singh

Back to Top
·  A Few Words About the Empeg Linux Environment
 (Entry last updated on January 14th, 2002)

Just a few words about working in shell mode (i.e. after exiting the player using "q" and using the serial console). There are some commands on the empeg that are not available on standard linux boxes, and some things to keep in mind while working on the empeg itself:

First, there are the commands to remount the partitions in read/write mode (while the player usually keeps them in read/only mode). rw remounts the root device (/dev/hda5 or /dev/root) in read/write mode, rwm does the same thing for the music partition(s) (/dev/hda4 and /dev/hdb4 on the MkII, /dev/hda4 and /dev/hdc4 on the MkI). The opposite commands work a little different. While rom does what everyone might expect (remount the music partition(s) read/only), ro does a little more than expected: It also remounts the music partition(s) read/only. So while there is no single command to remount all partitions read/write, there is one to remount all read/only.

The other thing to keep in mind is that the empeg is really tight on memory. Many programs should not have a problem with it, as the MkII - for example - has about 6-7MB of free RAM while the player is not running, this is going to be a problem when you use 3rd party software that runs in the background while the player is working (e.g. displayserver or my stupidftp-package) or when doing an fsck on a big drive. Both problems are solvable though:

If using 3rd party software that stays in memory while the player is running, you might want to use the ReserveCache directive in config.ini (as described above) to reduce the memory consumption of the player. This is not necessary (on the MkII) for my stupid-ftpd-package, but I didn't check wether displayserver might need it. It is needed if both programs are run.

If using memory consuming software while the player is not running (such as an fsck on large discs or using the debian root environment and/or compiling on the empeg), you might need to add swap to be able to run it. The player does a swapon /swapfile before running fsck, and does a swapoff /swapfile after it is finished. I tend to name the swap partition directly and to turn off all swap, using swapon /dev/hda6 (/swapfile is a link to /dev/hda6) and swapoff -a respectively.


Contributed by Sven Müller (www.incase.de)

Back to Top


Copyright © 2001-2024 riocar.org
All logos and trademarks on this site are property of their respective owners. The comments are property of their posters.