WYSE Winterm Hacking: Hacking the 3360SE

Kelly Koehn - 4/21/2007 (Updated: 4/29/2007)

Note: I have not worked on this project for some time and probably won't again as I don't have these units anymore. If you would like to donate a machine for more testing send me an e-mail.

Objective: Install Knoppix on a 3360 and make it a functioning Linux box.

With my success of the 3200LE I decided to venture out and buy some more of these little guys. I ordered some 2315's and luckily a 3360 was thrown in the mix. Well it was the likely candidate of this experiment ;) The specs are as follows:

Internals: (Not updated)
External Ports:
Inactive Ports:
There are two other ports that seem to be inactive inside the system. There is a CompactFlash port on the board but that appears to be inactive. According to some other sites it is a memory expansion port for storing data. The other port is an SO-DIMM slot right above the soldered onboard memory.

Getting Linux Working:
Unfortunately this unit took me several days to ponder over. After many trials and errors with the firmware I learned a valuable lesson that each firmware is only designed for a particular unit! To save everyone alot of trouble I will line out all of the steps you need to do to get Linux booted up on your WYSE terminal.

Create your boot image
As I stated before... each boot ROM image is designed for a particular piece of hardware. Alot of this stems from how WYSE decided to use different types of processors, OS, and architectures in each model of terminal. The 3360 is a MIDWAY system that uses the Geode x86 clone processor. The MIDWAY refers to the architecture that the board calls itself. The 3200LE is a ULC board, etc etc. If you try to flash an unknown or incorrect image to the box it will flash a message up that says it is not meant for that hardware. If you decide to flash using the parallel method (back door) then it will kill the box instantly and never boot again (without some intervention).

Before we can begin you must first download the original boot image of the system so we can extract some files from it. For demonstrations sake I'm only going to focus on the actual steps and not explain the process as much. If you want more information, check out the sites below as they have tons of information on this. Download the original image from the WYSE support site by selecting the 3360SE (CE.NET) from the retired list. For convenience I have posted a local copy of the latest firmware here. You'll notice that this file is an EXE file so you'll need to download this on a Windows box. On your Windows box, double-click on the file and it will open a WinZip self-extractor. Simply extract these files to a new folder on your desktop. When downloading the firmware be sure and select the corresponding member that you have. There is a 16MB/32MB version and a 32MB/64MB version. For my demonstration I have picked the 16MB/32MB version.

If you want to download just the applicable file we will need, click here

Once you unpack the file you'll find a series of directories. We will be focusing on the directory '506-4Wye1E_3360_FTP_CEN'. This directory contains the main boot ROM for the CE.NET systems. If your 3360 does not run CE.NET then you would probably use the one without _CEN. Do so at your own risk! For now, don't worry about copying anything just yet. We'll get to that when the time is right.

Download the firmware tools
To build the firmware for the 3360 we will need to download several tools. Before we can begin you will need to have three things installed: LinTools, AS86, and Bin86. I will go through each of these in the order they should be installed. The box I used to install these on is a Fedora Core 5 box with the latest patches. If you use another distribution then you may have to change these details slightly.

Installing AS86
To install AS86 you will need to download the following file: as86-0.16.17.tar.gz. Unpack this to a directory with the 'tar' command.

Now go into the 'as86-0.16.17' directory and type the following:

You should see some 'cc' compiling lines and you may see a couple of 'warning:' statements. It is safe to ignore these. If you see any 'error:' or 'fatal:' lines then fix the problem and try again. AS86 should not be installed.

Installing Bin86
To install Bin86 (which will give you LD86) you will need to download the following file: bin86-0.16.17.tar.gz. Unpack this to a directory with the 'tar' command.

Go into the 'bin86-0.16.17' directory and type the following commands:

You will see several 'cc' lines come across and a couple of 'warning' lines. The same thing applies... if you see fatal or error, fix the problem and try again. LD86 should not be installed to compile the applications.

Downloading LinTools
Now we will need to get the tools that will help us build our WinTerm image. Download this file and extract its contents with 'tar'. linterm_tools.tar.gz. Change to the 'linterm_tools' directory that was freshly created. Then go to the 'fw_builder' directory under that. You will see several directories in here. First of all, create a 'final' directory where we can place all of our completed files.

Now change to the 'bundle-tools' directory.

Extracting files from the original image
This is where we will work with the file from the WYSE support site. It is best to have an FTP server on your Linux box or have a way to transport files wtih a flash drive. By whatever means copy the 'D506_4_Wye1E.bin' file to this directory. We will need to start the process of extracting out pieces of the ROM file for creating our new ROM image. Type the following:

After this has been completed you will need to run a make on it to create the rest of the program. Do the following:

You will see that it creates a 'fwhead.h' file that will be used by the applications. Now it is time to extract the actual files from the image. In the same directory type the following command:

This will give you a list of all of the files that are in the boot ROM image. We are concerned about two files in particular: 'k' and 'mid_code'. The 'k' file is used to determine what the model number of the unit is and the 'mid_code' file is the BIOS of the unit. Create a directory called 'files' and change to it. Type in the following command to extract the files:

You will see a series of files scroll down the screen. If you do an 'ls' you will see all of the files from the image. We need to copy several files over as part of the 'base' image. Run the following commands to copy the necessary files:

This will copy the main BIOS, the start up image, and the magic packet so the ROM will function properly.

Compiling in the kernel
Now it is time to compile the kernel into the ROM image. Go back one directory to the 'fw_builder' directory and then go into the 'make-nk' directory. In the image there is a file called 'nk.bin' that is the heart of the CE operating system. Because the system was built around CE, this is the file that the system looks for to boot. We are going to sneak in a Linux kernel and initrd in there to make it start loading Linux instead. We will need to compile make-nk first however. If you already have as86 and ld86 installed then continue on... otherwise go above and install them.

There is no 'install' process so a make install is not necessary. To create the nk.bin file we need to execute the make-nk program. Run the following line to create the nk.bin file:

This will create the nk.bin file in the directory. Copy that to our 'final' location:


