Thursday, April 27, 2017

Macintosh Performa 430 - Part 1

In my last post, I mentioned that I had worked on three projects, one of which was a Macintosh Performa 430.  Now I should state up front, I'm not at all familiar with the classic Mac OS.  I've been using Mac OS X since 10.3, but I had never even touched one before that.  As a long-time Windows user, I didn't find the Mac OS X interface compelling at first, and the lack of a command line, multitasking, and other sort of "power user" features made the Mac OS a non-starter for me.  But then a good friend of mine told me about Mac OS X and it's Unix base, and that's what turned me around on the operating system.  And I've generally been a satisfied user for the past 15 years or so (though I will admit that the more iOS-focused releases have made me think of jumping ship).

So at the same time that I decided to install Mac OS 9, I also decided I wanted to try out System 7.  Why?  Well, to some degree because of my Apple IIgs that I acquired about two years ago.  It was the first time trying GS/OS and not only was I surprised at how much the interface reminded me of Macintosh, but I also found I liked this interface that was closer to the classic look and feel.

With my decision to try System 7, I just had to find a machine, so off to eBay I went.  Of course, as I explained in my last post, my rush to get an iBook left me with a model that couldn't actually run OS 9, so I wanted to avoid that this time.  Unfortunately, that's where I ran into the "model hell" of 90's Apple Computer.  The Performa line, for instance, isn't a line of computers in any meaningful way.  They aren't a series of computer with similar or gradually increasing specifications.  They're just a set of computers that Apple arbitrarily applied the label Performa to.  So when looking at an eBay auction, unless you know the particulars of Apple hardware and the auction is good enough to list everything, it can be hard to know what you're getting, or how this compares with other models.

Stock photo of an SE/30
But I finally found a unit I liked, a Macintosh SE.  It seemed a bit underpowered, but I'd always that style of case.  I had heard somewhere on one of the many retro podcasts that I listen to that a Macintosh SE/30 was recommended, but I couldn't find any that were both cheap and tested to work, so I figured the SE would do.  Also I have a Floppy Emu unit (more on that later), which can emulate a hard drive as well as floppy for an SE, and I really do prefer to replace hard drives with solid state devices if at all possible.  But an eBay sniper got it from me.  It sat at $40 until the last few seconds and then suddenly jumped to $100 and beyond my bidding limit.

Photo on the eBay auction
So back to the eBay drawing board.  I knew I wanted a 68k machine and not a PowerPC, since I already had two PowerPC iBooks.  Again, the dizzying array of models confused me, but I finally found another machine I liked maybe even more than the SE, the Performa 430.  It didn't have the all-in-one case of the SE, but the "pizza box" design really appealed to me.  It also has a 68030 at 16Mhz, so twice the speed (and the same as the recommended SE/30), and could support up to 10Mb ram instead of just 4 for the SE.  The maximum ram is not as good as the SE/30 by a long shot, but the Performa 430 was considered a lower-end Mac when it was introduced.  And the best part: It was tested and cost about $50.

I ordered it on Thursday and it actually, much to my surprise, got here on Friday, but unfortunately though it had been tested it had quite a few problems.

  1. It squealed while powered on.  It emitted a sound that was reminiscent of a radio being tuned, the high-pitch squeal when the radio operator can't quite find the frequency and keeps turning the knob.
  2. The floppy didn't work.  
  3. The hard drive worked, but when the unit was left on for a relatively short period of time (5-10 mins), then it wouldn't boot properly until it had 20 mins or so to cool down.  I discovered this while trying to diagnose the floppy issue, because I rebooted several times.  Or I tried to.  When I rebooted the first time it had been on for a little while, it would try to start up, then stop and reboot on its own.  And it would just keep rebooting until I finally turned it off.
  4. Not a problem with the Performa, but an obstacle for me: I didn't have a Mac monitor.  The Mac's of this period use a DB15 for video output, but it is in two rows instead of VGA's three, so it can't connect to a standard monitor with just a VGA cable.
  5. The PRAM battery was dead.
