Saturday, December 25, 2021

Merry Old VCR Christmas

Signs you married well: your wife buys you vintage artifacts for Christmas, in this case a logic chip and fragment of a PCB from the Cray-1 at the Lawrence Livermore National Laboratory.
(The other chips in this picture are IBM dies from a 90MHz PowerPC 601+ and a POWER9.)

The chip is a Fairchild SL56660, a 5/4 NAND gate. The original design only employed four ICs but in huge quantities: this one, an alternative but slower NAND gate, 1Kx1 bipolar SRAMs (usually the Fairchild 10415FC, about 70,000 of them in the 1976 Los Alamos National Laboratory unit), and the specialized Fairchild SL82747. This chip bears a date code of 14th week 1981 and is based on emitter-coupled logic (ECL), making it very fast for the time but also very power-hungry; CMOS made ECL and MECL obsolete. The later date code can be attributed to the fact this was probably from a board installed for repair purposes.

Merry Christmas and a very happy holiday season.

Sunday, December 19, 2021

Monitoring the vintage server room (and reverse-engineering USB sensors)

We're house hunting because of $JOB and $HOUR hour commute, and I just got word that the reseller I contract with for Floodgap's leased line is getting out of that business in mid-January. This makes finding new digs (or at least setting up some sort of temporary static IP alternative) a must because one of the gotta-haves is space for my vintage server room. Sure, you can outsource, or host things on slices, or put things on a rack of Raspberry Pis and call it a day. And admittedly that would probably take up less space, generate less heat, use less power and result in less inconvenience, but where's the fun in that when you can be running your own 2008-vintage IBM POWER6 for mail, web and gopher, or a Sawtooth Power Mac G4 file server, or a 1989 Mac IIci that still happily handles internal network DNS?

Friday, November 26, 2021

xa 2.3.12

I've updated xa, André Fachat's venerable 6502 cross-assembler, to version 2.3.12. This contains a bug fix for a regression in 65816 mode which I'd meant to release earlier but got sidetracked on (thanks Samuel Falvo for the nice test case, which is also incorporated into the suite). As with prior versions it is tested on pretty much all of my Un*x-alike systems here including AIX, Mac OS X (PowerPC, Intel and Apple Silicon), NetBSD/mac68k and Linux/ppc64le. I said this before for 2.3.11 but one more time for the record: this will probably be the last in the exceptionally long-lived 2.3 series before 2.4, which as I keep warning you will definitely have some minor compatibility breaks and jettison a couple long-deprecated options and syntaxes (but will have some new features to make up for it). Again, more to come on that.

Sunday, October 3, 2021

Shiner ESB, an Apple Network Server prototype, and what it did at Netscape/MCom

The Apple Network Server was, with the possible exception of the Apple Workgroup Server 95, Apple's first true server. I have a particular soft spot for the ANS because it was also my first server: an ANS 500 ran Floodgap (even before Floodgap in 1998 as stockholm.ptloma.edu and gopher.ptloma.edu) from 2000 until 2012, and stockholm is still in my collection. While Apple had the Workgroup Server line, these were merely contemporary Mac designs with value-added software or hardware options, and as such ran Mac OS. (The AWS 95 ran A/UX, Apple's SVR2 Unix-System 7 hybrid, though it could also run Mac OS — being really a rebadged, hopped-up Quadra 950 — with its custom PDS SCSI card removed.)

The ANS, however, was a real honest to goodness server with hotswappable drive bays and fans, and (its most notable feature) an award-winning lockable translucent door so you could keep the unwashed masses out of your drives but still watch the blinkenlights. If you bought the bigger model, you even got dual power supplies and additional rear bays.

Also notable about the ANS was that they weren't supposed to run Mac OS, and were never sold with it, not least of which because the classic Mac OS wasn't really up to the task of being a server. Unfortunately, while A/UX supported larger needs on the 68K-based Workgroup Servers that could run it, A/UX 3 couldn't run on Power Macs even under emulation. The plan with A/UX 4 was to use a new PowerPC-native OSF/1-based kernel and possibly to also integrate portions of IBM's AIX operating system, but this plan (along with Taligent and other doomed projects) stalled out with everything else in Apple around that period. For a time Apple even considered using Novell NetWare on PowerPC; the port actually existed, codenamed Wormhole, but its tepid reception eventually led to the release of the weird Workgroup Server 9150 which just ran Mac OS. Eventually, to get to market Apple reached for what was then the only professional-level Un*x running on the new PowerPC architecture, which was AIX itself. Three Apple Network Server models were developed but only two (the "Low End" 500 and "High End" 700) were released; the 3U rack 300 "Deep Dish" remained solely a prototype, which I'd still love to acquire if its current owner ever gets tired of it. Oddly, even though they were only ever sold as AIX machines, they were initially demonstrated running Mac OS (possibly a custom version), further confusing potential customers who already didn't want to buy Workgroup Servers. Introduced in 1996 at a retail cost starting north of US$10,000, which didn't even include the AIX license, they were very poor sellers and the line was canned by Gil Amelio around a year later.

I got my ANS 500 barely used for the cost of some consulting work after Apple stopped supporting it; you can see some scanned Polaroids of when it was in production way back in 1998. Later, I acquired an ANS 700 which I use as a spare and was briefly in service while I diagnosed a hardware issue with the 500. More recently, however, I managed to land a Shiner HE prototype dated 1995 from a scrapper in San Rafael, California. That is the unit depicted in these pictures.

Tuesday, September 21, 2021

A happy ending (and future) for Plua

In my previous article on Plua, a port of Lua to classic PalmOS, I mentioned I was hopeful we'd have a happy ending where there was a clean-room implementation, or better still, that the original author would get in touch with me and we could redistribute it.

Well, I'm pleased to announce that Marcio himself did get in touch (he's got a lot of fun Palm and retro projects still underway, incidentally) and graciously consented to relicense Plua2c, the "cross-compiler" portion, under the same MIT license as Lua itself. You can now download the source code from Github, which I'll keep maintained.

As for Plua-the-Palm-app and its various components, I will still be hosting the .prcs on Plua Revisited indefinitely, and Marcio and I have been discussing how we can add some improvements such as expanded screen size support and the like. This means Plua has a future again, and I couldn't be happier. Thanks, Marcio!

Thursday, September 16, 2021

RIP Sir Clive Sinclair

In the US the name Sinclair is more associated with gas stations and partisan media outlets than computers. We had only the Timex Sinclair series States-side, of which the major models were the T/S 1000, a rebadged ZX-81, and the 2068, which was an upgraded but partially incompatible ZX Spectrum. (There was also the T/S 1500, a more upmarket version of the T/S 1000 roughly analogous to calling the Cimmaron by Cadillac a more upmarket Cavalier, and two minor non-American spinoffs of the T/S 2068, the TC2068 and UK2068.) These sold quite poorly in the United States because of the dominant position of the obviously superior Commodore 64 (I'm bracing for the comments from Martin), despite at least one retailer selling T/S 1000s at firesale prices so customers could get a rebate on a Commodore purchase. (Commodore reportedly used some of them for doorstops.) In the UK and Europe, however, they were a hit because they were cheap, and they introduced a generation to computers that may not have been able to afford them otherwise. My T/S 1000's keyboard has crapped out and I'm not even sure where my 2068 is, but on the announcement of Sir Clive Sinclair's death from cancer at 81, hats off, gentlemen, and godspeed.

Thursday, September 9, 2021

The Incredible KIMplement 0.2b: a KIM-1 emulator for the Commodore 64 (and the Superkim)

As I manage to eke out a little more time now for personal projects, since TenFourFox is coming to a close and the OpenPOWER JIT is developing at record pace, it's time to dust off some older items I've really neglected. This last week I started by updating the Incredible KIMplement, my MOS/Commodore KIM-1 emulator for the Commodore 64.

No, that's not a joke. The KIMplement runs real KIM-1 code using a software 6502 core I've christened "6o6" (6502-on-6502). 6o6 implements protected memory, exception handling and all legal NMOS instructions. In addition, the KIMplement not only emulates those famous six seven-segment LEDs and the hex keypad, but also is one of the few KIM-1 emulators that emulates a TTY connection (an old-school ASR-33) and a KIM-4 expander with 16K of RAM, allowing you to run "big programs" too.

The KIM-1 is one of the earliest single-board computers, at least in the sense we conceive of them today. It was introduced in 1976 as an enticement for engineers to play with the MOS Technology 6502 which was then the cheapest microprocessor on the market. MOS had just gotten its pants sued off by Motorola, who did not like the prospect of an inexpensive drop-in replacement for their 6800 CPU; the MOS 6501 was completely pin- and bus-compatible, and where the 6800 cost $179 the 6501 was priced at just $25. The "lawsuit compatible" 6502 was just as cheap, but because the pins had been rearranged, couldn't be substituted without additional design work. The KIM-1 provided a platform for engineers to become more accustomed with the 6502, featuring a 1MHz CPU, 1K of RAM, cardedge I/O, a keypad, LEDs and in-ROM support for teletypes, punch tape and cassette tape, for only $245.

MOS expected this would be a low-volume item mostly of interest to circuit designers. Instead, hobbyists bought them in large numbers because it was easily the least expensive microcomputer you could purchase at the time. With a KIM-1 at its center, you could have a full system with teletype, power supply and cassette storage for around $500. No other system came close to competing on cost. When Commodore Business Machines bought the ailing MOS in 1977, they wisely kept producing the KIM-1 until 1979 even after the introduction of the PET. Several clone systems exist, most notably including the Synertek VIM-1/SYM-1, as well as one unusual clone I'll talk about in a moment. I am the proud owner of four KIMs (including an original pre-Commodore KIM-1) and they all work.

I don't know if KIMplement's CPU core could be truly considered "virtualizing" the 6502, but it's more than just a naïve emulation. Rather than manually setting results and flags, the core looks at the guest instruction and runs the same instruction (or a safe variant) in the core context so that all the side effects, in particular changes to the status register, occur "for free." There is no way that a Commodore 64 at 1.0225MHz (or, worse, 0.978MHz for PAL) can do full-speed emulation of a KIM-1 running at 1MHz, but because there is much less code running per instruction, I think this scheme is probably near the fastest way a 6502 can run "untrusted" 6502 code. In practice it is about 35-50 times slower than native code, and this upsets programs that use tight timing or cycle counts, but it's still absolutely enough to actually "do things."

What sorts of things? Besides a couple LED-based games (originally Jim Butterfield's version of Lunar Lander, and I also added the misère game variant Black Match) and toy applications, you can run Tom Pittman's Tiny BASIC in the TTY, and with the bug fixes in 0.2b now you can successfully run FOCAL-65:

This screenshot in VICE shows the emulated 64 running a full FOCAL-65 program to manually compute square roots using Newton's method. It takes it a few seconds to do each iteration, but it all works. This is also a good demonstration of the FOCAL programming language itself including its unusual "floating point" line numbers (actually module and line), which it inherited from its more complex ancestor JOSS.

For this version of the emulator (0.2b), I finally finished some performance improvements to the CPU core that had been gestating in my mind for literally years -- the last version of the KIMplement was released in 2006! -- and also fixed a problem with the TTY emulation where typing characters could get out of sync under CPU load. It can still drop keystrokes if you overflow the Kernal keyboard buffer, but it's a lot smoother generally. I also worked around a bug in VICE where, if you try to load files from a directory on the host machine, the RENAME-the-file-to-itself test used to check for the file's presence doesn't work (a real 1541 would respond with error 63 FILE EXISTS but VICE says 0 OK).

The other bug I fixed was caused by the CPU core, but can't be fixed in it. The 6502 has a decimal flag which can be set in the status register and causes add and subtract instructions to operate in binary coded decimal (e.g., $90 - $01 normally is $8F, but in BCD mode it's $89). Famously, or perhaps infamously, the Commodore 64 Kernal IRQ doesn't turn off the decimal flag, and there is at least one SBC in the normal execution path. Because 6o6 executes instructions for their side effects, if a program had previously set the decimal flag (and this is not at all uncommon in KIM-1 code) it needs to be on for those math operations. The usual solution is to turn on the interrupt flag first with SEI to suppress IRQs while decimal mode is on, but the normal state of guest code is to have the interrupt flag clear because the KIM-1 doesn't have this problem. If an IRQ hits right that moment, the IRQ will be executed with the decimal flag on, and possible unexpected behaviour could result.

This is an extremely infrequent occurrence, but in a long-running system "infrequent" is a synonym for "inevitable." This can't be efficiently solved in the core because there is no atomic method for controlling two flags at once. A better solution is very simple: we just make a patched IRQ that clears the decimal flag explicitly, and calls the normal Kernal IRQ. I did the same for NMIs as a belt-and-suspenders approach.

The eventual goal is to open-source the KIMplement, and in particular 6o6, but I want to have another demonstration application for 6o6 as well before I do. A small multitasking general-purpose kernel sounds like an ideal way to show off how it works.

On my main KIM-1 site I also put in a few words about the microproducts Superkim. This 1979 variant of the KIM-1 was developed in Redondo Beach by Paul Lamar, who had been using KIM-1s for automotive performance testing but was unsatisfied with their expansion capacity. Unlike the hobbyist audience of the KIM-1, the Superkim is all business. The unit in my possession was clearly in a card cage; the hex keypad was never even fitted. It uses a custom board rather than a modified KIM-1 with sockets for RAM, ROM and up to four 6522 VIAs (this unit has 4K of static RAM and a Rockwell R6502P), and sports a full prototyping breadboard on-unit. But its most noticeable (and, I might add, intimidating) characteristic is the 200 gold wirewrap pins penetrating the board:
I have no idea what the sam heck this board was doing, but it clearly did something major in whatever its application was. Don't ask me to power this thing up because I'm worried I'll short something out somewhere. I don't know how many of these were ever sold and Commodore and MOS seem to have had nothing to do with its development.
Of the clones I find the Superkim the most interesting. While many people mention the Rockwell AIM-65 as a clone (my unit is above), and it is strongly based internally on the KIM-1, its substantial expansion (wide alphanumeric LED screen, full keyboard, printer) would not make it generally recognizeable as such. I think the Synertek VIM-1/SYM-1 are more characteristic, though that is one unit I don't personally possess.

In the future, and hopefully that future isn't in another 15 years, I want to add actual cassette support (right now you just dump memory to and from disk) and maybe support for one of the hi-res video boards like the Visable. It may also be worth trying to port the KIMplement to a faster 6502-based system like the Commodore Plus/4 or the Commodore 128 in 80-column mode, or maybe even the Apple IIgs, though all of these would need a solution for the sprites I currently use for the LEDs. (Okay, you Atari freaks, I know, I know.) The KIM-1 is a great little machine and surprisingly capable. The fact all of mine have survived over four decades proves they don't make them like they used to.

You can download a .d64 or .sdas of the Incredible KIMplement and its demo applications, or read more about the KIM-1.