FPGARM4U devmachine setup

From Fpga4u

Jump to: navigation, search

Developer Debian machine setup

Setup the machine

How to setup the Debian machine that will be used for the development of the software used by the FPGARM4U embedded system.

Get a new computer or setup a virtual machine manager software (VMWare (prefered, http://www.vmware.com/fr/, NOT free), VirtualBox (http://www.virtualbox.org/, GPL license), put the Debian NetInstall cdrom (http://cdimage.debian.org/debian-cd/4.0_r3/i386/iso-cd/debian-40r3-i386-netinst.iso) in the cdrom reader or set the Debian NetInstall cdrom image in the cdrom configuration of the virtual machine, press the play button (power on), type the the following string in order to be able to change some default settings during the setup process

expert hw-detect/start_pcmcia=false bootkbd=en

... Install Debian Etch tutorial (http://www.debian.org/)... about 2 hours

In order to use the version 4.2 of the GNU C Compiler there is the need to upgrade the Debian installation up to the "unstable" revision.

Stable (Etch) -> Testing (Lenny) -> Unstable (Sid)

First, increase the maximum cache dimension for the tool "apt" adding the line

APT::Cache-Limit "32777216";

at the end of the file : /etc/apt/apt.conf.d/70debconf.

Add the lines referring to the "testing" repository to the file: /etc/apt/sources.list :

deb http://ftp.de.debian.org/debian/ testing main non-free contrib
deb-src http://ftp.de.debian.org/debian/ testing main non-free contrib

Then the system needs to download the list of the new available packages

# apt-get update

The system needs to upgrade the software already installed

# apt-get upgrade
# apt-get dist-upgrade

to upgrade the distribution to the "testing" version.

You can add the line that refers to the cross-toolchain repository to the file /etc/apt/sources.list

deb http://www.emdebian.org/debian/ testing main

and update the list of packages.

Now you can check that there is available the version 4.1 of the toolchain:

# apt-cache search arm | grep g++-
--> g++-4.1-arm-linux-gnu - The GNU C++ compiler

In the same way, you can move from the "testing" to the "unstable" version.

Add the line to the file: /etc/apt/sources.list :

deb http://ftp.de.debian.org/debian/ unstable main non-free contrib
deb-src http://ftp.de.debian.org/debian/ unstable main non-free contrib

Get the list of packages and upgrade the system

# apt-get update
# apt-get upgrade
# apt-get dist-upgrade

Add the lines related to the cross-toolchain repository to the file: /etc/apt/sources.list :

deb http://www.emdebian.org/debian/ unstable main

and update the list

# apt-get update
# apt-get upgrade

Now you can check that there is available the version 4.2 (or more recent) of the toolchain:

# apt-cache search arm | grep g++-
--> g++-4.2-arm-linux-gnu - The GNU C++ compiler

You can some install essential software :

# apt-get install vim-full screen gpm ssh

Setup the Cross-toolchain

The developer needs a cross-toolchain to compile the Linux Kernel and the other software for the target ARM architecture using an i386 machine to compile the source code. In the Debian distribution there is available the GNU toolchain based on the Gnu C Compiler, tape

# apt-get install g++-4.2-arm-linux-gnu

to install the cross-toolchain on the developer machine.

If there is no problem of package dependency in the debian distribution, the developer environment should be ready to configure and compile the kernel.

If there is any problem of package dependency you have to download the source code of the whole cross-toolchain (compiler, linker, assembler, library,...) and recompile them by yourself.


Setup the TFTP server

Install the nfs and the tftpboot servers to be able to download the kernel to the FPGARM4U board at boot time and to export a Network File System for the FPGARM4U linux operating system.

# apt-get install nfsboot nfs-kernel-server tftpd-hpa

Configure the tftpd-hpa package to have a ready tftpboot server. set the /etc/default/tftp-hpa file as

RUN_DAEMON="yes"
OPTION="-l -s /var/lib/tftpboot"

Restart the daemon

# /etc/init.d/tftpd-hpa start

copy the uImage (...) file of the Linux Kernel in the /var/lib/tftpboot/ directory. Each file in the directory /var/lib/tftpboot/ of the NFS server machine is now available to be downloaded through the network using the TFTP protocol.

Setup the NFS server

Install and configure the Root File System using the debootstrap package as described here to get the basic packages compiled for the ARM architecture or get a ready Root File System and copy it inside the directory /srv/fpgarm4u_rfs_A .

Install the NFS server software to make available the RootFileSystem to the FPGARM4U boards

# apt-get install nfs-kernel-server nfs-common portmap

Create the fpgarm4u_rfs_A directory in the /srv/ path if it does not exist yet

# mkdir /srv/fpgarm4u_rfs_A


add the line to the /etc/exports file of the server machine:

/srv/fpgarm4u_rfs_A/ <ip_client>(rw,no_root_squash,sync)

and run

# exportfs -a

to update the nfs server

add to the /etc/fstab of the client machine (in the new root file system):

proc                                 /proc    proc    defaults             0    0
<ip_server>:/srv/fpgarm4u_rfs_A      /        ext3    defaults,continue    0    0

All the files inside the directory /srv/fpgarm4u_rfs_A/ are available for the connection by the client machine (FPGARM4U).

(Follow the steps here to setup the Root File System in the current directory)

Personal tools