The Hawkboard is a Linux-based open source hardware project that is based on the same hardware as the Beagleboard. The Hawkboard design files are available from Hawkboard.org, although I’d like to see them adopt a more detailed license for it to make it easier for people working on derivatives to perform their due diligence. (Perhaps the results of next week’s Open Hardware Summit will inspire more folks to adopt open source hardware licenses). The Hawkboard folks were kind enough to send me a board to experiment with.
The Embedded Linux Wiki has great instructions for getting up and running with the Hawkboard, but they are geared toward people using Linux. Although I’ve got a virtual machine handy running Linux, I do most of my work on the Mac, so I looked into the steps needed to boot the Hawkboard under the Mac.
To get it to work, you need to run a TFTP server and an NFS server on your Mac. Fortunately, the current version of Mac OS X has all that built in, even on the non-server versions of the OS.
Setting up the TFTP Server
First, download the uImage kernel. This is described on the Embedded Linux Wiki, but I was not able to get the default uImage kernel working with the Mac OS X NFS server. Instead, I used the uImage available from Angstrom Linux, and renamed the file to uImage-Angstrom.
Next, open the Mac OS X Terminal (/Applications/Utilities/Terminal), copy the file to the /private/tftpboot directory, and start the tftp server. The commands for this are shown below. You will need to be logged in as an administrative user to run these commands. If you are prompted for a password, type your password (you may need to change “~/Downloads/uImage-Angstrom” to the exact location where you downloaded the uImage):
cd /private/tftpboot/ sudo cp ~/Downloads/uImage-Angstrom . sudo launchctl load -F /System/Library/LaunchDaemons/tftp.plist
Setting up the NFS Server
Next, download a root file system. Although this is described on the Embedded Linux Wiki, since I decided to work with the Angstrom Linux distribution, I used the online image builder to create my image with the following options:
- Machine: hawkboard
- Complexity of options: advanced
- Base system: regular
- /dev manager: kernel
- Type of image: tar.bz2
- User environment: console
Go back to the terminal, and create a directory to hold the root file system, and extract the RootFS file into that directory (you’ll need to change “random-abccd17c” to match the file you actually downloaded):
sudo mkdir /Hawkboard cd /Hawkboard sudo tar xvfp ~/tmp/random-abccd17c-image-hawkboard.tar.bz2
Next, edit the /etc/exports file, and add a line like the following to it:
/Hawkboard -mapall=root -network NETWORK -mask MASK
You will need to replace NETWORK and MASK with the correct network address and subnet mask for your network. For example, on my Mac, I used:
/Hawkboard -mapall=root -network 10.0.1.0 -mask 255.255.255.0
To edit a file in /etc. it’s easiest to use the nano or vi text mode editors. You can start nano with sudo nano /etc/exports
and vi with sudo vi /etc/exports
.
Next, start the NFS server and make sure that the last command displays the /Hawkboard entry:
sudo nfsd enable showmount -e
Loading the Linux Kernel
Now you’re ready to connect your Hawkboard using Ethernet to the same network that your Mac is connected to. If you decide to connect your Hawkboard directly to your Mac over Ethernet, that will work, but you’ll need to check your Mac’s self-assigned IP address in System Preferences->Network and use that when configuring the /etc/exports file (for example, if your Mac is showing a self-assigned address of 169.32.23.100, you can safely use 169.32.23.0 for the network and 255.255.255.0 for the mask).
You’ll also need to a serial connection from your Mac; for a serial terminal program, I suggest CoolTerm. Since Macs don’t have built-in RS232 ports, you’ll need a USB-RS232 adapter like this one. You’ll also need a female-to-female DB9 null modem such as Cables2Go’s 1ft DB9 F/F Null Modem Cable.
For example, to load the uImage file I downloaded, I clicked CoolTerm’s Options button and selected to my USB serial port (PL2303-00001004) at 115200 bps, then clicked OK. After that, I clicked Connect, powered up the Hawkboard, and typed in these commands at the hawkboard.org >
prompt:
setenv serverip 10.0.1.3 setenv ipaddr 10.0.1.201 tftp c0700000 uImage-Angstrom
You’ll need to do three things: replace 10.0.1.3 with your Mac’s IP address, replace 10.0.1.201 with an unused IP address that the Hawkboard will use, and (if necessary) replace uImage-Angstrom with the name of the file you copied into /tftproot earlier in this guide. You should see something like this happen:
TFTP from server 10.0.1.3; our IP address is 10.0.1.201 Filename 'uImage_v1'. Load address: 0xc0700000 Loading: *.################################################################# . ################################################################# . ################################################################# . ################################################################# . ################################################################# . ######################################################## done Bytes transferred = 1934036 (1d82d4 hex)
Booting the Kernel
Now you’re ready to try booting the kernel using the instructions for booting from NFS in the wiki. I gave the Hawkboard the following command:
Then I booted up the Hawkboard with the command bootm c0700000
, and in a minute or two, was greeted with the login prompt, and could log in as root (no password):
.-------. | | .-. | | |-----.-----.-----.| | .----..-----.-----. | | | __ | ---'| '--.| .-'| | | | | | | | |--- || --'| | | ' | | | | '---'---'--'--'--. |-----''----''--' '-----'-'-'-' -' | '---' The Angstrom Distribution hawkboard ttyS2 Angstrom 2010.7-test-20100909 hawkboard ttyS2 hawkboard login:
ADVERTISEMENT