Next Previous Contents

6. Programming the Target

Beware that many commercial tools will not handle the Linux zImage correctly. They often ignore the .image and .initrd sections (containing the compressed kernel and initial ramdisk images respectively), because these sections aren't marked with the LOAD attribute. Whether this is a bug in the tools or in the zImage build process is debatable. Many developers avoid the problem by simply skipping the 64K ELF header, treating the rest as a binary image and jumping to the first byte to enter the kernel loader.

If you want your debugger to have access to kernel symbols, use the conventional uncompressed vmlinux ELF image rather than zImage.

6.1 BDM/JTAG Downloading

If your board is wired correctly, and you're using Flash memory, you can program it on your board using BDM, described later under Debugging. This isn't the fastest method, but it's by far the easiest.

6.2 TFTP

If your ROM monitor supports TFTP, this is the fastest/easiest way to download code to your target during development.

There is a program that will hack the headers such that the VxWorks TFTP loader would load the zImage, at: ftp://ftp.embeddededge.com/pub/vxhack.c

6.3 Flash/EPROM Programmers

You will need socketed flash to make this viable. There are sockets available even for surface mount flash devices which preserve the device footprint, but they consume extra space on your board, even when you go to production and leave them off.

Some commercial E/PROM programming units only support Windows, which may be a problem if you only have access to Linux machines.

The Data I/O units have a terminal mode and an onboard floppy so they could be used from Linux without a problem.

The general consensus is that anything with serial/parallel support and a DOS binary should be able to be used from DOSEMU. There are some options to allow direct parport access so RTFM on dosemu. VMWare hosting one of these should be no problem at all.

Once you have a basic kernel booting on your board, you can use a flash driver to quickly reflash a new kernel. You need to be confident that the new one will boot though, or have some alternative method of recovering if it doesn't, like socketed ROMs or a BDM flash programmer.


Next Previous Contents