So when I got the Performa, I of course rushed to set it up.  The video connector was the first issue that hit me, so in some frustration I ordered a connector and assumed I'd have to wait several days before I could play with my new toy.  But then I remembered that I actually had such a connector (the adapter to the left in the picture to the right).  I'm not sure why I have it, I think it might be in relation to the Apple IIgs (even though it doesn't use it, I think at the time I thought it did), but it did the trick.  I was able to connect the Performa to an older VGA flatscreen I have and it detected the resolution and worked well.  The only thing I noticed was flickering in the image.  It was perfectly usable, but not great.

When the connector that I ordered arrived (the one to the right), I set the jumpers for an LC II model (Performa models 400-430 are just an LC II model under a different name and a different software configuration, an example of the confusing mess that was Apple's method of naming models) and hooked it up.  It worked wonderfully.  The flickering was gone and the image displayed perfectly.  So if you're trying to hook up an old Macintosh to a VGA monitor, definitely go for the connector with jumpers pictured above, a Mitsubish AD-A205 instead of the simpler model above.  

With the video problem resolved, I still had to get my Performa up and running.  Fortunately, it uses an ADB keyboard and mouse, as does the Apple IIgs.  I had purchased an Apple Extended Keyboard II unit and an ADB mouse for my IIgs when I first got it, so I scavanged those for my new Macintosh.  And with that, the unit booted like a champ into System 7.

At first, I was excited, of course.  Buying off eBay is always a bit of a risk, even when you're buying from someone with a good reputation and the unit was tested.  To see it boot was a relief...until I realized it had problems.  The squeal presented itself almost immediately, and a quick search of the Internet revealed that it wasn't unique to my device.  And that there wasn't a great solution.  The floppy drive issue came up when I decided to test it by popping in a floppy disk, and this led to the discovery of the rebooting issue when it had been on for a while.  The floppy disk got stuck in the drive, so I shut it down and ejected it manually with a paper clip.  When I turned it back on, it got all the way through booting to the desktop...and then suddenly rebooted.  After that, it wouldn't even get that far before it rebooted again.

One final thought: With all the problems this machine has, did the eBay seller lie?  Technically no, and even in spirit I don't think so.  As I indicated, when I first saw it boot, I thought it was working.  And according to his description, that's pretty much all he did.  He didn't test the floppy or run a stress test over hours to see how it would respond, but he also didn't pretend he'd done this.  When we buy an old computer off of eBay, we know we're taking a risk.  A seller might say he tested the computer, but unless he specifies that he fully tested and how he did so, then we have to assume we're getting at least a partially untested machine.  So I think the seller was honest in explaining how he tested and what he saw.  

I'll talk about how I resolved each of these issues in the next entry.

Monday, April 17, 2017

My iBook and Mac OS 9

So I'm back and working on some new retro projects.  I am blaming my long silence on kids, but things have changed such that I now should have a quite a bit more free time.  By "kids," I mean my god-children, specifically the twins Harmony and Trinity.  Some time ago they and their mother had moved out to live with her fiance (a very nice guy who is also great with the girls), but they were still attending the same school so as a consequence spent every other night with me.  So while they went to bed by 8, by that time I was generally too tired to do much of anything.  But now they're attending a school close to their new home, which is about 45 minutes away in clear traffic, so they come over here a lot less.

As much as I miss having the kids around, it does have the nice benefit that I have a great deal more free time, especially during the week.  So this weekend (the kids were at their father's for Easter) I tackled a few new projects.  On Friday I received a Macintosh Performa 430 I had purchased off of eBay; on Saturday I started putting together my RC2014 kit; and on Saturday I installed Mac OS 9 on an iBook that I had gotten several weeks ago but hadn't done anything with.  I'll talk about the first two projects in later posts, but I'll talk about the iBook now since it's the simplest.

I got the iBook off of eBay (the source of all vintage computers, at least for me) several weeks ago with the express purpose of using Mac OS 9 on it.  Why did I get it?  Well, I recently discovered the joys of cheap semi-old computers on eBay.  By "semi-old" I mean computers between 10-20 years old, not old enough to be considered truly "vintage" but not new either.  I bought a Dell Latitude D610, a 12-year old computer that I promptly upgraded to 2 GB of ram and the latest version of Lubuntu, a lighter Ubuntu distribution.  I also picked up a 12" G4 iBook with Max OS X 10.4 installed.  Both I got for under $50 including shipping.  The Dell I had specific plans to use for Node.js development, but I didn't really having any plans for the G4.  It was an impulse buy, pure and simple.  I didn't even have any great excitement over using an old version of Mac OS X.  I'm primarily a Mac OS X user, and 10.4 was the first version I used when I switched from the PC.  But I didn't have any great desire to jump back in time to 10.4.

Then a thought occurred to me: What about Mac Classic OS?  Prior to Mac OS X, I always eschewed Macs in favor of Windows.  There were many things I didn't like about the old Mac operating system.  I didn't know much about them honestly, but what I did know I didn't like.  I didn't like a single button mouse.  I didn't like the lack of true preemptive multitasking.  I didn't like the lack of a command-line.  Mac OS X solved all of these for me, with I guess the exception of the single-button mouse.  But then I learned about the Ctrl key, and Mac OS X (and maybe classic Mac OS did as well) supported multi-button mice just fine, so even that was resolved.

So anyway I decided to install Mac OS 9, since it is the last version of the classic operating system.  But then I discovered that my iBook didn't support OS 9, it could only run OS X.  Also the CD-ROM drive didn't work, so installing anything would be much more challenging.

So back to eBay where I found a 12" G3 iBook, and I confirmed beforehand that it did support Mac OS 9.  $50 and several days later, I had it in my hand.  I booted up the Mac OS X 10.4 that came on while I burned a Mac OS 9.2.1 iso image I found online.  But when I booted from the image and tried to install, it said it couldn't install on this computer.  Then I tried just Mac OS 9.0.4.  Same outcome.  Then System 8.6.  Same thing.  Finally after much searching I found out that Macs (at least classic Macs) are very tied to their particular version of the operating system.  On the PC side, you can install later version and even earlier versions of an operating system on any PC.  You can even boot into DOS on a modern computer!  But with the Mac, it has to be the version that the model shipped with or later.  My iBook shipped with 9.2.2 so it had to be that version and nothing earlier.  So I downloaded a 9.2.2 iso, but it actually had an install for 9.2.1 and an upgrade for to 9.2.2, not a direct install of 9.2.2.

I did some searching and found out about the Mac OS 9.2.2 Universal Install cd.  I downloaded this, followed the instructions, and they worked perfectly!  The final thing I did, after the OS was completed, was to upgrade the machine from 256 MB ram to 640 MB, which cost about $15 on eBay for the ram module.

But alas all was still not well in my Mac OS paradise.  My iBook has an AirPort card, but I don't seem able to connect to my WiFi.  I don't think it's the card though.  In the AirPort setup, it sees my network and says it connects, but then fails to find the DHCP server, saying that it can't check the status of the network.  My theory is that it doesn't support WPA2 security protocol, which wouldn't be surprising since it is quite old.  However, when I plug a network cable in, it sees the network just fine and I can get out to the internet.  Rockin' the Internet with IE 5.5! 😁

Still, not all is happiness and cupcakes.  I tried to connect the iBook to my iMac, running the latest Sierra, but the AFP protocols aren't compatible.  I tried a few things on the net, but nothing worked.  Finally I reverted to non-secure FTP.  I have a non-secure FTP server setup on my iMac to serve up files for my DOS machines (I can't use Sierra's built-in FTP server because it is secure, so DOS client can't connect to it), so I just fired it up, made a Macintosh directory, and the iBook could pull down files without a problem using Internet Explorer.  I even downloaded Fetch, a popular FTP client from back in the day.

But one small ray of sunshine in this otherwise cloudy day network incompatibility: My G4 iBook with Mac OS X 10.4 can connect to both the Mac OS 9 iBook and my iMac!  So I can use FTP to download from my iMac to the iBook, and on the rare circumstances that I need to go the other way, I can use the G4 iBook as an intermediary.  Why not just upload via ftp, you ask?  Because I can't figure out how to configure the ftp server I'm using to allow it.  I tried multiple times while playing around with my DOS machines, and finally just gave up.

So now I have a G3 laptop running Mac OS 9.  I installed Codewarrior Pro 7.1, so I hope to do some development for it.  But as I have other projects brewing at the same time, I don't know when I'll get back to this machine.

Tuesday, October 4, 2016

RC2016/10: Challenge proposal

I know I'm a little late on joining the Retrochallenge, but I've been dealing with the flu the past few days, so I haven't really had the energy or state of mind to write up my proposal.  But here I am, better late than never!

For this challenge, I'm going to try something different than my last few entries.  Instead of a programming challenge, I'm going to try for a bit more of a nostalgia trip.  For the month of October, I'm going on an extended flashback to the early 90's with DOS and Windows 3.1.  My original concept for this challenge was to only use DOS/Windows 3.1 for everything non-work related, but I quickly determined that just wasn't feasible.  The web is just too big a part of our lives now, and the lack of strong encryption and support for modern web standards makes a lot of it inaccessible.

So I'm going to take a middle road.  Although I'll still be using my iMac for my online surfing, I'm going to perform several specific tasks using DOS and/or Windows 3.1 and blog about those.  The tasks will be:

  1. Manage my personal budget.  I currently do this in Google Sheets, but for the month I'll use some DOS or Windows-based program such as Excel or Quattro Pro.
  2. Manage my weekly game with friends.  Once a week, I play a role-playing game named Champions with a group of friends.  I have two Java programs that I wrote that I use to help me run this game, so I'll come up with DOS or Windows replacements.
  3. Computer games.  Even though my first computer was a Commodore 64 and I have fond memories of playing games on it, my greatest affection for old games really comes from the early DOS and Windows years.  Civilization 1 & 2, Colonization, Harpoon, and Doom, among others.
  4. This blog!  While I won't be able to post it online using Windows, I'll author it on my DOS/Windows machine and then post it using my iMac.

So that's my challenge, to jump back 20 years digitally and see how much of my life I can manage using software that's 20+ years old!

Tuesday, August 16, 2016

CP/M on an emulator TRS-80 Model 4P

My TRS-80 Model 4P: You can't really see it but that's CP/M
running off of the FreHD that you also can't really se on top
of the machine.
So as I mentioned in my last blog post, I took an unplanned six-month rectrocomputing siesta.  I had only recently acquired a cool old-but-refurbished TRS-80 Model 4P with a FreHD (an SD-based hard drive emulator) that was already setup to book LS-DOS and CP/M.  Since I'd been wanting to play with CP/M, and I really like the TRS-80 Model 4P, this seemed like a perfect match.  But after some early frustration with trying to transfer CP/M software to the 4P, and with other things coming up IRL, I dropped retrocomputing for a while.

CP/M Emulation

So in my last post, I mentioned that I was kind of itching to do some software project, but due to my current situation, I was really looking for something emulated, not a physical machine.  My TRS-80 Model 4P immediately popped in my head, of course, but my last time I really had problems with emulators.  This was mostly because they wanted me to supply the ROM, but I still didn't have a way to exchange data between my 4P and my Mac.  Well, after some Internet digging (I swear I am the worst googler in the history of humanity), I finally found a working Model 4P ROM.  (Yes, I downloaded the ROM, even though it's copyrighted.  All I can offer is that you trust that I really do own the machine, as evidenced by the photo above.)

So with the 4P ROM in hand, digitally speaking, I tried out the TRS32 emulator first.  Although I'm a Mac person, I do have Windows running both in VMWare and in Boot Camp, so being a Windows-only program isn't necessarily a deal breaker.  And to be honest, it's a good program.  I had a few minor complaints with the interface, but overall it was very functional and easy to setup.  The only real issue I had is that it's shareware, costing $69 to register, and hard drive support was only included in the full version - something I knew I would want, since my 4P had FreHD.  Also, the guy does TRSTools for free, which is a nice little program to read/write TRS-80 floppy disk images.  I'm not opposed to paying for software, and his gift of TRSTools to the community made me even more interested in throwing him some cash, but $70 for an emulator seemed steep to me.

Then I found SDLTRS, an open source cross-platform emulator based on xtrs, an X-Windows emulator.  It is open source, and seems to do everything the full version of TRS32 does, including hard drive support.  The Windows and Linux interfaces are a bit spartan, but the Mac interface is pretty nice, though I wish the Mac supported the same keyboard shortcuts the Windows version does and was a little less mouse-driven.  In any case, it was as easy to get up and running as TRS32 was, and seemed every bit as functional.  So it became an easy choice, and so far I haven't regretted picking SDLTRS over TRS32.

Getting CP/M Running

As you might guess, this was basically just grabbing a disk image, popping it into the virtual floppy drive in SDLTRS, and booting up the VM.  But which CP/M?  There are several for the 4P, the two most common being CP/M Plus and Montezuma Micro's CP/M.  CP/M Plus was limited to CP/M 3.0, and since I already knew I was going with CP/M 2.2, that left only Montezuma's CP/M.  Here's where I got my CP/M image, and in fact most of the CP/M software that I downloaded.

Now before you hop out to that site and start downloading everything like I did, you may want to pause a bit to avoid some mistakes I made.  First, you don't need every CP/M boot disk that's out there.  I just got the last of the Montezuma Micro CP/M boot disks, and that's what I used.  Second, disks will be labeled as either of type COM, DSK, or DMK.  COM means that it's actually going to come as a binary program, not a disk image, so you'll need to copy it to a disk image to run it.  There are two ways to do this, which I'll discuss below.  DSK and DMK are two virtual disk image formats, so either of these are potentially usable in SDLTRS.  However, while SDLTRS does support DMK, I noticed that a lot of them were larger than the 166k floppy drives that the emulated machine supported, so it was hit-or-miss as to whether these worked out of the box.  All the DSK's I downloaded worked without an issue, though, so if something comes in multiple formats, always pick the DSK.  If it does come in DMK only, all is not lost.  It may very well work, so go ahead and try it.  But if it doesn't. the DMK will probably work in TRSTools, so you can copy the files to a temporary directory, then open a blank DSK and copy the files to that.  The DMK may be a larger size than the DSK, so you may have to pick which files you don't need or copy them to multiple DSK images.  I had to do this with the Hard Disk Drivers disk, which was larger than a DSK.  I put the executables on one DSK and the docs on another.  (I'll talk about setting up the hard drive in my next blog post, but at this point, just make sure to grab that disk image.)

Incidentally, I mention using a blank DSK above, but I didn't originally have a blank DSK image.  SDLTRS Floppy Management tools does allow you to create a blank floppy, but I couldn't get these to load once I'd created them, so after a few failed attempts, I gave up with that.  Now TRSTools does say it supports the Montezuma Micro disk format, which it does seem to, but I couldn't see how to create a usable disk image with it.  To get around that, I just made a copy of one of my working DSK image files, opened it in TRSTools, removed all the files, and made sure it was not flagged as write protected.  Then I just renamed it blank.dsk and would just make a copy of this every time I needed a blank floppy.

Now I mentioned above that some software will come as files instead of on DSK or DMK images.  On the download page above I referenced, Zork I could only be downloaded this way, and the first copy of Turbo Pascal 3 I found on another page came as a zip of files.  There are two ways to deal with this.  The first is to use the cpmutils, which is a set of utilities written for xtrs, the base of the SDLTRS emulator, while other way is to use a blank disk image and add them using TRSTools.  

In the SDLTRS distribution is a subdirectory called diskimages, with a disk image called cpmutils.dsk.  Now, annoyingly, this disk image didn't load for me in MM CP/M, but I used TRSTools to copy the files to a usable blank disk image (you can download the result of this here, if you don't want to do this yourself).  This has a bunch of files on it, but the three COM files are EXPORT, IMPORT, and XTRS.  These are special CP/M programs that take advantage of hooks in the emulator to be able to transfer files to and from the local filesystem.  So, for example, to make a disk image for Zork I, all you'd have to do is download the ZORK1.COM file, copy a blank disk image, and then type IMPORT ZORK1.COM ZORK1.COM.  This works in that you don't get any errors, and something is copied, but when I tried to execute ZORK1, it gave me weird, inconsistent results.  (This was after also copying ZORK1.DAT, which you need as well).  When I then used TRSTools to copy the files to a disk image, this worked, so I have to conclude there's some issue with the IMPORT.  If anyone has any clue, please leave a comment.  I should mention, btw, that I did use EXPORT several times successfully, though I wasn't copying any COM files, only text files.