Packaging the image
Now we are ready to package up in the image in an uploadable format. Change directory over to the 'bundle-tools' directory again. Inside you will find an application called 'fwpack'. This application packages all of the files up into a single BIN file that will be uploaded to the Winterm. This program takes several arguments with the first being the output file name, followed by the BIOS file, then any files you would like to also include in the image. Use the following command to create the image. We will call the final file 'd_linux.bin' and all files are located in the 'final' directory that we created previously. (There is a reason for the naming convention that I'll touch on later)

This will create the final d_linux.bin file that can be uploaded.

If you would like to download my final image for the 3360 you may do so here

Uploading the easy way
There are really two ways you can upload firmware images to the 3360. The first way is fairly simple. If you press the 'Control Panel' button and then open the 'Upgrade' icon you can type in the IP and path to an anonymous FTP server. However this method requires a params.ini file of which I don't have. For this reason I wouldn't suggest this method but if you can get it to work then great.

Uploading the hard way
In order to force the unit to take the new firmware you will need to have what is called a 'LapLink' cable. This is basically a parallel transfer cable that is used for transferring files between computers. You can scour the net and find schematics on how to build these cables. If you have a newer version of the Symantec LapLink software then it comes with a handy yellow cable that does the trick.

You will need a machine with a physical parallel port and capability to boot from a CD-ROM for this. Burn the following image to a CD-R. I used Nero to burn the image and it worked with no problem. Boot the PC up on this disc and you will find that it boots MS-DOS 6.22. You MUST run the application in real DOS mode as the NT environment will not allow you to control the parallel port as it needs.

Once you have the machine booted up we will need to create a second disk that has our image and transfer program on it. On another computer copy your 'd_linux.bin' file to a folder and also copy xfer.exe to the same directory. This is the program that will be used to copy the image to the Winterm. Once again I used Nero to create a new CD with no problems. However there are some precautions that you must take when creating this CD. You must make sure you DO NOT create a MultiSession disc. Be sure to remove the Joliet extensions from the file system and only use ISO9660 for safety. Burn the xfer.exe and d_linux.bin files to this CD and switch the discs in your upload PC. If you stay on the same drive that the PC booted up on then typing 'dir' should get you the new directory listing. Be sure you start the uplaod be sure that your Winterm is POWERED OFF... otherwise you will have to power cycle it. Start the transfer client on the PC by typing the following:

Notice that the file is called d_linux.bin. The program requires that it start with a combination of three different letters, one of which is 'd'. It must also end in the .bin extension. I guess this is some kind of verification of the file? Anyway you should see a window that comes on the screen saying it is waiting to send the file. Turn on your Winterm and within seconds you should start to see the byte count rise on the screen. If you do not, pull the power cord on your Winterm for a few seconds and try again. On the screen of the Winterm you will see it go through a 'download' phase, then 'erasing', and then the system will reboot. Your PC will close the application when the upload has completed. Once the Winterm comes back up it will verify the flash memory and if all goes well you will see the WYSE yellow/black logo followed by Tux proudly displayed in the corner. You will now be prompted to insert your USB key to boot from. At this point you and power off the system.

Creating our USB key to boot from
(Note: This was taken verbatim from my 3200LE tutorial so some things may not be exact)

Downloading your image:
I have made a custom image that is about 104MB or there is a standard DSL (DamnSmallLinux) image custom made for the Winterms. I have made several changes to my image to fix some bugs and customized it for the 3360SE. I have also configured my image to not load X-Windows and enabled sshd.

Select your image that you would like and download it:

Extract the contents of either file into a directory on your Linux box. You can do this on Windows but it is a lot more work (since Windows doesn't natively support EXT2 FS). Go ahead and plug in your USB drive into your Linux box and you will see it installed. Some distributions will automount the USB drive somewhere. If yours does not then you can type 'dmesg' and you will see what it called the device. Typically it will be called '/dev/sda'.

First we will need to prepare the drive for use. Typically flash drives come with a FAT or FAT32 system on them for Windows. Linux will read this out of the box but the Winterm image isn't looking for this and will *not* boot from it. We need to remove that file system and create an EXT2 file system in its place. Keep in mind that this will remove ALL data from your flash drive!!! Once again, ALL DATA WILL BE REMOVED AND UNRECOVERABLE!

Once you have your flash drive found go ahead and load fdisk to partition the system. Type the following command:

 fdisk /dev/sda

Note: If your distribution automounts USB drives, you will need to unmount it first!

If you want to see the existing partitions you can press the 'p' key to print out the partition list. Otherwise just press 'd' to delete the partition. Now we need to press 'n' to create a new partition. Press 'p' to create a primary partition and select '1' as the partition number. You will want to select '1' as the default sector and then just hit enter on the ending sector. This will use all of the flash drive by default. Once you have done this you need to set the partitions file system type by pressing 't'. You will be asked for the type, type in '83' for the Linux EXT2 system. Now press 'w' to write. It will write the FAT and then you will be returned to the console. Your flash drive may write for a little bit if it is a slower model -- just wait until it completes.

Now we need to format the drive with our EXT2 file system. Type the following command to create the file system:

 mke2fs /dev/sda1

This will begin 'formatting' the flash drive and you will be returned to the console prompt when it is completed. This should only take a few seconds.

Once the formatting is complete we will be ready to copy files to the drive. First we will need to mount the drive so you can write files to it. Type the following at the prompt to mount the drive:

 mount /dev/sda1 /mnt

Most systems have a /mnt directory for this specific purpose. If yours does not then create a directory or use an existing empty directory to mount to. Change to the /mnt directory and untar the archive to the drive. For our example I will assume you are using my customized image and your files are stored in the 'winterm' subdirectory under the root directory.

 cd /mnt
 tar -zxvf ~/winterm/winterm.tar.gz


You will see a series of files fly by and files will begin writing to your flash drive. Please be patient as this will take several minutes for the buffer on your flash drive to empty. Do not pull out the drive until the light stops flashing otherwise file errors will occur! Once the flashing has stopped you can unmount your flash drive and then remove it by typing:

 umount /mnt

Insert your flash drive into your Winterm and turn the power on. The system will initialize itself and when the orange light turns off it will be ready. Simply press the power button and the power light will turn green. You will see the WYSE logo appear with Tux on it and it will begin searching for the USB key. Shortly after Linux will begin booting and you will be at a console.

Caveats with the standard install:
Here are some things that I ran across while writing up this document. If you decide to use the standard DSL installation you will more than likely end up with a file system 'crash' at the beginning of the first boot. I'm not sure why but this happened to me almost everytime, resulting in a readonly file system. This seemed to be caused by fsck being an old version and not supporting something in the EXT2 standard. By commenting out the initial 'fsck' commands in /etc/init.d/checkroot.sh and /etc/init.d/checkfs.sh I was able to get a successful boot. It will however show an error about the file system being uncleanly mounted but it is silent about it. If you attempt to run fsck on the USB drive it will corrupt all data... I learned this the hard way!

The network will always attempt to search for DHCP even if you modify the configuration. In order to get it to stop this and use the /etc/network/interfaces configuration you will need to modify /etc/init.d/knoppix-autoconfig and comment out the line that reads 'pump -i $DEVICE >/dev/null....'. I just put the command 'ifup eth0' in there to bring up the ethernet device manually. If you don't do this and you modify the interfaces file it will cause the ethernet device (eth0) to fail when it comes up and you will always have to do an ifdown/ifup command -- not good for a headless system!

Well I hope this helps some people out... these are great little solid-state devices that not only are cheap... but quite reliable! Enjoy!

Special thanks to these sites. Without them this wouldn't be possible!
http://winterm-linux.blogspot.com/
http://winterm.gaast.net
http://www.marlwifi.org.nz/projects/winterm
http://www.allbootdisks.com/download/iso.html (MS-DOS boot ISO)
http://homepage.ntlworld.com/robert.debath/ (Maker of AS86 and Bin86)