<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.samygo.tv/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stefanth</id>
	<title>SamyGO - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.samygo.tv/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stefanth"/>
	<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Special:Contributions/Stefanth"/>
	<updated>2026-04-26T19:32:15Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1877</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1877"/>
		<updated>2011-05-04T13:11:16Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Microsoft Windows (i686/AMD)==&lt;br /&gt;
===Native===&lt;br /&gt;
The Codesourcery tool chain works in Microsoft Windows&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Cygwin===&lt;br /&gt;
See Microsoft windows, the cross tool chain described there works in Cygwin as well&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==GNU/Linux environment (i686/AMD architecture)==&lt;br /&gt;
===Samsung tool chain===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example Ubunutu/Debian on a standard PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for Mips cpu little endian architectures &amp;lt;br /&amp;gt;&lt;br /&gt;
toolchain_mips24ke_nfp_be.tgz for Mips cpu big endian architectures.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the little endian version will be used&amp;lt;br /&amp;gt;&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Emdebian toolchain)===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example Ubunutu/Debian on a standard PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| gcc-4.4-mipsel-linux-gnu&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other pre compiled packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 mipsel-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Hello world==&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1876</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1876"/>
		<updated>2011-05-04T08:03:40Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Microsoft Windows==&lt;br /&gt;
===Native for i686/AMD architecture===&lt;br /&gt;
The Codesourcery tool chain works in Microsoft Windows&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Cygwin for i686/AMD architecture===&lt;br /&gt;
See Microsoft windows, the cross tool chain described there works in Cygwin as well&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==GNU/Linux environment==&lt;br /&gt;
===Samsung tool chain for i686/AMD architecture===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example Ubunutu/Debian on a standard PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for Mips cpu little endian architectures &amp;lt;br /&amp;gt;&lt;br /&gt;
toolchain_mips24ke_nfp_be.tgz for Mips cpu big endian architectures.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the little endian version will be used&amp;lt;br /&amp;gt;&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Emdebian toolchain for i686/AMD architecture===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example Ubunutu/Debian on a standard PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| gcc-4.4-mipsel-linux-gnu&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other pre compiled packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 mipsel-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==Hello world==&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1846</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1846"/>
		<updated>2011-04-22T09:43:44Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for Mips cpu little endian architectures &amp;lt;br /&amp;gt;&lt;br /&gt;
toolchain_mips24ke_nfp_be.tgz for Mips cpu big endian architectures.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the little endian version will be used&amp;lt;br /&amp;gt;&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| gcc-4.4-mipsel-linux-gnu&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other pre compiled packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 mipsel-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1845</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1845"/>
		<updated>2011-04-22T09:43:16Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
'''===Codesourcery tool chain, Microsoft Windows==='''&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for Mips cpu little endian architectures &amp;lt;br /&amp;gt;&lt;br /&gt;
toolchain_mips24ke_nfp_be.tgz for Mips cpu big endian architectures.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the little endian version will be used&amp;lt;br /&amp;gt;&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| gcc-4.4-mipsel-linux-gnu&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other pre compiled packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 mipsel-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1843</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1843"/>
		<updated>2011-04-21T13:25:34Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for Mips cpu little endian architectures &amp;lt;br /&amp;gt;&lt;br /&gt;
toolchain_mips24ke_nfp_be.tgz for Mips cpu big endian architectures.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the little endian version will be used&amp;lt;br /&amp;gt;&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;400&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| gcc-4.4-mipsel-linux-gnu&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other pre compiled packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 XXXXXXX -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1842</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1842"/>
		<updated>2011-04-21T13:24:53Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for Mips cpu little endian architectures &amp;lt;br /&amp;gt;&lt;br /&gt;
toolchain_mips24ke_nfp_be.tgz for Mips cpu big endian architectures.&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the little endian version will be used&amp;lt;br /&amp;gt;&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;200&amp;quot; align=&amp;quot;left&amp;quot; | Cross compiler&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| gcc-4.4-mipsel-linux-gnu&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other pre compiled packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 XXXXXXX -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1841</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1841"/>
		<updated>2011-04-21T13:20:46Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 XXXXXXX -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1840</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1840"/>
		<updated>2011-04-21T12:18:23Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hellovd to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/XXXXXX/bin/XXXXXXX -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file helloed to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1839</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1839"/>
		<updated>2011-04-21T12:17:38Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/XXXXXX/bin/XXXXXXX -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code&amp;lt;br /&amp;gt;&lt;br /&gt;
The switch &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1838</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1838"/>
		<updated>2011-04-21T12:15:04Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
|&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/XXXXXX/bin/XXXXXXX -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for a specific variant of the CPU. Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1837</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1837"/>
		<updated>2011-04-21T12:10:38Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum, http://forum.samygo.tv/index.php&amp;lt;br /&amp;gt;&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite, this is free of charge) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1836</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1836"/>
		<updated>2011-04-21T12:08:37Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This part of the article about pre compiled cross tool chains was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1835</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1835"/>
		<updated>2011-04-21T11:50:34Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the &amp;lt;code&amp;gt;apt-get install linux .....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1831</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1831"/>
		<updated>2011-04-21T09:40:38Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the apt-get&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1830</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1830"/>
		<updated>2011-04-21T09:38:58Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the apt-get&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
----&lt;br /&gt;
&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1829</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1829"/>
		<updated>2011-04-21T09:37:28Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output for a TV set UEC46C5105&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the apt-get&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=The_C_Series_Wiki&amp;diff=1828</id>
		<title>The C Series Wiki</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=The_C_Series_Wiki&amp;diff=1828"/>
		<updated>2011-04-21T09:35:47Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:c_wiki.png|140px|right]]&lt;br /&gt;