It's too bad that I couldn't get the IMPORT working though.  TRSTools is nice, but as I'm a Mac user, it's a tad of a pain to use.  I use VMWare Fusion to run Windows on my Mac, but I don't usually have that running, and having to switch to the Windows desktop (I don't run the unified desktop because that annoys me too) when I want to use TRSTools bugs me.  But I keep disk images I'm working on in my shared folder between the Mac and Windows VM and that makes it easier.

Building a 4-Drive System

So now that you have a working CP/M system booting off floppy, and a way to transfer files, the last thing I'll mention is about changing your emulated system to a 4-drive system instead of the default 2-drive.  Now as I mentioned in my last blog, I am not very familiar with CP/M, and certainly not familiar with Montezuma CP/M.  So there may be a better way of trying to accomplish what I did.  If so, please let me know in the comments.  But this is what I had to do to get things to work so I could load up disks in four virtual drives.

BTW, if you haven't done so yet, make a copy of the CP/M boot disk image you're going to use.  Also make sure you're working image is not write protected.  This is set in the image file itself, not by the base operating system.  You'll know if it loads in SDLTRS and when you look at the floppy management screen and it has an asterisk beside it.  I didn't see any way to uncheck this in the Windows version, though in the Mac version you can unlock it.  For Windows, you can use TRSTools and just go into Disk Properties under the File menu.

