26 comments

  • hakfoo a day ago ago

    PATA-SATA adapters, the $3 AliExpress kind, seem to handle CHS fine. I have dumps of 40Mb and 200Mb drives from such adapters.

  • eqvinox a day ago ago

    The Raspberry Pi Pico is good for a lot of things; this is not one of them (due to the lack of at least USB 2.0 High Speed). An LPC18xx, LPC43xx or even IMXRT106x would've been a much better choice.

    • alnwlsn a day ago ago

      You might only be able to get 8-16MB/s max out of some of those old drives (especially pre-1994), so you probably aren't missing much.

      edit: whoops, that's bytes not bits per second

      • eqvinox a day ago ago

        USB 1.1 Full Speed is 12 Mbit, i.e. 1.5 MB/s theoretical, zero overhead accounted for. That's an order of magnitude you're missing there. Whether it matters depends on how large the drive is, I guess.

        It also bears pointing out these microcontrollers have built-in parallel memory interface buses, which are likely compatible with IDE (which is just ISA == the 8088/8086 parallel bus on a cable.) With DMA, ketchup and fries…

    • a day ago ago
      [deleted]
    • rasz 21 hours ago ago

      or good oldshool USB 2.0 Cypress FX2LP CY7C68013A or its Chinese clone Corebai CBM9002A

      cy4611b___usb_2_0_usb_to_ata_reference_design https://www.farnell.com/datasheets/62992.pdf Back around 2005 a lot of USB HDD enclosures used this exact chip.

      All the above needs is LBA to CHS translation.

      • eqvinox 16 hours ago ago

        > or good oldshool USB 2.0 Cypress FX2LP CY7C68013A or its Chinese clone Corebai CBM9002A

        I intentionally did not suggest those because dealing with an 8051 isn't something I'd inflict even on my worst enemy, let alone an open source hobby project.

        That said if it's vibe coded I guess the AI can deal with it? shrug

        • rasz 14 hours ago ago

          Thats what I was thinking, tell AI to add translation to a codebase already tested in production. But even without AI doing all the work fx2lp ata bridge reference design is in C and very readable

          • eqvinox 11 hours ago ago

            I still don't think I'd want to support the continued existence of 8051 products ;)

            • rasz 11 hours ago ago

              Its a $4 part doing 40MB/s over USB 2.0, hard to beat even 20 years after it was introduced.

              • eqvinox 2 hours ago ago

                I'm not disputing that. It can be a performant USB implementation and using an awful core that should've died out 10 years ago at the same time. Like, you can fireproof your house with asbestos, it works great. Still wouldn't recommend it, for, uh, reasons ;)

  • burnt-resistor 2 days ago ago

    Aand it's vibe-coded. Nope. There are zillions of PATA USB adapters available on secondary markets that work.

    • RiverCrochet 2 days ago ago

      From article:

      "While cheap, modern adapters usually only work with newer "LBA" type drives, ATAboy works all the way back to the earliest CHS only, PIO Mode 0, ATA disks."

      So I guess this would work on some particularly ancient drives that a USB adapter wouldn't work with - not that I've ever encountered one. It is vibecoded, but sounds like it would work fine to get an image off of the drive, which won't be very large compared to even modest contemporary storage capacities.

      • gattilorenz a day ago ago

        I don’t know, I have a cheap Chinese USB adapter and it read a 40 Mb hard drive from a 286 laptop just fine, so… plus larger (hundreds of MBs) disks too.

        • fuzzfactor a day ago ago

          I've got an adapter that only goes up to 40GB because it's 20 yrs old.

          ATA (aka IDE or EIDE) was all they had before SATA so these adapters were all over the place.

          WTF is a Pi for?

          There's small little chips that do exactly this interface, still probably plenty available surplus for cheap since ATA is not popular any more.

          Any ATA HDD that works on a mainstream USB adapter will handle CHS for DOS usage just fine, or LBA. Pretty much automatically. This was already smoothed out before about 1994 or so.

          DOS of the '90's could handle LBA anyway, I like the MS-DOS from Win98SE which was not available separately by then but after W98 is installed to a FAT32 partition, the key DOS OS files in W98 will be available to copy to a fresh fat32 volume. You pretty much copy the same (newer) DOS files from W98 to your DOS root that it would have after installing DOS 6.22

          Here's a USB adapter now:

          https://www.amazon.com/SATA-Adapter-Converter-Cable-Drive/dp...

          Not only that but Windows 10 will still install and run on drives with these old connectors just fine in BIOS mode as expected but also partitioned & formatted with the latest GPT HDD layout, GPT would boot with UEFI rather than BIOS for most mainstream configurations.

          But also if you do it right, GPT will boot a plain MBR HDD if the UEFI can find a suitable FAT32 BOOT folder.

          UEFI + GPT alone is just too lame to run DOS on bare metal any more. Not without BIOS mode or CSM enabled. GPT is still a show-stopper though, DOS needs MBR drive layout :(

          OTOH MS-DOS will still install & run on any PC or drive, even NVMe, as long as there is a CSM or legacy BIOS mode and you are not stuck with a crippled mother board having only UEFI. GPT-only means no DOS for you. Not without some kludge like a virtual machine.

          The purpose of UEFI + GPT was to make it so you couldn't run DOS, Win3.x, W9x, Wxp, Vista, W7, and Linux ever again on bare metal.

          Not without CSM. The key UEFI module.

          • eqvinox a day ago ago

            > The purpose of UEFI + GPT was to make it so you couldn't run DOS, Win3.x, W9x, Wxp, Vista, W7, and Linux ever again on bare metal.

            > Not without CSM. The key UEFI module.

            Linux works perfectly fine with GPT, UEFI and even Secure Boot though?

            • fuzzfactor a day ago ago

              The Microsoft SecureBoot is the shitshow.

              It took Linux a while to accommodate it but it seems to be OK for a few years now.

              Windows 7 was the biggest threat to W8 adoption anyway and this was part of a complete strategy to nip it in the bud.

              Take everything else down as collateral damage :(

          • rep_lodsb a day ago ago

            This has nothing to do with this project. It's an adapter for connecting (very) old hard drives which only support CHS to a modern computer via USB, so that you can copy the data off them.

            • fuzzfactor a day ago ago

              >It's an adapter for connecting (very) old hard drives which only support CHS to a modern computer via USB, so that you can copy the data off them.

              Exactly what the adapter shown on Amazon is for.

              As gattilorenz confirms above.

              • rep_lodsb a day ago ago

                Supposedly the problem is that these adapters only work with LBA, which wasn't supported by every drive in the very early days of IDE.

                But maybe some of these cheap adapters do in fact work with CHS, or that specific 40 MB drive with LBA?

                • gattilorenz a day ago ago

                  I mean, I’m sure there _are_ drive adapters without CHS support; in my sample size of 1, a cheap no-name adapter bought from Amazon a few years ago, it works just fine (I’m assuming the very early IDE drive I used didn’t use LBA, but I don’t have it anymore).

                  For what is worth the adapter is one of those half-red half-black vertical-insertion ones with a cursed USB-A to USB-A cable, connections for SATA and PATA (2.5 and 3.5”) and a sliding “Molex” connector for the 3.5 PATA drive. Not a quality item…

                • fuzzfactor a day ago ago

                  It may very well depend on how the HDD was set up originally.

                  Before the HDDs had Integrated Drive Electronics (IDE), it required you to add an interface card to one of your ISA slots which you then connected the HDD to.

                  Each HDD factory had a documented CHS geometry for their products, but it didn't take long for this to no longer try to represent the actual physical geometry on the platters any more.

                  Either way, you set the jumpers on the interface card for that particular geometry according to the documentation, and that was the only way to correctly address the sectors in the most reliable way, if at all.

                  With the arrival of IDE, the interface card was no longer needed because that logic was handled inside the HDD after that, and motherboards arrived with built-in connections for HDDs, not only floppies any more.

                  You would set the HDD geometry in BIOS and all seemed OK until CMOS corruption occurred from something like a power surge, when the setting reverted to default.

                  The IDE got smarter in tandem with the BIOS's advances, and eventually the default "automatic" BIOS setting was smart enough to correctly pick up the effective geometry. Whether the HDD was flexible enough to have been commissioned with something other than its "native" geometry or not. By this time almost all new HDDs were, but the older PIO-0 HDDs were still the most abundant, and for people moving it to a new motherboard this made it work seamlessly most of the time.

                  Once LBA came out it was layered on top of that but you still had fixed CHS options in BIOS if you wanted it. Otherwise CHS was handled automatically as established. Never was exactly the same under every BIOS.

                  With a lesser USB adapter it may or may not be able to pick up geometry correctly, depending on how the data appears. And it can still be various different things, detecting and utilizing the structure found on the HDD, or re-partioning and formatting a HDD that still contains its previous data like that and having layout & structure come out the same, or not quite. But setting up a completely zeroed HDD may not end up with the same CHS as any of that either. In that situation the factory geometry prevails since there is nothing other than zeros to autodetect data structure from.

                  To avoid this I still do like to zero (the first 100mb at least) of the HDD first, remove it from all power for at least an hour to allow internal capacitors which store any non-default geometry to discharge, then partition & format on a vintage Intel-based PC with highly compatible BIOS.

                  That drive will then be more compatible with anything it connects to, but if a zeroed HDD was commissioned from USB to start it still can be just fine.

                  Booting is another thing to layer on, then you may or may not have to pay attention to sector alignment in addition to geometry, even if plain storage use works there are other obstacles to booting that may come up.

                  Now it does seem like the only advantage of a something like a Pi in the process would not be more helpful to access data from a properly established old HDD, but maybe one of the only ways to set up an old HDD using something other than that HDDs inbuilt default. But this was to be avoided back then too, it was better to have the HDD set up as default rather than unique "custom" CHS which amounts to "weird" and after that it may not be possible to connect to anything else and be recognized.

                  Unless you can manually set CHS in BIOS to match, which a USB adapter won't let you do anything you want like BIOS. A Pi could substitute for that but it was never really a good idea, mainly useful to set a non-default CHS on one drive to match the default CHS on an established drive when both are plugged into the same motherboard.

                  If I was being very skeptical, I would say it's possible the coder didn't even know that USB adapters exist. Prompted his AI to come up with one and this is the first untested draft.

                  • rep_lodsb 21 hours ago ago

                    Thanks for trying to educate the young whippersnappers about hard drives, but a lot of this rambling seems entirely off-topic.

                    >Unless you can manually set CHS in BIOS to match, which a USB adapter won't let you do anything you want like BIOS. A Pi could substitute for that but it was never really a good idea, mainly useful to set a non-default CHS on one drive to match the default CHS on an established drive when both are plugged into the same motherboard.

                    USB hard drives act as SCSI block devices, they don't have a CHS geometry and sectors are addressed by a single number (LBA=Linear Block Address).

                    Again: the purpose of this device is to connect an OLD HARD DISK to a MODERN COMPUTER. Not the other way around! If you plug it in and try to boot from with a BIOS / UEFI CSM that supports this, it will make up a CHS geometry based on the total number of sectors, instead of using the (real or translated) one that the drive actually uses and reports in its "IDENTIFY DEVICE" response. Because it's connected over USB and behaves like any other USB mass storage device.

                    That may well lead to problems when booting DOS from a drive that was formatted in some other machine, because the MBR will not use the same geometry. But that's not what this is for.

                    >If I was being very skeptical, I would say it's possible the coder didn't even know that USB adapters exist.

                    From the second paragraph in the readme: «« While cheap, modern adapters usually only work with newer "LBA" type drives, ATAboy works all the way back to the earliest CHS only, PIO Mode 0, ATA disks. »»

                    • fuzzfactor 8 hours ago ago

                      Good to get your message. Upvote for sure.

                      There were a lot of "non-standard" elements to work around through time, since there wasn't actually a real standard. More info can always help from many viewpoints and experiences and still not cover it all, young or old the more that have something to give as well as something to learn is a winning combination :)

                      The CHS values are still present in the partition table along with LBA equivalent, SCSI or not. Only with MBR layout though, not GPT. Some systems have never paid attention to CHS, some have never stopped. Like different forms of DOS.

                      Which is why a proper USB adapter is intended to just work with a PIO-0 HDD, and usually does unless the data layout on the old drive is so uncommon to be the kind of edge case that would be a show-stopper when connected to a vintage ATA motherboard too. That would require the unique CHS to be manually set in the BIOS to conform to a "custom" layout that was so non-mainstream for some reason when the old HDD was set up.

                      Then you had "drive overlays" which can get even more challenging when you're connecting old HDDs to newer PCs so often it makes you blue in the face :)

      • selfhoster11 a day ago ago

        I have seen such drives. ATAboy promises to be a nice option if manufacturing and populating a PCB is not too expensive.

    • rep_lodsb a day ago ago

      Seems to me from reading the deleted text file[1] like the author[2] used an LLM to get feedback on how to improve their own code. That isn't at all what "vibe-coding" usually means, and I say that as a complete AI hater myself.

      Or do you have some "smoking gun" evidence?

      I think the setup screen is a really nice touch and not something an AI would come up with.

      [1] https://github.com/redruM0381/ATAboy/commit/4e55223acd1c8cdc...

      [2] or someone else? it keeps using the phrase "your friend"