How-to Setup a DHCP Server
Any RC element has two Ethernet interfaces in its default configuration: base and fabric. The base interface is the primary interface and it's used to perform the DHCP transaction. The fabric interface is configured through this same transaction using the vendor option provided by DHCP. The MAC addresses for both interfaces are determined by the (unique) serial number <n> printed on the RCE board and by the RC element <id> as follows:
base: 8:0:56:0:42:<2*n+id> fabric: 8:0:56:0:43:<2*n+id>
where <id> is either 0 or 1.
For example, in order to assign the addresses 192.168.2.108 (192.168.3.108) and 192.168.2.109 (192.168.3.109) to the base (fabric) interfaces of the two RC elements of a board with serial number 4, one would use a DHCP configuration file like the following:
ddns-update-style none; option space tgt_config; option tgt_config.secondary_interfaces code 1 = string; option arp-cache-timeout 255999; option ntp-servers 192.168.2.1; option domain-name-servers 192.168.2.1; set vendor-string = option vendor-class-identifier; subnet 192.168.2.0 netmask 255.255.255.0 { option routers 192.168.2.1; vendor-option-space tgt_config; group { host rce108 { hardware ethernet 8:0:56:0:42:08; fixed-address 192.168.2.108; option tgt_config.secondary_interfaces = concat(08:00:56:00:43:08, c0:a8:03:6c, ff:ff:ff:00); } host rce109 { hardware ethernet 8:0:56:0:42:09; fixed-address 192.168.2.109; option tgt_config.secondary_interfaces = concat(08:00:56:00:43:09, c0:a8:03:6d, ff:ff:ff:00); } } }
You should then be able to communicate with any of the base or fabric interfaces above from the appropriate subnet. For instance, to ping the base interface of rce108 in the example above, login into a machine connected to the 192.168.2.0 subnet and type:
ping 192.168.2.108
How to Prepare the Build Environment
The environment may be prepared in two different ways, depending on the user having access to the RCE development tools on SLAC AFS or not.
SLAC AFS access
Enter:
source /afs/slac/g/npa/setup/npa.csh
when using (t)csh
or:
source /afs/slac/g/npa/setup/npa.sh
when using bash
.
No SLAC AFS access
Download the following tarball files under a directory <downloaddir>
:
Change to your work directory and un-tar the downloaded files:
cd <workdir> tar xvzf <downloaddir>/rce.tgz tar xvzf <downloaddir>/gnu.tgz tar xvzf <downloaddir>/rtems.tgz
Edit release/projects.mk
to change the rtems_use
line so that it points to the location of rtems
on your system:
rtems_use := <workdir>/package/rtems/4.7.1
Add the rtems
tool chain to your path:
setenv PATH <workdir>/package/gnu/powerpc-rtems47-gcc411/bin:$PATH
If the version of make
on your system is older than 3.80, also add the provided make-3.81
to your path:
setenv PATH <workdir>/package/gnu/make-3.81/bin:$PATH
Structure of Software/Firmware
Both the software and the firmware source code use the same Makefile system and syntax. There are two hierarchy organizational concepts:
- packages (containing the standard set of associated source code files)
- projects (each of which contains several packages)
This is the first time we have used a second hierarchical level for code development.