Technologics TS-7200: Notes
Setting up serial communicationsI use minicom to talk to the serial port of a TS-7200 from my Linux desktop (Putty works from Windows® ). But when I first launched minicom after powering things up, I only saw:
No response. What's the deal? I vaguely remember that the com ports on my desktop are numbered weird. Its probably trying to talk to the wrong com port. C-A z enters the configuration menu for minicom, 'o' gets me to the submenu where you set the port related stuff. The TS-7200 likes to talk at 115200 baud, 8N1, and that looks right. I change the port to /dev/ttyS1. I get out of the menus, hit Enter, and voila:
Bingo. Fortunately, (actually, by design) can save minicom's settings so you only have to do this once. |
Building and Setting up a 2.6 KernelImportant saftey tip: Do not do this as root. There is too great a chance you will clobber your native kernel and kernel modules as root, and it isn't necessary to be root in any event. Get kernel sourcesI started from the 2.6 kernel page at the Technologic website. The Technologic toolchain works (x86).I created a ts7200 directory and untarred this inside it:
The kernel sources on the Technologic website (2.6.21) work, but don't include IDE support yet, so I used the 2.6.23 sources modified by Dan Smolik. Here is a link to Dan Smolik's source tree . I started with Dan's kernel config , but modified it quite a bit, so use mine at this point:
Configuring the kernelWe've copied the config file into the kernel source root and named it what the Makefile expects it to be. Note: the softlink to the kernel sources is a customary convenience. Before we can build this kernel, we need to modify a couple things. And before we can run make menuconfig to modify things, we need to set up a script to use do so with your cross-toolchain. You can do this on the command line, but the strings are long and easy to forget so I do it in a script.
Make sure the paths and names make sense for your setup if you have located things differently, or are using a different toolchain. Once you have this setup right, run the script. A colored text-based menu should come up.
Okay, you are in the kernel configuration menu now. There are a couple things we want to verify are correct (and you should go through this, as it is a good way to learn how to navigate through the kernel options). Arrow down to "Networking --->" then to "Wireless --->". Make sure the "Generic IEEE 802.11 Networking Stack" will be built as a module by hitting the space bar until an 'M' appears. Also check that CCMP and TKIP encryption will be built. Exit up out of these and go into "Device Drivers --->" then into "Network Device Support --->" and down to "Wireless LAN ---->". Make sure the "Wireless LAN (IEEE 802.11) " is selected with a '*', and "USB ZD1201 based Wireless device support" and "IEEE 802.11 for Host AP (Prism2/2.5/3 and WEP/TKIP/CCMP)" will be built as modules 'M'. Go back up to Device Drivers again and select "Character Devices ---->". Make sure both "Unix98 PTY support" and "Legacy (BSD) PTY support" are '*' selected. Now go all the way out of Device Drivers and into "File systems --->". Select '*' "Ext3 journalling file system support" - who knows? you may want to plug in a USB flash-stick with ext3 on it. And that's about it. Its a good idea to change the boot command too. Go to "Boot options --->" and select "console=...". Make sure the ip address is correct if you are assigning a static IP, and set root=/dev/hda1 if you want it to autoboot off the CF. You can override this on the command line to NFS boot. When you're happy with it, exit out and save your changes to the config. There's one other thing you want to do and I don't know how to do it in the menu, so edit the .config directly and set the CONFIG_LOCALVERSION="ide" or something you can remember. This will be appended to the name of the kernel that shows up with "uname -a", for example, and you need to know what it is for when you load the modules you build. Building the kernelOkay, now you are ready to build this kernel. If you were just to type 'make' it would try to build it using your host system's compiler and toolchain. Don't do that. Instead, get another script ).
Make sure the paths make sense as before, then run your build script.
You should see it start building stuff right away. It will take awhile the first time. After you have built it once, it only rebuilds the things you subsequently modify. When it finishes (without errors I hope) you are ready to have it install the modules it just built. What this does is move them to a modules directory in your root file system where the kernel expects to find them, and builds a modules dependency map there. If you weren't cross-compiling all you'd need to do would be run 'make modules_install' and it would put them under /lib/modules/. Again, we have to do it in a cross-compilation environment. So download another script and make sure it's paths are right, then run it:
Setting up a root file systemIf everything worked up to this point, you're almost done. Now get the root file system you will be using. I used the Debian Sarge with udev support provided by Technologic:
Note that you do need to be root when you untar this. The reason is there are soft links built into the filesystem which will not be properly built if you are not. Now copy the modules tree you built into the source tree, and the kernel itself somewhere useful:
These commands assume you are currently sitting in ts7200/2.6/ and that both the modules directory you built and the root file system are sitting their with you. You probably need to be root for the copies. I copy the kernel into boot/ under the root file system where it will be visible to tslinux at startup. Copying the root file system to your CFAt this point you have built a kernel and modules and configured the base file system, but its sitting on your desktop. You need to get it into your CF. The trick here is to make sure you move it with all of its links. The best way I know to do this is using tar. You also get a backup of your modified root filesystem for free.
Booting the new kernelYou are ready to try it. You can try booting off it directly. But I usually boot off an NFS mount at first. In that case the only thing you need off the CF is the kernel itself. Here is the RedBoot commands which should accomplish this:
The second exec command is used when no network is available. I normally do development and testing through an NFS mount to my desktop. The RedBoot commands for this (on my system) are:
Here is my NFS /etc/exports file as an example. Here is my /etc/network/interfaces on the exported debian root file system (this needs to be right or NFS won't work). And here is my /etc/fstab on the exported debian root file system. Tweaking things on the booted systemOnce you get it to boot, there are a few things to tweak. I was getting regular error messages caused by lack of virtual terminals (the TS-7200 isn't running X so it has no virtual terminals). To turn this off I had to modify the /etc/initab slightly. Here's my inittab Be sure to set up a hosts.allow file. You might need to apt-get install ssh to make sure it's set up properly. The hosts.allow makes sure your LAN addresses (and specified others) can SSH into the TS-7200. To get my zonet wifi dongle to work I had to
Here are a few other things you'll want to do while booted on your new system:
Installing makedev adds a device node making utility at /dev/MAKEDEV. Not sure this is necessary, but it certainly doesn't hurt anything. Linx is a text-only web browser which comes in real handy sometimes. Once you do all that, it's easy. Note: I think my copy of the root file system still has the system log turned on. This is very useful while still debugging, but once everything is running correctly, you should make sure it is off to save wear on the CF Moving the new kernel into the TS-onboard Flash memoryOkay, this is a bit nerve-wracking because if you screw it up you will be sending your box back to Technologics to get the onboard flash reloaded. Basically, what you need to do is get the kernel you want to use loaded into memory, then delete the current kernel from the onboard flash, then copy the memory into the onboard flash. Here's the sequence after interrupting the boot process so you have the Redboot prompt:
This should write the current kernel you loaded into memory at 0x00218000 into the flash at 0x160000. Note that your new name can be the same as your old name. You can take a look at what you've got in the onboard flash with the fconfig command. Here's mine:
|