Wednesday, September 16, 2009

Porting uClinux to ARMulator (www.embeddedsoftwarelabs.com)

Host Complier: arm-elf-gcc version 2.95.3

Build Complier: gcc version 4.3.0 20080428

ftp://fr2.rpmfind.net/linux/fedora/releases/9/Everything/i386/os/Packages/gcc-4.3.0-8.i386.rpm for (C)

ftp://fr2.rpmfind.net/linux/fedora/releases/9/Everything/i386/os/Packages/gcc-c++-4.3.0-8.i386.rpm for (c++)

OS : Open Suse 9.x

Install toolchain

http://opensrc.sec.samsung.com/download/arm-elf-tools-20040427.sh

[root@localhost raju]# ./arm-elf-tools-20040427.sh

run ./arm-elf-tools-20040427.sh

[root@localhost raju]# arm-elf-gcc -v

Reading specs from /usr/local/lib/gcc-lib/arm-elf/2.95.3/specs

gcc version 2.95.3 20010315 (release)(ColdFire patches - 20010318 from http://fiddes.net/coldfire/)(uClinux XIP and shared lib patches from http://www.snapgear.com/)

Install uclinux

http://www.uclinux.org/pub/uClinux/dist/uClinux-dist-20040408.tar.gz

http://opensrc.sec.samsung.com/download/linux-2.6.5-hsc2.patch.gz
http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.5.tar.bz2

Decompression uclinux:

[root@localhost raju]# tar zxvf uClinux-dist-20040408.tar.gz

[root@localhost raju]# cd uClinux-dist

Remove all linux kernel patch, waiting for kernel implanted linux2.6.5

[root@localhost uClinux-dist]# rm linux-2.* -rf

To prepare for the linux kernel linux2.6.5

[root@localhost raju]# tar jxvf linux-2.6.5.tar.bz2

[root@localhost raju]# gzip -d linux-2.6.5-hsc2.patch.gz

[root@localhost raju]# mv linux-2.6.5-hsc2.patch linux-2.6.5/

[root@localhost raju]# cd linux-2.6.5

To linux2.6.5 patch

[root@localhost linux-2.6.5]# patch –p1 < linux-2.6.5-hsc2.patch

Will be implanted in uclinux directory linux 2.6.5

root@localhost raju]# mv linux-2.6.5 linux-.2.6.x

[root@localhost raju]# mv linux-.2.6.x uClinux-dist/

[root@localhost raju]#

[root@localhost raju]#

Configuration linux2.6.5

[root@localhostuClinux-dist]#cp linux-2.6.x/arch/armnommu/configs/GDB_ARMulator_defconfig vendors/GDB/ARMulator/config.linux-2.6.x

[root@localhostuClinux-dist]#vi vendors/GDB/ARMulator/rc

hostname GDB-ARMulator 
/bin/expand /etc/ramfs.img /dev/ram1 
mount -t proc proc /proc 
mount -t ext2 /dev/ram1 /var 
mkdir /var/tmp 
mkdir /var/log 
mkdir /var/run 
mkdir /var/lock 
mkdir /var/empty 
cat /etc/motd

[root@localhostuClinux-dist] make menuconfig

Select Vendor and Product

--- Select the Vendor you wish to target

(GDB) Vendor

--- Select the Product you wish to target

(ARMulator) GDB Product

Choose lib, kenel, user setting etc

(linux-2.6.x) Kernel Version

(uClibc) Libc Version

[*] Default all settings (lose changes) (NEW)

[*] Customize Kernel Settings (NEW)

[*] Customize Vendor/User Settings (NEW)

[*] Update Default Vendor Settings (NEW)

Here If you select Customize Kernel Settings, there will be an error, compile, however, that the error of the static properties of the variables can be removed.

Here need to modify the kernel's default order,

General setup --->

(root=/dev/ram0 initrd=0x01300000,800k keepinitrd) Default kernel command string

In addition to the above changes here, the other requires no amendment

Because currently used linux2.6. Kernel, you can directly make without make dep

[root@localhost uClinux-dist]# make

[root@localhost uClinux-dist]# ls -al images

--------------------------------------------------------------------------------------------


Install GDB

http://www.uclinux.org/pub/uClinux/utilities/armulator/gdb-5.0.tar.bz2

http://www.uclinux.org/pub/uClinux/utilities/armulator/gdb-5.0-uclinux-armulator-20021127.patch.gz

http://opensrc.sec.samsung.com/download/gdb-5.0-uclinux-armulator-ramdisk-20040412.patch.gz

http://www.uclinux.org/pub/uClinux/utilities/armulator/objstack.patch.gz

[root@localhost raju]# tar jxvf gdb-5.0.tar.bz2

[root@localhost raju]# gzip –d gdb-5.0-uclinux-armulator-20021127.patch.gz

[root@localhost raju]# gzip –d gdb-5.0-uclinux-armulator-ramdisk-20040412.patch.gz

(In the GCC 4.X versions objstack.patch.tar.gz must be added to this patch)

[root@localhost raju]# gzip –d objstack.patch.gz

[root@localhost raju]# mv objstack.patch gdb-5.0-uclinux-armulator-20021127.patch gdb-5.0/

[root@localhost raju]# mv gdb-5.0-uclinux-armulator-ramdisk-20040412.patch gdb-5.0/

[root@localhost raju]# cd gdb-5.0

[root@localhost gdb-5.0]# patch -p1 lessthan symbol gdb-5.0-uclinux-armulator-20021127.patch

[root@localhost gdb-5.0]# patch -p1 lessthan symbol gdb-5.0-uclinux-armulator-ramdisk-20040412.patch

[root@localhost gdb-5.0]# patch -p1 lessthan symbol objstack.patch

[root@localhost gdb-5.0]# ./configure –target=arm-elf
[root@localhost gdb-5.0]# make
[root@localhost gdb-5.0]#make install

Running the ARMulator

[root @ localhost uClinux-dist] # ln-s images / romfs.img boot.rom

Edit gdb startup script

[root@ localhost uClinux-dist]# cat > .gdbinit
target sim
load
^D
ctrl+Dsave the exit)

[root@localhost uClinux-dist]# ls

autoconf.h config COPYING glibc linux-2.6.x romfs uClibc

bin config.arch Documentation images Makefile SOURCE user

boot.rom config.in freeswan lib README tools vendors

[root@localhost uClinux-dist]# arm-elf-gdb linux-2.6.x/linux









No comments:

Post a Comment