Boot up CP/M and run CONFIG and you'll see the following menu:

Select F for Disk drive definitions and you'll see:

Select 'C' and enter 4 when it asks, "How many drives?"  That should bring you back to the same screen, but showing 4 physical drives instead of 2.  His the ESC key (in SDLTRS, ESC is mapped to the BREAK key and Shift-up arrow is mapped to TRS-80's ESC), and you'll be back at the main menu shown above.

Go ahead and hit 'G' at this point, which will take you to the Disk format definitions menu:

Now you'll notice that you do have four drives defined, A - D, but A and C seem mapped to the same drive, device 0, and B and D to the same device 1.  Now someone who knows more about CP/M may understand this and how to work with this, but for me it just meant I couldn't get and disk images to read correctly in C and D.  So if you're following what I did, select 'C' and you'll see:

The first two options match our new 4-drive disk definitions, but the two DATA format drives don't seem to work, so I set the C and D drives to 'A' to match the two drives that do work.  

Once you've done all that, use ESC to get back to the main menu, and then SAVE THE CONFIG!  It the 'H' option on the main menu.  It's easy to just jump all the way back and forget this; I did it several times.

At that point, hit F10 to reboot and you have a 4-floppy drive system.

In my next post, I'll go through setting up a hard drive for my emulated system.

Tuesday, August 9, 2016

Running silent

As I'm sure no one has noticed, I haven't posted in a while.  I would like to say that I've been so busy with retrocomputing projects that I just haven't had time to post, but the truth would actually be the opposite.  I haven't done anything with retrocomputing for the last four to six months, so I just haven't had anything to post.  There were a number of reasons for me going silent.  My living situation has been in a bit of an upheaval during this time.  I've been sick several times, and my overall energy level has been down (which, for me, is saying quite a bit, since I'm not normally what one would think of energetic in the first place).  And, honestly, I just haven't really been inspired to do anything with retrocomputers.

