uClinux for the DragonEngine II

BOA + PHP page
SQLite page
PostgreSQL page
Tftpnaive
MTD root filesystem
Microwindows setup
memory map
linux driver for FPGA

penguin What is uClinux

uClinux is about porting GNU/Linux for MMU less processors, you will find a lot of informations about uClinux on the following pages:

you might want to search for uClinux on your favorite search engine too...

penguin What is the DragonEngine board

The DragonEngine board is a single board computer with a 68VZ328 processor, 8 to 32 MB of SDRAM, 2 or 4 MB of flash, a CS8900 Ethernet chip and a 50k gates FPGA. The company selling this board is Exys.

There are several other boards on which you can install uClinux, from other companies or even as a free hardware project. I choose this one because it was a very good fit for my use and because I don't have the skills nor the tools to build one. This board is really great to work with and the people at Exys answered all my questions.

penguin Downloading and Installing uClinux

Go to the uClinux distribution page and download the full source distribution and the latest m68k-elf toolchain. Install first the toolchain by following the instructions from the download site page. To build uClinux, extract the source distribution tarball as a normal user : this will create the source tree with uClinux-dist at the top level; go to the uClinux-dist directory and type:

$ make xconfig

If you are not running X11, other options are : make menuconfig or make config

Go back to your terminal window and type:

$ make dep
$ make clean
$ make

After a couple of minutes, you will have a new file: uClinux-dist/images/image.bin the file contains the boot kernel and a rom file system. The default build process generate an image file to be downloaded at address 0x10000 on the DragonEngine board, then you may start it at the same address.

Since snapshot 20020927 the default build process creates a compressed image, it will be created along the normal (uncompressed) image in the directory uClinux-dist/images. The compressed image name is zImage.bin, it is a auto-unzip image, download it into your board and start it at address 0x400000. There no specific option to activate it, it will be created for each build. If you want to flash the compressed image, change the file image.ld, for example, the setting below will locate the compressed image at 0x4030000 in the flash :

// uClinux-dist/linux-2.4.x/arch/m68knommu/platform/68VZ328/de2/zimage/image.ld

MEMORY
{
  ram (rwx) : ORIGIN =    0x1000, LENGTH = 64k-4k
  rom (rwx) : ORIGIN = 0x4030000, LENGTH = 2M-196k
}

Upload and write the image in flash at this adress, then a go 0x4030000 will boot uClinux.

The details about a .ld file may be found in the ld manual, in the 'Linker Scripts' section.

penguin Snapshots

The first snapshot which did contain the support files for the DragonEngine was the 2001112 snapshot. If you are working with an old (not listed below) snapshot, check out this page for patches.

What about patches ?

For those who don't use the CVS access, or the CVS repository does not yet include the changes, use the patches below. Each of them should be included in the following snapshot.

How to apply patches

To apply a patch, if a specific command is not given with the patch description, type :

cd uClinux-dist
zcat patch-filename | patch -p1

Then compile a new image by the usual way (make dep; make clean; make) unless the patch has specific instruction.

20030522 snapshot

All the previous patches but ramrootfs.patch has been applied to this snapshot. This snapshot is using a MTD based root filesystem and contains the latest version of the DragonEngine specific driver set : de2spi, de2ts, de2eeprom and de2fpga as well as the frame buffer driver.

20030909 snapshot

It contains bug fixes for the DragonEngine drivers, and some changes to the rc script.

The /var sub-directories are no longer built in the rc file, it is using an ext2 ram filesystem built at compile time, if you want to change the content of the /var file system, look at the ram.sh and var.sh scripts in vendors/Exys/de2

The board use still use DHCP to initialize the network, but once it is initialized, msntp is used to initialize the clock as well, check the TZ file to adjust the timezone and the rc file to choose a time server close to your location. Some symbolic links have been added so that the DHCP daemon is able to write his configuration files to /var/etc/dhcpc, the name server list is also initialized by the DHCP daemon (/etc/resolv.conf -> /var/etc/resolv.conf).

20040218 snapshot

The DragonEngine setup (on kernel 2.4.x) has stabilized, I have started to work on some user packages, see the Userland section section below...

This snapshot add support of the new kernel 2.6.x, it is booting on the DragonEngine but there is still issues to be solved with regard to scheduling.

Latest kernel from CVS

The uClinux CVS Repository contains the lastest kernel changes. To use the cvs kernel, download first the latest uClinux distribution, untar it, remove the kernels in the uClinux-dist directory then install the cvs kernel inside the distribution :

# tar xvfz uClinux-dist-YYYYMMDD.tar.gz
# cd uClinux-dist
# rm -rf linux-*
# cvs -d:pserver:anonymous@cvs.uclinux.org:/var/cvs login
password: <press enter>
# cvs -z3 -d:pserver:anonymous@cvs.uclinux.org:/var/cvs co -P uClinux-2.4.x
-d linux-2.4.x

You can use the normal build process with this setting.

You will find more instructions on the page Anonymous CVS Access to update your workspace.

penguin Userland

This section is for uClinux-dist/user part of the distribution.

penguin Customizing

To have more informations about the memory map, check this page : the uClinux DragonEngine memory map

If you are using the latest snapshot, you may specify the SDRAM size of your board using a config option (Kernel Settings/Processor type and features/RAM size), I would recommend using the RAM model (Kernel Settings/Processor type and features/Kernel executes from = RAM), it is easier to work with and save memory as it doesn't required to reserve some space in the high addresses. MTD root filesystem works out of the box with the RAM model, not with the other models (change needed).

The RAM model is now the default in the distribution (along with the MTD root filesystem).

If you change the default to HIMEM setting , you may choose the memory layout for the image by changing the file himem.ld in the de2 platform directory. See the comments at the beginning of the file, there is examples for a 8MB, 16MB and 32MB RAM, the default is for a 8MB RAM.

The details about a .ld file may be found in the ld manual, in the 'Linker Scripts' section.

penguin Booting

Once you have a working image, you may want to use BOOTP/TFTP to bootstrap your board through the network. You might find my tftpnaive software useful.

sig