Category Archives: Other

Transferring files to the Osborne 1

As any of my friends could tell you, I’m pretty big into collecting vintage computers. It costs me $70/month in storage fees, but I am just completely drawn to some of the awesome technical creativity that went into early machines before standardization took hold of the market. Mixed with the nostalgia, closeness to the hardware, and challenge of using something less than user-friendly, these old machines are great. In particular, I’m a big fan of the early portables, or luggables to be more realistic.

One fantastic machine that I’m lucky to have 3 of is the Osborne 1.

Osborne 1

It’s a pretty sweet machine, running a Z-80 processor, 64K RAM, dual 5 1/4 floppies, a monochrome 5″ screen (love this, its absolutely tiny compared to the machine), modem port, serial port, battery port, parallel port, all folding into a suitcase.

If you’re lucky enough to get the original software pack, it actually comes with the a good amount of applications, including it’s OS CP/M (the precursor to DOS), Wordstar, Supercalc, CBASIC, MBASIC, and dBase II. However, I personally love vintage machines for their games and getting them connected to other computers. The machine sports a DB-25 serial port at 1200 bps, and I knew I could transfer the modest sized library of CP/M software that can still be found on the net over the serial link. I had no terminal software though, so I did some research and came up with the following after a long struggle (please leave a comment if you have any better info or corrections):