That started to change about two weeks ago, when I started getting a hankering to do some sort of software project.  I looked around for several things, and started working on a cloud-based web project, until that pissed me off and really sucked away all my interest.  Several other ideas also occurred to me, but finally I decided to come back to the platform I was just getting into when I stopped retrocomputing, the TRS-80 Model 4P.  More specifically, CP/M on the Model 4P.

The Road to CP/M

I used CP/M only briefly back in the day.  When I was a senior in high school, I took a few classes at the local community college, including an introduction to computers which featured CP/M.  I believe they used DEC Rainbows, though I'm fuzzier on that so I could easily be wrong.  But I very clearly remember the cover to the book we used, The CP/M Handbook.  That was it, one semester in one class, and I never used CP/M again.  But being a computer history buff, I read a great deal about CP/M and Gary Kildall and always had a great respect for the man and his contribution to computers.

Before my break, I decided I wanted to explore the world of CP/M, specifically I wanted to do some programming with early Turbo Pascal.  I bought a Kaypro II, but that had a bad second floppy, and Kaypro's CP/M was really built for a two-floppy system.  So I bought a second Kaypro II, which did have two good floppies, though the first one was very slow to load anything.  Also it didn't have the little kickstand that my first Kaypro had, and that bugged me much more than it should have.  So I had the bright idea of putting the good drive from the second machine into the first machine.  I was defeated by two rusted screws, after trying everything I could think of.  The two Kaypro's sit, still disassembled, just a few feet from where I write this, mocking and taunting me.