&lt;br /&gt;
==SamyGO C Series Wiki Page Main==&lt;br /&gt;
On this page, you will find hacks related for only C series TVs.&lt;br /&gt;
*[[BEFORE YOU START: Safety measures for C series TVs]]&lt;br /&gt;
*[[Compatibility Table for C series TVs]]&lt;br /&gt;
*[[For what we need all these C-Series Hacks%3F]]&lt;br /&gt;
&lt;br /&gt;
==Hacking/rooting==&lt;br /&gt;
*[[Hacking C-Series TV with Internet@TV only]]&lt;br /&gt;
*[[Hacking TV over Hotel mode (most C series models)]]&lt;br /&gt;
*[[How to get root access on a C series TV]]&lt;br /&gt;
*[[PSxxC7000]]&lt;br /&gt;
&lt;br /&gt;
==ServiceMenu tricks==&lt;br /&gt;
*[[Enabling the PVR for C-Series]]&lt;br /&gt;
*[[How to change your Internet@TV region]]&lt;br /&gt;
*[[How to enable MHP for C-Series]] (available only in Italy)&lt;br /&gt;
&lt;br /&gt;
==Software Applications==&lt;br /&gt;
*[[Applications list for C seres TVs]]&lt;br /&gt;
*[[Desktop applications list]]&lt;br /&gt;
*[[Android applications list]]&lt;br /&gt;
*[[iOS applications list]]&lt;br /&gt;
*[[PVR Recording over NFS for C-Series]] - Samygo-All-Extensions.&lt;br /&gt;
*[[How to connect C series to NFS under WIN7 using Hanewin NFS Server]]&lt;br /&gt;
&lt;br /&gt;
==Software Tools==&lt;br /&gt;
*[[Setting up a cross-compilation toolchain]]&lt;br /&gt;
&lt;br /&gt;
==Hardware==&lt;br /&gt;
*[[Ex-Link Cable for C-Series]]&lt;br /&gt;
*[[Using NoN-Samsung USB WiFi dongles with TV]]&lt;br /&gt;
*[[Fix low speed USB devices (keyboard, mouse, ...) on C-Series Trident]]&lt;br /&gt;
&lt;br /&gt;
==Other==&lt;br /&gt;
*[[How to downgrade T-VALDEUC firmware]]&lt;br /&gt;
*[[How to format /mtd_rwarea/ to reset USB hack]]&lt;br /&gt;
*[[How to identify CPU type]]&lt;br /&gt;
*[http://tobias.schroepf.de/doku/doku.php?id=garage:samsung_tv_hacking External page dealing with the C series] &amp;lt;small&amp;gt;TODO: The contents from this page should be copied to this Wiki.&amp;lt;/small&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1827</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1827"/>
		<updated>2011-04-21T09:32:31Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;The test program have been tested on the following TV sets&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | TV&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | CPU&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Architecture&lt;br /&gt;
! scope=&amp;quot;col&amp;quot; width=&amp;quot;100&amp;quot; align=&amp;quot;left&amp;quot; | Status&lt;br /&gt;
|-&lt;br /&gt;
| UE46C5105&lt;br /&gt;
| Mips&lt;br /&gt;
| Little endian&lt;br /&gt;
| Working&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the apt-get&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1826</id>
		<title>Setting up a cross-compilation toolchain</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Setting_up_a_cross-compilation_toolchain&amp;diff=1826"/>
		<updated>2011-04-21T09:17:56Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A tool chain is a set of executable programs that enables you to build (assemble, compile and link) your own executable programs from source code (typically C, C++, fortran or other programming languages). To build these executables, the source code needs to be translated into machine-readable code. This is what a tool chain does. The translation proceeds in three steps (well, you may think of it this way): translation into low-level code (compilation), translation to machine-readable code (assembly), combination with other code libraries (linking). Compilation/assembly mostly proceeds in a single go. So, for a tool chain you need at least three programs: a compiler, an assembler, and a linker. In almost all cases you will also need a C-library to link with.  &lt;br /&gt;
&lt;br /&gt;
Unlike source code, executables are machine-specific. That means that executables built for the Intel x86 architecture (the basis for most computers in the world today) will not run on other types of processors, for example the ARM architecture, the basis for many embedded systems. To build executables for a Samsung TV on an x86-based machine, you will need a tool chain that runs on the x86-architecture and builds executable code for the ARM-architecture. This procedure is called cross-compilation, and requires a cross compilation tool chain. This wiki page deals with the installation of different tool chain provided by various providers, executing on various platforms such as on an x86, Linux or Windows (Cygwin) platform.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tutorial describes different ways to set up a cross tool chain to compile programs that can be executed on a TV set.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The tutorial do not describe how to create applications that can be downloaded and executed on the TV via it's standard menus or by Samsung provided value chain systems.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The TV need to be hacked according to one of the several ways described on the SamyGo Wiki so it is possible to use telnet/ssh to log on to the TV and execute the example program via a shell.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__ &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Using pre compiled compilers=&lt;br /&gt;
&lt;br /&gt;
A pre compiled compiler means that someone have already built the compiler and the user only have to install the tool, there are no steps involving building the tool chain from scratch&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
The example source code in this tutorial is using stdout for output and do not include any drawing on the actual TV screen.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This article was inspired by the following persons work&lt;br /&gt;
scottrix, arris69, aaaaa75 from the SamyGo forums http://forum.samygo.tv/viewtopic.php?f=12&amp;amp;t=1537&amp;amp;start=0&amp;amp;hilit=codesourcery and &amp;lt;br /&amp;gt;&lt;br /&gt;
Moozing, http://moozing.wordpress.com/2011/04/05/cross-compile-in-debian/&lt;br /&gt;
&lt;br /&gt;
Thanks to Roman, the original designer and developer of WebGui SamyGo used in the hotel mode hack.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==First step==&lt;br /&gt;
As a first step it is necessary to know what type of CPU there is in the target TV set and it's architecture so the right tool chain can be downloaded.&lt;br /&gt;
The CPU is easily recognised by executing the following at the telenet/ssh prompt of the TV set&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 # cat /proc/cpuinfo &amp;lt;br /&amp;gt;&lt;br /&gt;
produce the following output&lt;br /&gt;
 system type             : MStar Titania3&lt;br /&gt;
 processor               : 0&lt;br /&gt;
 cpu model               : MIPS 34Kc V5.4&lt;br /&gt;
 BogoMIPS                : 351.23&lt;br /&gt;
 wait instruction        : yes&lt;br /&gt;
 microsecond timers      : yes&lt;br /&gt;
 tlb_entries             : 16&lt;br /&gt;
 extra interrupt vector  : yes&lt;br /&gt;
 hardware watchpoint     : yes, count: 4, address/irw mask: [0x0000, 0x02a0, 0x0448, 0x0288]&lt;br /&gt;
 ASEs implemented        : mips16 dsp mt&lt;br /&gt;
 shadow register sets    : 1&lt;br /&gt;
 core                    : 0&lt;br /&gt;
 VCED exceptions         : not available&lt;br /&gt;
 VCEI exceptions         : not available&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
In this example the target CPU is a Mips of the type 34kc.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is also necessary to know if the CPU is running in little endian or big endian mode, on some TV series it can be guessed from the name of the software,&lt;br /&gt;
enable the service menu on the TV and look at the top most lines that indicate the software version, &amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the C series TV set.&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-MSX the architecture is little endian&amp;lt;br /&amp;gt;&lt;br /&gt;
If the number starts with T-TDT the architecture is big endian&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For example, for the TV set UEC465105 it says &amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
T-MSX5DEUC-2005.4&amp;lt;br /&amp;gt;&lt;br /&gt;
T-MSX5DEUS-1001&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This indicate that that the architecture for UEC465105 is little endian. If there are any doubts about what type of architecture the CPU is executing in, ask in the SamyGo forum.&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Codesourcery tool chain, Microsoft Windows===&lt;br /&gt;
This tool chain works in Microsoft Windows, this tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
The test program have been tested on the following TV sets&lt;br /&gt;
TV 			CPU		Architecture		Status&lt;br /&gt;
UE46C5105	Mips	Little endian		Working&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Download the (lite) tool chain for the Mips CPU from CodeSourcery (http://www.codesourcery.com/sgpp/lite_edition.html) and install it, during the installation it is possible add the path to the tool chain to the environment variables PATH which can be recommended.&lt;br /&gt;
This compiler have support both for little endian and big endian  which is controlled by a switch, see below.&lt;br /&gt;
&lt;br /&gt;
After installing the tool,&lt;br /&gt;
Start a command window and enter the following&lt;br /&gt;
 c:\&lt;br /&gt;
 mkdir C:\temp\sample1&lt;br /&gt;
 cd C:\temp\sample1&lt;br /&gt;
&lt;br /&gt;
create a helloword.c file, see [[#Hello world|Hello world]] &amp;lt;br /&amp;gt;&lt;br /&gt;
 mips-linux-gnu-gcc.exe -mel -mglibc -march=34kc helloworld.c -o hellocs&lt;br /&gt;
&amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; tells the compiler to generate code for a little endian architecture, use switch &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; for big endian architecture.&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines a very specific CPU type, if not given, the compiler generates generic code that is not optimized for any type of CPU&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;-o&amp;lt;/code&amp;gt; defines the output file&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
copy the file hellocs to the TV with ftp or any other file transfer tool and enter the following at the prompt&amp;lt;br /&amp;gt;&lt;br /&gt;
 ./hellocs&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Samsung tool chain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&lt;br /&gt;
&lt;br /&gt;
The test program have been tested on the following models&lt;br /&gt;
TV 			CPU		Architecture		Status&lt;br /&gt;
UE46C5105	Mips	Little endian		Working&lt;br /&gt;
&lt;br /&gt;
Samsung provide two tool chains via their open source download page, http://opensource.samsung.com &lt;br /&gt;
VDLinux-mips34kc-toolchain-lite-20100223.tgz for little endian architectures and toolchain_mips24ke_nfp_be.tgz for big endian architectures.&lt;br /&gt;
In this example the little endian version will be used&lt;br /&gt;
Download VDLinux-mips34kc-toolchain-lite-20100223.tgz from http://opensource.samsung.com and enter the following at the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir tc&lt;br /&gt;
 cd tc&lt;br /&gt;
 tar -zxvf ../VDLinux-mips34kc-toolchain-lite-20100223.tgz&lt;br /&gt;
 cd&lt;br /&gt;
 mkdir sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/VDLinux-mips34kc-toolchain-lite-20100223/bin/mips-linux-gnu-gcc -mglibc -march=34kc  helloworld.c -o hellovd&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./hellovd&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Emdebian toolchain, GNU/Linux environment===&lt;br /&gt;
This tool chain works in GNU/Linux hosted on a i686 architecture, for example ubunutu/debian on a PC. This tool does not work in a Cygwin environment on a PC.&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The test program have been tested on the following models&amp;lt;br /&amp;gt;&lt;br /&gt;
TV 			CPU		Architecture		Status&lt;br /&gt;
UE46C5105	Mips	Little endian		Working&lt;br /&gt;
&lt;br /&gt;
Emdebian provides a number pre compiled packages that can be installed using apt-get, in this example the cross compiler will target a MIPS cpu with an little endian architecture.&lt;br /&gt;
Use http://www.emdebian.org/toolchains/search.php for other precompiled  packages targeting other cpu's&lt;br /&gt;
&lt;br /&gt;
At the prompt&lt;br /&gt;
 cd&lt;br /&gt;
 apt-get install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
 mkdir -p sample1&lt;br /&gt;
 cd sample1&lt;br /&gt;
create the helloword.c file, see http://en.wikipedia.org/wiki/Hello_world_program_examples#C&lt;br /&gt;
 ~/tc/toolchain_mips24ke_nfp_be/bin/mips24ke_nfp_be-gcc -mglibc -march=34kc  helloworld.c -o helloed&lt;br /&gt;
&amp;lt;code&amp;gt;-mglibc&amp;lt;/code&amp;gt; tells the compiler to use GNU/libc instead of uclibs&lt;br /&gt;
&amp;lt;code&amp;gt;-march&amp;lt;/code&amp;gt; defines the very specific target CPU, if not given, the compiler generates generic code that is not optimized for the CPU&lt;br /&gt;
Note, this tool chain can only produce little endian code, the flag &amp;lt;code&amp;gt;-mel&amp;lt;/code&amp;gt; is not needed and the flag &amp;lt;code&amp;gt;-meb&amp;lt;/code&amp;gt; will cause an error.&amp;lt;br /&amp;gt;&lt;br /&gt;
copy the file hello to the TV and execute at the prompt&lt;br /&gt;
 ./helloed&lt;br /&gt;
&lt;br /&gt;
Installing a big endian MIPS tool chain would be &lt;br /&gt;
 apt-get install linux-libc-dev-mips-cross libc6-mips-cross libc6-dev-mips-cross binutils-mips-linux-gnu gcc-4.4-mips-linux-gnu g++-4.4-mips-linux-gnu&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;'''Errors during apt-get'''&amp;lt;/big&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not allowed''': You need to put &amp;lt;code&amp;gt;sudo&amp;lt;/code&amp;gt; first on the line, like &amp;lt;code&amp;gt;sudo apt-get ....&amp;lt;/code&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Not found''':&amp;lt;br /&amp;gt;&lt;br /&gt;
Do the following at the prompt (read http://emdebian.org/tools/crosstools.html)&amp;lt;br /&amp;gt;&lt;br /&gt;
'''NOTE''' the &amp;gt;&amp;gt; on the &amp;lt;code&amp;gt;echo&amp;lt;/code&amp;gt; line, '''DO NOT USE''' single &amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;
 echo &amp;quot;deb http://www.emdebian.org/debian/ squeeze main&amp;quot; &amp;gt;&amp;gt; /etc/apt/sources.list&lt;br /&gt;
 apt-get update&lt;br /&gt;
 apt-get install emdebian-archive-keyring&lt;br /&gt;
then redo the apt-get&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Out of cache memory''':&amp;lt;br /&amp;gt;&lt;br /&gt;
add &amp;quot;-o apt::Cache-Limit=XXXXXXX &amp;quot; to the apt-get line where XXXXXXX is a number bigger than the the reported cache size when the error message is given, &lt;br /&gt;
like this (using sudo, mips target, little endian, cache size 30000000)&amp;lt;br /&amp;gt;&lt;br /&gt;
 sudo apt-get -o apt::Cache-Limit=30000000 install linux-libc-dev-mipsel-cross libc6-mipsel-cross libc6-dev-mipsel-cross binutils-mipsel-linux-gnu gcc-4.4-mipsel-linux-gnu g++-4.4-mipsel-linux-gnu&lt;br /&gt;
&lt;br /&gt;
Done&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Hello world===&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 int main(void)&lt;br /&gt;
 {&lt;br /&gt;
        printf(&amp;quot;Hello world\n&amp;quot;);&lt;br /&gt;
        return (0);&lt;br /&gt;
 }&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=Toolchains 101, building and compiling the tool chain from scratch=&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page is a brief summary of the cross-compilation discussion on the SamyGO forum. Main contributors to this information are Robbiesz and marcelru.&lt;br /&gt;
The information in this page pertains to the building of a tool chain, based on the source code as stored in the file 32B650.zip, available from Samsung.&lt;br /&gt;
&lt;br /&gt;
We are still in the testing phase, for now, check out the forum discussion (topic: cross-compilation [http://forum.samygo.tv/viewtopic.php?f=5&amp;amp;t=34]). Especially the Windows building procedure is not completely established yet and relies (for now) on the Linux scripts. When fully reliable, a separate set of scripts for Windows/Cygwin will be released. For more info, errors you may encounter, support for other Samsung tool chains, please refer to the forum, or better still, participate.&lt;br /&gt;
 &lt;br /&gt;
===The Samsung toolchain===&lt;br /&gt;
The source code for the Samsung ARM toolchain is available on the net, but needs some adjustments before it can be built. We will discuss that later. &lt;br /&gt;
The main parts are: &lt;br /&gt;
*GNU binutils (containing among other things an assembler and a linker)&lt;br /&gt;
*GCC, the GNU C/C++ compiler (and a host of other languages we will not use)&lt;br /&gt;
*Glibc, the GNU C library&lt;br /&gt;
*linux kernel sources, for operating system/processor specific details.&lt;br /&gt;
&lt;br /&gt;
For the remainder of this wiki page, we will use the toolchain for the 32B650/32B550/... TV's as an example. The source code for this toolchain is stored in the file 32B650.zip [http://www.samsung.com/global/opensource/files/32B650.zip]. Download this file and store it in the directory where you want to build your toolchain.&lt;br /&gt;
Download the SamyGO patches that enable compilation of the toolchain here: [http://forum.samygo.tv/download/file.php?id=14]&lt;br /&gt;
===Building the toolchain on Linux===&lt;br /&gt;
Since most Linux distro's come standard with a full toolchain for building packages, building the cross-compilation toolchain on this platform is fairly straightforward, and proceeds in 6 stages (You will need approximately 2.5GB diskspace for the build).&lt;br /&gt;
====Source installation====&lt;br /&gt;
Unpack and install the source code files. This is done with the script install_sources.sh: edit paths and code versions to your liking:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 #&lt;br /&gt;
 # install_sources.sh installs the source code for the toolchain for Samsung&lt;br /&gt;
 # TV's, as found in the file 32B650.zip. Place this file together with the &lt;br /&gt;
 # patches tarball (SamyGO-toolchain_fc11_patches.tgz) in the ${BUILDROOT} &lt;br /&gt;
 # directory, defined below, and run this script.&lt;br /&gt;
 #&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 &lt;br /&gt;
 cd ${BUILDROOT}&lt;br /&gt;
 mkdir -p ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the Samsung zip file&lt;br /&gt;
 &lt;br /&gt;
 unzip 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 # remove unnecessary stuff and move the kernel and toolchain code&lt;br /&gt;
 &lt;br /&gt;
 rm -f libgphoto2-2.3.1.tar.zip&lt;br /&gt;
 rm -f libusb-0.1.12.tar.gz&lt;br /&gt;
 rm -f SDL-1.2.11.zip&lt;br /&gt;
 mv linux.chelsea.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the toolchain and remove unnecessary stuff&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 rm -f SELP.3.2.x-Chelsea.src.tgz&lt;br /&gt;
 &lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/gcc-4.2.0-4.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/binutils-2.17.50.tgz ${BUILDROOT}/src&lt;br /&gt;
 mv ./SELP.3.2.x-Chelsea.src/Toolchain/glibc-2.5.90-9.0.9.tgz ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ./SELP.3.2.x-Chelsea.src&lt;br /&gt;
 &lt;br /&gt;
 # unpack the patches and move them&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf SamyGO-toolchain_fc11_patches.tgz&lt;br /&gt;
 mv *.patch ${BUILDROOT}/src&lt;br /&gt;
&lt;br /&gt;
'''Notice for binutils:''' If original binutils-2.17.50 don't compile on your computer, you can try it with different versions of binutils. On OpenSUSE 11.2, I compile it via binutils-2.19.1&lt;br /&gt;
&lt;br /&gt;
====Kernel headers installation====&lt;br /&gt;
Install the kernel header files. You will need these when you want to build your own kernel modules for your TV. For that, the kernel source code's version has to match your TV's kernel version _exactly_. The installation is done with the install_kernel_src.sh script: again, edit to meet your needs.&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh &lt;br /&gt;
 &lt;br /&gt;
 # how to install kernel headers using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_kernel_src.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the linux tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your needs&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove previous installation if it is there:&lt;br /&gt;
 rm -rf linux &lt;br /&gt;
 rm -rf linux-r011 &lt;br /&gt;
 rm -rf RFS &lt;br /&gt;
 rm -rf ssdtv_platform&lt;br /&gt;
 &lt;br /&gt;
 # unpack, move up one dir and link:&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf linux.chelsea.tgz              # from 32B650.zip&lt;br /&gt;
 mv ./linux/* .&lt;br /&gt;
 rm -rf linux/&lt;br /&gt;
 &lt;br /&gt;
 ln -s ./linux-r011 linux&lt;br /&gt;
 &lt;br /&gt;
 cd linux&lt;br /&gt;
 &lt;br /&gt;
 # copy header files to sysroot:&lt;br /&gt;
 mkdir -p ${SYSROOT}/usr/include&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/linux ${SYSROOT}/usr/include/linux&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-arm ${SYSROOT}/usr/include/asm&lt;br /&gt;
 cp -a ${BUILDROOT}/src/linux/include/asm-generic ${SYSROOT}/usr/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # remove stale link to ssdtv headers:&lt;br /&gt;
 rm -rf ${SYSROOT}/usr/include/asm/arch-ssdtv&lt;br /&gt;
 &lt;br /&gt;
 # ... and copy these as well:&lt;br /&gt;
 cp -a ${BUILDROOT}/src/ssdtv_platform/include/asm-arm/arch-ssdtv ${SYSROOT}/usr/include/asm&lt;br /&gt;
 &lt;br /&gt;
Everything is now installed (but not yet unpacked). The remainder of the installation consists of the actual building of the tools: First the binutils are built: as, ld and a bunch of others. For cross-compilation, these tools do not need any resources for the target platform (ARM, in this case).&lt;br /&gt;
====Building of binutils====&lt;br /&gt;
Apart from a small bug in one of the source files and a configuration change to be made to part of the code (patches are included) the build is straightforward, done with mkbinutils.sh:&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to build binutils using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkbinutils.sh) in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the binutils tarball and &lt;br /&gt;
 # the patch in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking &lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 UTILS=binutils-2.17.50&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf binutils-2.17.50.tgz               # from 32B650.zip&lt;br /&gt;
 patch -p0 &amp;lt; ./binutils-2.17.50_fc11.patch &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${UTILS}&lt;br /&gt;
 cd BUILD/${UTILS}&lt;br /&gt;
 &lt;br /&gt;
 ../../${UTILS}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
     --with-sysroot=${SYSROOT} &lt;br /&gt;
 make&lt;br /&gt;
 &lt;br /&gt;
 make install&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p $PREFIX/$TARGET/include&lt;br /&gt;
 cp ${BUILDROOT}/src/${UTILS}/include/libiberty.h $PREFIX/$TARGET/include&lt;br /&gt;
&lt;br /&gt;
When all goes well, you will now have the following executables in /usr/local/bin:&lt;br /&gt;
&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-addr2line&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ar&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-as&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-c++filt&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-gprof&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ld&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-nm&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objcopy&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-objdump&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-ranlib&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-readelf&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-size&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strings&lt;br /&gt;
 arm-SamyGO-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
====GCC installation, stage 1====&lt;br /&gt;
The C-compiler (gcc) has to be built in two stages: First, it is built and linked against the existing C-library (glibc). This version of the compiler is used to build glibc for the target platform, and then gcc is built again, now with the just compiled C-library.&lt;br /&gt;
&lt;br /&gt;
The stage 1 build of gcc renders a barebones gcc, just useful for compiling glibc, as described in the next step: Edit install_gcc_stage1.sh according to your needs and execute. The source code will be patched to prevent building of two runtime objects that cannot be linked yet (because we don't have a working C-library for ARM, yet) &lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 1 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage1.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GCC}.tgz      # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./gcc-4.2.0-4.0.9_t-linux-eabi.patch&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage1 &lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage1&lt;br /&gt;
   ../../${GCC}/configure --prefix=${PREFIX} --target=${TARGET} \&lt;br /&gt;
       --enable-languages=c --disable-shared --disable-threads \&lt;br /&gt;
       --disable-libmudflap --disable-libssp --disable-nls \&lt;br /&gt;
       --disable-libgomp --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
   make all-gcc&lt;br /&gt;
   make install-gcc&lt;br /&gt;
====Glibc installation====&lt;br /&gt;
Build glibc for ARM: Edit the paths in mkglibc.sh (if needed) and execute:&lt;br /&gt;
&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install glibc using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (mkglibc.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the glibc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools                     # change to meet your needs&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GLIBC_VER=glibc-2.5.90-9.0.9&lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # unpack&lt;br /&gt;
 &lt;br /&gt;
 tar -zxvf ${GLIBC_VER}.tgz              # from 32B650.zip&lt;br /&gt;
 &lt;br /&gt;
 patch -p0 &amp;lt; ./${GLIBC_VER}_fc11.patch&lt;br /&gt;
 &lt;br /&gt;
 rm -rf ${BUILDROOT}/src/glibc-build-localedef&lt;br /&gt;
 mv ${BUILDROOT}/src/${GLIBC_VER}/glibc-build-localedef ./&lt;br /&gt;
 &lt;br /&gt;
 mkdir -p ${BUILDROOT}/src/BUILD/${GLIBC_VER}&lt;br /&gt;
 cd BUILD/${GLIBC_VER}&lt;br /&gt;
 &lt;br /&gt;
 # create some cached defaults: &lt;br /&gt;
 echo &amp;quot;libc_cv_forced_unwind=yes&amp;quot; &amp;gt; config.cache&lt;br /&gt;
 echo &amp;quot;libc_cv_c_cleanup=yes&amp;quot; &amp;gt;&amp;gt; config.cache&lt;br /&gt;
 &lt;br /&gt;
 export GCC_PATH=${PREFIX}/bin&lt;br /&gt;
 &lt;br /&gt;
 BUILD_CC=gcc CC=${GCC_PATH}/${CROSS_COMPILE}gcc ../../${GLIBC_VER}/configure \&lt;br /&gt;
     --target=${TARGET} --host=${TARGET} --prefix=${PREFIX}/${TARGET} \&lt;br /&gt;
     --with-__thread \&lt;br /&gt;
     --cache-file=config.cache --with-headers=${SYSROOT}/usr/include \&lt;br /&gt;
     --with-glibc=${BUILDROOT}/src/${GLIBC_VER} \&lt;br /&gt;
     --disable-profile --enable-add-ons&lt;br /&gt;
 make &lt;br /&gt;
 make install&lt;br /&gt;
====GCC installation, stage 2====&lt;br /&gt;
Finally, gcc needs to be rebuilt and linked against the just built glibc for ARM. Now C++-support will be included as well.&lt;br /&gt;
&lt;br /&gt;
Edit install_gcc_stage2.sh and execute. In this script, links to the kernel header files are created in the include/ directory of the toolchain. That's not very elegant. Normally, the C-compiler should try and find the kernel headers in e.g., /usr/src/linux/include, but that's where the native kernel sources for your build platform reside. Your build platform is not necessarily the same as your target platform (most likely not). The method presented here works, but needs some editing in the future.&lt;br /&gt;
 #! /bin/sh&lt;br /&gt;
 &lt;br /&gt;
 # how to install gcc stage 2 using this script:&lt;br /&gt;
 # &lt;br /&gt;
 # Create the ${BUILDROOT} directory, put this script (install_gcc_stage2.sh) &lt;br /&gt;
 # in it.&lt;br /&gt;
 # In ${BUILDROOT}, create a directory ./src and put the gcc tarball in it.&lt;br /&gt;
 &lt;br /&gt;
 # go up one directory and run this script. &lt;br /&gt;
 &lt;br /&gt;
 TARGET=arm-SamyGO-linux-gnueabi&lt;br /&gt;
 BUILDROOT=/tmp/arm-tools&lt;br /&gt;
 PREFIX=/usr/local                            # change to your liking&lt;br /&gt;
 SYSROOT=${BUILDROOT}/sysroot&lt;br /&gt;
 GCC=gcc-4.2.0-4.0.9 &lt;br /&gt;
 &lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
  &lt;br /&gt;
 cd ${BUILDROOT}/src&lt;br /&gt;
 &lt;br /&gt;
 # remove links to kernel headers if they exist:&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 rm -f  ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # create symlinks to kernel headers:&lt;br /&gt;
 &lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/linux ${PREFIX}/${TARGET}/include/linux&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm ${PREFIX}/${TARGET}/include/asm&lt;br /&gt;
 ln -s ${SYSROOT}/usr/include/asm-generic ${PREFIX}/${TARGET}/include/asm-generic&lt;br /&gt;
 &lt;br /&gt;
 # make builddir: &lt;br /&gt;
 &lt;br /&gt;
 mkdir -p BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 cd BUILD/${GCC}-stage2&lt;br /&gt;
 &lt;br /&gt;
 CC=gcc ../../${GCC}/configure --target=${TARGET} --prefix=${PREFIX} \&lt;br /&gt;
    --enable-languages=c,c++ --enable-threads --enable-shared \&lt;br /&gt;
    --disable-nls --enable- __cxa_atexit --enable-long-long \&lt;br /&gt;
    --enable-c99 --with-cpu=arm1136jf-s --with-fpu=vfp&lt;br /&gt;
 &lt;br /&gt;
 make&lt;br /&gt;
 make install&lt;br /&gt;
&lt;br /&gt;
When you look in /usr/local/bin now, you should see the cross-compilers for C and C++ for arm-SamyGO-linux-gnueabi.&lt;br /&gt;
&lt;br /&gt;
===Building the toolchain on Windows (Cygwin)===&lt;br /&gt;
The toolchain build on Windows/Cygwin proceeds in the same way as the build on Linux. If you have the choice between Windows and Linux, go for Linux. Shell script execution is orders of magnitude faster on Linux, and the installation procedure is carried out through _many_ shell scripts. Don't say that you haven't been warned. To be able to build the toolchain you need to have Cygwin installed, see the Cygwin website [http://www.cygwin.com] for details on installation. At the time of writing, the Cygwin stable release version was 1.5.25-15, and that is the version used for the build here, on Windows XP Home Edition. Cygwin creates a Unix-style environment on the Windows platform, and comes with pretty much the same development environment as GNU/Linux. You will need this GNU/Linux-style environment to be able to build your toolchain. The native Windows environment (visual studio and the likes) will NOT work.&lt;br /&gt;
====Cygwin installation notes====&lt;br /&gt;
When installing Cygwin, select &amp;quot;Unix-style linefeeds&amp;quot; (the default) when prompted. Otherwise you will find yourself editing ALL installation scripts, not just the handful presented here. &lt;br /&gt;
Apart from the default (minimal) installation, which you shouldn't touch, you should have at least the following packages installed:&lt;br /&gt;
&lt;br /&gt;
(Untick the &amp;quot;Hide obsolete packages&amp;quot; box in the &amp;quot;Select Packages&amp;quot; installer window to view everything, the packages in the following list may have been selected already for default installation)&lt;br /&gt;
&lt;br /&gt;
*autoconf&lt;br /&gt;
*automake&lt;br /&gt;
*bash&lt;br /&gt;
*binutils&lt;br /&gt;
*bison&lt;br /&gt;
*byacc&lt;br /&gt;
*bzip2&lt;br /&gt;
*diffutils&lt;br /&gt;
*flex&lt;br /&gt;
*gawk&lt;br /&gt;
*gcc&lt;br /&gt;
*gcc-core&lt;br /&gt;
*gcc-g++&lt;br /&gt;
*gcc4&lt;br /&gt;
*gcc4-core&lt;br /&gt;
*gcc4-g++&lt;br /&gt;
*gettext&lt;br /&gt;
*gzip&lt;br /&gt;
*libgcc1&lt;br /&gt;
*libiconv&lt;br /&gt;
*m4&lt;br /&gt;
*make&lt;br /&gt;
*patch&lt;br /&gt;
*patchutils&lt;br /&gt;
*texinfo&lt;br /&gt;
*unzip&lt;br /&gt;
*vim&lt;br /&gt;
*zip&lt;br /&gt;
It is not clear whether you actually need all of these, but most packages take little disk space and little time to install. Running into errors because of lacking packages will take more time.&lt;br /&gt;
&lt;br /&gt;
With Cygwin properly installed, the same 6 steps as described in the Linux installation section need to be taken.&lt;br /&gt;
Download the SamyGO patches and scripts [http://forum.samygo.tv/download/file.php?id=14] and edit these.&lt;br /&gt;
====Editing of installation scripts====&lt;br /&gt;
In the following, only differences with respect to the Linux installation will be described. Start Cygwin by double-clicking on its Desktop icon.&lt;br /&gt;
You will get a window in which the standard Cygwin shell runs (ash, if I'm not mistaken).&lt;br /&gt;
At the prompt, type the following command to make the BUILDROOT directory (take your pick with respect to the name, this is what I've been using):&lt;br /&gt;
 mkdir -p ./tmp/arm-tools&lt;br /&gt;
Copy the Samsung sources (32B650.zip) and the SamyGO patches and scripts to this directory. Windows explorer will do. Unpack the patches:&lt;br /&gt;
 cd ./tmp/arm-tools&lt;br /&gt;
 tar -zxvf SamyGO-toolchain-install_fc11.tgz&lt;br /&gt;
Edit the environment variable BUILDROOT in the installation scripts (all just installed files that end with .sh).&lt;br /&gt;
By default, Cygwin is installed in C:/cygwin. All paths used in Cygwin are relative to this installation path, but for some reason the BUILDROOT environment variable needs to point to the full path. Edit the line BUILDROOT in all installation scripts to make it point to the full path of your build (be sure to use the forward slashes!!):&lt;br /&gt;
 ...&lt;br /&gt;
 BUILDROOT=c:/cygwin/home/username/tmp/arm-tools         # edit according to your needs. &lt;br /&gt;
 ...&lt;br /&gt;
When using notepad.exe or another DOS-style editor, revert the scripts, after saving, to unix-style linefeeds with the command:&lt;br /&gt;
 dos2unix ./install_sources.sh&lt;br /&gt;
Do this for all scripts you edit, BEFORE execution. Failing to do so may render errors like:&lt;br /&gt;
 $'\r': command not found&lt;br /&gt;
This error type occurs when shell scripts with DOS rather than Unix-style linefeeds are being processed. When using the vi editor (in the Cygwin shell window) you don't have this problem.&lt;br /&gt;
====Installation of the sources and kernel headers====&lt;br /&gt;
Execute ./install_sources.sh and ./install_kernel_src.sh after one another by typing their names with a leading ./ and their extension .sh. Unlike Windows, Unix does not guess filename extensions. They are considered to be part of the filename, nothing else. This step installs the sources and kernel headers in the right place.&lt;br /&gt;
====Building of binutils and gcc, stage 1====&lt;br /&gt;
Edit ./mkbinutils.sh and ./install_gcc_stage1.sh. In both scripts, add a line to make the environment variable CC point to gcc-4:&lt;br /&gt;
 ...&lt;br /&gt;
 export ARCH=arm&lt;br /&gt;
 export CROSS_COMPILE=${TARGET}-&lt;br /&gt;
 export PATH=$PATH:${PREFIX}/bin&lt;br /&gt;
 export CC=/usr/bin/gcc-4&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
and build the binutils with ./mkbinutils.sh. &lt;br /&gt;
After successful completion, build gcc stage 1 with ./install_gcc_stage1.sh.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To be continued soon ...&lt;br /&gt;
&lt;br /&gt;
Well, building glibc on Cygwin proves to be a bit harder than I thought. For now only statically linked stuff is possible. Will get back here as soon as it's working properly, sorry, folks ...&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1788</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1788"/>
		<updated>2011-04-10T09:42:42Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* TV is not hacked */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Universal USB disk to hack C series TV'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
After hack your TV you can connect to TV via Telnet, you get CIFS (Samba) and NFS support, FTP Server, WebUI, crond, ...&amp;lt;br&amp;gt;&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will be executed.&amp;lt;br&amp;gt; &lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Safety measures for C series TVs==&lt;br /&gt;
Make some important settings before start hacking TV:&lt;br /&gt;
* In service menu, '''enable Debug mode''' for the RS232 port.&lt;br /&gt;
::With TV switched off, press the following sequence on the remote: '''[INFO] [MENU] [MUTE] [POWER]'''&lt;br /&gt;
::Enter the '''Control''' menu and set the value of the '''RS232 mode''' to '''Debug'''.&lt;br /&gt;
::Once you're back to the main Service menu, you will have to power off the TV for normal operation.&lt;br /&gt;
::Notice that your TV will reset RS232 mode back to UART when you install another firmware (no matter if it's older or newer).&lt;br /&gt;
* Have a working '''[[Ex-Link Cable for C-Series]]''' at hand. (desirable)&lt;br /&gt;
::If you don't feel capable of soldering such a cable, you can find and buy a cheap (under '''$5''') '''[http://shop.ebay.com/i.html?_trkparms=65%253A12%257C66%253A2%257C39%253A1%257C72%253A4030&amp;amp;rt=nc&amp;amp;_nkw=usb+ttl&amp;amp;_sticky=1&amp;amp;_trksid=p3286.c0.m14&amp;amp;_sop=15&amp;amp;_sc=1 USB to TTL adapter]''' at eBay.&lt;br /&gt;
&lt;br /&gt;
== Supported TV models ==&lt;br /&gt;
TV model is not important, you should check your firmware.&amp;lt;br&amp;gt;&lt;br /&gt;
* This hack '''works''' on all firmware versions (even latest firmwares):&lt;br /&gt;
 T-TDT5DEUC&lt;br /&gt;
 T-MSX5DEUC&lt;br /&gt;
 T-MSX6DEUC&lt;br /&gt;
 T-VALDEUC&lt;br /&gt;
 T-VALAUSC (modification of hack needed)&lt;br /&gt;
* Hack '''does not''' work on TV with '''T-VAL6DEUC''' firmware. &lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
1. USB &amp;gt; 1GB space (Windows users can use FAT32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to clean FAT32 USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 [Mute] [1] [1] [9] [Enter]&lt;br /&gt;
 set to '''on''' by pressing [left]&lt;br /&gt;
4. Export settings from TV to the same FAT32 USB (&amp;quot;Clone TV to USB&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Unplug USB stick from TV and save files you get anywhere on PC&amp;lt;br&amp;gt;&lt;br /&gt;
6. Download [http://download.samygo.tv/C%20Series/HotelMode%20hack/network_opt_18.02.2011_1.zip network_opt_18.02.2011_1.zip], extract archive. You get 1GB file '''network_opt_18.02.2011_sda2.img'''&amp;lt;br&amp;gt;&lt;br /&gt;
*'''IMPORTANT:''' This is the 3rd version of the USB image, updated on 18.2.2011.&amp;lt;br&amp;gt;&lt;br /&gt;
::If you have hacked TV with the earlier version or over widget and you want have benefits of this hack,&amp;lt;br&amp;gt;&lt;br /&gt;
::you should [http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_%28most_C_series_models%29#TV_is_already_hacked re-hack TV].[[File:Win32diskimage_howto.png |right]]&amp;lt;br&amp;gt;&lt;br /&gt;
7. Make USB from this image with help of included win32diskimager&lt;br /&gt;
* After win32diskimager finishes, you get two partitions on USB: one FAT32, accessible under Windows and a second, ext3 - not accessible under Windows.&amp;lt;br&amp;gt;&lt;br /&gt;
* You '''do not need''' to do any changes on ext3 partition.&amp;lt;br&amp;gt;&lt;br /&gt;
* '''All operations have to be done on the FAT32 partition, no linux needed.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation. What to do if... ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== '''TV is not hacked''' ===&lt;br /&gt;
8. Attach Universal hack USB you made to PC. Copy channel settings file (you made in normal mode) to root of USB.&amp;lt;br&amp;gt;&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length     Date    Time    Name&lt;br /&gt;
 --------- ---------- -----   ----&lt;br /&gt;
       68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (from the step &amp;quot;Clone TV to USB&amp;quot; above, only files, without directories) to '''/HotelMode''' directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone: &lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''off'''&lt;br /&gt;
* Hotel Mode &amp;amp;rarr; Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must work without errors.&amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again.&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories) (&amp;quot;Clone USB to TV&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
17. Press OK.&amp;lt;br&amp;gt;&lt;br /&gt;
18. TV restarts few times and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB!&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Wait 3 minutes'''. After three minutes you can switch off TV.&lt;br /&gt;
* Switch on TV again&lt;br /&gt;
* Try connect to TV over Telnet (Port 23).&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings, you can deactivate hotel mode from service menu.&lt;br /&gt;
19. If you haven't got your channels back and if you can't Telnet to TV, it means something went wrong.&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have Telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
21. Done.&lt;br /&gt;
&lt;br /&gt;
=== '''TV is already hacked''' ===&lt;br /&gt;
(Over Hotel Mode or Widget - doesn`t matter)&lt;br /&gt;
* Make USB (steps 6. and 7.)&lt;br /&gt;
* Do not change anything&lt;br /&gt;
* Attach to TV and connect via SSH/Telnet&lt;br /&gt;
* Find your usb:&lt;br /&gt;
 df -h | grep &amp;quot;/dtv/usb/sd&amp;quot; &lt;br /&gt;
* execute script '''first_run.sh''' with parameter of path to USB.&lt;br /&gt;
::e.g. if path to USB is '''/dtv/usb/sda1''', then command to enter is:&lt;br /&gt;
 sh +x /dtv/usb/sda1/first_run.sh /dtv/usb/sda1 &lt;br /&gt;
&amp;lt;small&amp;gt;Path might be different on your TV, for example: &lt;br /&gt;
::/dtv/usb/sdb1/first_run.sh /dtv/usb/sdb1 &lt;br /&gt;
::/dtv/usb/sdc1/first_run.sh /dtv/usb/sdc1 &lt;br /&gt;
Check exact path over Telnet before you start.&amp;lt;/small&amp;gt;&lt;br /&gt;
* Wait until you get the message &amp;quot;Installation Completed!&amp;quot;, but '''do not reboot TV 3 minutes''' (TV is making some dumps in this time, do not interrupt it.)&lt;br /&gt;
* Reboot TV (switch off, wait, switch on again)&lt;br /&gt;
* Done&lt;br /&gt;
&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
* To get access to TV (Telnet/FTP/WebUI) you must attach the same USB-stick that you created for this hack '''or''' prepare USB-stick with the latest [http://download.samygo.tv/C%20Series/ SamyGO-Extensions]. (If you need to know your CPU type enter '''cat /proc/cpuinfo''' into console.)&lt;br /&gt;
&lt;br /&gt;
* Example for mounting a NFS-share manually:&lt;br /&gt;
 cd /dtv/usb/sda1&lt;br /&gt;
 mkdir videos&lt;br /&gt;
 /bin/mount -o nolock 192.168.1.123:/videos /dtv/usb/sda1/videos -t nfs&lt;br /&gt;
&amp;lt;small&amp;gt;Change IP to your NFS-server IP, path to USB might differ too (sdb1/sdc1).&amp;lt;/small&amp;gt;&lt;br /&gt;
* To watch movies, create empty directory on root of usb:&lt;br /&gt;
 !network&lt;br /&gt;
&lt;br /&gt;
== Bricked TV ==&lt;br /&gt;
* '''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== '''ExLink cable available''' ===&lt;br /&gt;
==== Screen is blank ====&lt;br /&gt;
If your start.sh has been written with errors, TV does not boot properly...&amp;lt;br&amp;gt;&lt;br /&gt;
* Unplug TV and wait 30 sec. Plug to AC, power on TV. &lt;br /&gt;
This should remove /mtd_rwarea/start.sh. If that did not help, try:&lt;br /&gt;
* Connect [[Ex-Link Cable for C-Series]], switch to debug mode:&lt;br /&gt;
 10041004&lt;br /&gt;
enter:&lt;br /&gt;
 31337 (removes /mtd_rwarea/start.sh)&lt;br /&gt;
or:&lt;br /&gt;
 666 (removes /mtd_rwarea/start.sh, /mtd_rwarea/usb_mount, /mtd_rwarea/network_opt)&lt;br /&gt;
or:&lt;br /&gt;
 44337794 (check file to know better what it does /mtd_rwarea/network_opt/sbin/44337794)&lt;br /&gt;
&lt;br /&gt;
==== No reaction to USB, no telnet, but screen is on ====&lt;br /&gt;
* create empty file named '''kill_start.sh''' on root of USB&lt;br /&gt;
* power off TV&lt;br /&gt;
* attach USB and power on TV&lt;br /&gt;
/mtd_rwarea/start.sh should be deleted&lt;br /&gt;
&lt;br /&gt;
If no success, then:&lt;br /&gt;
==== format /mtd_rwarea/ ====&lt;br /&gt;
If you do not have success or script finishes with error,&lt;br /&gt;
or you have hacked over Widget and it stopped working (on latest firmwares),&lt;br /&gt;
Format /mtd_rwarea over ExLink and get &amp;quot;virgin&amp;quot; TV back:&lt;br /&gt;
* Make [[Ex-Link Cable for C-Series]] attach to TV.&lt;br /&gt;
* Power off TV.&lt;br /&gt;
* Unplug network and antenna cable. Leave only ExLink and power cable plugged.&lt;br /&gt;
* Power on TV.&lt;br /&gt;
* Open terminal and connect to TV over ExLink.&lt;br /&gt;
* Apply these commands (followed by Enter):&lt;br /&gt;
 10041004&lt;br /&gt;
 81588&lt;br /&gt;
 20089999&lt;br /&gt;
 2&lt;br /&gt;
 0&lt;br /&gt;
 0&lt;br /&gt;
 2 (advanced)&lt;br /&gt;
 2 (DeviceManager Debug)&lt;br /&gt;
 90 (DeviceManager MW Debug)&lt;br /&gt;
 12 (DLNA, FLASH, ODD, HDD, MoIP Test)&lt;br /&gt;
 11 (FLASH, HDD Format Test)&lt;br /&gt;
 10 (or another, /mtd_rwarea/ partition number (14)&lt;br /&gt;
&lt;br /&gt;
::On the last line you have to enter number of your /mtd_rwarea/. On C550 it is 10, but on other TV it can be other (e.g. 14)&lt;br /&gt;
::Try to hack TV again starting from step 7.&lt;br /&gt;
&lt;br /&gt;
=== '''no ExLink cable available''' ===&lt;br /&gt;
&lt;br /&gt;
* Create script on USB '''emergency_start.sh''' (kill_start.sh is to delete)&lt;br /&gt;
* Attach USB to TV on stand-by mode and power it on&lt;br /&gt;
* TV executes this script on boot.&lt;br /&gt;
Factory reset on ServiceMenu. This operation should delete ''/mtd_rwarea/network_opt''&lt;br /&gt;
*Hack TV with universal USB disk again&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
To be updated...&lt;br /&gt;
&lt;br /&gt;
== Tested and works on TV ==&lt;br /&gt;
* LE32C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE32C550J1WU [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1WX [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE37C630  [T-MSX6DEUC 1002.1]&amp;lt;br&amp;gt;&lt;br /&gt;
* LE40C650L1WX [T-VALDEUC-2002]&lt;br /&gt;
* LE40C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE40C750 [T-VALDEUC 3007.1]&lt;br /&gt;
* PN58C7000 [T-VALAUSC 001035] - some [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=974&amp;amp;p=13650#p13642 modification] of hack is needed.&lt;br /&gt;
* PS50C550 [T-TDT5DEUC]&lt;br /&gt;
* UE32C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* UE32C5000QW [T-TDT5DEUC-1022.0 ]&lt;br /&gt;
* UE40C8700 [T-VALDEUC-'''3006.2''']&lt;br /&gt;
* UE40C8700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE40C6700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE46C6105 [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE55C7700 [T-VALDEUC '''3006.1'''] &lt;br /&gt;
* UE55C8705 [T-VALDEUC '''3007.1''']&lt;br /&gt;
::To be updated...&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Author and developer of universal USB hack disk - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 12:13, 11 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1787</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1787"/>
		<updated>2011-04-10T09:40:07Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* TV is not hacked */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Universal USB disk to hack C series TV'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
After hack your TV you can connect to TV via Telnet, you get CIFS (Samba) and NFS support, FTP Server, WebUI, crond, ...&amp;lt;br&amp;gt;&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will be executed.&amp;lt;br&amp;gt; &lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Safety measures for C series TVs==&lt;br /&gt;
Make some important settings before start hacking TV:&lt;br /&gt;
* In service menu, '''enable Debug mode''' for the RS232 port.&lt;br /&gt;
::With TV switched off, press the following sequence on the remote: '''[INFO] [MENU] [MUTE] [POWER]'''&lt;br /&gt;
::Enter the '''Control''' menu and set the value of the '''RS232 mode''' to '''Debug'''.&lt;br /&gt;
::Once you're back to the main Service menu, you will have to power off the TV for normal operation.&lt;br /&gt;
::Notice that your TV will reset RS232 mode back to UART when you install another firmware (no matter if it's older or newer).&lt;br /&gt;
* Have a working '''[[Ex-Link Cable for C-Series]]''' at hand. (desirable)&lt;br /&gt;
::If you don't feel capable of soldering such a cable, you can find and buy a cheap (under '''$5''') '''[http://shop.ebay.com/i.html?_trkparms=65%253A12%257C66%253A2%257C39%253A1%257C72%253A4030&amp;amp;rt=nc&amp;amp;_nkw=usb+ttl&amp;amp;_sticky=1&amp;amp;_trksid=p3286.c0.m14&amp;amp;_sop=15&amp;amp;_sc=1 USB to TTL adapter]''' at eBay.&lt;br /&gt;
&lt;br /&gt;
== Supported TV models ==&lt;br /&gt;
TV model is not important, you should check your firmware.&amp;lt;br&amp;gt;&lt;br /&gt;
* This hack '''works''' on all firmware versions (even latest firmwares):&lt;br /&gt;
 T-TDT5DEUC&lt;br /&gt;
 T-MSX5DEUC&lt;br /&gt;
 T-MSX6DEUC&lt;br /&gt;
 T-VALDEUC&lt;br /&gt;
 T-VALAUSC (modification of hack needed)&lt;br /&gt;
* Hack '''does not''' work on TV with '''T-VAL6DEUC''' firmware. &lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
1. USB &amp;gt; 1GB space (Windows users can use FAT32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to clean FAT32 USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 [Mute] [1] [1] [9] [Enter]&lt;br /&gt;
 set to '''on''' by pressing [left]&lt;br /&gt;
4. Export settings from TV to the same FAT32 USB (&amp;quot;Clone TV to USB&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Unplug USB stick from TV and save files you get anywhere on PC&amp;lt;br&amp;gt;&lt;br /&gt;
6. Download [http://download.samygo.tv/C%20Series/HotelMode%20hack/network_opt_18.02.2011_1.zip network_opt_18.02.2011_1.zip], extract archive. You get 1GB file '''network_opt_18.02.2011_sda2.img'''&amp;lt;br&amp;gt;&lt;br /&gt;
*'''IMPORTANT:''' This is the 3rd version of the USB image, updated on 18.2.2011.&amp;lt;br&amp;gt;&lt;br /&gt;
::If you have hacked TV with the earlier version or over widget and you want have benefits of this hack,&amp;lt;br&amp;gt;&lt;br /&gt;
::you should [http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_%28most_C_series_models%29#TV_is_already_hacked re-hack TV].[[File:Win32diskimage_howto.png |right]]&amp;lt;br&amp;gt;&lt;br /&gt;
7. Make USB from this image with help of included win32diskimager&lt;br /&gt;
* After win32diskimager finishes, you get two partitions on USB: one FAT32, accessible under Windows and a second, ext3 - not accessible under Windows.&amp;lt;br&amp;gt;&lt;br /&gt;
* You '''do not need''' to do any changes on ext3 partition.&amp;lt;br&amp;gt;&lt;br /&gt;
* '''All operations have to be done on the FAT32 partition, no linux needed.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation. What to do if... ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== '''TV is not hacked''' ===&lt;br /&gt;
8. Attach Universal hack USB you made to PC. Copy channel settings file (you made in normal mode) to root of USB.&amp;lt;br&amp;gt;&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length     Date    Time    Name&lt;br /&gt;
 --------- ---------- -----   ----&lt;br /&gt;
       68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (only files, without directories) to '''/HotelMode''' directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone: (These are the files coming from the step &amp;quot;Clone TV to USB&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''off'''&lt;br /&gt;
* Hotel Mode &amp;amp;rarr; Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must work without errors.&amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again.&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories) (&amp;quot;Clone USB to TV&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
17. Press OK.&amp;lt;br&amp;gt;&lt;br /&gt;
18. TV restarts few times and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB!&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Wait 3 minutes'''. After three minutes you can switch off TV.&lt;br /&gt;
* Switch on TV again&lt;br /&gt;
* Try connect to TV over Telnet (Port 23).&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings, you can deactivate hotel mode from service menu.&lt;br /&gt;
19. If you haven't got your channels back and if you can't Telnet to TV, it means something went wrong.&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have Telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
21. Done.&lt;br /&gt;
&lt;br /&gt;
=== '''TV is already hacked''' ===&lt;br /&gt;
(Over Hotel Mode or Widget - doesn`t matter)&lt;br /&gt;
* Make USB (steps 6. and 7.)&lt;br /&gt;
* Do not change anything&lt;br /&gt;
* Attach to TV and connect via SSH/Telnet&lt;br /&gt;
* Find your usb:&lt;br /&gt;
 df -h | grep &amp;quot;/dtv/usb/sd&amp;quot; &lt;br /&gt;
* execute script '''first_run.sh''' with parameter of path to USB.&lt;br /&gt;
::e.g. if path to USB is '''/dtv/usb/sda1''', then command to enter is:&lt;br /&gt;
 sh +x /dtv/usb/sda1/first_run.sh /dtv/usb/sda1 &lt;br /&gt;
&amp;lt;small&amp;gt;Path might be different on your TV, for example: &lt;br /&gt;
::/dtv/usb/sdb1/first_run.sh /dtv/usb/sdb1 &lt;br /&gt;
::/dtv/usb/sdc1/first_run.sh /dtv/usb/sdc1 &lt;br /&gt;
Check exact path over Telnet before you start.&amp;lt;/small&amp;gt;&lt;br /&gt;
* Wait until you get the message &amp;quot;Installation Completed!&amp;quot;, but '''do not reboot TV 3 minutes''' (TV is making some dumps in this time, do not interrupt it.)&lt;br /&gt;
* Reboot TV (switch off, wait, switch on again)&lt;br /&gt;
* Done&lt;br /&gt;
&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
* To get access to TV (Telnet/FTP/WebUI) you must attach the same USB-stick that you created for this hack '''or''' prepare USB-stick with the latest [http://download.samygo.tv/C%20Series/ SamyGO-Extensions]. (If you need to know your CPU type enter '''cat /proc/cpuinfo''' into console.)&lt;br /&gt;
&lt;br /&gt;
* Example for mounting a NFS-share manually:&lt;br /&gt;
 cd /dtv/usb/sda1&lt;br /&gt;
 mkdir videos&lt;br /&gt;
 /bin/mount -o nolock 192.168.1.123:/videos /dtv/usb/sda1/videos -t nfs&lt;br /&gt;
&amp;lt;small&amp;gt;Change IP to your NFS-server IP, path to USB might differ too (sdb1/sdc1).&amp;lt;/small&amp;gt;&lt;br /&gt;
* To watch movies, create empty directory on root of usb:&lt;br /&gt;
 !network&lt;br /&gt;
&lt;br /&gt;
== Bricked TV ==&lt;br /&gt;
* '''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== '''ExLink cable available''' ===&lt;br /&gt;
==== Screen is blank ====&lt;br /&gt;
If your start.sh has been written with errors, TV does not boot properly...&amp;lt;br&amp;gt;&lt;br /&gt;
* Unplug TV and wait 30 sec. Plug to AC, power on TV. &lt;br /&gt;
This should remove /mtd_rwarea/start.sh. If that did not help, try:&lt;br /&gt;
* Connect [[Ex-Link Cable for C-Series]], switch to debug mode:&lt;br /&gt;
 10041004&lt;br /&gt;
enter:&lt;br /&gt;
 31337 (removes /mtd_rwarea/start.sh)&lt;br /&gt;
or:&lt;br /&gt;
 666 (removes /mtd_rwarea/start.sh, /mtd_rwarea/usb_mount, /mtd_rwarea/network_opt)&lt;br /&gt;
or:&lt;br /&gt;
 44337794 (check file to know better what it does /mtd_rwarea/network_opt/sbin/44337794)&lt;br /&gt;
&lt;br /&gt;
==== No reaction to USB, no telnet, but screen is on ====&lt;br /&gt;
* create empty file named '''kill_start.sh''' on root of USB&lt;br /&gt;
* power off TV&lt;br /&gt;
* attach USB and power on TV&lt;br /&gt;
/mtd_rwarea/start.sh should be deleted&lt;br /&gt;
&lt;br /&gt;
If no success, then:&lt;br /&gt;
==== format /mtd_rwarea/ ====&lt;br /&gt;
If you do not have success or script finishes with error,&lt;br /&gt;
or you have hacked over Widget and it stopped working (on latest firmwares),&lt;br /&gt;
Format /mtd_rwarea over ExLink and get &amp;quot;virgin&amp;quot; TV back:&lt;br /&gt;
* Make [[Ex-Link Cable for C-Series]] attach to TV.&lt;br /&gt;
* Power off TV.&lt;br /&gt;
* Unplug network and antenna cable. Leave only ExLink and power cable plugged.&lt;br /&gt;
* Power on TV.&lt;br /&gt;
* Open terminal and connect to TV over ExLink.&lt;br /&gt;
* Apply these commands (followed by Enter):&lt;br /&gt;
 10041004&lt;br /&gt;
 81588&lt;br /&gt;
 20089999&lt;br /&gt;
 2&lt;br /&gt;
 0&lt;br /&gt;
 0&lt;br /&gt;
 2 (advanced)&lt;br /&gt;
 2 (DeviceManager Debug)&lt;br /&gt;
 90 (DeviceManager MW Debug)&lt;br /&gt;
 12 (DLNA, FLASH, ODD, HDD, MoIP Test)&lt;br /&gt;
 11 (FLASH, HDD Format Test)&lt;br /&gt;
 10 (or another, /mtd_rwarea/ partition number (14)&lt;br /&gt;
&lt;br /&gt;
::On the last line you have to enter number of your /mtd_rwarea/. On C550 it is 10, but on other TV it can be other (e.g. 14)&lt;br /&gt;
::Try to hack TV again starting from step 7.&lt;br /&gt;
&lt;br /&gt;
=== '''no ExLink cable available''' ===&lt;br /&gt;
&lt;br /&gt;
* Create script on USB '''emergency_start.sh''' (kill_start.sh is to delete)&lt;br /&gt;
* Attach USB to TV on stand-by mode and power it on&lt;br /&gt;
* TV executes this script on boot.&lt;br /&gt;
Factory reset on ServiceMenu. This operation should delete ''/mtd_rwarea/network_opt''&lt;br /&gt;
*Hack TV with universal USB disk again&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
To be updated...&lt;br /&gt;
&lt;br /&gt;
== Tested and works on TV ==&lt;br /&gt;
* LE32C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE32C550J1WU [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1WX [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE37C630  [T-MSX6DEUC 1002.1]&amp;lt;br&amp;gt;&lt;br /&gt;
* LE40C650L1WX [T-VALDEUC-2002]&lt;br /&gt;
* LE40C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE40C750 [T-VALDEUC 3007.1]&lt;br /&gt;
* PN58C7000 [T-VALAUSC 001035] - some [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=974&amp;amp;p=13650#p13642 modification] of hack is needed.&lt;br /&gt;
* PS50C550 [T-TDT5DEUC]&lt;br /&gt;
* UE32C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* UE32C5000QW [T-TDT5DEUC-1022.0 ]&lt;br /&gt;
* UE40C8700 [T-VALDEUC-'''3006.2''']&lt;br /&gt;
* UE40C8700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE40C6700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE46C6105 [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE55C7700 [T-VALDEUC '''3006.1'''] &lt;br /&gt;
* UE55C8705 [T-VALDEUC '''3007.1''']&lt;br /&gt;
::To be updated...&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Author and developer of universal USB hack disk - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 12:13, 11 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1778</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1778"/>
		<updated>2011-04-09T16:58:16Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Tested and works on TV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Universal USB disk to hack C series TV'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
After hack your TV you can connect to TV via Telnet, you get CIFS (Samba) and NFS support, FTP Server, WebUI, crond, ...&amp;lt;br&amp;gt;&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will be executed.&amp;lt;br&amp;gt; &lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Safety measures for C series TVs==&lt;br /&gt;
Make some important settings before start hacking TV:&lt;br /&gt;
* In service menu, '''enable Debug mode''' for the RS232 port.&lt;br /&gt;
::With TV switched off, press the following sequence on the remote: '''[INFO] [MENU] [MUTE] [POWER]'''&lt;br /&gt;
::Enter the '''Control''' menu and set the value of the '''RS232 mode''' to '''Debug'''.&lt;br /&gt;
::Once you're back to the main Service menu, you will have to power off the TV for normal operation.&lt;br /&gt;
::Notice that your TV will reset RS232 mode back to UART when you install another firmware (no matter if it's older or newer).&lt;br /&gt;
* Have a working '''[[Ex-Link Cable for C-Series]]''' at hand. (desirable)&lt;br /&gt;
::If you don't feel capable of soldering such a cable, you can find and buy a cheap (under '''$5''') '''[http://shop.ebay.com/i.html?_trkparms=65%253A12%257C66%253A2%257C39%253A1%257C72%253A4030&amp;amp;rt=nc&amp;amp;_nkw=usb+ttl&amp;amp;_sticky=1&amp;amp;_trksid=p3286.c0.m14&amp;amp;_sop=15&amp;amp;_sc=1 USB to TTL adapter]''' at eBay.&lt;br /&gt;
&lt;br /&gt;
== Supported TV models ==&lt;br /&gt;
TV model is not important, you should check your firmware.&amp;lt;br&amp;gt;&lt;br /&gt;
* This hack '''works''' on all firmware versions (even latest firmwares):&lt;br /&gt;
 T-TDT5DEUC&lt;br /&gt;
 T-MSX5DEUC&lt;br /&gt;
 T-MSX6DEUC&lt;br /&gt;
 T-VALDEUC&lt;br /&gt;
 T-VALAUSC (modification of hack needed)&lt;br /&gt;
* Hack '''does not''' work on TV with '''T-VAL6DEUC''' firmware. &lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
1. USB &amp;gt; 1GB space (Windows users can use FAT32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to clean FAT32 USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 [Mute] [1] [1] [9] [Enter]&lt;br /&gt;
 set to '''on''' by pressing [left]&lt;br /&gt;
4. Export settings from TV to the same FAT32 USB (&amp;quot;Clone TV to USB&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Unplug USB stick from TV and save files you get anywhere on PC&amp;lt;br&amp;gt;&lt;br /&gt;
6. Download [http://download.samygo.tv/C%20Series/HotelMode%20hack/network_opt_18.02.2011_1.zip network_opt_18.02.2011_1.zip], extract archive. You get 1GB file '''network_opt_18.02.2011_sda2.img'''&amp;lt;br&amp;gt;&lt;br /&gt;
*'''IMPORTANT:''' This is the 3rd version of the USB image, updated on 18.2.2011.&amp;lt;br&amp;gt;&lt;br /&gt;
::If you have hacked TV with the earlier version or over widget and you want have benefits of this hack,&amp;lt;br&amp;gt;&lt;br /&gt;
::you should [http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_%28most_C_series_models%29#TV_is_already_hacked re-hack TV].[[File:Win32diskimage_howto.png |right]]&amp;lt;br&amp;gt;&lt;br /&gt;
7. Make USB from this image with help of included win32diskimager&lt;br /&gt;
* After win32diskimager finishes, you get two partitions on USB: one FAT32, accessible under Windows and a second, ext3 - not accessible under Windows.&amp;lt;br&amp;gt;&lt;br /&gt;
* You '''do not need''' to do any changes on ext3 partition.&amp;lt;br&amp;gt;&lt;br /&gt;
* '''All operations have to be done on the FAT32 partition, no linux needed.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation. What to do if... ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== '''TV is not hacked''' ===&lt;br /&gt;
8. Attach Universal hack USB you made to PC. Copy channel settings file (you made in normal mode) to root of USB.&amp;lt;br&amp;gt;&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length     Date    Time    Name&lt;br /&gt;
 --------- ---------- -----   ----&lt;br /&gt;
       68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (only files, without directories) to '''/HotelMode''' directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''off'''&lt;br /&gt;
* Hotel Mode &amp;amp;rarr; Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must work without errors.&amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again.&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories) (&amp;quot;Clone USB to TV&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
17. Press OK.&amp;lt;br&amp;gt;&lt;br /&gt;
18. TV restarts few times and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB!&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Wait 3 minutes'''. After three minutes you can switch off TV.&lt;br /&gt;
* Switch on TV again&lt;br /&gt;
* Try connect to TV over Telnet (Port 23).&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings, you can deactivate hotel mode from service menu.&lt;br /&gt;
19. If you haven't got your channels back and if you can't Telnet to TV, it means something went wrong.&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have Telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
21. Done.&lt;br /&gt;
&lt;br /&gt;
=== '''TV is already hacked''' ===&lt;br /&gt;
(Over Hotel Mode or Widget - doesn`t matter)&lt;br /&gt;
* Make USB (steps 6. and 7.)&lt;br /&gt;
* Do not change anything&lt;br /&gt;
* Attach to TV and connect via SSH/Telnet&lt;br /&gt;
* Find your usb:&lt;br /&gt;
 df -h | grep &amp;quot;/dtv/usb/sd&amp;quot; &lt;br /&gt;
* execute script '''first_run.sh''' with parameter of path to USB.&lt;br /&gt;
::e.g. if path to USB is '''/dtv/usb/sda1''', then command to enter is:&lt;br /&gt;
 sh +x /dtv/usb/sda1/first_run.sh /dtv/usb/sda1 &lt;br /&gt;
&amp;lt;small&amp;gt;Path might be different on your TV, for example: &lt;br /&gt;
::/dtv/usb/sdb1/first_run.sh /dtv/usb/sdb1 &lt;br /&gt;
::/dtv/usb/sdc1/first_run.sh /dtv/usb/sdc1 &lt;br /&gt;
Check exact path over Telnet before you start.&amp;lt;/small&amp;gt;&lt;br /&gt;
* Wait until you get the message &amp;quot;Installation Completed!&amp;quot;, but '''do not reboot TV 3 minutes''' (TV is making some dumps in this time, do not interrupt it.)&lt;br /&gt;
* Reboot TV (switch off, wait, switch on again)&lt;br /&gt;
* Done&lt;br /&gt;
&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
* To get access to TV (Telnet/FTP/WebUI) you must attach the same USB-stick that you created for this hack '''or''' prepare USB-stick with the latest [http://download.samygo.tv/C%20Series/ SamyGO-Extensions]. (If you need to know your CPU type enter '''cat /proc/cpuinfo''' into console.)&lt;br /&gt;
&lt;br /&gt;
* Example for mounting a NFS-share manually:&lt;br /&gt;
 cd /dtv/usb/sda1&lt;br /&gt;
 mkdir videos&lt;br /&gt;
 /bin/mount -o nolock 192.168.1.123:/videos /dtv/usb/sda1/videos -t nfs&lt;br /&gt;
&amp;lt;small&amp;gt;Change IP to your NFS-server IP, path to USB might differ too (sdb1/sdc1).&amp;lt;/small&amp;gt;&lt;br /&gt;
* To watch movies, create empty directory on root of usb:&lt;br /&gt;
 !network&lt;br /&gt;
&lt;br /&gt;
== Bricked TV ==&lt;br /&gt;
* '''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== '''ExLink cable available''' ===&lt;br /&gt;
==== Screen is blank ====&lt;br /&gt;
If your start.sh has been written with errors, TV does not boot properly...&amp;lt;br&amp;gt;&lt;br /&gt;
* Unplug TV and wait 30 sec. Plug to AC, power on TV. &lt;br /&gt;
This should remove /mtd_rwarea/start.sh. If that did not help, try:&lt;br /&gt;
* Connect [[Ex-Link Cable for C-Series]], switch to debug mode:&lt;br /&gt;
 10041004&lt;br /&gt;
enter:&lt;br /&gt;
 31337 (removes /mtd_rwarea/start.sh)&lt;br /&gt;
or:&lt;br /&gt;
 666 (removes /mtd_rwarea/start.sh, /mtd_rwarea/usb_mount, /mtd_rwarea/network_opt)&lt;br /&gt;
or:&lt;br /&gt;
 44337794 (check file to know better what it does /mtd_rwarea/network_opt/sbin/44337794)&lt;br /&gt;
&lt;br /&gt;
==== No reaction to USB, no telnet, but screen is on ====&lt;br /&gt;
* create empty file named '''kill_start.sh''' on root of USB&lt;br /&gt;
* power off TV&lt;br /&gt;
* attach USB and power on TV&lt;br /&gt;
/mtd_rwarea/start.sh should be deleted&lt;br /&gt;
&lt;br /&gt;
If no success, then:&lt;br /&gt;
==== format /mtd_rwarea/ ====&lt;br /&gt;
If you do not have success or script finishes with error,&lt;br /&gt;
or you have hacked over Widget and it stopped working (on latest firmwares),&lt;br /&gt;
Format /mtd_rwarea over ExLink and get &amp;quot;virgin&amp;quot; TV back:&lt;br /&gt;
* Make [[Ex-Link Cable for C-Series]] attach to TV.&lt;br /&gt;
* Power off TV.&lt;br /&gt;
* Unplug network and antenna cable. Leave only ExLink and power cable plugged.&lt;br /&gt;
* Power on TV.&lt;br /&gt;
* Open terminal and connect to TV over ExLink.&lt;br /&gt;
* Apply these commands (followed by Enter):&lt;br /&gt;
 10041004&lt;br /&gt;
 81588&lt;br /&gt;
 20089999&lt;br /&gt;
 2&lt;br /&gt;
 0&lt;br /&gt;
 0&lt;br /&gt;
 2 (advanced)&lt;br /&gt;
 2 (DeviceManager Debug)&lt;br /&gt;
 90 (DeviceManager MW Debug)&lt;br /&gt;
 12 (DLNA, FLASH, ODD, HDD, MoIP Test)&lt;br /&gt;
 11 (FLASH, HDD Format Test)&lt;br /&gt;
 10 (or another, /mtd_rwarea/ partition number (14)&lt;br /&gt;
&lt;br /&gt;
::On the last line you have to enter number of your /mtd_rwarea/. On C550 it is 10, but on other TV it can be other (e.g. 14)&lt;br /&gt;
::Try to hack TV again starting from step 7.&lt;br /&gt;
&lt;br /&gt;
=== '''no ExLink cable available''' ===&lt;br /&gt;
&lt;br /&gt;
* Create script on USB '''emergency_start.sh''' (kill_start.sh is to delete)&lt;br /&gt;
* Attach USB to TV on stand-by mode and power it on&lt;br /&gt;
* TV executes this script on boot.&lt;br /&gt;
Factory reset on ServiceMenu. This operation should delete ''/mtd_rwarea/network_opt''&lt;br /&gt;
*Hack TV with universal USB disk again&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
To be updated...&lt;br /&gt;
&lt;br /&gt;
== Tested and works on TV ==&lt;br /&gt;
* LE32C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE32C550J1WU [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1WX [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE37C630  [T-MSX6DEUC 1002.1]&amp;lt;br&amp;gt;&lt;br /&gt;
* LE40C650L1WX [T-VALDEUC-2002]&lt;br /&gt;
* LE40C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE40C750 [T-VALDEUC 3007.1]&lt;br /&gt;
* PN58C7000 [T-VALAUSC 001035] - some [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=974&amp;amp;p=13650#p13642 modification] of hack is needed.&lt;br /&gt;
* PS50C550 [T-TDT5DEUC]&lt;br /&gt;
* UE32C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* UE32C5000QW [T-TDT5DEUC-1022.0 ]&lt;br /&gt;
* UE40C8700 [T-VALDEUC-'''3006.2''']&lt;br /&gt;
* UE40C8700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE40C6700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE46C6105 [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE55C7700 [T-VALDEUC '''3006.1'''] &lt;br /&gt;
* UE55C8705 [T-VALDEUC '''3007.1''']&lt;br /&gt;
::To be updated...&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Author and developer of universal USB hack disk - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 12:13, 11 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1777</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1777"/>
		<updated>2011-04-09T16:52:00Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Tested and works on TV */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Universal USB disk to hack C series TV'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
After hack your TV you can connect to TV via Telnet, you get CIFS (Samba) and NFS support, FTP Server, WebUI, crond, ...&amp;lt;br&amp;gt;&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will be executed.&amp;lt;br&amp;gt; &lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below).&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==Safety measures for C series TVs==&lt;br /&gt;
Make some important settings before start hacking TV:&lt;br /&gt;
* In service menu, '''enable Debug mode''' for the RS232 port.&lt;br /&gt;
::With TV switched off, press the following sequence on the remote: '''[INFO] [MENU] [MUTE] [POWER]'''&lt;br /&gt;
::Enter the '''Control''' menu and set the value of the '''RS232 mode''' to '''Debug'''.&lt;br /&gt;
::Once you're back to the main Service menu, you will have to power off the TV for normal operation.&lt;br /&gt;
::Notice that your TV will reset RS232 mode back to UART when you install another firmware (no matter if it's older or newer).&lt;br /&gt;
* Have a working '''[[Ex-Link Cable for C-Series]]''' at hand. (desirable)&lt;br /&gt;
::If you don't feel capable of soldering such a cable, you can find and buy a cheap (under '''$5''') '''[http://shop.ebay.com/i.html?_trkparms=65%253A12%257C66%253A2%257C39%253A1%257C72%253A4030&amp;amp;rt=nc&amp;amp;_nkw=usb+ttl&amp;amp;_sticky=1&amp;amp;_trksid=p3286.c0.m14&amp;amp;_sop=15&amp;amp;_sc=1 USB to TTL adapter]''' at eBay.&lt;br /&gt;
&lt;br /&gt;
== Supported TV models ==&lt;br /&gt;
TV model is not important, you should check your firmware.&amp;lt;br&amp;gt;&lt;br /&gt;
* This hack '''works''' on all firmware versions (even latest firmwares):&lt;br /&gt;
 T-TDT5DEUC&lt;br /&gt;
 T-MSX5DEUC&lt;br /&gt;
 T-MSX6DEUC&lt;br /&gt;
 T-VALDEUC&lt;br /&gt;
 T-VALAUSC (modification of hack needed)&lt;br /&gt;
* Hack '''does not''' work on TV with '''T-VAL6DEUC''' firmware. &lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
1. USB &amp;gt; 1GB space (Windows users can use FAT32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to clean FAT32 USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 [Mute] [1] [1] [9] [Enter]&lt;br /&gt;
 set to '''on''' by pressing [left]&lt;br /&gt;
4. Export settings from TV to the same FAT32 USB (&amp;quot;Clone TV to USB&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
5. Unplug USB stick from TV and save files you get anywhere on PC&amp;lt;br&amp;gt;&lt;br /&gt;
6. Download [http://download.samygo.tv/C%20Series/HotelMode%20hack/network_opt_18.02.2011_1.zip network_opt_18.02.2011_1.zip], extract archive. You get 1GB file '''network_opt_18.02.2011_sda2.img'''&amp;lt;br&amp;gt;&lt;br /&gt;
*'''IMPORTANT:''' This is the 3rd version of the USB image, updated on 18.2.2011.&amp;lt;br&amp;gt;&lt;br /&gt;
::If you have hacked TV with the earlier version or over widget and you want have benefits of this hack,&amp;lt;br&amp;gt;&lt;br /&gt;
::you should [http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_%28most_C_series_models%29#TV_is_already_hacked re-hack TV].[[File:Win32diskimage_howto.png |right]]&amp;lt;br&amp;gt;&lt;br /&gt;
7. Make USB from this image with help of included win32diskimager&lt;br /&gt;
* After win32diskimager finishes, you get two partitions on USB: one FAT32, accessible under Windows and a second, ext3 - not accessible under Windows.&amp;lt;br&amp;gt;&lt;br /&gt;
* You '''do not need''' to do any changes on ext3 partition.&amp;lt;br&amp;gt;&lt;br /&gt;
* '''All operations have to be done on the FAT32 partition, no linux needed.'''&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation. What to do if... ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
=== '''TV is not hacked''' ===&lt;br /&gt;
8. Attach Universal hack USB you made to PC. Copy channel settings file (you made in normal mode) to root of USB.&amp;lt;br&amp;gt;&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length     Date    Time    Name&lt;br /&gt;
 --------- ---------- -----   ----&lt;br /&gt;
       68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (only files, without directories) to '''/HotelMode''' directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''off'''&lt;br /&gt;
* Hotel Mode &amp;amp;rarr; Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must work without errors.&amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again.&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories) (&amp;quot;Clone USB to TV&amp;quot;)&amp;lt;br&amp;gt;&lt;br /&gt;
17. Press OK.&amp;lt;br&amp;gt;&lt;br /&gt;
18. TV restarts few times and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB!&amp;lt;br&amp;gt;&lt;br /&gt;
* '''Wait 3 minutes'''. After three minutes you can switch off TV.&lt;br /&gt;
* Switch on TV again&lt;br /&gt;
* Try connect to TV over Telnet (Port 23).&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings, you can deactivate hotel mode from service menu.&lt;br /&gt;
19. If you haven't got your channels back and if you can't Telnet to TV, it means something went wrong.&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have Telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
21. Done.&lt;br /&gt;
&lt;br /&gt;
=== '''TV is already hacked''' ===&lt;br /&gt;
(Over Hotel Mode or Widget - doesn`t matter)&lt;br /&gt;
* Make USB (steps 6. and 7.)&lt;br /&gt;
* Do not change anything&lt;br /&gt;
* Attach to TV and connect via SSH/Telnet&lt;br /&gt;
* Find your usb:&lt;br /&gt;
 df -h | grep &amp;quot;/dtv/usb/sd&amp;quot; &lt;br /&gt;
* execute script '''first_run.sh''' with parameter of path to USB.&lt;br /&gt;
::e.g. if path to USB is '''/dtv/usb/sda1''', then command to enter is:&lt;br /&gt;
 sh +x /dtv/usb/sda1/first_run.sh /dtv/usb/sda1 &lt;br /&gt;
&amp;lt;small&amp;gt;Path might be different on your TV, for example: &lt;br /&gt;
::/dtv/usb/sdb1/first_run.sh /dtv/usb/sdb1 &lt;br /&gt;
::/dtv/usb/sdc1/first_run.sh /dtv/usb/sdc1 &lt;br /&gt;
Check exact path over Telnet before you start.&amp;lt;/small&amp;gt;&lt;br /&gt;
* Wait until you get the message &amp;quot;Installation Completed!&amp;quot;, but '''do not reboot TV 3 minutes''' (TV is making some dumps in this time, do not interrupt it.)&lt;br /&gt;
* Reboot TV (switch off, wait, switch on again)&lt;br /&gt;
* Done&lt;br /&gt;
&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
* To get access to TV (Telnet/FTP/WebUI) you must attach the same USB-stick that you created for this hack '''or''' prepare USB-stick with the latest [http://download.samygo.tv/C%20Series/ SamyGO-Extensions]. (If you need to know your CPU type enter '''cat /proc/cpuinfo''' into console.)&lt;br /&gt;
&lt;br /&gt;
* Example for mounting a NFS-share manually:&lt;br /&gt;
 cd /dtv/usb/sda1&lt;br /&gt;
 mkdir videos&lt;br /&gt;
 /bin/mount -o nolock 192.168.1.123:/videos /dtv/usb/sda1/videos -t nfs&lt;br /&gt;
&amp;lt;small&amp;gt;Change IP to your NFS-server IP, path to USB might differ too (sdb1/sdc1).&amp;lt;/small&amp;gt;&lt;br /&gt;
* To watch movies, create empty directory on root of usb:&lt;br /&gt;
 !network&lt;br /&gt;
&lt;br /&gt;
== Bricked TV ==&lt;br /&gt;
* '''&amp;lt;font color=red&amp;gt;'''WARNING - Do not type ''reboot'' in console - it was the reason on few bricked TVs.&amp;lt;/font color&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
=== '''ExLink cable available''' ===&lt;br /&gt;
==== Screen is blank ====&lt;br /&gt;
If your start.sh has been written with errors, TV does not boot properly...&amp;lt;br&amp;gt;&lt;br /&gt;
* Unplug TV and wait 30 sec. Plug to AC, power on TV. &lt;br /&gt;
This should remove /mtd_rwarea/start.sh. If that did not help, try:&lt;br /&gt;
* Connect [[Ex-Link Cable for C-Series]], switch to debug mode:&lt;br /&gt;
 10041004&lt;br /&gt;
enter:&lt;br /&gt;
 31337 (removes /mtd_rwarea/start.sh)&lt;br /&gt;
or:&lt;br /&gt;
 666 (removes /mtd_rwarea/start.sh, /mtd_rwarea/usb_mount, /mtd_rwarea/network_opt)&lt;br /&gt;
or:&lt;br /&gt;
 44337794 (check file to know better what it does /mtd_rwarea/network_opt/sbin/44337794)&lt;br /&gt;
&lt;br /&gt;
==== No reaction to USB, no telnet, but screen is on ====&lt;br /&gt;
* create empty file named '''kill_start.sh''' on root of USB&lt;br /&gt;
* power off TV&lt;br /&gt;
* attach USB and power on TV&lt;br /&gt;
/mtd_rwarea/start.sh should be deleted&lt;br /&gt;
&lt;br /&gt;
If no success, then:&lt;br /&gt;
==== format /mtd_rwarea/ ====&lt;br /&gt;
If you do not have success or script finishes with error,&lt;br /&gt;
or you have hacked over Widget and it stopped working (on latest firmwares),&lt;br /&gt;
Format /mtd_rwarea over ExLink and get &amp;quot;virgin&amp;quot; TV back:&lt;br /&gt;
* Make [[Ex-Link Cable for C-Series]] attach to TV.&lt;br /&gt;
* Power off TV.&lt;br /&gt;
* Unplug network and antenna cable. Leave only ExLink and power cable plugged.&lt;br /&gt;
* Power on TV.&lt;br /&gt;
* Open terminal and connect to TV over ExLink.&lt;br /&gt;
* Apply these commands (followed by Enter):&lt;br /&gt;
 10041004&lt;br /&gt;
 81588&lt;br /&gt;
 20089999&lt;br /&gt;
 2&lt;br /&gt;
 0&lt;br /&gt;
 0&lt;br /&gt;
 2 (advanced)&lt;br /&gt;
 2 (DeviceManager Debug)&lt;br /&gt;
 90 (DeviceManager MW Debug)&lt;br /&gt;
 12 (DLNA, FLASH, ODD, HDD, MoIP Test)&lt;br /&gt;
 11 (FLASH, HDD Format Test)&lt;br /&gt;
 10 (or another, /mtd_rwarea/ partition number (14)&lt;br /&gt;
&lt;br /&gt;
::On the last line you have to enter number of your /mtd_rwarea/. On C550 it is 10, but on other TV it can be other (e.g. 14)&lt;br /&gt;
::Try to hack TV again starting from step 7.&lt;br /&gt;
&lt;br /&gt;
=== '''no ExLink cable available''' ===&lt;br /&gt;
&lt;br /&gt;
* Create script on USB '''emergency_start.sh''' (kill_start.sh is to delete)&lt;br /&gt;
* Attach USB to TV on stand-by mode and power it on&lt;br /&gt;
* TV executes this script on boot.&lt;br /&gt;
Factory reset on ServiceMenu. This operation should delete ''/mtd_rwarea/network_opt''&lt;br /&gt;
*Hack TV with universal USB disk again&lt;br /&gt;
&lt;br /&gt;
== FAQ ==&lt;br /&gt;
To be updated...&lt;br /&gt;
&lt;br /&gt;
== Tested and works on TV ==&lt;br /&gt;
* LE32C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE32C550J1WU [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE32C550J1WX [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE37C630  [T-MSX6DEUC 1002.1]&amp;lt;br&amp;gt;&lt;br /&gt;
* LE40C650L1WX [T-VALDEUC-2002]&lt;br /&gt;
* LE40C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE40C750 [T-VALDEUC 3007.1]&lt;br /&gt;
* PN58C7000 [T-VALAUSC 001035] - some [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=974&amp;amp;&lt;br /&gt;
* PS50C550 [T-TDT5DEUC]&lt;br /&gt;
* UE32C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* UE32C5000QW [T-TDT5DEUC-1022.0 ]&lt;br /&gt;
* UE40C8700 [T-VALDEUC-'''3006.2''']&lt;br /&gt;
* UE40C8700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE40C6700 [T-VALDEUC '''3007.1''']&lt;br /&gt;
* UE46C6105 [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE55C7700 [T-VALDEUC '''3006.1'''] &lt;br /&gt;
p=13650#p13642 modification] of hack is needed.&lt;br /&gt;
* UE55C8705 [T-VALDEUC '''3007.1''']&lt;br /&gt;
::To be updated...&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
Author and developer of universal USB hack disk - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 12:13, 11 March 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1776</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1776"/>
		<updated>2011-04-09T14:05:22Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Microsoft Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UE46C5105 (and probably other TV's from the C serie) ===&lt;br /&gt;
This TV have a slight different menu system than above described.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;save to USB stick&amp;quot; is in the channel sub meny under &amp;quot;Antenna&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Also, Samsung does not save the channel files in a directory any more but instead all channel files are saved in one single file with the ending .scm&lt;br /&gt;
&lt;br /&gt;
This scm file is an ordinary zip file so to unpack it the file have either to be &amp;quot;dropped&amp;quot; on WinZip (Windows) or feed to unzip.&lt;br /&gt;
Another way is to rename the file so it ends with .zip instead of .scm and then open it with WinZip or feed to unzip.&lt;br /&gt;
&lt;br /&gt;
The unpacking of the file recreates the above described file structure.&lt;br /&gt;
&lt;br /&gt;
After the edition is done, zip together the content and rename it to .scm again.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo]. For 64 bit swt library, you can check it out [https://jira.vuze.com/browse/SUP-19 this page]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
NOTE (Added 2011-04-09):&lt;br /&gt;
There is another channel editor program here http://www.file-upload.net/download-2749294/chlpced-0.72-release.zip.html&lt;br /&gt;
It is not a java program but an executable, it also read the .scm file directly, no need to unpack the file.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1775</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1775"/>
		<updated>2011-04-09T13:53:50Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Microsoft Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UE46C5105 (and probably other TV's from the C serie) ===&lt;br /&gt;
This TV have a slight different menu system than above described.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;save to USB stick&amp;quot; is in the channel sub meny under &amp;quot;Antenna&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Also, Samsung does not save the channel files in a directory any more but instead all channel files are saved in one single file with the ending .scm&lt;br /&gt;
&lt;br /&gt;
This scm file is an ordinary zip file so to unpack it the file have either to be &amp;quot;dropped&amp;quot; on WinZip (Windows) or feed to unzip.&lt;br /&gt;
Another way is to rename the file so it ends with .zip instead of .scm and then open it with WinZip or feed to unzip.&lt;br /&gt;
&lt;br /&gt;
The unpacking of the file recreates the above described file structure.&lt;br /&gt;
&lt;br /&gt;
After the edition is done, zip together the content and rename it to .scm again.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo]. For 64 bit swt library, you can check it out [https://jira.vuze.com/browse/SUP-19 this page]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
NOTE (Added 2011-04-09):&lt;br /&gt;
There is another channel editor program here http://www.file-upload.net/download-2749294/chlpced-0.72-release.zip.html&lt;br /&gt;
It is not a java program but an executable&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Enabling_the_PVR_for_C-Series&amp;diff=1297</id>
		<title>Enabling the PVR for C-Series</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Enabling_the_PVR_for_C-Series&amp;diff=1297"/>
		<updated>2011-01-26T07:21:43Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Tested on those models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This has been tested on LE40C650L1KXXU&lt;br /&gt;
&lt;br /&gt;
Be very careful what you press on the remote whilst in service menu.&lt;br /&gt;
&lt;br /&gt;
Move through menu list by pressing down or up arrow only.&lt;br /&gt;
&lt;br /&gt;
only press right arrow to change an option.&lt;br /&gt;
&lt;br /&gt;
NOTE: All user settings will be reset to default after this so write all your settings down on paper and reset them afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Put in a blank USB HDD/flash formatted to FAT32. &lt;br /&gt;
UPDATE: This step is not necessary, it can be set up without a USB flashdisk.&lt;br /&gt;
&lt;br /&gt;
2. Turn on TV, push on remote control: MUTE-1-1-9-ENTER, Hotel Mode menu appears (H1) set HOTEL MODE to ON (right arrow) and then turn off TV.&lt;br /&gt;
&lt;br /&gt;
3. Whilst TV is off invoke service menu by pushing INFO-MENU-MUTE-POWER on remote control (If this doesn't work try MUTE-1-8-2-POWER). This will turn the TV on and show the Service Menu (S1).&lt;br /&gt;
&lt;br /&gt;
4. In service menu move down to Control and select this (right arrow) - new menu appears (S2) - move down to Hotel Option and select this (right arrow) - new menu appears (S3) - move down to Clone TV to USB and select this (right arrow). TV then checks USB.&lt;br /&gt;
- Completed Successfully -select ok- enter.&lt;br /&gt;
&lt;br /&gt;
H1 menu appears - press return.&lt;br /&gt;
&lt;br /&gt;
S4 menu appears - move up to Sub Option category and select (right arrow).&lt;br /&gt;
&lt;br /&gt;
new large menu appears (S5)&lt;br /&gt;
&lt;br /&gt;
5. In this menu move down to PVR Support and set to ON (right arrow). (Move to PVR by pressing down button, no right!) This option now appears on its own on the TV screen, press return to go back to main menu again (S5)&lt;br /&gt;
&lt;br /&gt;
5a. You can also set Gemstar Support to on if required for the GuidePlus EPG.&lt;br /&gt;
&lt;br /&gt;
6. Press return to go back to previous menu (S4) and move down to Hotel Option and select this (right arrow). H1 menu appears then set Hotel Mode to OFF (right arrow) and power off your tv.&lt;br /&gt;
&lt;br /&gt;
7. Turn tv on normally. PVR is now enabled&lt;br /&gt;
&lt;br /&gt;
If you now press record or pause whilst watching live TV the TV will ask to format the USB drive. If this is done successfully the PVR function should now work and you enter timeshift mode and begin to record to the USB.&lt;br /&gt;
&lt;br /&gt;
In media player mode there is a new &amp;quot;TV Recordings&amp;quot; category. You can select this to access your recordings and there are management functions in the tools menu.&lt;br /&gt;
&lt;br /&gt;
In the EPG when you press info on a tv program you should now have the option to record it.  and a red clock icon appears next to the program.&lt;br /&gt;
&lt;br /&gt;
If you enabled Gemstar (GuidePlus) you can access this by going into:- Menu/Antenna/Guide&lt;br /&gt;
&lt;br /&gt;
If you go into Menu/Antenna/Channel Manager and then press the tools button you can access the &amp;quot;Timer Recording&amp;quot; where you can easily setup any time, channel, start and end time - like oldie VHS recorder.&lt;br /&gt;
&lt;br /&gt;
== Tested on those models ==&lt;br /&gt;
* LE40C650L1KXXU&lt;br /&gt;
* UE46C5105 (PVR mode can be switched on in the menu but the TV is lacking the PVR software itself so the PVR functionality does not work)&lt;br /&gt;
&lt;br /&gt;
[[User:Stefanth|Stefanth]] 07:21, 26 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Enabling_the_PVR_for_C-Series&amp;diff=1296</id>
		<title>Enabling the PVR for C-Series</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Enabling_the_PVR_for_C-Series&amp;diff=1296"/>
		<updated>2011-01-26T07:20:26Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This has been tested on LE40C650L1KXXU&lt;br /&gt;
&lt;br /&gt;
Be very careful what you press on the remote whilst in service menu.&lt;br /&gt;
&lt;br /&gt;
Move through menu list by pressing down or up arrow only.&lt;br /&gt;
&lt;br /&gt;
only press right arrow to change an option.&lt;br /&gt;
&lt;br /&gt;
NOTE: All user settings will be reset to default after this so write all your settings down on paper and reset them afterwards.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Put in a blank USB HDD/flash formatted to FAT32. &lt;br /&gt;
UPDATE: This step is not necessary, it can be set up without a USB flashdisk.&lt;br /&gt;
&lt;br /&gt;
2. Turn on TV, push on remote control: MUTE-1-1-9-ENTER, Hotel Mode menu appears (H1) set HOTEL MODE to ON (right arrow) and then turn off TV.&lt;br /&gt;
&lt;br /&gt;
3. Whilst TV is off invoke service menu by pushing INFO-MENU-MUTE-POWER on remote control (If this doesn't work try MUTE-1-8-2-POWER). This will turn the TV on and show the Service Menu (S1).&lt;br /&gt;
&lt;br /&gt;
4. In service menu move down to Control and select this (right arrow) - new menu appears (S2) - move down to Hotel Option and select this (right arrow) - new menu appears (S3) - move down to Clone TV to USB and select this (right arrow). TV then checks USB.&lt;br /&gt;
- Completed Successfully -select ok- enter.&lt;br /&gt;
&lt;br /&gt;
H1 menu appears - press return.&lt;br /&gt;
&lt;br /&gt;
S4 menu appears - move up to Sub Option category and select (right arrow).&lt;br /&gt;
&lt;br /&gt;
new large menu appears (S5)&lt;br /&gt;
&lt;br /&gt;
5. In this menu move down to PVR Support and set to ON (right arrow). (Move to PVR by pressing down button, no right!) This option now appears on its own on the TV screen, press return to go back to main menu again (S5)&lt;br /&gt;
&lt;br /&gt;
5a. You can also set Gemstar Support to on if required for the GuidePlus EPG.&lt;br /&gt;
&lt;br /&gt;
6. Press return to go back to previous menu (S4) and move down to Hotel Option and select this (right arrow). H1 menu appears then set Hotel Mode to OFF (right arrow) and power off your tv.&lt;br /&gt;
&lt;br /&gt;
7. Turn tv on normally. PVR is now enabled&lt;br /&gt;
&lt;br /&gt;
If you now press record or pause whilst watching live TV the TV will ask to format the USB drive. If this is done successfully the PVR function should now work and you enter timeshift mode and begin to record to the USB.&lt;br /&gt;
&lt;br /&gt;
In media player mode there is a new &amp;quot;TV Recordings&amp;quot; category. You can select this to access your recordings and there are management functions in the tools menu.&lt;br /&gt;
&lt;br /&gt;
In the EPG when you press info on a tv program you should now have the option to record it.  and a red clock icon appears next to the program.&lt;br /&gt;
&lt;br /&gt;
If you enabled Gemstar (GuidePlus) you can access this by going into:- Menu/Antenna/Guide&lt;br /&gt;
&lt;br /&gt;
If you go into Menu/Antenna/Channel Manager and then press the tools button you can access the &amp;quot;Timer Recording&amp;quot; where you can easily setup any time, channel, start and end time - like oldie VHS recorder.&lt;br /&gt;
&lt;br /&gt;
== Tested on those models ==&lt;br /&gt;
* LE40C650L1KXXU&lt;br /&gt;
* UE46C5105 (PVR mode can be switched on but the TV is lacking the PVR software)&lt;br /&gt;
&lt;br /&gt;
[[User:Stefanth|Stefanth]] 07:20, 26 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1200</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1200"/>
		<updated>2011-01-20T19:05:47Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* If you have linux and TV is not hacked */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Universal USB disk to hack C series TV. It should work on any C series TV with export settings to ext3 USB support. Some models does not support ext3 file system for settings export (C6000/C630...firmwares with T-VAL6DEUC) &lt;br /&gt;
Tested and works on models with T-MSX5DEUC, T-TDT5DEUC and T-VALDEUC (until 5.1.2011).&lt;br /&gt;
&lt;br /&gt;
After this hack you can connect to TV over telnet, you get CIFS (samba) and NFS support.&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will executed.&lt;br /&gt;
&lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below)&lt;br /&gt;
&lt;br /&gt;
Author and developer - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Until further notice, '''don't try this hack on a TV without Ethernet port''' (like C530).&lt;br /&gt;
Read the [http://forum.samygo.tv/viewforum.php?f=13 C series forum] for additional information and try [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=1076 the original juuso hack].&lt;br /&gt;
&lt;br /&gt;
== To Do ==&lt;br /&gt;
* NFS automounts&lt;br /&gt;
* php script for administer TV over http&lt;br /&gt;
* implementations of easy installation/uninstallation of scripts&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
Only for USB, recognised as '''sda'''.&amp;lt;br&amp;gt;&lt;br /&gt;
How to check. Read this [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=1076&amp;amp;start=40#p10979 post]. Later limitation will be removed.&amp;lt;br&amp;gt;&lt;br /&gt;
1. USB &amp;gt; 1GB space. (windows user can use Fat32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
4. Export settings from TV to USB&amp;lt;br&amp;gt;&lt;br /&gt;
5. Save files you get anywhere in PC&amp;lt;br&amp;gt;&lt;br /&gt;
6 Download [http://www.multiupload.com/UYW99RK4FG file], extract from archive. You get 1Gb file ''network_opt_28.12.2010_3_sda.img''&amp;lt;br&amp;gt;&lt;br /&gt;
7 Make USB from this image.&amp;lt;br&amp;gt;&lt;br /&gt;
* Under windows you can use [http://launchpad.net/win32-image-writer/+download win32diskimager].&lt;br /&gt;
* After win32diskimager finishes, USB is not accessible under Windows, because it is ext3 format.&lt;br /&gt;
&lt;br /&gt;
== Hack TV==&lt;br /&gt;
===If you have linux and TV is not hacked===&lt;br /&gt;
8. Attach USB you made to linux PC. Copy channel settings file (you made in normal mode) to root of USB&lt;br /&gt;
&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length      Date    Time    Name&lt;br /&gt;
 ---------  ---------- -----   ----&lt;br /&gt;
        68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (only files, without directories) to /restore directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
* You should get structure on USB/restore:&lt;br /&gt;
./restore:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx  2 root       root         4096 2010-12-27 21:47 .&lt;br /&gt;
 drwx------ 10 root       root         4096 2010-12-27 20:14 ..&lt;br /&gt;
 -rw-r--r--  1 root       root         2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r--  1 root       root          144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r--  1 root       root          188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r--  1 root       root       144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r--  1 root       root           95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root         5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r--  1 root       root          720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r--  1 root       root         7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r--  1 root       root         9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r--  1 root       root        98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root           28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
* Whole USB structure you have to get:&lt;br /&gt;
./:&lt;br /&gt;
&lt;br /&gt;
 drwx------ 10 perforator perforator  4096 2010-12-27 21:57 .&lt;br /&gt;
 drwxr-xr-x  4 root       root        4096 2010-12-27 21:35 ..&lt;br /&gt;
 -rwxrwxrwx  1 root       root       23443 2010-12-23 13:55 channel_list_LE32C550_1001.scm&lt;br /&gt;
 -rwxrwxrwx  1 perforator root        4635 2010-12-27 16:08 first_run.sh&lt;br /&gt;
 drwxrwsrwx  2 root       root        4096 2010-12-23 14:50 link0_Clone&lt;br /&gt;
 lrwxrwxrwx  1 root       root          29 2010-12-27 20:14 link0_Temp -&amp;gt; /mtd_rwarea/usb_mount/usb_cmd&lt;br /&gt;
 drwxrwsrwx  2 root       root        4096 2010-12-23 14:50 link1_Clone&lt;br /&gt;
 lrwxrwxrwx  1 root       root          31 2010-12-27 20:14 link1_Temp -&amp;gt; /mtd_rwarea/usb_mount/usb_mount&lt;br /&gt;
 drwxrwxrwx  5 root       root        4096 2010-12-24 03:32 modules&lt;br /&gt;
 drwxrwxrwx  8 root       root        4096 2010-12-27 14:04 opt&lt;br /&gt;
 drwxrwxrwx  2 root       root        4096 2010-12-27 21:47 restore&lt;br /&gt;
 drwxrwsrwx  3 root       root        4096 2010-12-23 14:04 T-MSX5DEUC&lt;br /&gt;
 drwxrwsrwx  3 root       root        4096 2010-12-23 14:04 T-TDT5DEUC&lt;br /&gt;
 drwxrwxrwx  3 root       root        4096 2010-12-24 00:10 T-VALDEUC&lt;br /&gt;
&lt;br /&gt;
 ./link0_Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-23 14:50 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 .. &lt;br /&gt;
&lt;br /&gt;
 ./link1_Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-23 14:50 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
&lt;br /&gt;
 ./modules:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 2010-12-24 03:32 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  5 root       root       4096 2010-12-27 14:07 T-MSX5DEUC&lt;br /&gt;
 drwxrwsrwx  5 root       root       4096 2010-12-24 04:17 T-TDT5DEUC&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 2010-12-24 04:18 T-VALDEUC&lt;br /&gt;
&lt;br /&gt;
 ./modules/T-MSX5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 etc&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 lib&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc/init.d:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  240 2010-12-27 01:38 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root   4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root   4096 1970-01-01 03:02 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 405132 1970-01-01 03:02 cifs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 136636 1970-01-01 03:02 lockd.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 290572 1970-01-01 03:02 nfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 342380 1970-01-01 03:02 sunrpc.ko&lt;br /&gt;
&lt;br /&gt;
 ./modules/T-MSX5DEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 bin&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root    4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 4 root root    4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1625796 1970-01-01 03:02 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  138 1970-01-01 03:02 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 etc&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:36 lib&lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:39 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:39 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  240 2010-12-27 01:38 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:36 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 04:19 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-24 04:19 .&lt;br /&gt;
 drwxrwsrwx 3 root root   4096 2010-12-25 18:36 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  62972 2010-12-11 00:00 auth_rpcgss.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 399356 2010-12-11 00:00 cifs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root  41076 1980-01-01 00:00 isofs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 106436 2010-12-11 00:00 lockd.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 405780 2010-12-11 00:00 nfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root  15080 2010-12-11 00:00 rpcsec_gss_krb5.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 105104 2010-12-11 00:00 smbfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 240652 2010-12-11 00:00 sunrpc.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 127728 1980-01-01 00:00 udf.ko&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-25 18:36 bin&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:10 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root    4096 2010-12-25 18:36 .&lt;br /&gt;
 drwxrwsrwx 4 root root    4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1694608 1980-01-01 00:00 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr/sbin:&lt;br /&gt;
 Ð¸ÑÐ¾Ð³Ð¾ 12&lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 14:10 .&lt;br /&gt;
 drwxrwsrwx 4 root       root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  138 2010-12-24 17:40 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 etc&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:37 lib&lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:11 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:11 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  130 2010-12-27 14:11 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:37 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 04:20 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-24 04:20 .&lt;br /&gt;
 drwxrwsrwx 3 root root   4096 2010-12-25 18:37 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 274304 2010-12-03 22:39 cifs.ko&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-25 18:37 bin&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:41 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-25 18:37 .&lt;br /&gt;
 drwxrwsrwx 4 root root   4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 904544 2010-10-29 01:27 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-24 17:41 .&lt;br /&gt;
 drwxrwsrwx 4 root       root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  138 2010-12-24 17:41 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./opt:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  8 root       root       4096 2010-12-27 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 14:04 bin&lt;br /&gt;
 drwxrwxrwx  4 root       root       4096 1970-01-01 03:02 etc&lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 1970-01-01 03:02 lib&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 01:53 sbin&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 1970-01-01 03:02 usr&lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 1970-01-01 03:02 var&lt;br /&gt;
 &lt;br /&gt;
 ./opt/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:04 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 init.d&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 02:16 init.d-disabled&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxr-xr-x 2 root root 4096 1970-01-01 03:04 start.sh_before_nonblock&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:10 startup_run_once&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:37 usb_mount_after&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/start.sh_before_nonblock:&lt;br /&gt;
 &lt;br /&gt;
 drwxr-xr-x 2 root root 4096 1970-01-01 03:04 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxr-xr-x 1 root root  521 1970-01-01 03:04 0_01_restore_start.sh.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:10 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1430 2010-12-27 01:38 0_00_0_emergency_start.init&lt;br /&gt;
 -rwxrwxrwx 1 root root  422 2010-12-27 17:10 0_10_telnetd.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/usb_mount_after:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:37 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  243 2010-12-27 01:37 0_00_usbSamyGO.sh.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d-disabled:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 02:16 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 modules&lt;br /&gt;
 &lt;br /&gt;
 ./opt/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:53 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  192 2010-12-27 01:40 31337&lt;br /&gt;
 -rwxrwxrwx 1 root root  652 2010-12-27 01:52 44337794&lt;br /&gt;
 -rwxrwxrwx 1 root root  178 2010-12-27 01:40 666&lt;br /&gt;
 -rwxrwxrwx 1 root root  591 2010-12-27 01:53 event.sh&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 bin&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:02 restore&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/restore:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:02 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 -rwxr-xr-x 1 root root  213 1970-01-01 03:04 9_9_kill_start.sh_ok.init&lt;br /&gt;
 -rwxr-xr-x 1 root root  418 1970-01-01 03:04 start.sh&lt;br /&gt;
&lt;br /&gt;
 ./opt/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:32 usb_mount&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/sbin/usb_mount:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:32 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  841 2010-12-27 01:32 opt_path&lt;br /&gt;
 -rwxrwxrwx 1 root root  723 2010-12-27 01:30 unknownDev_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  161 1970-01-01 03:02 usb_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  166 1970-01-01 03:02 usb_moip_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  181 1970-01-01 03:02 usb_mount&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 spool&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 cron&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool/cron:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 crontabs&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool/cron/crontabs:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
&lt;br /&gt;
 ./restore:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  2 root       root         4096 2010-12-27 21:47 .&lt;br /&gt;
 drwx------ 10 perforator perforator   4096 2010-12-27 21:57 ..&lt;br /&gt;
 -rw-r--r--  1 root       root         2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r--  1 root       root          144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r--  1 root       root          188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r--  1 root       root       144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r--  1 root       root           95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root         5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r--  1 root       root          720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r--  1 root       root         7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r--  1 root       root         9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r--  1 root       root        98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root           28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
 &lt;br /&gt;
 ./T-MSX5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx  3 root       root       4096 2010-12-23 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-27 15:50 Clone&lt;br /&gt;
&lt;br /&gt;
 ./T-MSX5DEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 15:50 .&lt;br /&gt;
 drwxrwsrwx 3 root       root 4096 2010-12-23 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1&lt;br /&gt;
 &lt;br /&gt;
 ./T-TDT5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx  3 root       root       4096 2010-12-23 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-27 14:13 Clone&lt;br /&gt;
&lt;br /&gt;
 ./T-TDT5DEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 14:13 .&lt;br /&gt;
 drwxrwsrwx 3 root       root 4096 2010-12-23 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1&lt;br /&gt;
 &lt;br /&gt;
 ./T-VALDEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 2010-12-24 00:10 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 14:16 Clone&lt;br /&gt;
 &lt;br /&gt;
 ./T-VALDEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root       root 4096 2010-12-27 14:16 .&lt;br /&gt;
 drwxrwxrwx 3 root       root 4096 2010-12-24 00:10 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1 &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
* Go to ServiceMenu&lt;br /&gt;
 Info - Menu - Mute - Power&lt;br /&gt;
* Hotel Mode -&amp;gt;Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must go w/o errors. &amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories)&lt;br /&gt;
&lt;br /&gt;
17. Press OK.&lt;br /&gt;
&lt;br /&gt;
18. TV restarts twice and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB.&lt;br /&gt;
* Wait 3 minutes. After trhee minutes or if you get to console earlier you can reboot TV.&lt;br /&gt;
* Try connect to TV over telnet (port:23)&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings right, you can deactivate hotel mode from service menu.&lt;br /&gt;
&lt;br /&gt;
19. If you haven`t got your channels back and if you can`t telnet to TV, it means - something went wrong&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
&lt;br /&gt;
===Do not have linux and TV is not hacked===&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
== Ways to unbrick TV ==&lt;br /&gt;
== FAQ ===&lt;br /&gt;
== Tested on those models ==&lt;br /&gt;
* LE 32-C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE 40-C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE 32-C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE 32-C550J1WUA [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE 32-C550J1WXRU [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE 32-C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* PS 50-C550 [T-TDT5DEUC]&lt;br /&gt;
* LE 40-C650L1WXXH [T-VALDEUC-2002]&lt;br /&gt;
&lt;br /&gt;
TO be updated in few days&lt;br /&gt;
&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 20:21, 5 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1199</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1199"/>
		<updated>2011-01-20T19:03:09Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* If you have linux and TV is not hacked */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Universal USB disk to hack C series TV. It should work on any C series TV with export settings to ext3 USB support. Some models does not support ext3 file system for settings export (C6000/C630...firmwares with T-VAL6DEUC) &lt;br /&gt;
Tested and works on models with T-MSX5DEUC, T-TDT5DEUC and T-VALDEUC (until 5.1.2011).&lt;br /&gt;
&lt;br /&gt;
After this hack you can connect to TV over telnet, you get CIFS (samba) and NFS support.&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will executed.&lt;br /&gt;
&lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below)&lt;br /&gt;
&lt;br /&gt;
Author and developer - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Until further notice, '''don't try this hack on a TV without Ethernet port''' (like C530).&lt;br /&gt;
Read the [http://forum.samygo.tv/viewforum.php?f=13 C series forum] for additional information and try [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=1076 the original juuso hack].&lt;br /&gt;
&lt;br /&gt;
== To Do ==&lt;br /&gt;
* NFS automounts&lt;br /&gt;
* php script for administer TV over http&lt;br /&gt;
* implementations of easy installation/uninstallation of scripts&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
Only for USB, recognised as '''sda'''.&amp;lt;br&amp;gt;&lt;br /&gt;
How to check. Read this [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=1076&amp;amp;start=40#p10979 post]. Later limitation will be removed.&amp;lt;br&amp;gt;&lt;br /&gt;
1. USB &amp;gt; 1GB space. (windows user can use Fat32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
4. Export settings from TV to USB&amp;lt;br&amp;gt;&lt;br /&gt;
5. Save files you get anywhere in PC&amp;lt;br&amp;gt;&lt;br /&gt;
6 Download [http://www.multiupload.com/UYW99RK4FG file], extract from archive. You get 1Gb file ''network_opt_28.12.2010_3_sda.img''&amp;lt;br&amp;gt;&lt;br /&gt;
7 Make USB from this image.&amp;lt;br&amp;gt;&lt;br /&gt;
* Under windows you can use [http://launchpad.net/win32-image-writer/+download win32diskimager].&lt;br /&gt;
* After win32diskimager finishes, USB is not accessible under Windows, because it is ext3 format.&lt;br /&gt;
&lt;br /&gt;
== Hack TV==&lt;br /&gt;
===If you have linux and TV is not hacked===&lt;br /&gt;
8. Attach USB you made to linux PC. Copy channel settings file (you made in normal mode) to root of USB&lt;br /&gt;
&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length      Date    Time    Name&lt;br /&gt;
 ---------  ---------- -----   ----&lt;br /&gt;
        68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (only files, without directories) to /restore directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
* You should get structure on USB/restore:&lt;br /&gt;
./restore:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx  2 root       root         4096 2010-12-27 21:47 .&lt;br /&gt;
 drwx------ 10 root       root         4096 2010-12-27 20:14 ..&lt;br /&gt;
 -rw-r--r--  1 root       root         2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r--  1 root       root          144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r--  1 root       root          188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r--  1 root       root       144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r--  1 root       root           95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root         5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r--  1 root       root          720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r--  1 root       root         7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r--  1 root       root         9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r--  1 root       root        98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root           28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
* Whole USB structure you have to get:&lt;br /&gt;
./:&lt;br /&gt;
&lt;br /&gt;
 drwx------ 10 perforator perforator  4096 2010-12-27 21:57 .&lt;br /&gt;
 drwxr-xr-x  4 root       root        4096 2010-12-27 21:35 ..&lt;br /&gt;
 -rwxrwxrwx  1 root       root       23443 2010-12-23 13:55 channel_list_LE32C550_1001.scm&lt;br /&gt;
 -rwxrwxrwx  1 perforator root        4635 2010-12-27 16:08 first_run.sh&lt;br /&gt;
 drwxrwsrwx  2 root       root        4096 2010-12-23 14:50 link0_Clone&lt;br /&gt;
 lrwxrwxrwx  1 root       root          29 2010-12-27 20:14 link0_Temp -&amp;gt; /mtd_rwarea/usb_mount/usb_cmd&lt;br /&gt;
 drwxrwsrwx  2 root       root        4096 2010-12-23 14:50 link1_Clone&lt;br /&gt;
 lrwxrwxrwx  1 root       root          31 2010-12-27 20:14 link1_Temp -&amp;gt; /mtd_rwarea/usb_mount/usb_mount&lt;br /&gt;
 drwxrwxrwx  5 root       root        4096 2010-12-24 03:32 modules&lt;br /&gt;
 drwxrwxrwx  8 root       root        4096 2010-12-27 14:04 opt&lt;br /&gt;
 drwxrwxrwx  2 root       root        4096 2010-12-27 21:47 restore&lt;br /&gt;
 drwxrwsrwx  3 root       root        4096 2010-12-23 14:04 T-MSX5DEUC&lt;br /&gt;
 drwxrwsrwx  3 root       root        4096 2010-12-23 14:04 T-TDT5DEUC&lt;br /&gt;
 drwxrwxrwx  3 root       root        4096 2010-12-24 00:10 T-VALDEUC&lt;br /&gt;
&lt;br /&gt;
 ./link0_Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-23 14:50 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 .. &lt;br /&gt;
&lt;br /&gt;
 ./link1_Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-23 14:50 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
&lt;br /&gt;
 ./modules:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 2010-12-24 03:32 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  5 root       root       4096 2010-12-27 14:07 T-MSX5DEUC&lt;br /&gt;
 drwxrwsrwx  5 root       root       4096 2010-12-24 04:17 T-TDT5DEUC&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 2010-12-24 04:18 T-VALDEUC&lt;br /&gt;
&lt;br /&gt;
 ./modules/T-MSX5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 etc&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 lib&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc/init.d:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  240 2010-12-27 01:38 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root   4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root   4096 1970-01-01 03:02 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 405132 1970-01-01 03:02 cifs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 136636 1970-01-01 03:02 lockd.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 290572 1970-01-01 03:02 nfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 342380 1970-01-01 03:02 sunrpc.ko&lt;br /&gt;
&lt;br /&gt;
 ./modules/T-MSX5DEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 bin&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root    4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 4 root root    4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1625796 1970-01-01 03:02 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  138 1970-01-01 03:02 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 etc&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:36 lib&lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:39 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:39 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  240 2010-12-27 01:38 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:36 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 04:19 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-24 04:19 .&lt;br /&gt;
 drwxrwsrwx 3 root root   4096 2010-12-25 18:36 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  62972 2010-12-11 00:00 auth_rpcgss.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 399356 2010-12-11 00:00 cifs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root  41076 1980-01-01 00:00 isofs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 106436 2010-12-11 00:00 lockd.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 405780 2010-12-11 00:00 nfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root  15080 2010-12-11 00:00 rpcsec_gss_krb5.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 105104 2010-12-11 00:00 smbfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 240652 2010-12-11 00:00 sunrpc.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 127728 1980-01-01 00:00 udf.ko&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-25 18:36 bin&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:10 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root    4096 2010-12-25 18:36 .&lt;br /&gt;
 drwxrwsrwx 4 root root    4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1694608 1980-01-01 00:00 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr/sbin:&lt;br /&gt;
 Ð¸ÑÐ¾Ð³Ð¾ 12&lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 14:10 .&lt;br /&gt;
 drwxrwsrwx 4 root       root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  138 2010-12-24 17:40 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 etc&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:37 lib&lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:11 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:11 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  130 2010-12-27 14:11 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:37 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 04:20 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-24 04:20 .&lt;br /&gt;
 drwxrwsrwx 3 root root   4096 2010-12-25 18:37 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 274304 2010-12-03 22:39 cifs.ko&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-25 18:37 bin&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:41 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-25 18:37 .&lt;br /&gt;
 drwxrwsrwx 4 root root   4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 904544 2010-10-29 01:27 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-24 17:41 .&lt;br /&gt;
 drwxrwsrwx 4 root       root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  138 2010-12-24 17:41 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./opt:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  8 root       root       4096 2010-12-27 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 14:04 bin&lt;br /&gt;
 drwxrwxrwx  4 root       root       4096 1970-01-01 03:02 etc&lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 1970-01-01 03:02 lib&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 01:53 sbin&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 1970-01-01 03:02 usr&lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 1970-01-01 03:02 var&lt;br /&gt;
 &lt;br /&gt;
 ./opt/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:04 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 init.d&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 02:16 init.d-disabled&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxr-xr-x 2 root root 4096 1970-01-01 03:04 start.sh_before_nonblock&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:10 startup_run_once&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:37 usb_mount_after&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/start.sh_before_nonblock:&lt;br /&gt;
 &lt;br /&gt;
 drwxr-xr-x 2 root root 4096 1970-01-01 03:04 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxr-xr-x 1 root root  521 1970-01-01 03:04 0_01_restore_start.sh.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:10 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1430 2010-12-27 01:38 0_00_0_emergency_start.init&lt;br /&gt;
 -rwxrwxrwx 1 root root  422 2010-12-27 17:10 0_10_telnetd.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/usb_mount_after:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:37 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  243 2010-12-27 01:37 0_00_usbSamyGO.sh.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d-disabled:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 02:16 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 modules&lt;br /&gt;
 &lt;br /&gt;
 ./opt/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:53 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  192 2010-12-27 01:40 31337&lt;br /&gt;
 -rwxrwxrwx 1 root root  652 2010-12-27 01:52 44337794&lt;br /&gt;
 -rwxrwxrwx 1 root root  178 2010-12-27 01:40 666&lt;br /&gt;
 -rwxrwxrwx 1 root root  591 2010-12-27 01:53 event.sh&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 bin&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:02 restore&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/restore:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:02 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 -rwxr-xr-x 1 root root  213 1970-01-01 03:04 9_9_kill_start.sh_ok.init&lt;br /&gt;
 -rwxr-xr-x 1 root root  418 1970-01-01 03:04 start.sh&lt;br /&gt;
&lt;br /&gt;
 ./opt/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:32 usb_mount&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/sbin/usb_mount:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:32 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  841 2010-12-27 01:32 opt_path&lt;br /&gt;
 -rwxrwxrwx 1 root root  723 2010-12-27 01:30 unknownDev_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  161 1970-01-01 03:02 usb_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  166 1970-01-01 03:02 usb_moip_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  181 1970-01-01 03:02 usb_mount&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 spool&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 cron&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool/cron:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 crontabs&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool/cron/crontabs:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
&lt;br /&gt;
 ./restore:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  2 root       root         4096 2010-12-27 21:47 .&lt;br /&gt;
 drwx------ 10 perforator perforator   4096 2010-12-27 21:57 ..&lt;br /&gt;
 -rw-r--r--  1 root       root         2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r--  1 root       root          144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r--  1 root       root          188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r--  1 root       root       144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r--  1 root       root           95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root         5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r--  1 root       root          720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r--  1 root       root         7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r--  1 root       root         9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r--  1 root       root        98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root           28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
 &lt;br /&gt;
 ./T-MSX5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx  3 root       root       4096 2010-12-23 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-27 15:50 Clone&lt;br /&gt;
&lt;br /&gt;
 ./T-MSX5DEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 15:50 .&lt;br /&gt;
 drwxrwsrwx 3 root       root 4096 2010-12-23 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1&lt;br /&gt;
 &lt;br /&gt;
 ./T-TDT5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx  3 root       root       4096 2010-12-23 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-27 14:13 Clone&lt;br /&gt;
&lt;br /&gt;
 ./T-TDT5DEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 14:13 .&lt;br /&gt;
 drwxrwsrwx 3 root       root 4096 2010-12-23 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1&lt;br /&gt;
 &lt;br /&gt;
 ./T-VALDEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 2010-12-24 00:10 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 14:16 Clone&lt;br /&gt;
 &lt;br /&gt;
 ./T-VALDEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root       root 4096 2010-12-27 14:16 .&lt;br /&gt;
 drwxrwxrwx 3 root       root 4096 2010-12-24 00:10 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1 &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
* Go to ServiceMenu&lt;br /&gt;
 Info - Menu - Mute - Power&lt;br /&gt;
* Hotel Mode -&amp;gt;Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must go w/o errors. &amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories)&lt;br /&gt;
17. Press OK.&lt;br /&gt;
18. TV restarts twice and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB.&lt;br /&gt;
* Wait 3 minutes. After trhee minutes or if you get to console earlier you can reboot TV.&lt;br /&gt;
* Try connect to TV over telnet (port:23)&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings right, you can deactivate hotel mode from service menu.&lt;br /&gt;
19. If you haven`t got your channels back and if you can`t telnet to TV, it means - something went wrong&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
&lt;br /&gt;
===Do not have linux and TV is not hacked===&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
== Ways to unbrick TV ==&lt;br /&gt;
== FAQ ===&lt;br /&gt;
== Tested on those models ==&lt;br /&gt;
* LE 32-C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE 40-C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE 32-C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE 32-C550J1WUA [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE 32-C550J1WXRU [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE 32-C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* PS 50-C550 [T-TDT5DEUC]&lt;br /&gt;
* LE 40-C650L1WXXH [T-VALDEUC-2002]&lt;br /&gt;
&lt;br /&gt;
TO be updated in few days&lt;br /&gt;
&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 20:21, 5 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1198</id>
		<title>Hacking TV over Hotel mode (most C series models)</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=Hacking_TV_over_Hotel_mode_(most_C_series_models)&amp;diff=1198"/>
		<updated>2011-01-20T19:01:59Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* If you have linux and TV is not hacked */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Universal USB disk to hack C series TV. It should work on any C series TV with export settings to ext3 USB support. Some models does not support ext3 file system for settings export (C6000/C630...firmwares with T-VAL6DEUC) &lt;br /&gt;
Tested and works on models with T-MSX5DEUC, T-TDT5DEUC and T-VALDEUC (until 5.1.2011).&lt;br /&gt;
&lt;br /&gt;
After this hack you can connect to TV over telnet, you get CIFS (samba) and NFS support.&lt;br /&gt;
Moreover, if you attach USB with script file &amp;quot;SamyGO.sh&amp;quot;, it will executed.&lt;br /&gt;
&lt;br /&gt;
This hack has unificated structure for comfortable script execution for developers (read below)&lt;br /&gt;
&lt;br /&gt;
Author and developer - Perforator from forum.ixbt.com (He made the first hack for C series TV also).&lt;br /&gt;
&lt;br /&gt;
'''IMPORTANT''': Until further notice, '''don't try this hack on a TV without Ethernet port''' (like C530).&lt;br /&gt;
Read the [http://forum.samygo.tv/viewforum.php?f=13 C series forum] for additional information and try [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=1076 the original juuso hack].&lt;br /&gt;
&lt;br /&gt;
== To Do ==&lt;br /&gt;
* NFS automounts&lt;br /&gt;
* php script for administer TV over http&lt;br /&gt;
* implementations of easy installation/uninstallation of scripts&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
Only for USB, recognised as '''sda'''.&amp;lt;br&amp;gt;&lt;br /&gt;
How to check. Read this [http://forum.samygo.tv/viewtopic.php?f=13&amp;amp;t=1076&amp;amp;start=40#p10979 post]. Later limitation will be removed.&amp;lt;br&amp;gt;&lt;br /&gt;
1. USB &amp;gt; 1GB space. (windows user can use Fat32 formatted USB)&amp;lt;br&amp;gt;&lt;br /&gt;
2. TV in normal mode. Export channels from TV to USB&amp;lt;br&amp;gt;&lt;br /&gt;
3. Activate Hotel Mode&lt;br /&gt;
 Mute-1-1-9-Enter&lt;br /&gt;
 set to '''on''' by pressing &amp;quot;left&amp;quot;&lt;br /&gt;
4. Export settings from TV to USB&amp;lt;br&amp;gt;&lt;br /&gt;
5. Save files you get anywhere in PC&amp;lt;br&amp;gt;&lt;br /&gt;
6 Download [http://www.multiupload.com/UYW99RK4FG file], extract from archive. You get 1Gb file ''network_opt_28.12.2010_3_sda.img''&amp;lt;br&amp;gt;&lt;br /&gt;
7 Make USB from this image.&amp;lt;br&amp;gt;&lt;br /&gt;
* Under windows you can use [http://launchpad.net/win32-image-writer/+download win32diskimager].&lt;br /&gt;
* After win32diskimager finishes, USB is not accessible under Windows, because it is ext3 format.&lt;br /&gt;
&lt;br /&gt;
== Hack TV==&lt;br /&gt;
===If you have linux and TV is not hacked===&lt;br /&gt;
8. Attach USB you made to linux PC. Copy channel settings file (you made in normal mode) to root of USB&lt;br /&gt;
9. Rename file (channel_list_LE32C550_1001.scm for C550) to zip&lt;br /&gt;
 channel_list_LE32C550_1001.scm.zip&lt;br /&gt;
10. Add directory ''usb_mount'' with empty file in it (e.g. ''1.txt;'' - very important) to archive&amp;lt;br&amp;gt;&lt;br /&gt;
11. Rename back to channel_list_LE32C550_1001.scm&lt;br /&gt;
* You get files inside of archive:&lt;br /&gt;
  Archive:  channel_list_LE32C550_1001.scm&lt;br /&gt;
   Length      Date    Time    Name&lt;br /&gt;
 ---------  ---------- -----   ----&lt;br /&gt;
        68  2038-01-19 06:14   CloneInfo&lt;br /&gt;
       96  2038-01-19 06:14   FineTune_Digital&lt;br /&gt;
    40000  2038-01-19 06:14   map-AirA&lt;br /&gt;
   292000  2038-01-19 06:14   map-AirD&lt;br /&gt;
    40000  2038-01-19 06:14   map-CableA&lt;br /&gt;
   292000  2038-01-19 06:14   map-CableD&lt;br /&gt;
        4  2038-01-19 06:14   map-ChKey&lt;br /&gt;
      720  2038-01-19 06:14   RadioMap&lt;br /&gt;
        0  2010-11-30 21:55   usb_mount/&lt;br /&gt;
        8  2010-11-30 21:55   usb_mount/1.txt&lt;br /&gt;
 ---------                     -------&lt;br /&gt;
   664896                     10 files&lt;br /&gt;
12. Copy files exported in Hotel mode (only files, without directories) to /restore directory on USB&lt;br /&gt;
* Exported in HotelMode files to copy: &lt;br /&gt;
./T-MSX5DEUC/Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxr-xr-x 2 root root   4096 2010-12-27 18:39 .&lt;br /&gt;
 drwxr-xr-x 3 root root   4096 2010-12-27 18:39 ..&lt;br /&gt;
 -rw-r--r-- 1 root root   2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r-- 1 root root    144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r-- 1 root root    188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r-- 1 root root  40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r-- 1 root root 292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r-- 1 root root 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r-- 1 root root     95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root   5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r-- 1 root root    720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r-- 1 root root   7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root    324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r-- 1 root root   9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r-- 1 root root  98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r-- 1 root root     28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r-- 1 root root      4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
* You should get structure on USB/restore:&lt;br /&gt;
./restore:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx  2 root       root         4096 2010-12-27 21:47 .&lt;br /&gt;
 drwx------ 10 root       root         4096 2010-12-27 20:14 ..&lt;br /&gt;
 -rw-r--r--  1 root       root         2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r--  1 root       root          144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r--  1 root       root          188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r--  1 root       root       144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r--  1 root       root           95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root         5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r--  1 root       root          720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r--  1 root       root         7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r--  1 root       root         9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r--  1 root       root        98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root           28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 UserTransponderDataBase.dat &lt;br /&gt;
* Whole USB structure you have to get:&lt;br /&gt;
./:&lt;br /&gt;
&lt;br /&gt;
 drwx------ 10 perforator perforator  4096 2010-12-27 21:57 .&lt;br /&gt;
 drwxr-xr-x  4 root       root        4096 2010-12-27 21:35 ..&lt;br /&gt;
 -rwxrwxrwx  1 root       root       23443 2010-12-23 13:55 channel_list_LE32C550_1001.scm&lt;br /&gt;
 -rwxrwxrwx  1 perforator root        4635 2010-12-27 16:08 first_run.sh&lt;br /&gt;
 drwxrwsrwx  2 root       root        4096 2010-12-23 14:50 link0_Clone&lt;br /&gt;
 lrwxrwxrwx  1 root       root          29 2010-12-27 20:14 link0_Temp -&amp;gt; /mtd_rwarea/usb_mount/usb_cmd&lt;br /&gt;
 drwxrwsrwx  2 root       root        4096 2010-12-23 14:50 link1_Clone&lt;br /&gt;
 lrwxrwxrwx  1 root       root          31 2010-12-27 20:14 link1_Temp -&amp;gt; /mtd_rwarea/usb_mount/usb_mount&lt;br /&gt;
 drwxrwxrwx  5 root       root        4096 2010-12-24 03:32 modules&lt;br /&gt;
 drwxrwxrwx  8 root       root        4096 2010-12-27 14:04 opt&lt;br /&gt;
 drwxrwxrwx  2 root       root        4096 2010-12-27 21:47 restore&lt;br /&gt;
 drwxrwsrwx  3 root       root        4096 2010-12-23 14:04 T-MSX5DEUC&lt;br /&gt;
 drwxrwsrwx  3 root       root        4096 2010-12-23 14:04 T-TDT5DEUC&lt;br /&gt;
 drwxrwxrwx  3 root       root        4096 2010-12-24 00:10 T-VALDEUC&lt;br /&gt;
&lt;br /&gt;
 ./link0_Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-23 14:50 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 .. &lt;br /&gt;
&lt;br /&gt;
 ./link1_Clone:&lt;br /&gt;
&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-23 14:50 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
&lt;br /&gt;
 ./modules:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 2010-12-24 03:32 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  5 root       root       4096 2010-12-27 14:07 T-MSX5DEUC&lt;br /&gt;
 drwxrwsrwx  5 root       root       4096 2010-12-24 04:17 T-TDT5DEUC&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 2010-12-24 04:18 T-VALDEUC&lt;br /&gt;
&lt;br /&gt;
 ./modules/T-MSX5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 etc&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 lib&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc/init.d:&lt;br /&gt;
&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:06 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  240 2010-12-27 01:38 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root   4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root   4096 1970-01-01 03:02 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 405132 1970-01-01 03:02 cifs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 136636 1970-01-01 03:02 lockd.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 290572 1970-01-01 03:02 nfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 342380 1970-01-01 03:02 sunrpc.ko&lt;br /&gt;
&lt;br /&gt;
 ./modules/T-MSX5DEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-27 14:07 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 bin&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root    4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 4 root root    4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1625796 1970-01-01 03:02 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-MSX5DEUC/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:07 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  138 1970-01-01 03:02 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 etc&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:36 lib&lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:39 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:39 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  240 2010-12-27 01:38 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:36 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 04:19 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-24 04:19 .&lt;br /&gt;
 drwxrwsrwx 3 root root   4096 2010-12-25 18:36 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  62972 2010-12-11 00:00 auth_rpcgss.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 399356 2010-12-11 00:00 cifs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root  41076 1980-01-01 00:00 isofs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 106436 2010-12-11 00:00 lockd.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 405780 2010-12-11 00:00 nfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root  15080 2010-12-11 00:00 rpcsec_gss_krb5.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 105104 2010-12-11 00:00 smbfs.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 240652 2010-12-11 00:00 sunrpc.ko&lt;br /&gt;
 -rwxrwxrwx 1 root root 127728 1980-01-01 00:00 udf.ko&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwsrwx 5 root root 4096 2010-12-24 04:17 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-25 18:36 bin&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:10 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root    4096 2010-12-25 18:36 .&lt;br /&gt;
 drwxrwsrwx 4 root root    4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1694608 1980-01-01 00:00 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-TDT5DEUC/usr/sbin:&lt;br /&gt;
 Ð¸ÑÐ¾Ð³Ð¾ 12&lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 14:10 .&lt;br /&gt;
 drwxrwsrwx 4 root       root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  138 2010-12-24 17:40 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 03:32 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 etc&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:37 lib&lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 usr&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 init.d&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:46 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:11 startup_run_once&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-27 14:11 .&lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-24 03:47 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  130 2010-12-27 14:11 0_20_insmod.init&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 3 root root 4096 2010-12-25 18:37 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 04:20 modules&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-24 04:20 .&lt;br /&gt;
 drwxrwsrwx 3 root root   4096 2010-12-25 18:37 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 274304 2010-12-03 22:39 cifs.ko&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 4 root root 4096 2010-12-27 17:12 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-24 04:18 ..&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-25 18:37 bin&lt;br /&gt;
 drwxrwsrwx 2 root root 4096 2010-12-24 17:41 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root root   4096 2010-12-25 18:37 .&lt;br /&gt;
 drwxrwsrwx 4 root root   4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 904544 2010-10-29 01:27 busybox&lt;br /&gt;
 &lt;br /&gt;
 ./modules/T-VALDEUC/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-24 17:41 .&lt;br /&gt;
 drwxrwsrwx 4 root       root 4096 2010-12-27 17:12 ..&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  138 2010-12-24 17:41 platform.sh&lt;br /&gt;
 &lt;br /&gt;
 ./opt:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  8 root       root       4096 2010-12-27 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 14:04 bin&lt;br /&gt;
 drwxrwxrwx  4 root       root       4096 1970-01-01 03:02 etc&lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 1970-01-01 03:02 lib&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 01:53 sbin&lt;br /&gt;
 drwxrwxrwx  5 root       root       4096 1970-01-01 03:02 usr&lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 1970-01-01 03:02 var&lt;br /&gt;
 &lt;br /&gt;
 ./opt/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:04 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 init.d&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 02:16 init.d-disabled&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxr-xr-x 2 root root 4096 1970-01-01 03:04 start.sh_before_nonblock&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:10 startup_run_once&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:37 usb_mount_after&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/start.sh_before_nonblock:&lt;br /&gt;
 &lt;br /&gt;
 drwxr-xr-x 2 root root 4096 1970-01-01 03:04 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxr-xr-x 1 root root  521 1970-01-01 03:04 0_01_restore_start.sh.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/startup_run_once:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:10 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root 1430 2010-12-27 01:38 0_00_0_emergency_start.init&lt;br /&gt;
 -rwxrwxrwx 1 root root  422 2010-12-27 17:10 0_10_telnetd.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d/usb_mount_after:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:37 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 2010-12-27 17:03 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  243 2010-12-27 01:37 0_00_usbSamyGO.sh.init&lt;br /&gt;
 &lt;br /&gt;
 ./opt/etc/init.d-disabled:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 02:16 .&lt;br /&gt;
 drwxrwxrwx 4 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/lib:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 modules&lt;br /&gt;
 &lt;br /&gt;
 ./opt/lib/modules:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:53 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  192 2010-12-27 01:40 31337&lt;br /&gt;
 -rwxrwxrwx 1 root root  652 2010-12-27 01:52 44337794&lt;br /&gt;
 -rwxrwxrwx 1 root root  178 2010-12-27 01:40 666&lt;br /&gt;
 -rwxrwxrwx 1 root root  591 2010-12-27 01:53 event.sh&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 bin&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:02 restore&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 sbin&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/bin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 14:05 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/restore:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 17:02 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 -rwxr-xr-x 1 root root  213 1970-01-01 03:04 9_9_kill_start.sh_ok.init&lt;br /&gt;
 -rwxr-xr-x 1 root root  418 1970-01-01 03:04 start.sh&lt;br /&gt;
&lt;br /&gt;
 ./opt/usr/sbin:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 .&lt;br /&gt;
 drwxrwxrwx 5 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:32 usb_mount&lt;br /&gt;
 &lt;br /&gt;
 ./opt/usr/sbin/usb_mount:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 2010-12-27 01:32 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 2010-12-27 14:08 ..&lt;br /&gt;
 -rwxrwxrwx 1 root root  841 2010-12-27 01:32 opt_path&lt;br /&gt;
 -rwxrwxrwx 1 root root  723 2010-12-27 01:30 unknownDev_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  161 1970-01-01 03:02 usb_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  166 1970-01-01 03:02 usb_moip_cmd&lt;br /&gt;
 -rwxrwxrwx 1 root root  181 1970-01-01 03:02 usb_mount&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 8 root root 4096 2010-12-27 14:04 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 spool&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 cron&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool/cron:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 crontabs&lt;br /&gt;
 &lt;br /&gt;
 ./opt/var/spool/cron/crontabs:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root root 4096 1970-01-01 03:02 .&lt;br /&gt;
 drwxrwxrwx 3 root root 4096 1970-01-01 03:02 ..&lt;br /&gt;
&lt;br /&gt;
 ./restore:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  2 root       root         4096 2010-12-27 21:47 .&lt;br /&gt;
 drwx------ 10 perforator perforator   4096 2010-12-27 21:57 ..&lt;br /&gt;
 -rw-r--r--  1 root       root         2304 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          378 1980-01-01 00:00 FADAT&lt;br /&gt;
 -rw-r--r--  1 root       root          144 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rw-r--r--  1 root       root          188 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rw-r--r--  1 root       root        40000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rw-r--r--  1 root       root       292000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rw-r--r--  1 root       root       144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rw-r--r--  1 root       root           95 1980-01-01 00:00 PackageDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root         5382 1980-01-01 00:00 PLDAT&lt;br /&gt;
 -rw-r--r--  1 root       root          720 1980-01-01 00:00 RadioMap&lt;br /&gt;
 -rw-r--r--  1 root       root         7979 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root          324 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rw-r--r--  1 root       root         9478 1980-01-01 00:00 SSDAT&lt;br /&gt;
 -rw-r--r--  1 root       root        98554 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rw-r--r--  1 root       root           28 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rw-r--r--  1 root       root            4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
 &lt;br /&gt;
 ./T-MSX5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx  3 root       root       4096 2010-12-23 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-27 15:50 Clone&lt;br /&gt;
&lt;br /&gt;
 ./T-MSX5DEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 15:50 .&lt;br /&gt;
 drwxrwsrwx 3 root       root 4096 2010-12-23 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1&lt;br /&gt;
 &lt;br /&gt;
 ./T-TDT5DEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx  3 root       root       4096 2010-12-23 14:04 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwsrwx  2 root       root       4096 2010-12-27 14:13 Clone&lt;br /&gt;
&lt;br /&gt;
 ./T-TDT5DEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwsrwx 2 root       root 4096 2010-12-27 14:13 .&lt;br /&gt;
 drwxrwsrwx 3 root       root 4096 2010-12-23 14:04 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1&lt;br /&gt;
 &lt;br /&gt;
 ./T-VALDEUC:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx  3 root       root       4096 2010-12-24 00:10 .&lt;br /&gt;
 drwx------ 10 perforator perforator 4096 2010-12-27 21:57 ..&lt;br /&gt;
 drwxrwxrwx  2 root       root       4096 2010-12-27 14:16 Clone&lt;br /&gt;
 &lt;br /&gt;
 ./T-VALDEUC/Clone:&lt;br /&gt;
 &lt;br /&gt;
 drwxrwxrwx 2 root       root 4096 2010-12-27 14:16 .&lt;br /&gt;
 drwxrwxrwx 3 root       root 4096 2010-12-24 00:10 ..&lt;br /&gt;
 -rwxrwxrwx 1 root       root  256 2010-12-27 15:58 Clone.dat&lt;br /&gt;
 -rwxrwxrwx 1 perforator root  319 2010-12-27 15:50 link0&lt;br /&gt;
 -rwxrwxrwx 1 perforator root   39 2010-12-27 15:50 link1 &lt;br /&gt;
 &lt;br /&gt;
13. Exit from Hotel mode:&lt;br /&gt;
* Go to ServiceMenu&lt;br /&gt;
 Info - Menu - Mute - Power&lt;br /&gt;
* Hotel Mode -&amp;gt;Off&lt;br /&gt;
14. Attach USB to TV and import channel settings to TV. Everything must go w/o errors. &amp;lt;br&amp;gt;&lt;br /&gt;
15. Activate Hotel mode again&lt;br /&gt;
16. Import HotelMode settings you exported before (as is, with directories)&lt;br /&gt;
17. Press OK.&lt;br /&gt;
18. TV restarts twice and starts in ''black screen''. DO NOT POWER OFF, DO NOT DISCONNECT USB.&lt;br /&gt;
* Wait 3 minutes. After trhee minutes or if you get to console earlier you can reboot TV.&lt;br /&gt;
* Try connect to TV over telnet (port:23)&lt;br /&gt;
* If you get to console, congratulations.&lt;br /&gt;
* TV starts in Hotel mode. If you have your channel settings right, you can deactivate hotel mode from service menu.&lt;br /&gt;
19. If you haven`t got your channels back and if you can`t telnet to TV, it means - something went wrong&lt;br /&gt;
* Look for file ''first_run.ok'' and content of directory ''/result'' on USB&lt;br /&gt;
20. If you have telnet after hack, execute:&lt;br /&gt;
 cp $OPT_DIR/usr/restore/start.sh /mtd_rwarea/start.sh&lt;br /&gt;
&lt;br /&gt;
===Do not have linux and TV is not hacked===&lt;br /&gt;
== Normal operating of hacked TV ==&lt;br /&gt;
== Ways to unbrick TV ==&lt;br /&gt;
== FAQ ===&lt;br /&gt;
== Tested on those models ==&lt;br /&gt;
* LE 32-C550J1W [T-MSX5DEUC-2005.4]&lt;br /&gt;
* LE 40-C550 [T-MSX5DEUC-2003.1]&lt;br /&gt;
* LE 32-C530 [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE 32-C550J1WUA [T-MSX5DEUC-2007.4]&lt;br /&gt;
* LE 32-C550J1WXRU [T-MSX5DEUC-2005.4]&lt;br /&gt;
* UE 32-C5100QW [T-MSX5DEUC-2007.4]&lt;br /&gt;
* PS 50-C550 [T-TDT5DEUC]&lt;br /&gt;
* LE 40-C650L1WXXH [T-VALDEUC-2002]&lt;br /&gt;
&lt;br /&gt;
TO be updated in few days&lt;br /&gt;
&lt;br /&gt;
--[[User:Juzis28|Juzis28]] 20:21, 5 January 2011 (UTC)&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1149</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1149"/>
		<updated>2011-01-11T08:25:03Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* UE46C5105 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UE46C5105 (and probably other TV's from the C serie) ===&lt;br /&gt;
This TV have a slight different menu system than above described.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;save to USB stick&amp;quot; is in the channel sub meny under &amp;quot;Antenna&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Also, Samsung does not save the channel files in a directory any more but instead all channel files are saved in one single file with the ending .scm&lt;br /&gt;
&lt;br /&gt;
This scm file is an ordinary zip file so to unpack it the file have either to be &amp;quot;dropped&amp;quot; on WinZip (Windows) or feed to unzip.&lt;br /&gt;
Another way is to rename the file so it ends with .zip instead of .scm and then open it with WinZip or feed to unzip.&lt;br /&gt;
&lt;br /&gt;
The unpacking of the file recreates the above described file structure.&lt;br /&gt;
&lt;br /&gt;
After the edition is done, zip together the content and rename it to .scm again.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
Note: The java engine must be a 32 bit version of the Java engine, the reason for this is that the swt.jar file only exists as a 32 bit build.&lt;br /&gt;
This mean that the 32 bit java engine have to be reinstall or be parallel installation if there only exist a 64 bit version on the PC.&lt;br /&gt;
&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo].&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1148</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1148"/>
		<updated>2011-01-11T08:21:22Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Channel Import/Export Menu */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== UE46C5105 ===&lt;br /&gt;
This TV and perhaps all other C-series TV's have a slight different menu system.&lt;br /&gt;
The &amp;quot;save to USB stick&amp;quot; is in the channel sub meny under &amp;quot;Antenna&amp;quot;.&lt;br /&gt;
Also, Samsung does not save the channel files as a directory anymore but instead all files are saved in one single file with the ending .scm&lt;br /&gt;
Lucky, this scm file is an ordinary zip file so to unpack it the file have either to be &amp;quot;dropped&amp;quot; on WinZip (Windows) or feed to unzip.&lt;br /&gt;
&lt;br /&gt;
Another way is to rename the file so it ends with .zip instead of .scm and then open it with WinZip or feed to unzip.&lt;br /&gt;
After unpacking the file the file structure is the same as above.&lt;br /&gt;
&lt;br /&gt;
After the edition is done, zip together the content and rename it to .scm again.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
Note: The java engine must be a 32 bit version of the Java engine, the reason for this is that the swt.jar file only exists as a 32 bit build.&lt;br /&gt;
This mean that the 32 bit java engine have to be reinstall or be parallel installation if there only exist a 64 bit version on the PC.&lt;br /&gt;
&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo].&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1147</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1147"/>
		<updated>2011-01-11T08:14:06Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Microsoft Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
Note: The java engine must be a 32 bit version of the Java engine, the reason for this is that the swt.jar file only exists as a 32 bit build.&lt;br /&gt;
This mean that the 32 bit java engine have to be reinstall or be parallel installation if there only exist a 64 bit version on the PC.&lt;br /&gt;
&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo].&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1146</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1146"/>
		<updated>2011-01-11T08:12:48Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Microsoft Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
Note: The java engine must be a 32 bit version of the Java engine, the reason for this is that the swt.jar file only exists as a 32 bit build.&lt;br /&gt;
This mean that you have reinstall or parallel install a 32 bit Java engine if you have the 64 bit version.&lt;br /&gt;
&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo].&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1145</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1145"/>
		<updated>2011-01-11T08:11:43Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Microsoft Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
Note: You need a 32 bit version of the Java engine, the reason for this is that the swt.jar file only exists as a 32 bit build.&lt;br /&gt;
This mean that you have reinstall or parallel install a 32 bit Java engine if you have the 64 bit version.&lt;br /&gt;
&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo].&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same director.&lt;br /&gt;
These two jar files are the only files needed, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
Added by [[User:Stefanth|Stefanth]]&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1144</id>
		<title>SamyGO ChanEdit - Chanel Editor</title>
		<link rel="alternate" type="text/html" href="http://wiki.samygo.tv/index.php?title=SamyGO_ChanEdit_-_Chanel_Editor&amp;diff=1144"/>
		<updated>2011-01-11T08:09:05Z</updated>

		<summary type="html">&lt;p&gt;Stefanth: /* Ubuntu 9.10 amd64 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=SamyGO ChanEdit=&lt;br /&gt;
&lt;br /&gt;
With SamyGO ChanEdit you can edit your channel list of your Samsung TV Set using any Computer able to run a Java VM supporting SWT. This makes moving channels around a lot easier. Also the list can be extended by channels that are not found by the channel search engine. For example Sky.de interactive channels, which the editor can add automatically when a list containing Sky.de channels is loaded.&lt;br /&gt;
&lt;br /&gt;
==Channel Import/Export Menu==&lt;br /&gt;
First you have to connect a USB drive with a FAT/FAT32 filesystem to your TV.&lt;br /&gt;
&lt;br /&gt;
When the TV is switched ON press '''Volume Down''' [[File:Volume_down_key.png|30px]] once and then press '''the Enter [[File:Enter_key.png|30pxâ]] button for 10 seconds'''. This will display the &amp;quot;Channel Import / Export&amp;quot; Menu.&lt;br /&gt;
&lt;br /&gt;
If this doesn't work, check that &amp;quot;Speaker Select&amp;quot; in &amp;quot;Sound Menu&amp;quot; is set to &amp;quot;TV Speaker&amp;quot;. Anynet+ (HDMI-CEC) should be disabled.&lt;br /&gt;
[[File:Channel_Import_Export.png|300px|left|thumb|Channel Import / Export]]&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Choose '''USB to TV''' for channeldata import or '''TV to USB''' for copying the channeldata to the USB drive.&lt;br /&gt;
&lt;br /&gt;
When everything worked correct you'll find the following data on your USB drive:&lt;br /&gt;
&lt;br /&gt;
 kilroy@kilroy:~$ ls -la /media/USB2GB/T-CHLCIPDEUC/Clone/&lt;br /&gt;
 total 744&lt;br /&gt;
 drwx------ 2 kilroy kilroy   4096 1980-01-01 00:00 .&lt;br /&gt;
 drwx------ 3 kilroy kilroy   4096 1980-01-01 00:00 ..&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1920 1980-01-01 00:00 Clone.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     20 1980-01-01 00:00 FineTune&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   1092 1980-01-01 00:00 FineTune_Digital&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    124 1980-01-01 00:00 LNBSettingsDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-AirA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-AirD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy  28000 1980-01-01 00:00 map-CableA&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 248000 1980-01-01 00:00 map-CableD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 map-ChKey&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy 144000 1980-01-01 00:00 map-SateD&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   3184 1980-01-01 00:00 PTCCABLE&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy    584 1980-01-01 00:00 SatDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy   5616 1980-01-01 00:00 ServiceProviders&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 TransponderDataBase.dat&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy     88 1980-01-01 00:00 TSIDList&lt;br /&gt;
 -rwxr-xr-x 1 kilroy kilroy      4 1980-01-01 00:00 UserTransponderDataBase.dat&lt;br /&gt;
&lt;br /&gt;
Now you can edit the channel list (for the moment only map-CableD for DVB-C) stored on the drive using SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
After that just use the same procedure to import the list again.&lt;br /&gt;
&lt;br /&gt;
==Downloading and Installing==&lt;br /&gt;
Download the SamyGO ChanEdit (and required Java library for you OS) from [http://download.samygo.tv/SamyGO%20Applications/ SamyGO Applications] file download area.&lt;br /&gt;
&lt;br /&gt;
===Ubuntu 9.10 amd64===&lt;br /&gt;
&lt;br /&gt;
You have to download the files '''SamyGO ChanEdit-v0.31.tar.bz2''' and '''SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2'''&amp;lt;br&amp;gt;&lt;br /&gt;
Ubuntu 9.10 is comes with openjdk-6-jre but you can also install Java from SUN (recommended).&lt;br /&gt;
&lt;br /&gt;
 # sudo aptitude install sun-java6-jre&lt;br /&gt;
 [ -d ~/bin ] || mkdir ~/bin&lt;br /&gt;
 tar xjf Downloads/SamyGO\ ChanEdit-v0.31.tar.bz2 -C ~/bin/&lt;br /&gt;
 tar xjf Downloads/SamyGoChanEd_lib-Linux-GTK-x86_64.tar.bz2 -C ~/bin/SamyGO\ ChanEdit-v0.31/&lt;br /&gt;
 ln -s ~/bin/SamyGO\ ChanEdit-v0.31/SamyGoChanEd.jar Desktop/SamyGoChanEd.jar&lt;br /&gt;
&lt;br /&gt;
Right click at the SamyGoChanEd.jar icon and select  '''Properties -&amp;gt; Open With:''' ''OpenJDK Java 6 Runtime'' (or ''Sun Java 6 Runtime'')&lt;br /&gt;
&lt;br /&gt;
===Microsoft Windows===&lt;br /&gt;
Note: You need a 32 bit version of the Java engine, the reason for this is that the swt.jar file only exists as a 32 bit build.&lt;br /&gt;
This mean that you have reinstall or parallel install a 32 bit Java engine if you have the 64 bit version.&lt;br /&gt;
&lt;br /&gt;
To execute the channel editor you need two parts, the channel editor program itself and a support library called swt.&lt;br /&gt;
The channel editor program can be found here [http://download.samygo.tv/SamyGO%20PC%20Applications SamyGO ChanEdit]&lt;br /&gt;
&lt;br /&gt;
The SWT library can either be downloaded directly from [http://www.eclipse.org/swt http://www.eclipse.org/swt] or from [http://download.samygo.tv/SamyGO%20PC%20Applications/SamyGO%20ChanEdit%20SWT%20Libraries SamyGo].&lt;br /&gt;
&lt;br /&gt;
Unpack the downloaded files and place the both .jar files,SamyGoChanEd.jar and swt.jar, in the same directory,&lt;br /&gt;
you only need these jar files, there are other files and content in the downloaded zip/gz/bz2 files but they are not needed&lt;br /&gt;
&lt;br /&gt;
Open a command prompt and enter &lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;java -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
The following example is on a Windows 7 installation, the java.exe file might be in a different place depending on the installation and operating system.&lt;br /&gt;
If you get an error message saying that java is not a commando then you need to give the full path to the Java engine, like this&lt;br /&gt;
&lt;br /&gt;
'''&amp;lt;tt&amp;gt;&amp;quot;c:\Program Files (x86)\Java\jdk1.6.0_23\bin\java.exe&amp;quot; -classpath .;swt.jar;SamyGoChanEd.jar gui.Main&amp;lt;/tt&amp;gt;'''&lt;br /&gt;
&lt;br /&gt;
Of course it is possible to create a link on the desktop and execute the same command line.&lt;br /&gt;
&lt;br /&gt;
==Modifying Channel List==&lt;br /&gt;
You can modify your Channel list via SamyGO ChanEdit.&lt;br /&gt;
&lt;br /&gt;
The files are under your USB at T-CHxxDEUC/Clone directory.&lt;br /&gt;
With Version 0.31 currently only map-CableD for digital Cable Channels is editable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;center&amp;gt;[[File:SamyGO ChanEdit.png]]&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Afterwards you can import the channel list to TV from the USB stick.&lt;/div&gt;</summary>
		<author><name>Stefanth</name></author>
		
	</entry>
</feed>