BMOW title
Floppy Emu banner

Apple Lisa Floppy Emulation

m7

The Lisa computer was Apple’s precursor to the Macintosh, and it shared a lot of the same hardware and software. I’m going to look at adding Lisa support to my Floppy Emu disk emulator for Macintosh.

The Emu can already emulate a standard Sony 400K floppy drive, and the Lisa 2 aka Macintosh XL can use a standard Sony 400K floppy drive. (The relatively rare Lisa 1 used 5 1/4 inch Twiggy floppies.) So I *think* they should already be compatible at a low level, from an electrical and interface standpoint. That means the Lisa support could be added with just a firmware update, and no hardware changes necessary. My challenge is that I don’t actually own a Lisa! But with the assistance of a few kind Floppy Emu fans who are also Lisa owners, I’ve started getting closer.

The first obvious task is that the Emu firmware must be modified to support tag bytes. On both the Lisa and the Macintosh, a floppy sector’s data contains 12 bytes of tags, plus 512 bytes of normal data. On the Mac, the tags aren’t used for anything, and Floppy Emu just treats them as if they were always zero. Standard .dsk image files don’t even store the tag bytes, although Disk Copy 4.2 images do. But unlike the Mac, the Lisa needs those tag bytes in order for Lisa-formatted disk images to work correctly. So at a minimum, the firmware will need to fetch the tag bytes for each sector from the DC42 image file, instead of just pretending they’re zero.

 
Macintosh Emulation on the Lisa

But wait! Even without changing anything on the current Emu firmware, it should be possible to get it working on the Lisa under Macworks XL. Macworks is software for the Lisa 2 that basically turns the computer into an emulated Macintosh. After booting Macworks XL from a standard Lisa disk, you’ll then see the familiar Macintosh blinking question mark as it awaits a Mac boot disk. At that point, it should be possible to use a standard Floppy Emu and a Macintosh disk image to boot the Mac OS on the Lisa. Or boot into Mac OS with another disk, then use Floppy Emu to mount a second Macintosh disk. A helpful Lisa owner tried this exact experiment… and it didn’t work. The Lisa-as-Mac recognized that a disk was inserted, but complained that it wasn’t initialized, and offered to format it.

So why didn’t it work? I need to find the answer to that question before I even start worrying about tag bytes and other changes. My Lisa helper sent a few interesting screenshots, including the one above.

When booted using Macworks, the Mac OS on the Lisa includes a floppy control panel for something called the PFG, which I learned is the programmable frequency generator. Those control panel options look intriguing, but I’m not sure what they do. He tried normal and desperate modes with the same results.

From what little I could piece together, the PFG is an extra piece of hardware that not all Lisa 2’s have. If present, its purpose is to enable the Lisa to read floppies that were written in Macintosh II series computers that have three bit slip markers per sector. The bit slip marker is a special bit sequence on the floppy that helps the floppy controller get synchronized correctly. Apparently the Mac only needs 3 of them, although early Macs wrote 5 of them. The Lisa needs 5. With the Mac II series, the floppy logic was optimized to write only 3 bit slip markers, which made floppies written by those machines unreadable by the Lisa – hence the need for the PFG. I think.

The PFG shouldn’t be necessary when using a Floppy Emu, because the Emu sends at least 10 bit slip markers, and possibly as many as 55. So maybe there are too many, and that creates a problem? It shouldn’t be, given my knowledge of the Mac OS disk routines, if the Lisa is faithfully emulating a Mac.

 
Troubleshooting

To troubleshoot this, I need to find a way to get low-level floppy error data instead of just useless “this disk is not initialized” messages. Deep in the floppy routines, it knows if the read operation failed because it couldn’t adjust the drive speed properly, or couldn’t step to the desired track, or couldn’t find the sector on the track, or the sector checksum was wrong, or any of about 10 other possible failure reasons. There are a couple of ways I could do that:

1. I’ve already written a simple floppy testing program for the Mac. If I can get a Lisa with a hard drive and Macworks, I can copy the program onto the HD and run it from there. The trouble is, the generous soul who lives nearby and offered to lend me his Lisa doesn’t have an HD for it.

2. There’s a program called BLU (Basic Lisa Utility) that can be loaded from a floppy disk, and then used to run a variety of low-level tests, including floppy tests. The manual in appendix D shows the error info that’s provided, and it’s quite detailed. Unfortunately it’s sent to the serial port and not the screen, so I’d have to rig up a serial connection to another machine in order to see the output.

Without a hard disk, option 2 is really my only choice. But there’s another problem: I need a real floppy drive to load BLU from disk. But I need a Floppy Emu in order to test it. And the Lisa 2 only has a single floppy port. Hot swapping the drives is not an option. So I think what I’ll have to do is build a custom cable similar to my previous daisy chain adapter. This cable/adapter will allow the connection of two floppies drives to the same port, with both of them powered at the same time, and an external switch to control which one is enabled.

Other questions I’m unsure about:

  • Does the Lisa have an IWM controller chip, like the Mac? I think it does. But possibly it’s clocked at a different speed.
  • Is my understanding of the purpose of the PFG correct? Do all Lisas have one, or only some of them?

Assuming I can ever get this sorted under Macworks, then there are many other questions I’ll need to answer about tag bytes, the Lisa filesystem, and probably the DART disk image format. But getting Mac disks to work on the Lisa under Macworks is the first step.

Read 7 comments and join the conversation 

7 Comments so far

  1. RedskullDC - February 21st, 2015 4:17 pm

    Hi Steve,
    >Does the Lisa have an IWM controller chip, like the Mac? I think it does. But possibly it’s clocked at a different speed.

    Yes it does.
    Check out sheet#4 at:
    http://www.freeinfosociety.com/electronics/schemview.php?id=1416

    Clocked at 8MHz, so perhaps it is really a SWIM, not an IWM?

    Cheers,
    Leslie

  2. Michael Engel - February 21st, 2015 7:38 pm

    The Lisa 2/10 uses an IWM – however, it uses a dedicated 6504 CPU (pin-reduced version of the 6502) to control the floppy and talk to the 68000. The source code for the 6504 floppy controller firmware is available at http://bitsavers.informatik.uni-stuttgart.de/pdf/apple/lisa/firmware/IO_ROM_88_Listing_Dec83.pdf
    – 44 pages of 650x assembly, but it might help to figure out some of the differences.

    The older Lisas (2/5 and the Twiggy-drive Lisa 1) seem to use a floppy controller built from discrete components, similar to the original Woz design for the Apple II.

  3. Steve Chamberlin - February 21st, 2015 9:01 pm

    Huh, that’s interesting. The discrete circuit must be similar enough in functionality to the IWM chip that it can still control the same 400k Sony drive. So hopefully from the point of view of Floppy Emu, it shouldn’t matter whether a Lisa has the IWM or the discrete circuit.

  4. Michael Engel - February 21st, 2015 9:11 pm

    There seem to be a number of differences between the Lisa 2/5 and the 2/10 – see the Lisa FAQ, section 3.8.3 “Will a Lisa 2/10 I/O board work in a Lisa 2/5?”: http://lisafaq.sunder.net/single.html

  5. John Honniball - February 23rd, 2015 5:32 am

    I have a Lisa with a 3.5-inch floppy disk and an internal hard disk. The snag is, the hard disk does not work! I have a set of boot/install floppy disks that I made (some years ago) using DART and another Mac. But the installation process failed and just told me that I didn’t have a hard disk. I think the drive is dud, but I’ve no real way of diagnosing it.

    Do you have any plans to make a Floppy Emu emulate a Lisa hard disk? I don’t think the HD interface is standard (no surprise there).

  6. Steve Chamberlin - February 23rd, 2015 6:40 am

    I finally had a chance to test a Lisa in person yesterday, and I repeated the test of using Floppy Emu to load a Macintosh disk image while running Macworks. It doesn’t work, and I’m not sure why, because I think it should! The error information I was able to gather wasn’t very helpful either. On a real Mac, there are lots of different low-level floppy error codes for problems like bad checksums, trouble finding the sector, trouble finding the address and data marks, stepping problems and so on. These were very helpful when I was originally developing Floppy Emu. But on the Lisa with Macworks, at least in my testing, floppy problems just led to an error value of 0 (success) but with bogus sector data returned. That doesn’t give me much to work with, but I’m going to keep trying.

    I don’t know anything about the Lisa HD, but Floppy Emu probably isn’t the right kind of hardware to emulate it. There’s already a Lisa HD emulator called the X/Profile, though I don’t know much about it other than that it exists.

  7. Steve Chamberlin - February 23rd, 2015 6:42 am

    @John Honniball, check out Basic Lisa Utility – http://sigmasevensystems.com/blumanual.html . You can load it from floppy, and it has some low-level functions for testing and formatting the Lisa hard disk. Maybe you can get yours working again.

Leave a reply. For customer support issues, please use the Customer Support link instead of writing comments.