The Model 4P: A Great CP/M Machine or the Greatest CP/M Machine?

I had read somewhere that the TRS-80 Model 4/4P was an excellent CP/M machine, and I found a nice sale on eBay.  It wasn't the cheapest unit, but the person had cleaned the inside and outside of it, guaranteed that the unit worked, and also included a FreHD unit (a hard drive simulator for the TRS-80 computers using an SD drive, for those who don't know) with the ROM upgraded to take full advantage of it.  As I said, it wasn't the cheapest deal, but just having someone who seemed knowledgeable attest that it is completely functional is worth some extra cash, to those who have experience buying retro computers on eBay.  It even had the latest LSDOS and CP/M as bootable hard disk images on the SD card.  And, sure enough, when I got it it booted up very nicely into both OS's.  The only problem was that while the LSDOS image had a lot of software, the CP/M included the base OS and that was it.  

Well, that's no big deal, thought I.  I can find tons of CP/M software on the net, and I'll just load that up.  Of course, the 4P only has 5.25" drives, and none of my modern machines has a 5.25" drive, so "sneaker net" is out.  Of course, I thought about transferring it through a serial connection, but I couldn't get that to work.  And I couldn't figure out how to transfer anything to the hard drive images on the SD card.  FreHD is a cool device, but the documentation leaves much to be desired.

That's pretty much where I left it, when I began my unplanned, months-long absence from retrocomputing.

In my next post (hopefully within a day or two), I'll follow up with what I'm up to now and what I plan to do.

Thursday, February 4, 2016

My newest acquisition and newest project

Early last month I ordered a 6502 single board computer off of eBay, and it finally got here yesterday.  It was designed and built by Wichit Sirichote, who lives in Thailand, which is why it took so long to get here.  I've been playing with it a little bit and so far it looks like it works exactly as advertised, and I'm hoping to really dive pretty deep into this machine.

If you check out the guy's web page, at the bottom he links to two PDF documents that go along with this system.  The user manual explains how to operate the machine and presents some technical information, while the second document gives 10 sample programs to help learn about the machine.  I spent last night manually typing in the hex form of the programs, which was fun, but by program 9 they were getting big enough that this was getting annoying.  The keyboard is just a bunch of soft buttons with a sheet of some kind of sticker paper on top, so it's really about as good as a membrane keyboard.  So it's good enough for playing around, but it really isn't good for any real programming.

So today I actually figured out how to upload a program.  This wasn't difficult; the user manual explained the process well enough.  But the computer expects the uploaded file to be in Intel or MOS hex file format.  I wasn't familiar with either of these, but a quick Google search turned up what I needed to know.  Both are a text file format to encode binary data in hexadecimal form.  They're very similar formats, differing only slightly.

Here's an example of the Intel hex file format of a simple program from the book that I ran through the assembler:


The format is actually pretty simple once you break it down.  If you're curious I recommend checking out the Intel HEX Wikipedia entry.  The above, however, is just 14 bytes that are loaded into memory at address $0200 (hexadecimal value, or 512 in base-10); the second line is the end-of-file record.  As I said, the MOS hex file format is very similar.  The only difference is that it starts with a ';' instead of a ':', and the record type (the fourth byte, with each two characters comprising one byte) isn't there.  Also the end-of-file line has a slightly different format.

Now the webpage for this kit includes a download with the TASM assembler, which is an older shareware assembler that, as near as I can tell, isn't available for sale anymore.  But the problem is, I think it's a 16-bit DOS app.  When I run it under Windows 7, it says it's incompatible.  I did run it under DOS in VMWare and got a simple little program to compile, but obviously this isn't a long-term solution.  By the way, the irony that a DOS-based assembler is not usable for a guy who's into retro computers (including DOS-based machines) is not lost on me.  All I can say is that I would be happy to do the development in DOS except for two things: I don't have a serial port to upload the program available in my DOS environment (VirtualBox under Mac); and it would just be clunky to have to transfer my program from DOS to an environment where I could upload the program.

