Hi drdanj
Step 0: Prerequisites
Bootstrapping Kermit is fairly easy (but time consuming) if you have certain prerequisites in place:
- Target machine that boots CP/M, has RS232 port, PIP.COM and LOAD.COM and has a configuration program for the serial port.
- PC with a serial port and terminal emulator such as Hyperterm or Teraterm.
- Null modem cable to connect PC and target machines with the right plugs on each end.
- A copy of the files CPSKER.HEX and the customisation file for the target machine - find them here: http://www.z80.eu/kermit.html. I see nothing for a Victor 9000 there, so you should try the CPVGEN.HEX file.
- A copy of the file MLOAD.HEX from ftp://kermit.columbia.edu/kermit/a
I will assume you have these already.
Step 1: Set up basic serial coms
Connect the machines together using the null modem cable. Go into the terminal program and set the serial port to 300 baud, 8 bits, no parity, 1 stop bit, no handshake. Set the terminal to local echo. On the target machine, launch the configuration program and set the serial port to match.
Now let's do a little test. On the target machine, enter the command
pip a:test.txt=rdr:[e] . This launches pip and listens to the rdr: device, which is normally configured as the serial port. Nothing will happen and that's because it's waiting for serial data. Switch to the PC and (in the terminal program) open the connection you configured and enter some text in the window. Any ASCII will do. You should see the characters appearing on the screen of the target machine, because we specified "eho" option in the pip command (that's the [e] part of the command). After doing this, type ^Z (CRTL-Z) and you should hear disk activity on the target machine. Pip is writing the text you entered to the file. Check the file is correct by entering
type test.txt on the target. You should see the same text you entered appear on the screen.
Step 2: Determine the size of PIP's file buffer
During the test of Step 1, you transferred text to the target and created a file copy. We need to do this for CPSKER.HEX and the customisation file (which I will call CPVGEN.HEX during this description). However, there is a problem. When
pip receives a file from the serial port, it copies the data into a buffer which, when full, is written to the output file. While it is doing this, it isn't listening to the serial port, and so it misses any data sent while it is writing to the file. This is bad! So, we need to do some experiments to work out how much data it can receive into its buffer before having to write to the file. The easy way to do this is to send CPSKER.HEX to it, and examine the file on the target to see where the break occurs. This is easy because hex files have what looks like a line number at the start of each line (it's really an address for the line).
So:-
- On the target, enter pip tst.txt:=rdr:[e]
- On the PC, open CPSKER.TXT in a text editor like notepad.exe and copy the entire file to the clipboard, then switch to the terminal program and paste it.
- You should see the hex file on the target machine window. There should be clear lines with carriage returns. If you do not see these, and it is just filling the whole screen with no line ends, you will need to set the terminal options to send CR with every linefeed, and try again.
- You should hear the occasional disk activity on the target. Wait until the text stops scrolling on its screen. This should be becasue the data has all been sent. Go back to the PC terminal program and type a ^Z (CTRL-Z). You should hear disk activity on the target again.
- Now let's see what we have. On the target, enter type test.txt. Be ready with ^S - this pauses the screen, and restarts it. Watch the address counter at the start of each line, you will see it incrementing. You are looking for a gap, or sudden jump in the number (it's hexadecimal so will have A B C D E F as well as 0-9). When you see it, hit ^S and take note of the highest value before the jump. Round it down to the nearest 00.
So, we have a point at which
pip's buffer is full. We can reliably transfer that much text over the serial line with no handshaking.
Step 3: Transfer the hex files
In order to transfer CPSKER.HEX to the target, we need to chop it up into segments that are small enough to fit into pip's file buffer, then send it a piece at a time. Go back to the text editor on the PC and locate the line that has the address we determined in Step 2. Cut the text from the start of the file to this line. Now:
- On the target, enter pip C1.HEX:=rdr:[e]
- On the PC, paste the cut portion of CPSKER.HEX into the terminal program.
- Wait for the text to stop appearing on the target screen
- Type ^Z on the PC's terminal program. You should hear disk activity on the target.
- Look at the next line in the PC editor (should be the first line as you cut the last segment) and add the buffer size value to its address.
- Locate the line with that address and cut from the start of the file to that line.
Repeat these steps, adding 1 to the file name Cn.HEX each time. When you have sent all the CPSKER.HEX file, you will have a set of text files on the target called Cn.HEX, where n starts at 1 and goes up to the number of times you had to repeat the process. On the Model II I had 9 of these files.
To transfer CPVGEN.HEX and MLOAD.HEX, you should be able to do each in one segment. Open it in the PC's text editor and look at the last lines. Note the address indicator. Hopefully it is lower than the value we determined in step 2. If so just copy the file across in one go: on the target, enter
pip CPVGEN.HEX:=rdr:[e], then on the PC in notepad, copy the entire file into the terminal program. As before, wait until it stops scrolling on the target display, and enter a ^Z on the terminal. If you find that the file is too big, you will have to use the segmented transfer approach you used to copy CPSKEL.HEX across. Repeat for MLOAD.HEX.
Step 4. Combine the files on the target.
So, we have a bunch of files on the target that together comprise the CPSKER.HEX file, plus one file that is the customisation file. We need to combine all these files into one, and to do this we are once again going to use our best mate
pip. Like this:
- On the target, enter pip CPSKER.HEX:=C1.HEX,C2.HEX,C3.HEX,C4.HEX,C5.HEX,C6.HEX - add or remove Cn.HEX files according to how many you have. The main point is they are all there and in the correct order.
- On the PC, paste the cut portion of CPSKEL.HEX into the terminal program.
- Wait for the text to stop appearing on the target screen
- Type ^Z on the PC's terminal program. You should hear disk activity on the target.
- Look at the next line in the PC editor (should be the first line as you cut the last segment) and add the buffer size value to its address.
- Locate the line with that address and cut from the start of the file to that line.
Step 5 - Combine the hex files into executables
By this point you should have a copies of CPSKER.HEX, CPVGEN.HEX and MLOAD.HEX on the target. Now we need to turn them into executables, and according to the instructions on the Kermit page I linked to at the start of this post, you need to use MLOAD.COM, so...
- On the target, issue the command load mload.hex - this will read MLOAD.HEX and write MLOAD.COM.
- Now, to create KERMIT.COM, enter the command mload cpsker.hex,cpvgen.hex - MLOAD will create a file called CPVSKER.COM which you should rename to KERMIT.COM with the command ren kermit.com=cpsker.com
Step 6. Enjoy your new KERMIT executable
That's it, you're done. You can up the baud rate on the PC and target machine and start using kermit immediately. You don't actually need hardware handshaking if you're transferring small files. Have a play, see what setup works best for you.