Using the Intrinsyc CerfBoard without reading manuals

A. Setting up the CerfBoard

Getting connected

  1. Plug in the power to J2 on the breakout board (the large board). Looking at the board with the three serial ports on the left, the power switch is on the top edge, near the middle. J2 is to the left of the power switch.
  2. Plug in an ethernet cable (liberate one from the back of a Textronix TLA 704 Logic Analyzer) into the ethernet port on the CerfBoard (the little board). The ethernet port is at the top-left of the board.
  3. Plug in a serial cable to serial port 3 on the breakout board. This is the bottom serial port in the row of three. Plug the other end of the cable into COM1 or COM2 of your PC.

On your PC

  1. Run Hyperterminal.
  2. Create a new connection with the following settings:
  3. Connect.
  4. Log in as root (no password needed!)
The first command you should use on the CerfBoard is dmesg. This dumps a whole pile of information, including the MAC (the hardware network address). We'll need this to assign a static IP to your board.

B. Compiling the Linux kernel

On nedre (via Reflection X, telnet or string and paper cups...)

  1. Log in with user name 327user and password SuperMan.
  2. Change directory to groupX, where X is your group number between 1 and 7 (see below).

    Group numbers:

    1. David Hall, Erica Johnson
    2. Adam Kirk, Jeff Ahrenholtz
    3. Michael Bushbach, Mauro Leibelt
    4. Kevin Nichols, Matt Cosand
    5. Sze Ying Kong, Jason Dougherty
    6. Iliana Avila, Albert Wong
    7. Justin Huff, Melissa Poole

    This directory is your group's workspace.

  3. Change to directory linux/drivers/char.
  4. Choose an appropriate name for your device driver, say blah.
  5. Copy ~/skeleton.c to blah.c.
  6. Edit blah.c, including changing the name of the existing function blah_init to blah_init. For example if your device driver is called foo, you should rename blah_init to foo_init. This file will contain your device driver routines.
  7. In the file Makefile, add blah.o to the end of the line which begins with with obj_y. The default make file rules will take care of compiling blah.c. The actual command used is arm-linux-gcc -c blah.c (compile but do not link).
  8. In the file mem.c:
  9. Change directory up two levels (cd ../..).
  10. Type make zImage to compile the operating system. Try doing this with Windows :-). The zImage file is automatically copied to the file /local/cse466/tftp/zImageX (X is your group number).

On the CerfBoard (via Hyperterminal)

  1. Power up / press reset on the board.
  2. At the message "Waiting for RTC", press a key.
  3. Danger Will Robinson! If you get any of the following commands wrong, you may end up with a non-functioning CerfBoard. For instance you could overwrite the boot loader code. This would be very bad and is similar to wiping the BIOS on a PC.

    memset c0000000 0 1ff
    tftp bootX c0000000
    flash 20000 c0000000 1ff
    exec 20000

    X is your group number.
    memset clears the given area of RAM.
    tftp is the Trivial File Transfer Protocol. It is not error-checked and requires no log in sequence. It does however require that your client (i.e. CerfBoard) be permitted by the server (nedre) to use this service (this is determined by a configuration file on the server).
    flash writes data into Flash memory from RAM. Flash memory is essentially a battery backed RAM and you can think of it as writable ROM. Yes I know, this is a bit of an oxymoron.
    exec runs the boot script at the given location.

  4. Once the board has rebooted, log in as root.
  5. Create the device file for your device driver, using the command mknod /dev/blah0 c major_version_number 0.

    mknod creates a special file, in this case a character special file (that's the c option). We don't care about the minor version number, so arbitrarily choose 0.
    major_version_number is the number in the #define directive in the file linux/drivers/char/blah.c on nedre. Your device driver is now ready for use.

The major version number in Linux is essentially an index by which the operating system can refer to drivers. It does not have anything to do with the particular release version of the driver. Indeed major version numbers can be assigned dynamically (thus avoiding conflicts) but we are not going to take this approach.

C. Downloading programs (as opposed to kernel code) to the CerfBoard

On nedre

  1. Write your program. It treats /dev/blah0 like an ordinary file.
  2. Compile using arm-linux-gcc. This is a cross compiler, which takes C and generates ARM machine code.

On the CerfBoard

  1. Ftp to 192.168.0.1, user name 327user, password as mentioned earlier. Sure, we could waste time setting up a nameserver but we have to consider possible conflicts with the CSE nameserver.
  2. Change to your group's working directory.
  3. Get the file.
  4. Exit ftp.