Transferring Files to the Osborne 1

  1. Use the DB-25 port – The machine has two serial interfaces, a DB-9 and a DB-25. There is not a lot of documentation out there regarding the difference, but from what I’ve gathered, the DB-9 is not a standard RS-232 serial port, but a TTL serial port specifically designed for use with the Osborne modem (that fit snuggling in the storage bay under the left disk drive). While I’m sure it’s possible to build or use a UART to convert TTL to RS-232, it’s easier to use the DB-25, which is indeed an RS-232 port.
  2. Do not use a null modem – One of the first things I kept running into was once I managed to find a way to transmit data (see below), my remote computer (my primary Debian box) got absolutely nothing over the line. Not garbled characters from a mismatch in speed, just absolutely nothing. I thought maybe my port was bad, so I tried a new Osborne hooked to another machine (even with a new cable), and still nothing. Of course, normally you would use a null modem to switch the send/receive pins when connecting a computer to another computer over serial link, which I was doing. It turns out that the Osborne serial port was probably designed to be used as a terminal, and hence it already does the crossover. I had to directly connect my serial cable from one computer to another, with no null modem, for it to work.
  3. Set the serial speed – Depending on what revision of the Osborne 1 you have, it will either have a default speed of 300 or 1200 bps. 1200 is slow enough, so you definitely want to make sure it isn’t set at 300 bps. The CP/M disk will contain a “setup.com” program that you can run to configure various settings, including serial speed. Make sure 1200 is selected.
  4. Use PIP to initially transfer files – PIP is a fantastic utility included with CP/M that allows data to be moved from one device to another – devices being both files or physical interfaces. With PIP, we can instruct the Osborne to dump a text file from a remote computer to a local file. While PIP has no error correction and is not designed to be a full terminal, it does get the job of initially getting a terminal program onto the machine. Usage consists of “PIP <target>=<source>”. So you could use it to copy a file from drive B to drive A, “PIP A:FILE.TXT=B:FILE.TXT”, or from the serial port to a file, “PIP B:FILE.TXT=RDR:”. RDR (short for reader, as in paper tape reader, oh the historical goodness in that one) is the device name for the serial port.
  5. Get the Kermit assembly modules (in hex) onto the machine – This part I gathered from instructions on z80.eu and using files from Columbia University’s Kermit Page. Columbia University has a huge archive of versions of Kermit for different computers, including CP/M machines. These consist of two files – the base Kermit module, and then a small module that is specific to the machine. In particular, cpsker.hex (the main kermit module), and cpvosb.hex (the Osborne 1 specific code). These previous links are copies I made of these files in case you can’t reach Columbia’s site for whatever reason. Start by instructing PIP to save data from the serial port to a file, e.g. “PIP B:CPVOSB.HEX=RDR:”, then dump the contents of this file on the remote computer to the serial port. After the transfer, you will have a good copy of cpvosb.hex on your Osborne (you may have to control-d, control-c, or control-z to end the transfer if the Osborne does not quit out automatically, sometimes it worked for me and sometimes it didn’t). The larger, main kermit module is a little more tricky.
  6. Get the main Kermit assembly module – Unfortunately, the main module is a little more tricky as its bigger than PIP’s buffer, so it must write a portion of the file to disk during transfer (as opposed to the entire thing at the end). The problem is, PIP has no error correction, and when it goes to use the disk drive, you WILL lose part of the file being transferred. The transfer takes a while anyway, so having to restart because of corruption is a giant pain. Since these hex files are simply text files, I split the file into 4 parts to decrease the chance of file corruption (and decrease the time I’d have to wait for each one if I had to retransmit). After splitting them into 4 parts, I followed the same procedure as in step 5 for each file. Once they were all on the machine, I cleaned up any extra line feeds introduced by the transfer with ED (ed is so non-intuitive it makes vi look like MS Word – reference for its use can be found here), then concatenated the files together with PIP (PIP full.txt=file1.txt,file2.txt,file3.txt,file4.txt). I then had both the kermit and machine module.
  7. Compile Kermit – Luckily, CP/M comes with both ASM and DDT on disk that allow compiling and linking source files. We will use DDT to link these two modules together. The following blurb is from the Columbia page with a few comments from me:
    
    
              ddt cpsker.hex <--- At the command line, DDT your base module
    
              NEXT  PC   
              3500 0100
              -cpvosb.hex  <--- insert the machine dependent module
              -r
              NEXT  PC
              xxxx 0000
              -^C  <---- control-c
    
              A>save dd kerm411.com  <---- executable file to create
    
          "The page count ("dd") used in the SAVE command is calculated from
          the last address ("xxxx") given by DDT in response to the R command:
          drop the last two digits and add 1 if they were not zero, then
          convert from hexadecimal (base 16) to decimal (base 10): 684F
          becomes 69 hex, which is 105 decimal (5 times 16 plus 9) -- but 6700
          becomes 67 hex, or 103 decimal."
    
    
    

    If you receive any errors or strange messages from DDT that don't match what's listed above, it's likely your files were corrupted during transfer (this happened twice to me) and you will need to try again. Also make sure that you have enough room on your floppy to create the executable, you might have to do some disk and file juggling!

  8. Assign Logical to Physical Device - This one you'll have to do every time you restart the machine before you use Kermit. CP/M machines have logical and physical devices. We've worked with the physical serial port device RDR, but there are logical devices that are connected to physical devices to perform translations. Kermit makes use of the PTR (paper tape reader) logical device, so we need to connect this logical device to the serial port physical device. We do this using the STAT command - "STAT PTR:=RDR:".
  9. You're Done! - At this point, you have Kermit, ready to use, on your Osborne 1. There are many implementations (as seen on the Columbia page) of Kermit for every OS, so finding one for Windows, OS X or Linux won't be an issue. There are lots of guides out there for using Kermit as well, so I won't mention the commands here - they're fairly straight forward. Kermit does have error correction and multi-file transferring capabilities, so you can let it go for 30 minutes and transfer something big with no worries. It can also be used as a terminal, so you can connect over serial link to a linux shell and have some fun!
  10. The first thing I transferred once Kermit was good to go was Zork-I, there is just something about text adventures on monochrome screens that is just awesome. Zork I, II, and III for CP/M can be found here. What's nice is these archives make use of a separate z-machine from the data file, so you can copy any z3 data file (which are the vast majorities, I used this method to play The Lurking Horror) in place of zork1.dat - just remember to rename it the same thing.

    Have fun with your Osborne 1!

    Zork 1 on Osborne 1

Expanding the blog

So, the last week or so I’ve been thinking a lot about the direction I want this blog to go. I’ve decided to widen the areas I talk about to include the following:

1. Personal Entries – not so much in a “today I had an excellent ham sandwich” way, but there are often times when I want to write about things going in my life that are technology or computer science related, and I don’t have a good forum to do that. I would love to have a place where I can post thoughts and quick ideas, and I figured this blog would be a good choice.

2. Technology (non-CS) tutorials – especially in the area of retrocomputing, there are a lot of times when I’m looking to do something, can’t find a great solution that’s already been done online, so I have to experiment and find my own path. I would like to post my experiences to hopefully help someone else avoid some headaches. This happens quite a lot with working with older machines, due to the fact that there is a lot of information that simply didn’t make it to the Internet. If a computer was only semi-popular in the early 80s and not used since, it’s often hard to find information.

3. Who knows what else?

