Open main menu

DAVE Developer's Wiki β

Changes

Software Manual (Diva)

5,440 bytes removed, 15:01, 2 October 2014
m
Build system
Please refer to [http://wiki.dave.eu/index.php/Category:DVDK DVDK page on '''DAVE Embedded Systems''' Developer's Wiki] for further information on DVDK.
 
== Build system ==
 
=== Introduction ===
 
A build system is a set of source trees, Makefiles, patches, configuration files, tools and scripts that makes it easy to generate all the components of a complete embedded Linux system. A build system, once properly set up, automates the configuration and cross-compilation processes, generating all the required targets (userspace packages (libraries, programs), the kernel, the bootloader and root filesystem images) depending on the configuration. Some well known build systems are the following:
 
* Arago (http://arago-project.org/wiki/index.php/Main_Page)
* OpenEmbedded (http://wiki.openembedded.net/index.php/Main_Page)
* Yocto (https://www.yoctoproject.org/)
* Buildroot (http://buildroot.uclibc.org)
 
=== Setting up the server environment ===
 
During development, user needs to interact with the target system. This section describes the tools that must be installed and configured on the host system for this purpose. Please note that all these tools are already installed and properly configured on the virtual machine image provided with the DIVELK.
 
==== TFTP Server ====
One of the most useful features of a bootloader during development is the capability to download the Linux kernel from the network. This saves a lot of time because developer doesn't have to program the image in flash every time he/she modifies it. U-Boot implements the TFTP protocol (see the <code>tftp</code> command), so the host system must be configured to enable the TFTP service. Installation and configuration of a TFTP server depends on the host Linux distribution.
 
The default DVDK <code>tftp</code> installation has <code>/srv/tftp</code> as work directory. It is recommended to create a subdirectory dedicated to the image files created with the DIVELK.
 
==== NFS Server ====
One of the most important components of a Linux system is the root file system. A good development root file system provides the developer with all the useful tools that can help him/her on his/her work. Such a root file system can become very big in size, so it's hard to store it in flash memory. User could split the file system in different parts, mounting them from different media (flash, network, usb...). But the most convenient thing is to mount the whole root file system from the network, allowing the host system and the target to share the same files. In this way, the developer can quickly modify the root file system, even “on the fly” (meaning that the file system can be modified while the system is running).
The most common way to setup a system like the one described is through NFS. As for TFTP, installation and configuration depends on the host Linux distribution.
 
The default DVDK NFS installation is configured for sharing <code>/home</code> directory and all the subdirectories.
 
==== Pre-built toolchain ====
 
To start developing software for the Diva platform, users need a proper toolchain, which can be pre-built or built-from-scratch. Building a toolchain from scratch is not a trivial task (though using a recent build system is easier than in the past), so the recommended approach consists in using a pre-built toolchain.
 
DIVELK provides the arago-2012.10 toolchain (GCC version is 4.5.3).
 
==== Pre-built root file system ====
 
Linux needs a root file system: a root file system must contain everything needed to support the Linux system (applications, settings, data, ..). The [http://en.wikipedia.org/wiki/Root_directory root] file system is the file system that is contained on the same partition on which the root directory is located. The Linux kernel, at the end of its startup stage, mounts the root file system on the configured root device and finally launches the <code>/sbin/init</code>, the first user space process and "father" of all the other processes. An example of root file system is shown below:
 
<pre>
drwxr-xr-x 2 root root 4096 2011-05-03 11:23 bin/
drwxr-xr-x 2 root root 4096 2011-04-01 17:20 boot/
drwxr-xr-x 3 root root 4096 2011-07-07 12:17 dev/
drwxr-xr-x 44 root root 4096 2011-05-03 19:02 etc/
drwxr-xr-x 4 root root 4096 2011-04-01 17:35 home/
drwxr-xr-x 5 root root 4096 2011-05-03 11:23 lib/
drwxr-xr-x 12 root root 4096 2011-07-07 12:03 media/
drwxr-xr-x 6 root root 4096 2011-05-19 16:39 mnt/
drwxr-xr-x 2 root root 4096 2011-03-11 05:21 proc/
drwxr-xr-x 2 root root 4096 2011-05-03 11:23 sbin/
drwxr-xr-x 2 root root 4096 2011-03-11 05:21 sys/
lrwxrwxrwx 1 root root 8 2011-05-30 12:19 tmp -> /var/tmp/
drwxr-xr-x 11 root root 4096 2010-11-05 19:36 usr/
drwxr-xr-x 8 root root 4096 2010-12-12 11:30 var/
</pre>
 
For more information on the Linux filesystem, please refer to [http://www.freeos.com/articles/3102/ The Linux filesystem explained]
 
DIVELK provides a pre-built root file system, that can be used during the evaluation/development phase, since it provides a rich set of packages for working with the Diva platform. However, there are other pre-built file systems that can be used:
 
* Arago (http://arago-project.org/files/releases/)
* Angstrom/Narcissus (http://www.angstrom-distribution.org/narcissus/)
* Beaglebone (http://www.angstrom-distribution.org/demo/beaglebone/)
 
DIVELK root file systems are stored into the following directories:
* /home/dvdk/delk/rfs/arago-base
* /home/dvdk/delk/rfs/tisdk
== DVDK installation ==