Hacker News new | past | comments | ask | show | jobs | submit login
Greaseweazle (retrocmp.de)
114 points by mikerg87 7 months ago | hide | past | favorite | 36 comments



A local shop wanted my help - a customer had old documents on a Mac floppy. It had been years and years since I had my sights on a Mac with a floppy drive.

I figured I could help anyway. First, I checked that the floppies weren't in DOS/Windows format. A long shot, but for a short while it was not unheard of to use DOS floppies as the lingua franca between Macs and PCs.

Nah, that wasn't it. It was a real Mac floppy. No PC could read it.

A Greaseweazle to the rescue! Created a floppy image. But how to read it? Turns out there's a Mac emulator on the web you can just drop a floppy image into, complete with MS Word 5 for Mac to read the document, export it to RTF and Bob's your uncle!


This made me curious, why were pc floppy drive controllers unable to read mac formatted disks. my first thought was the variable sectors per cylinder, I mean sure the OS is not going to like it but what about the the actual capability of the controller. So I found a data sheet for a fairly modern fd controller(the NCT6776F all in one)

Now I am not super sure, however if I am reading the data sheet correctly it looks like you could, if you were insane enough to spend the time on a lowlevel custom driver, format each track with a different number of sectors.

my next thought was the variable speed, this might be it, the pc floppy controller has no command to change drive speed, but I was not convinced, it may not be as efficient, but I could think of no reason it could not read still read the tracks at a fixed speed.

But I think the real reason a pc controller could not read apple floppies was that the on disk magnetic layout was GCR and the pc controller only understands MFM and FM, which ties into and changed my mind about the drive speed. if not designed for it the controller would not be happy about different sized magnetic zones.

https://media.digikey.com/pdf/Data%20Sheets/Nuvoton%20PDFs/N...

https://en.wikipedia.org/wiki/List_of_floppy_disk_formats

As a fun tangent I learned there are commands in the controller for a tape drive . I have never seen(or even heard of) a tape drive on a floppy port, how common was it to have one?


For variable number of sectors per cylinder you either need control over bitrate or motor speed.


Not an expert, I just read the datasheet but the format command takes

  The number of data bytes written in a sector 
  Sectors per Cylinder
  Gap Length
  Data Pattern
Then while the command is executing it takes(or might give... I am not real clear on this part)

  Cylinder Number
  Head Number
  Record
  The number of data bytes written in a sector
 
So the hacker in me says why cant you say you want to format the disk then only format one cylinder. then do it again with another cylinder but this time with a different number of sectors.

Reading and writing such a franken disk is left as an exercise for the reader.

Honestly the whole exercise might be a fun weekend messing with assembly trying to see what contortions you could get the disk controller to do. It also sounds like a huge pain, I think I would want some sort of low level "stub" os, that does nothing bet gets the system initialized in a known state. then you could proceed to engage in severe sadomasochism, locking up your system in strange and mysterious ways.


This will just make gaps between sectors bigger, lowering capacity given standard bitrate and rotation speed.

The point of zone bit recording (ZBR) / zoned constant linear velocity (ZCLV) is to pack mode data on the outside (longer) cylinders. Doing some back of napkin calculations the most Outer track has circumference of ~27 cm while inner is ~18cm long. Outer track should be able to fit 1.5 x magnetic flips while staying in spec.

If you want even more data you go GCR all the way to RLL encoding. Fantastic dev blog documenting implementation of 3.5 Inch HD (2.7)RLL Floppy Controller for use in MEGA65 project: https://c65gs.blogspot.com/2022/01/more-work-on-hd-floppies-... Over 3MB out of standard 1.44MB drive/floppy by combining both zone recording and RLL.


> Turns out there's a Mac emulator on the web you can just drop a floppy image into...

For the record: I think you're talking about https://infinitemac.org/ - right?


I think so, but at a glance I can't find where I can upload files to infinitemac...


Drag and drop the file into the browser window. (Or hover over the Apple icon in the lower left and click "Load File".) If it's a disk image, it'll mount that; otherwise, it'll be copied to the VM as a file.


> Created a floppy image.

How?

Most PC floppy controllers were not "low level" enough to read those disks.

You even mention that in your comment.


The Greaseweazle device discussed in the article appears to be a specially-designed floppy controller that is low-level enough to read arbitrarily formatted disks.


IIRC Macs disks had different density for different sectors. The sectors on the outside had more data than sectors on the inside. I'm surprised a PC disk drive can read those, I'd have expected that to be impossible. I certainly have never heard of anyone doing that while PCs and Macs with floppy disks were around.

EDIT: ok. it seems like this specific device is flexible enough. cool.


Back in the day, Amiga could read Amiga floppies (of course), PC floppies and Mac floppies, using standard floppy drives.


Read and write.

Again, I think it was just the controller delegated some signal processing to the rest of the hardware.


Is this needed because motherboards no longer include any floppy drive channels?

I'm not yet grasping why Greaseweazle is better than a standard cheapy USB floppy drive.

Greaseweazle is undisputable an awesome name for a project, though.

