Mu-arm: Difference between revisions

From Bashlinux
Jump to navigationJump to search
Content deleted Content added
No edit summary
No edit summary
Line 2: Line 2:
= ARM Microcontroller =
= ARM Microcontroller =


== ARM9 ==
Mini 2440
'''Mini 2440'''
* [[mini2440-friendlyarm|Friendly Arm]]
* [[mini2440-friendlyarm|Friendly Arm]]
* [[mini2440-pengutronix|Pengutronix]]
* [[mini2440-pengutronix|Pengutronix]]

== How to build the kernel ==
To get running the kernel, we need to setup the environment with the proper toolchain so we can start to cross-compile the kernel.

=== GNU ARM Toolchain ===
* Download arm-none-linux-gnueabi from sourcery.mentor.com or the manufacturer website
* Decompress the tarball and place in `~/CROSS_COMPILER`
* Add the path to your environment by editing `~/.bash_profile` and adding
<pre><nowiki>
PATH=$PATH:$HOME/bin:~/CROSS_COMPILER/arm/4.4.3/bin
</nowiki></pre>


=== Build the kernel ===
* Download the kernel from kernel.org
* Create a working directory and decompress the kernel inside there
<pre><nowiki>
# mkdir kernel
# cd kernel
# wget http://mirrors.kernel.org/...linux-2.6.36...
# tar zxvf linux-2.6.36*tgz
# mkdir kernel-bin
# cd linux-2.6.36
</nowiki></pre>


* Generate `.config`
<pre><nowiki>
CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm make O=../kernel-bin/ mini2440_defconfig
</nowiki></pre>


* Modify the kernel
<pre><nowiki>
# cd ../kernel-bin
# make ARCH=arm menuconfig
# cd ../mini2440
</nowiki></pre>


* Cross compile the kernel and modules
<pre><nowiki>
CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm make O=../kernel-bin/
</nowiki></pre>


* If using uboot, then generate uImage
<pre><nowiki>
# ../uboot/tools/mkimage -A arm -O linux -T kernel -C none -a 0x30008000 -e 0x30008000 -d ../kernel-bin/arch/arm/boot/zImage ../uImage
</nowiki></pre>


=== Kernel Modules ===
* Build the modules that are going to be placed into the filesystem
<pre><nowiki>
CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm make O=../kernel-bin/ modules
CROSS_COMPILE=arm-none-linux-gnueabi- ARCH=arm make O=../kernel-bin/ INSTALL_MOD_PATH=.. modules_install
</nowiki></pre>


* Mount the FS image and copy the files inside the root folder
<pre><nowiki>
# cp ../lib/modules/2.6.36/ /mnt/mini2440/rootfs/lib/modules/ -r
</nowiki></pre>


=== uboot ===
* Get the sources from git repository
<pre><nowiki>
# mkdir uboot
# cd uboot
# git clone git://repo.or.cz/u-boot-openmoko/mini2440.git
</nowiki></pre>


* Prepare and build uboot
<pre><nowiki>
# cd mini2440
# make mini2440_config
# make all
</nowiki></pre>

Revision as of 16:02, 4 June 2012

ARM Microcontroller

ARM9

Mini 2440