Manufacturers

Suppliers

Creating a rootfs for ARMEL using the debootstrap tool from Debian.

Compiling a root file system from scratch is a painfull undertaking as it requires a lot of skills and more important time. Debian offers binaries in ARMEL format which can be instandly used, no further compilation process required. The downside of this is that debian is made for desktop systems and not really for embedded devices. Therefore, the off-the-shelf debian distribution uses more space as a hand crafted one, and might not run as fast as possible on the hardware.

For whom is it usefull then?

It is for all those projects useful, where you do not need fast startup times, lowest memory footprints, but a small easy to configure OS framework in which your application runs. As an example, if you create a c/c++ application under linux which interacts with the user via a graphical UI and you do not use the underlaying OS for anything else than calling some device drivers, debian is made for you. If you however, use BASH scripts a lot and use various unix tools concurrently to achieve your applications goals you would be better off with a hand crafted solution.

For which boards is that useful?

All boards from Hiteg with an ARM9 or ARM11 SOC from SAMSUNG need an ARMEL distribution. The ARMHF is for ARMv7 CPUs only. The main difference between those two is the floating point library and format. On v6 and down ARM CPUs floating point values are read as integers from RAM first, then converted into a Floating Point value, either 32Bit or 64Bit. They get stored in RAM the same way, converted to integer and written to RAM. ARMv7 and up does that directly, meaning, no integer step is in-between. So actually in the same way as the Intel(ish) CPUs are doing it. The FP-Unit in V7 ARMs has direct access to the RAM and is not an isolated co-processor anymore.

Requirements

It seems to be best to work with a Debian installation as host. We tried using Ubuntu 12.04LTS and we got spooky results. An easy way to get a working Debian installation is to install Virtualbox or VMware and download the testing netinstall iso. As debian testing is also a great environment for development, make yourself a home and install additional packages as your liking.

Bootstrapping a Debian ARMEL root

As this is reported, written about on the Internet on many places, we will not copy all those steps here for you, but invite you to follow the steps as described here: Debootstrap Debian You will find that they use ttyS0 as UART which is correct on some platforms, on SAMSUNG SOCs the UARTs are named ttySAC with n range from 0 to 3. Please feel free to change that accordingly.

dev folder

We have to add some additional device nodes in the dev folder, as debian doesn't know about. These are foremost the UARTs ttySAC0-ttySAC2 on the MINI2440v2 and additionally ttySAC3 on the TenByTen6410. You can create those with:

 

mknod ttySAC0 c 204 64
for UART0
mknod ttySAC1 c 204 65
for UART1
mknod ttySAC0 c 204 66
for UART2
mknod ttySAC1 c 204 67
for UART3

 

As we want to use the rootfs via nfs, we have to make sure that /dev/nfs is existing. You can create this node with:

mknod nfs b 0 255

Please also look if there is a console node, tty, tty0...tty4 otherwise create with:

mknode console c 5 1
mknode tty  c 5 0
mknode tty0 c 4 0
mknode tty1 c 4 1
mknode tty2 c 4 2
mknode tty3 c 4 3
mknode tty4 c 4 4

The rest will be populated by udev and we don't have to care about it.

First boot

To try out your new root we recommend to use NFS for that purpose. You would have to install a NFS server and edit the export file, which can be found in your host's etc folder. To keep the path short we created a symbolic link to the folder we want to export.

ln -s /nfsroot /media/debian

Our export entry looks like this:

/nfsroot	*(rw,sync,no_subtree_check,no_root_squash,no_all_squash,no_auth_nlm,fsid=0)

We couldn't achieve a stable nfs connection with less paramters. Please report back to us, if you can do so. For u-boot and the kernel we have to specify some parameter to enable NFS there. Our u-boot bootargs look like this:

bootargs=root=/dev/nfs rw nfsroot=192.168.1.118:/nfsroot,v3 rootpath=/nfsroot ip=192.168.1.115:192.168.1.118:192.168.1.1:255.255.255.0:tbt6410::off init=/bin/init console=ttySAC0,115200 mem=256M

Our u-boot bootcmd for the TenByTen6410 looks like this:

bootcmd=extpwrctl ETH ON ; nfs c0008000 /nfsroot/zImage ; bootm c0008000

Where we switch on the ethernet port, fetch the kernel via nfs and execute it. The MINI2440v2 u-boot is not able currently to fetch something from NFS, therefore you'd need a TFTP server setup in addition to your NFS server. Or you read the kernel from NAND or SD-Card, as at this point you should already have a running, prooven kernel. To make this work we set:

ethaddr=00:40:5c:26:0a:5b
netmask=255.255.255.0
ipaddr=192.168.1.115
gatewayip=192.168.1.1
serverip=192.168.1.118

with the setenv u-boot command. you might need different settings here, depending on your local network setup. As you can see in the bootargs you encounter there similar TCP/IP related numbers, please feel free to change those according to your network requirements.

From NFS to NAND

OK, you are happy with your rootfs, your application works great and you want the root in NAND. Nothing is more easy than that. What you have to do is on your board format the root partition of the NAND with the YAFFS2 file system. Mount it somewhere and use the pax utility to copy your entire NFS root to that partition. The pax tool is made for this, as it also preserves the /dev entries, etc.. You have to make sure, however, that your kernel comes with NAND partition support and MTD driver.


HomeHome

Specials

No specials at this time

Cart  

(empty)

New products

No new products at this time