Sunday 14 October 2012

Porting Linux on ARM 9

We shall consider the TS-7300 arm9 from Technologic Systems.TS-7300 allows us to port using the SD-card.

Problems of porting linux on ARM7 lpc2100
please note any attempt to port linux onto boards like arm7 mcb2100 is intractable with generic methods as the linux incorporate memory management unit which needs to be supported and which is missing in the said board (mcb2100)
Additionally porting kernel image onto flash which typically has size of 256KB is again not possible for linux,Pretty bulky!

To begin porting on TS-7300

First we shall partition the SD card
1.Download SD image from here
2.Extract the SD image ,insert the SD card into the SD card reader(either you can use card reader available in your system or may have to acquire a card reader,generally they are available in standard Laptops)
3.Format the SD card,this will delete all partitions(backup already loaded data if required).For formating try Gparted tool,install by :
$>sudo apt-get install gparted
4.Identify the SD card in your system.
$>fdisk -l 
lists the partition in your machine ,The SD card is identified by /dev/sdxx xx being certain integer/character variables






5.Bootable SD card can then be developed by using
$>dd if=/path_to_SDimage/sdimage.dd of=/dev/sdxx
Note the dd command is a linux nuke, if you do not specify the correct disk at of= field then it may crash your system.Happened to me !.In case you do not heed the warning , not to worry check this
6.Minicom is something like hyperterminal in windows, allowing you to work with serial port, to install
$>sudo apt-get install minicom
7.Insert the SD card onto the TS-7300 machine and using a RS232 cable connect the TS-7300 with your system,A serial to USB adaptor may be required if your system does not have the DB connector for the Serial port.
8.Switch on TS-7300 and use the minicom to access the serial port
$> minicom -s
shows a configuration window

To provide appropriate serial port , you have to find which serial port is connected to the TS-7300 for that
$>dmesg | grep ttyUSB
lists all the USB terminals,in case you are using the serial to usb adaptor.However if you are directly using a single serial cable then
$>dmesg | grep ttyS*
will list the serial port , Identify your serial port and enter in serial device field of minicom.Note for example the above screen grab indicates /dev/ttyUSB0 as the USB port to which the serial cable is interface.
Also set the desired,data rate
9.Choosing Exit in minicom will establish the link between host machine and peripheral, In this case you may see the Board booting up !
Enter
$> uname -r
In the minicom terminal this indicate the version of kernel on the board,We have ported an OS !!

link is very useful for developers,The repository also provides various flavors of OS and tools.

Filesystem may be needed to develop device drivers,If the filesystem is not inherently provided by the SD image ,a filesystem is needed to be created after partitioning  the SD card.

The C program which provides the functionality needs to be crosscompiled and introduced into the userspace ie the filesystem , by copying the crosscompiled C code(Crosscompiling produces an executable) onto the SD card.

Acquire the cross compiler by using
$>wget http://code.google.com/p/princess-alist/downloads/arm-linux-gcc-4.3.2.tgz

Extract at usr/local/bin , and set the environment fields by
$> export$PATH=PATH:/usr/local/bin/4.1.1-920t/bin/
$>export ARCH=arm

$>export CROSS_COMPILE=arm-linux-

Cross compile by
$>arm-linux-gcc -o objectname filename.c

Transfer the objectname file to the SD card and after booting you can execute it by using ./objectname in ARM9

Check out a LED driver,link
 
This is sufficient to get you started on ARM!

We have just ARMed the Penguin !

PS:If you face any problems , specify the same in the comment field.


2 comments:

  1. Great !! Did b you build the kernel yourself ? How did you configure the kernel ? Command line or editors ?

    And did you have to modify the files to include support for your specific platform ?

    ReplyDelete
  2. No the kernel was preconfigured and customized by the Technologic system guys.Since it was preconfigured its not required to tailor it to the platform.

    ReplyDelete