With TASM eliminated, I'd really like to use a modern assembler, something that is cross-platform and still supported.  I looked and didn't find any 6502 cross-assemblers that would directly output Intel hex file, so I decided I'll just have to convert my assembled program into Intel hex as a second step in my build, which means I can use any assembler.  So which one?  I've used the assembler with cc65 before, but I wasn't thrilled with it.  cc65 is great for C programming, but less great for assembler, though it's a completely functional assembler.  I looked at several, and decided to try KickAssembler.

Now as a 6502 assembler, KickAssembler seems very C64 oriented, especially since it only generates either a simple binary file or a C64 compatible PRG file.  But for my purposes the PRG should actually do nicely.  It's about as simple a format as one could imagine.  The first two bytes indicates the starting address; the rest is just the raw binary.  I searched for a utility to convert a binary to Intel hex, but didn't find one I liked, so I decided to write one myself.  So the PRG really does work very well, since it contains all the information I need and nothing more.

So what are my plans with this little board?  Here's a rough projection of what I'd like to do (though given my record of being distracted, it's not likely I'll actually finish all this):

  1. Write bin2ihex
  2. Build an emulator using C and Qt (emulators are so much easier for testing/debugging)
  3. Write a new monitor that uses the serial port
That's obviously a good bit of work, especially the new monitor.  I would like to do an interpreted environment like BASIC, but not BASIC as I'm not really a fan of that language.  Maybe Forth or else some other simple language.  

I'll keep posting as I progress.

Saturday, January 30, 2016

Eulogy for a retrochallenge

If you've been following my retrochallenge at all, then you have come to one of two conclusions: Either I'm making progress but not blogging about it, or I'm just no making progress.  Unfortunately it was the latter, not the former.  My last blog earlier this month discussed all the progress I had made: I developed my tool chain and created a Makefile that automated the build process and would be flexible as the project grew.  But this turned out to be pointless since my project never grew.

Why didn't the project go anywhere?  Well, there are a lot of reasons.  I was unexpectedly busy at work, so I didn't have quite as much free time as I normally would.  But more significantly, being so busy at work just left me less motivated to program on my own, since programming is what I do professionally.

Another reason is that, although I had a full LMweek off from work and the family was gone, this turned out to offer me less free time than I had anticipated.  My hobby stuff, including all my retro stuff, was crammed into my "man cave" upstairs in the house, but some rearrangements meant that I could take over the office down below, so I spent part of my free week moving my stuff into my new digs.  This is a big improvement for me, because it allows me to setup two or three retro systems at one time, whereas before I was really limited to only one or maybe two if the second one didn't take up much space.  And I still have my "man cave" which will now become my ham shack (as in ham radio, not pork).

Which leads me into my third reason: Distractions!  Early in the month I purchased a 6502 SBC, so I got distracted by that.  Then @Retrochallenge started tweeting about his ham radio activities, and that inspired me to get back into that hobby.  And even just recently, I purchased a Kaypro 2000.  Although this hasn't arrived yet, I started looking into this system as well.  So basically I lost focus early on and just never really got back to my project.

This is my second retrochallenge, and so far I'm 0 for 2 in terms of completing my project.  But even though I didn't complete last year's either, I felt a lot better about that.  My project involved a lot of reading and learning of the PDP-8 and OS/8, which turned out to take a lot more time than I had expected.  So even though I didn't finish, I learned a lot and felt like I had accomplished a lot.  This time, though, was almost a complete bust.  I did relearn a bit of the xBase platform, and the project skeleton I made for kBase will be usable for future cc65 projects, whether they be for the Apple II or for other 6502 platforms.  I also got a copy of Tom Raidna's TUI library, which I think will be useful for future projects.  So I do feel like I at least gave myself a bit of a step up for future projects, but I definitely didn't really accomplish much.  So I feel pretty unsatisfied with my work this month.

So is this the end for kBase?  Honestly I don't know.  I still like the idea of the project, but I just don't have the motivation to work on it right now.  There are just too many other things I'm playing with at the moment.  And this is a hobby, not work.  But I can't predict what ideas will grab me in the future, and I enjoy working on interpreters, so there's every possibility that I'll come back to this project.  Maybe just in time for Retrochallenge 16/07!