Embedded Freaks..

December 9, 2008

Testing The Host Infrastructure

Filed under: embedded-linux — Tags: — kunilkuda @ 6:23 pm

Done with setup, now we’re heading for the testing.

Preparing The Kernel

Download the kernel source from TS-Logic site (or your board manufacturer’s site). Compile it, and copy into /tftpboot directory.

# tar xvzf tskernel-2.6.21-ts-src.tar.gz
# cd linux-2.6.21-ts/
# make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi- ts72xx_defconfig
# make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-
# cp arch/arm/boot/zImage /tftpboot/

Note if the compilation fails due to ‘PATH_MAX’ const not found, add “#include <linux/limit.h>” in the beginning of the failure file. Mine has some problem with scripts/mod/sumversion.c.

Now, turn on the TFTPD.

# sudo /etc/init.d/atftpd restart

Preparing The Root Filesystem
This step will copy the root filesystem into NFS shared directory. Therefore, our board can boot from it, rather than booting from SD-CARD/CF/Flash.

Download one of embedded linux distro from TS-Logic site (I’m using Debian 3.1 Sarge for TS-72xx). Untar it as root (because it needs root privilege to untar device files in /dev) to the NFS share directory. Note: Use TS-Linux distro with 2.4 kernel, use Debian 3.1 Sarge with 2.6 kernel, since it’s not interchangeable.

# sudo tar xvzf debian-sarge-udev-11-15-2007.tar.gz -C /nfs/

Then activate the NFS services

# sudo /etc/init.d/portmap restart
# sudo /etc/init.d/nfs-kernel-server restart


Booting The Board

Now, turn on the board, and press CTRL-C to cancel the standard Redboot booting sequence. The Redboot prompt should appear in your screen.

redboot_promptThen, plugin the ethernet of the board into the host’s ethernet port, and select your embedded linux profile.

Turn On DHCP Server

# sudo /etc/init.d/dhcp3-server restart

Load and Execute Kernel
From RedBoot’s prompt, load the linux kernel with:

Redboot> ip -l 192.168.0.2/24
Redboot> load -r -b 0x218000 -h 192.168.0.1 zImage
Redboot> exec -c "console=ttyAM0,115200 ip=dhcp nfsroot=192.168.0.1:/nfs/tmp/mnt"

That’s it. Your kernel suppose to boot with Debian’s root filesystem on NFS folder (the login should appears in your screen).

Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: