You must be prepared to discuss your work at the beginning of your laboratory period on Tuesday, September 4, and to demonstrate your program to your TA during that session. This part of the assignment is worth 5 points.
The computer component of a traffic light system comprises a processor and a memory. Part of the memory (ROM) consists of devices whose content is ``burned in'' by the manufacturer, and cannot be altered by the processor. It holds the program and any constant data. The other part (RAM) is used to hold values computed during the system's operation.
Ultimately, the designer of a computer-controlled traffic light control program must deliver an appropriate collection of 0's and 1's to the ROM burner. The obvious strategy is to use normal tools (editor, compiler, assembler) running on a desktop or laptop computer to create a file that will specify the contents of the ROM, and then send that file to the ROM burner. This strategy is sound, but incomplete because it ignores the unpleasant fact that we can never seem to do something right the first time!
Think about the normal development cycle that you've followed in your programming classes: You use an editor to write code, you compile it, and then you execute it on some test data. Usually, the test fails in some way and you go back through the cycle again. Although you may not have thought about it, the fact that you could get through one iteration of this cycle quickly was critical to your ability to get your assignment done. Even if the traffic-light designer had the traffic light hardware available (hardware and software design usually proceed in parallel, so that's not a good assumption), the need to burn a ROM for each iteration would make this approach unacceptably slow.
An even more serious problem is that if there's a mistake in the program, the most probable effect is that the traffic light will do nothing. Thus the programmer will not be able to get any information at all about the error. How do you find out why a program doesn't work? Add statements to print intermediate data? Use a debugger? The traffic light has no printer, no keyboard, and no extra software...
One solution is for the designer to use a two-level development system consisting of a simulator and a processor board with a simple monitor. That is the environment you will be working in this semester. Each station consists of a normal desktop system running Windows 2000 and a single-board computer with a simple monitor program in its ROM. The desktop system (``Dell'') is connected to the internet, and its Z: drive is your account on the ECE server. The single-board computer (``MB5'') communicates with the Dell via the Dell's COM1 port.
A commercial MC68000 development system runs on the Dell. It is used to compile MC68000 programs, and can simulate their execution. The simulator provides interactive debugging facilities. Compiled programs can be downloaded to the MB5, and then executed there. During execution, those programs can read from and write to the Dell's COM1 port.
This assignment will walk you through a ``final'' development cycle, starting with a directory on your Z: drive that contains a correct program. You will translate the program using the Dell's MC68000 compiler, download it to the MB5, and run it with some data. (This is a ``final'' development cycle because the program is correct; it illustrates the last step in the development process.)
Your task is to obtain a copy of the directory containing this program, compile it on the Dell, download the compiled program to the MB5, and use it to decrypt a given cryptogram. You will to obtain a test cryptogram via electronic mail, solve that cryptogram on the MB5, and return your solution via electronic mail.
Note any problems you have as they occur, and be prepared to discuss them at your next laboratory session. Also be prepared to demonstrate and explain your use of the development system to your TA during the lab session.
The individual steps are expanded below.
Obtain a cryptogram via electronic mail
For this assignment, each student, individually,
must send an e-mail message to
ecen2120@schof.colorado.edu.
The subject line of that message must consist of your official university
e-mail address
(for example, Prof. Waite would use William.Waite@Colorado.edu),
a space, and the word hw1 (the letters ``hw'' followed by the
digit ``1''); the body of the message will be ignored, and may be empty.
You will be sent a cryptogram as a reply to that message.
Thus the cryptogram will be sent to the account from which your request was
made, not to the address in the subject line, and it is your
responsibility to ensure that the cryptogram can be delivered to you via
the account you used to make the request.
It's a good idea to request your cryptogram before going to the lab,
so that it will be available when you need it.
Log onto a Dell
When you press Ctrl+Alt+Delete on one of the Dell, a Windows
Log On window will appear.
Fill in your user name and password, and select METAVERSE in the
Log on to pane before clicking OK.
If you use the Cygwin interface, you will get an error message when the window first opens:
You are a ``domain user'', because you are working in your home directory on the ECE server rather than being logged on to the particular Dell you're sitting at. Simply ignore this message.CMD.EXE was started with '\\blacksun\arp\Windows Folders\Desktop' as the current directory path. UNC paths are not supported. Defaulting to Windows directory. Your group is currently "mkpasswd". This indicates that the /etc/passwd (and possibly /etc/group) files should be rebuilt. See the man pages for mkpasswd and mkgroup then, for example, run mkpasswd -l [-d] > /etc/passwd mkgroup -l [-d] > /etc/group Note that the -d switch is necessary for domain users.
If you use the Cygwin interface, you will need to add the MC68000 development system binary directory to your path. Edit file .bashrc in your home directory adding the following line to the end of the file:
PATH=$PATH:/cygdrive/c/MGC/embedded/bin
We recommend the vi editor for use in this course.
It is a capable editor that is available on a variety of platforms.
You can run it as a Cygwin command, or you can double-click the gVim
6.3 icon on your desktop.
There is also a vimtutor icon on the desktop; double-clicking it
will put you into an excellent tutorial.
Obtain the decryption program
Start Internet Explorer on one of the Dells in the laboratory, and point
it to this assignment.
Click here to get a zip file containing the source
code for the decryption program and an appropriate Makefile.
The browser will pop up a ``File Download'' window asking you what to do
with the file; click Open: to invoke WinZip.
Click the middle button in the bottom row (I Agree) of the license
window, and when the WinZip control window appears click the
Extract icon.
An ``Extract'' window will pop up.
Select a directory on your Z: drive, either by using the browse area of the ``Extract'' window or by typing the full path name into the Extract to: area in the upper left. Click the Extract button in the upper right after you have selected the directory. WinZip will create a hw1 subdirectory of the selected directory, and this subdirectory will contain all of the source files and the Makefile needed to create the decryption program. After this operation is complete, you can dismiss the WinZip window.
The linking step may produce a warning message:
Ignore this warning.(W) #A0347-D Command Ignored: Output is S
The linker has produced a file called driver.abs, which contains
the MC68000 program in a form (``Motorola S-Records'') that can be
downloaded to the MB5.
Download the program to the MB5
Double-click on the Tera Term icon on the desktop, or
use the Windows Start menu to start Tera Term Pro.
Select the Serial connection via COM1, and click
OK.
Turn on the MB5 board, using the switch on the left side (all descriptions of the MB5 assume that the keypad is ``right side up'' as you look at it). All of the LEDs should be lit. If the board is already on, press the red reset button on the left side below the red LED.
In the Tera Term window, you will see text describing the five single-letter commands, A through F, implemented by MooseLoad (the MB5's ROM monitor). You want to download a program from the Dell, so type an upper-case A on the Dell's keyboard.
MooseLoad should now request that you send your code. From Tera Term's File menu, select Send file.... This will produce a normal Windows explorer pop-up window to allow you to select the file. Initially, this window is positioned in the TTERMPRO directory. Click the downward-pointing arrow at the right end of the Look in: pane and select the Z: drive. Navigate to the hw1 directory you created earlier, and open file driver.abs.
A Send file progress window containing a running count of the bytes transferred will now appear, and text will be written into the main Tera Term window. The downloading process for this program will take about three and a half minutes. When it is complete, the progress window will disappear and MooseLoad will write its command list to the main TeraTerm window.
Type an upper-case B on the Dell's keyboard to begin execution. MooseLoad will then ask you for the address at which to start running. Since you want to run the program from the beginning, type the six characters of the program's starting address, followed by Enter. The case of the letters is irrelevant here.
MooseLoad prints Executing..... and goes to a new line. At this point, the program is awaiting input. You might expect to be able to type in the text of the cryptogram to be solved, correcting any mistakes you made by simply backspacing over them. Unfortunately, the program does not understand backspaces. Thus the best strategy is either to paste that text from the mail message containing the cryptogram, or to create a file with the cryptogram text.
You can invoke Explorer or Mozilla to get web mail. If your e-mail server can be accessed via SSH, you can log onto it from the Dell as follows:
If you create a file containing the cryptogram, download it in exactly the same way that you downloaded the program.
After you have either pasted or downloaded the cryptogram, type the character # on the Dell's keyboard. This tells the program that the cryptogram has been completely read, and that it should be solved.
The program outputs partial solutions to the Tera Term window. Each partial solution shows the supposed plaintext, with * indicating letters that the program has not yet decided upon. A partial solution will only be output if it gets a higher ``score'' than the previous best solution. Thus the program may pump out text for a while, and then think for a long time before another output. When it is finished, it returns control to MooseLoad and MooseLoad displays its list of commands.
When the program is trying to find a higher-scoring partial solution, it does not provide any indication that it is still alive. You must have faith that the program is correct, and will eventually terminate (some cryptograms may force the program to run for up to 10 minutes). Imagine the quandry of a developer -- is the program stuck, or is it just taking longer than expected? As the semester progresses, you will experience these doubts for yourself!
It may be that the program cannot solve the cryptogram completely by the probable word technique. In that case, some *'s will remain in the program's final output. It is also possible for the program to end up with a complete solution that is slightly wrong. Since you must solve the cryptogram completely, use whatever technique you are comfortable with to fill in the missing letters or correct the program's errors. (Scrolling back over the last few partial solutions usually makes the solution obvious.) You are not being tested on your knowledge of cryptography, and the missing letters should not present much of a problem.
| Instructor | Revision $Revision: 1.28 $ ($Date: 2007/08/27 00:15:43 $) |