Edit: Thanks for the clarifications :)


> "Is this needed because motherboards no longer include any floppy drive channels?"

Not really. As you point out, the lack of floppy controller on modern PC motherboards can be solved with a regular USB floppy drive. The Greaseweazle is an incredibly versatile floppy controller which is able to do raw/low-level reads of practically any known disk format out there, making it a great tool for rescue/archiving and as a one-size-fits-all option.

I bought one myself in order to "dump" and preserve about a thousand Amiga disks of my own, many of which contain stuff I created in the 1990s.


> Is this needed because motherboards no longer include any floppy drive channels?

Yes, partially.

> I'm not yet grasping why Greaseweazle is better than a standard cheapy USB floppy drive.

1.) Support for non-standard formats.

2.) Ability to capture raw flux images, bypassing the limitations of actual floppy controllers, and allowing for weird formats to be preserved and written (ex. of flux images bypassing rare hardware restrictions: https://www.youtube.com/watch?v=vCU4xbHFb58&t=1538s)

3.) Can allow for drives with weird quirks.


> ...Ability to capture raw flux image...

It's sort of "raw flux" but it's still in the digital domain. The drive's pre-amp, gain control, and ADC are still in the loop. Tapping the direct output of the heads would really be raw flux (and would allow creating a completely software-defined "floppy drive").


This isn't a standard floppy drive controller; it's a low-level device that allows you access the disk at the raw, magnetic domain kind of level. This means it can read or write all kinds of formats that are typically not accessible on standard floppy controllers like "variable speed" systems used on old 400/800KB Mac disks.


A typical use case for it is to dump Amiga disks, which are physically 3.5" disks but whose 880KB format is unreadable by a standard PC floppy controller.


And to preserve old copy-protected floppy disks which used strange formats and/or deliberate errors to thwart copying tools.


Even some PC floppies can't be read by the cheap USB-floppy drives on Amazon. They typically expect exactly 1.44 megabyte floppies. Format it slightly differently, and those USB drives can't see it, even if the floppy would have worked just fine in any "real" floppy drive connected to the floppy interface on the motherboard.


USB floppy controllers are very different from "real" floppy controllers. USB controllers are doing the floppy formats in firmware, so the PC it connects to can only use it for formats the USB controller knows about, which is typically just your standard PC formats (one or two). Traditional controllers are way more flexible and is only limited to what kind of flux modulation they can handle (an Adaptec AHA-1522A can handle FM, for example, while the later ones can't). Then it's up to your software what you can read. I use an old PC (old enough to have a floppy drive and a good controller, but new enough to have ethernet) to read non-PC floppy disks of many different formats. But certain stuff it can't do, and that's typically Apple and Commodore. For that you need a direct flux reader like the Greaseweazle or Kryoflux or one of the others.


I have an greaseweasel and 3.5" floppy mounted internally in a system used for utility tasks.

It's pretty handy to have it all ready to go for unusual floppies.


If it's a modern case, how do you deal with dust?


Case is from a ~2008 era Acer Aspire M5640 with newer guts, which happens to have a door slide mechanism that covers the two external 3.5" bays with semi-transparent plastic, and an array of top-mounted USB 2.0 ports.

It's probably one of the nicer tool-free OEM mATX cases out there - no nonstandard parts, edges aren't sharp, and generally easy to route cables in.


Not sure what you are thinking of, but if the case have big enough mesh/holes on the side of the case, there won't be much air suction through the floppy port.


> standard cheapy USB floppy drive.

The cheap ones with brands that seem to consist of random syllables are laptop drives harvested from e-junk and placed into a USB housing.


Also have a look at drawbridge which even supports live loading Amiga disks in an emulator. https://amiga.robsmithdev.co.uk/


See also, FluxEngine: http://cowlark.com/fluxengine/index.html

The hardware is just an off-the-shelf fpga dev board with the 34-pin connector soldered directly to it. That's it. No other components or pcb or anything.

https://photos.app.goo.gl/aDKggy7UAHsyLj717

You extract pin #5 from the connector and solder the entire odd row to gnd (one wire and there is a gnd pad right at the end of the connector) and snap off the programmer board. Done.


I was a bit surprised about the use of a FPGA directly connected to a 5V bus, but Infinion/Cypress describes their CY8C58LP as 'programmable system on a chip' (ARM M3 core, the usual set of interface subsystems and a few 'universal digital blocks' (like a mini FPGA). And yes, it is 5V tolerant. Looks interesting.

https://www.infineon.com/dgdl/Infineon-PSoC_5LP_CY8C58LP_Fam...


Nice, also the PSoC5LP CY8CKIT-059 is cheap and can be had for ~20 €.


Okay, but which floppy drive I need to connect to it?

Can I connect a PC floppy drive, and read Amiga disks with it?


>Can I connect a PC floppy drive, and read Amiga disks with it?

Yes.


Thanks. I've bought one :)


Enjoy.

Note that, via an (open source, third party) plugin for WinUAE, it is now possible to use the GreaseWeazle Amiga floppies directly in the emulator too.


100 points for brilliant product name.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: