Introduction

The WDTV is based on the SigmaDesigns 8635LF processor. It is able to run either Windows or Linux depending on the SDK you purchase.
The SDK is a mix of proprietary and non-proprietary software, luckily for us most non-proprietary software included has GPL based licensing,
(see GNU.org) and they have given us access to the source code with their modifications in tow.

So Western Digital chose Linux (thank you!!) as their platform of choice, if you are looking for the source code they have kindly made it available
on their support website. But anything from the original SDK is under NDA by SigmaDesigns and getting access to those proprietary components will cost,
but the GPL based code can be downloaded from their ftp site.

What do you need?

  1. A WDTV unit (duh!)
  2. Access to a x86 based Linux box virtual(vmware, parallels, virtualbox) or physical (real machine).
  3. The WD TV GPL Code
  4. WDTV firmware (optional)
  5. Lotsa of time..

Ok, so you've gone to support.wdc.com and navigated thru Downloads, gone to the Home Entertainment section then selected WDTV,
clicked on “WD TV GPL Code” and pushed the Download button. Once the zip file is downloaded and in your Linux machine we need to unzip it.

I add the -q for quiet mode. I also find -d useful for when I want to unzip it into a different directory.

freak@debian:~/wdtv/tutorial$ unzip -q WDTV_GPL_Code_1.01.02.zip
freak@debian:~/wdtv/tutorial$ ls   GPL.tgz
TVDOCK_GPL_code_package.2008.9.25.tar
TVDOCK_Project_Source_Code_License_List.doc
WDTV_GPL_Code_1.01.02.zip

After untaring both GPL.tgz and TVDOCK_GPL_code_package.2008.9.25.tar we are left with 2 additional directories GPL and TVDOCK_GPL_code_package.2008.9.25 .

freak@debian:~/wdtv/tutorial$ tar xzf GPL.tgz
freak@debian:~/wdtv/tutorial$ tar xf TVDOCK_GPL_code_package.2008.9.25.tar
freak@debian:~/wdtv/tutorial$ ls
GPL        
TVDOCK_GPL_code_package.2008.9.25.tar
TVDOCK_Project_Source_Code_License_List.doc
GPL.tgz     

Within the GPL directory is smp86xx_toolchain_2.8.2.0 , this contains the x86 mips cross-compilers and linker utilities. Within this directory is an environment file called toolchain-path.env .

freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ ls -l
total 36
drwxr-xr-x  2 freak freak 4096 2008-04-15 06:28 bin
drwxr-xr-x 43 freak freak 4096 2008-12-30 04:10 include
drwxr-xr-x  2 freak freak 4096 2008-04-15 06:22 info
drwxr-xr-x  4 freak freak 4096 2008-12-30 04:07 lib
drwxr-xr-x  3 freak freak 4096 2008-04-15 06:09 libexec
drwxr-xr-x  4 freak freak 4096 2008-04-15 06:09 man
lrwxrwxrwx  1 freak freak   19 2009-02-10 11:57 mipsel-linux -> mipsel-linux-uclibc
drwxr-xr-x  3 freak freak 4096 2008-04-15 06:11 mipsel-linux-uclibc
drwxr-xr-x  2 freak freak 4096 2008-04-15 06:22 share
-rw-r--r--  1 freak freak  248 2008-12-30 03:02 toolchain-path.env

Dont source this file! You can either edit it or create a new one and add 2 simple lines. For the sake of this tutorial, I will create one called mips.env, using my trusty Vim editor. With the following content.

freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ more mips.env
PATH=`pwd`/bin:$PATH
export PATH

Now their are 2 ways of adding this so your environment.

A)

freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games
freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ . ./mips.env
freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ echo $PATH
/home/freak/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/games

or

B)

freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/games
freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ source mips.env
freak@debian:~/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0$ echo $PATH
/home/freak/wdtv/tutorial/GPL/smp86xx_toolchain_2.8.2.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/games

When building application either call mipsel-linux-gcc directly or modify your CC and CXX environmental variables and you are good to go. And that's it, you are ready to starting building binaries for the WDTV. Good Luck!!

Now available! toolchain under XP/Cygwin!

  1. First, get cygwin itself from http://www.cygwin.com/ (run the setup file)
  2. You will need several packages, all from the Dev group:
    binutils, byacc, cramfs, flex, gcc-g++, gettext-devel, libncurses-devel, make, nasm, readline
  3. You need to remove the /usr/include/libintl.h file, because it causes problems compiling the Linux kernel
  4. Get the binary toolchain from Mediafire
  5. Extract the toolchain in the /opt directory
  6. Source the *.env file (type “source /opt/smp*/*.env”)

The env file also adds the “ARCH” and “CROSS_TOOL” variables to make things easier. To build the linux kernel, you can just use “make menuconfig”. However, if a package has a Configure script, you will need to specify –host=mipsel-linux on the Configure line.
For packages without a COnfigure script you may need to use “CC=mipsel-linux-gcc make”.

I'm uploaded the .config files for the toolchain itself (under cygwin), Linux Kernel, and Busybox here. You need to rename the related file to ”.config” in the package's home directory and type “make oldconfig”. Then you can “make config” or “make menuconfig” on the package and tweak settings.

Good luck!
Zorander

 
setting_up_the_environment_for_compiling.txt · Last modified: 2009/10/06 22:35 by mrlazy
 
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki