Is there anyone out there who has used a Catweasel with Linux who wants to give me a hand getting it working? The module is loading, and dmesg shows it, but when I try to access /dev/cw0amigadd, I get "no such device" and the light doesn't ever come on.

Update, 21 June 2004: I got cwfloppy working: turns out that it doesn't work in dual-CPU machines, so I had to put the Catweasel in a single-cpu PC first.

Tags: , , , ,

27 Responses:

  1. brad says:

    Total shots in the dark...

    Sure your device node is correct?

    What's /proc/devices say?

    • Also, what's lspci(8) say?

      • jwz says:
        00:00.0 Host bridge: Advanced Micro Devices [AMD] AMD-760 MP [IGD4-2P] System Controller (rev 11)
        00:01.0 PCI bridge: Advanced Micro Devices [AMD] AMD-760 MP [IGD4-2P] AGP Bridge
        00:07.0 ISA bridge: Advanced Micro Devices [AMD] AMD-766 [ViperPlus] ISA (rev 02)
        00:07.1 IDE interface: Advanced Micro Devices [AMD] AMD-766 [ViperPlus] IDE (rev 01)
        00:07.3 Bridge: Advanced Micro Devices [AMD] AMD-766 [ViperPlus] ACPI (rev 01)
        00:07.4 USB Controller: Advanced Micro Devices [AMD] AMD-766 [ViperPlus] USB (rev 07)
        00:08.0 Communication controller: Tiger Jet Network Inc. Intel 537
        00:09.0 USB Controller: VIA Technologies, Inc. USB (rev 61)
        00:09.1 USB Controller: VIA Technologies, Inc. USB (rev 61)
        00:09.2 USB Controller: VIA Technologies, Inc. USB 2.0 (rev 62)
        00:09.3 FireWire (IEEE 1394): VIA Technologies, Inc. IEEE 1394 Host Controller (rev 46)
        00:0a.0 SCSI storage controller: Adaptec AIC-7892A U160/m (rev 02)
        00:0c.0 Multimedia audio controller: C-Media Electronics Inc CM8738 (rev 10)
        00:0d.0 Ethernet controller: 3Com Corporation 3c905C-TX/TX-M [Tornado] (rev 78)
        01:05.0 VGA compatible controller: Matrox Graphics, Inc. MGA G400 AGP (rev 85)
    • jwz says:

      I made the devices per the driver's makefile:

        mknod /dev/cw0msdosdd b 120 1
        mknod /dev/cw0msdoshd b 120 2
        mknod /dev/cw0amigadd b 120 3
        mknod /dev/cw0amigahd b 120 4

      /proc/devices lists it:

        120 cwfloppy

      dmesg sees it:

        cwfloppy: cw0 is PCI Catweasel
        cwfloppy: cw1 is ISA Catweasel at 0x0320

      The drive I'm using is a Matsushita JU-363-03, SN 85NA 040395, from 1985 or so. I know it works (just tried it in an A1000.)

      I guess I'm not totally sure it's powered up properly... I just plugged in the PC's 4-pin floppy power connector, since A) it fit and B) the drive says that it's 5v/12v, which "real" PC floppy drives are as well, right?

      I can't find an IRC channel where the Amiga-emulator folks hang out (they list one on the UAE web page, but it's gone.)

      • jerronimo says:

        That's an original A1000 drive too. :D

        When you get it working (I've never used a CatWeasel, so I can't help) enjoy some of that fine gronking and drive click for me. :)

  2. mapzter says:

    Does /dev/cw0amigadd exist?
    If it doesn't mknod /dev/cw0amigadd b 120 3 should create it with the right major & minor.

  3. jwz says:

    I tried this and got the "no such device" error. Then I tried this and get:

      % ./cw2dmk foo.dmk
      Detected Catweasel MK3 at port 0x1000
      Looking for drive 0...not detected
      Looking for drive 1...not detected
      cw2dmk: Failed to detect any drives

    So it's sounding like the card doesn't like the drive? Maybe the power is wrong? Maybe it just hates this drive? I only have the two drives, and they're the same model.

    • kjaer says:

      The Catweasel expects a standard PC-style floppy disk drive, which is not the same sort of beast as a standard Amiga floppy disk drive.

      For starters, on an Amiga, the disk change and ready lines (pins 2 and 34) are swapped with respect to those on the PC. The Amiga also likes drives to respond to drive select 0 (DS0) where PC drives are nearly always wired from the factory as DS1 (the twist IBM put in the cable, all the way back in 1981, takes care of the necessary "magic").

      The best thing to do is probably take $5 to your friendly neighborhood Fry's and pick up a new floppy disk drive.


      • jwz says:


        I thought the who point of the Catweasel was that PC floppy drives can't read Amiga floppies, so this controller is necessary to hook an Amiga drive up to a PC.

        Now you're saying that to read an Amiga floppy in a PC, I have to hook a PC drive up to a PC via a Catweasel? How does that make any sense?

        • kjaer says:

          Actually, it's the controller that can't read the floppies---or, more significantly, can't be reprogrammed to read the floppies. I could go into excruciating detail, but it's not the kind of thing that makes me friends at parties, so I'll refrain unless you are really interested.

          Suffice to say, if the software is there to program the Catweasel (which it sounds like there is, for your purposes) to read an Amiga floppy. It uses a PC drive to accomplish this.

          You may notice that the Catweasel is not capable of reading 400k or 800k Macintosh floppies... in this case it's not just the controller; there are significant differences between the drives as well.

          • simmonmt says:

            I could go into excruciating detail

            Yes, please.

          • jwz says:


            So I plugged it into the floppy drive in my PC and got:

              % ./cw2dmk /tmp/foo.dmk
              Detected Catweasel MK3 at port 0x1000
              Looking for drive 0...detected
              Detected 5.25" SD/DD disk in 360KB/720KB drive, or 3.5" SD/DD disk
              Detected 2 sides formatted
              Trying 2 sides, 86 tracks/side, single stepping, autodetect encoding
              Track 0, side 0: [retry 1] [retry 2] [retry 3] [retry 4] 0 good sectors, 6 errors
              Track 0, side 1: [apparently single-sided; restarting]
              Trying 1 side, 86 tracks/side, single stepping, autodetect encoding
              Track 0, side 0: [retry 1] [retry 2] [retry 3] [retry 4] 0 good sectors, 6 errors

            ...and so on.

            My floppy drive is, of course, a Mitsumi, which the doc says "might not work." Yay.

          • yakko says:

            According to this page, the catweasel can read Apple GCR 800k floppies, as well as MFM floppies.

            It can also read 5.25" floppies. I wonder if it does 13-sector format.

            This may just be my next toy if I can get my hands on one.

          • jwz says:

            So I went and picked up a Teac drive (which according to this is the one to get -- I got a FD235HF -- and it does the same thing:

              Detected Catweasel MK3 at port 0x1000
              Looking for drive 0...detected
              Detected 5.25" SD/DD disk in 360KB/720KB drive, or 3.5" SD/DD disk
              Detected 2 sides formatted
              Trying 2 sides, 86 tracks/side, single stepping, autodetect encoding
              Track 0, side 0: [retry 1] [retry 2] [retry 3] [retry 4] 0 good sectors, 6 errors
              Track 0, side 1: [apparently single-sided; restarting]
              Trying 1 side, 86 tracks/side, single stepping, autodetect encoding
              Track 34, side 0: [retry 1] [retry 2] [retry 3] [retry 4] 0 good sectors, 11 errors
              Track 35, side 0: [apparently only 35 tracks; done]

              13 good tracks, 0 good sectors
              22 bad tracks, 295 unrecovered errors, 94 retries
            • Computers still hate Jamie. Possibly as much as he hates them, now.

            • scosol says:

              you should switch to gentoo :P

              hahah no seriously- that looks like a bad disk, or cw2dmk is detecting the wrong kind of dick

     has a lot of verbosity and manual-specification options

              • jwz says:

                No, it's not bad disks. Or dicks. It does this on every disk, including the ones that I booted the A1000 off of just yesterday.

                • scosol says:

                  well what does super-verbosity say? my guess is that its thinking the disk is a format that its not-

                  and whew! thank god its not bad dicks, a catweasel with a bad dick is something you want no part of!

                  • jwz says:

                    It says all kinds of crap that still tells me nothing, like [FM] and [unexpected DAM] and [bad data CRC]. That seems to say "this disk is dead" but I know for a fact that this is not the case.

                    And actually, I don't know for certain that this .dmk file that it wrote is not a good disk image (despite saying at the end, "9 good tracks, 0 good sectors") because I don't see evidence that UAE can read .dmk files: it seems likely that it only wants .adf files, and I don't see any conversion filter between the two.

                    (Because, you know, the world needs two different, incompatible file formats for representing the contents of a twenty year old floppy disk.)

                    However, I'm gonna go ahead and guess that all those errors meant something very basic is still going wrong here.

                  • kjaer says:

                    I missed the fact that you're trying to use Tim Mann's Catweasel tools.

                    The thing that I think you're missing is that the Catweasel is nothing more than a highly flexible floppy disk drive controller---it has a hardware design that makes very few assumptions about the organization of flux transitions on a piece of magnetic media, nor assigns any specific definitions to sequences of those transitions. This means that the Catweasel relies on software to do many things which are handled by hardware in a traditional floppy disk drive controller.

                    Tim Mann's tools program the Catweasel in such a way that it can cope with disks written by Western Digital WD177x/179x, DEC RX02, or NEC765 and their workalikes. The Amiga disk controller is very different from any of these.

                    Earlier I made a statement that the Catweasel was incapable of handling the old 400k/800k Macintosh disks. I assumed that the constant-angular-velocity setup of the IWM and Sony drives in the old Macintoshes would make things very difficult for anybody writing software to drive the Catweasel to read these disks. The assumption was correct but I drew a false conclusion from it---frankly it's highly impressive that anybody was able to write that software, and speaks volumes for the flexibility of the Catweasel (and the software engineering talent floating around on the 'net)

                    (Incidentally, one of the perennial problems with the Catweasel is that the folks selling it largely failed to differentiate between what the card was capable of doing in theory, and what could be accomplished by the software which actually existed at that time. I am currently unprepared to give a comprehensive analysis of which capabilities have been realized in software.)

                    There are many opportunities for vendors to introduce incompatibilities in floppy disk formats. At its barest essential, it's all data recorded by manipulating sequences of magnetic flux transitions at the surface of a magnetic medium. Leaving out incompatibilities resulting from differing physical characteristics (media diameter, magnetic coercivity, etc.) and filesystems, there are still many things which will render media recorded on differing systems mutually unintelligible.

                    One of the differences might be in the scheme used to encode the digital data into an analog signal. Traditionally, a controller will implement one of three popular encoding schemes: frequency modulation (FM), modified frequency modulation (MFM) or group code recording (GCR). Another difference is in the layout of the tracks and sectors which define storage allocation on a floppy disk. Almost all 8" disks are written at 48 tracks per inch (TPI). 5.25" disks are usually 48 or 96 TPI, although some drives had heads capable of 100 TPI.

                    Early controllers required "hard-sectored" media, on which the sectors were defined by holes punched in the medium at regular intervals. These holes would pass underneath a sensor in the drive, which could be read by the controller, and used to determine when to start or stop reading or writing to a specific sector. A 10 sector disk was physically different from a 13 sector disk.

                    As controllers grew more sophisticated, some of this functionality moved into software, and "soft-sectored" media began to take over. This allowed controllers to implement differing sector arrangements without requiring different media.

                    The original Apple Disk ][ controller was a GCR-encoded, 35 track, 13 (soft) sector arrangment, with 256 bytes per sector and 113 KB per disk. By changing the GCR encoding slightly, it became possible to squeeze 16 sectors into a track, resulting in a disk capacity of 140 KB. The only change was to the ROM program on the Disk ][ controller card, and the part of Apple DOS that interfaced with it; both systems used the same 48 TPI disk drives and same soft sectored media, but a 13 sector disk was not intelligible to a 16 sector system, and vice versa.

                    (--end part one--)

                  • kjaer says:

                    (--begin part two--)

                    The IBM PC used the NEC765 (current PCs use a workalike, which has some of the modes offered by the NEC part which are unused by the PC architecture removed for cost savings). It is a programmable floppy controller, which supports MFM encoding, and multiple sector / track arrangements. The standard PC modes include 40 tracks of either 8 sectors (160/340 KB) or 9 sectors (180 / 360 KB), 80 tracks of 15 sectors (1200 KB), 80 tracks of 9 sectors (720 KB) or 80 tracks of 18 sectors (1440 KB). The NEC765 also uses the old "IBM" sector headers, like the WD 177x and 179x. As an aside, the NEC765 performs a reset after each index pulse (from the index hole present on all soft sector diskettes), and therefore cannot handle any data that starts too soon after the index pulse. Because the WD chips do not perform that reset, it is capable of starting its first sector sooner than the NEC, and thus possible to for a controller based on the WD chip to write a disk with a data format which is 100% compatible with the NEC controller, but is still not readble by it.

                    Now, the floppy controller in the Amiga is, like everything else in the machine, highly customized. It uses otherwise-unused capacity in several of the custom chipset (Paula and Gary), along with a MOS 8520 CIA (Complex Interface Adapter). The 8520 is a descendant of the 6526, which was used in the C=64, C=128, and 1571. This setup is highly flexible and, like the Disk ][, relies on software to define most of its operational parameters.

                    Working in your favor, Commodore programmed this disk controller to use MFM encoding. Working against you are 80 tracks of 11 sectors, and more to the point, the Amiga uses neither the traditional sector gaps nor IBM 3740-style sector headers a NEC or WD setup would expect. Furthermore, a track on an Amiga disk may start at any rotational position, whereas the NEC or WD controllers expect the first sector of a track to start at a specific location following the index pulse.

                    Tim Mann's utilities expect characteristic structures on the disk which will not be present on an Amiga disk.

                    You need different software for the Catweasel, before you will be able use it to read Amiga disks.

                    There are different disk image formats because they will be used by different emulators, which expect different disk controller behavior, different disk structures, and different weirdness which will be exploited differently by different copy protection schemes. All of that has to be emulated somehow.

                    Hope this helps.


                  • jwz says:

                    Thank you for all that! At least now I understand it better... even if I don't yet know what to do about it. I guess I'm back to trying to figure out how to make cwfloppy work.

                  • kjaer says:

                    It would be instructive to know what you have, and what you intend to accomplish.

                    It is possible, even, that the Amiga floppy could be mounted directly as a normal filesystem, using the FFS kernel module and the appropriate Catweasel device node. This is pure speculation on my part, as I personally have never worked with a Catweasel. It seems like an interesting toy, however, so I have placed an order for one.

                  • jwz says:

                    What I have:

                    • Hundreds of Amiga floppies.
                    • A barely-functional A1000.
                    • A Linux PC with a Catweasel card and a brand new Teac floppy drive.

                    What I want:

                    • To be able to load the contents of those floppies into an Amiga emulator running on Linux (e.g., UAE, which wants ".ADF" files.)
                    • A pony.

                    In the past, I have tried to copy those floppy images off the A1000 via Kermit and the serial port, but that didn't work out so well. I did manage to successfully transfer some text files and images, but for some reason, the ancient version of Kermit I have on the A1000 side won't transfer binary files properly (I think it's confused about the file size, or something: it doesn't seem to transfer the whole file, or trashes the last buffer, or something like that.)

                    I spent some time trying to get a more recent version of Kermit onto the Amiga end, but I can't seem to transfer executable files that will actually run. So, lacking any way to get new software on to the Amiga, I bought a Catweasel.

                  • dzm6 says:

                    What I want:

                    • ...
                    • A pony.