I basically want to use this blog for more things, as well as be a little more active documenting things going on with Shredz64 and the PSX64. So I hope you’ll read along and perhaps find some useful information!

Play Adventure Games, Be a Better Programmer

> Open trapdoor
> Go down
> Turn on lantern

I can’t count the number of times I typed the sentences above on my faithful Commodore 64 immediately after getting home from school every weekday afternoon. An explanation to the uninitiated: these simple statements were a way of communicating with a style of game known as “interactive fiction”, or “text adventure”. The particular one that started it all for me was the classic masterpiece known as Zork, where every day I could explore a mysterious underground empire from my room. While the magic of text adventures is an article in itself, after playing Zork once I was completely hooked. Not only did I seek out more adventures to sink my teeth into, I was also lucky enough that my parents purchased a PC for me soon after. From there I discovered the wonder of graphical adventure games, like the Monkey Island series from Lucas Arts and the Kings Quest series from Sierra. From then, and even to this day, I was a complete adventure game junky. No other genre of game could come close to giving me as much enjoyment.

How are adventure games relevant though?

For those who haven’t played an adventure game before, the premise is generally one of accomplishing goals through a series of small tasks. For example, in the popular classic from Lucas Arts, “The Secret of Monkey Island” (spoilers ahead!), at one point in the game it’s necessary to obtain money to purchase a number of items. There isn’t, of course, a pile of money sitting on the ground – that would be too easy. You need to earn it, in this case, from getting paid to get yourself shot out of a cannon at the circus. However, they won’t stick you in the cannon unless you’re wearing a helmet. Guess what? You need to find a helmet, and there is no helmet in the game. There is, however, a cooking pot in the tavern’s kitchen that would fit perfectly on your head. However, you can’t get into the kitchen because the cook won’t let you in…

As you can see, there is a goal (obtain sum of money), and a number of tasks involved in getting there (get into kitchen, get pot, wear it, fire out of cannon). Before you can accomplish a task, there are a number of prerequisite tasks that must be completed first. Each of those tasks has its own set of tasks to complete first, etc. In Computer Science, we call this step-by-step procedure an algorithm.

Algorithms are the heart of programming

Computers, the powerful machines they are, are at their core relatively dumb. They need to be given a list of instructions to follow. They can perform about 4 billion of them a second, but at the end of the day they still need that list of procedures, outlined step-by-step. This is where you, the programmer comes in. Given a goal you wish to accomplish, you must devise a series of steps to lead to that goal, then translate these steps into a language the computer (ultimately) recognizes, such as Visual Basic, C++, or Java.

The same mentality that guides us to get the helmet, to get the cannon, to get the money, is the same process that guides us to be good programmers: to think in steps. A top down approach of taking an overall goal, breaking it into smaller pieces, further dividing each of those pieces into easy steps, until we’ve turned a very large and complex problem into a series of tiny, easy to handle tasks. And sometimes in programming we need to take alternate avenues – just as there is no helmet in Money Island but a cooking pot which makes an excellent substitute, there will be many times in programming where alternative over conventional thinking is necessary to accomplish a goal.

Why adventure games build these skills effectively

The one issue with programming, especially if you’re new to it as I imagine many people reading this article are, is it is a fairly foreign concept. You’re so busy struggling with the syntax of the new language you’re learning that the overall design of the program itself suffers. While this is a necessary part of learning to program, wouldn’t it be great if there were other exercises you could do in the meantime to strengthen your algorithm building skills?

Enter adventure games. They are a great tool to improve your “algorithmic dexterity” as they are enjoyable and usually take place in recognizable situations that you are accustomed to. We all know what a cooking pot is, and we all know we can put it on our head. We know if we turn a lantern on, it’s going to provide light. These are situations we’re used to seeing. However, these common situations put to the extreme focus of step-by-step procedures are what build our instruction-making skills – and adventure games are the absolute masters of requiring this brand of thinking for hours at a time.

So start playing games!

I don’t want to give the wrong impression – learning to program is a lot of hard (but enjoyable!) work, and there are some dry moments when it takes memorization and reading a book/screen. However, when dealing with the flowcharts academia will make you draw out when learning algorithms (a favorite seems to be “Draw out your morning routine!”), or if you’re learning on your own, try supplementing the boring with a little fun. Fire up an adventure game and train your algorithmic brain! Not only will you build a necessary skill, but you’ll also have fun doing it.