Git Product home page Git Product logo

Comments (7)

Manawyrm avatar Manawyrm commented on September 15, 2024

Hm, I do have quite a collection of old hardware, but I don't seem to have any HDDs old enough to only support CHS, not LBA.
Not sure, how CHS is handled in the Linux kernel (if at all?), but the 3 registers LBAH, LBAM, LBAL are used for Cylinder, Heads and Sectors instead. The kernel can specify these registers directly, so if it wanted, my driver should (?!) be able to handle CHS.

Please feel free to test this yourself, you don't need the fancy PCB, just plug some wires (and ideally the resistors, not 100% strictly required though) into the GPIOs and you should be good to go.

I'd be happy to accept PRs fixing issues regarding CHS.

from pata-gpio.

fonic avatar fonic commented on September 15, 2024

I have a Conner CP30254 (252 MB, ca. 1992) that I'd really like to access. This project would be perfect for this.

AFAICT, the Linux kernel is (still) fully aware of CHS, see these source files of the 5.10 LTS branch (search for CHS):

libata:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/driver-api/libata.rst?h=v5.10
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/include/linux/libata.h?h=v5.10
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/ata/libata-core.c?h=v5.10

ide (legacy, deprecated, removed in 5.13+):
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/Documentation/ide/ide.rst?h=v5.10
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/ide/ide-disk.c?h=v5.10
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/tree/drivers/ide/ide.c?h=v5.10

Your pata-gpio hooks into libata, right? So CHS drives would probably just work out of the box? What do you think?

from pata-gpio.

fonic avatar fonic commented on September 15, 2024

The only thing I'm unsure of is how one would specify the drive geometry for libata. The legacy driver offers ide_core.chs=[interface_number.device_number]:cyls,heads,sects, but I was unable to find similar parameters for libata.

Old drives like mine do not support any auto-detection - I clearly remember having to enter (or select) the correct CHS values for the drive within the BIOS.

from pata-gpio.

Manawyrm avatar Manawyrm commented on September 15, 2024

Not sure if something still might be parsing the ide_core parameters… I‘d give it a try.

My driver is very low level and only handles the raw communication and setting of registers, everything else is done by libata.

Not sure if anyone has ever used libata with a CHS drive…

I have been looking for some very old pre-LBA drives in my collection over Christmas, but I wasn‘t able to find one that doesn‘t support autodetection.

from pata-gpio.

fonic avatar fonic commented on September 15, 2024

Not sure if something still might be parsing the ide_core parameters… I‘d give it a try.

I've studied the kernel sources for quite a bit - the ide_core parameters are only parsed by the legacy driver (i.e. the one activated by configuration item Device Drivers -> ATA/ATAPI/MFM/RLL support (DEPRECATED)).

libata has its own set of parameters, defined here. Manually setting CHS drive geometry is not supported, libata relies solely on information sent by the drive itself (i.e. in reply to a ATA_CMD_ID_ATA request), which early drives likely won't provide (see FIXME in this comment block).

Thus, I'd presume that drives made before ATA-1 (first standard, started 1986, finalized 1994) won't work with libata and thus won't work with pata-gpio.


The way I see it, the best bet to access a CHS-only drive in 2022 is a mainboard with an IDE interface that's supported by the legacy 'ide' driver + Linux distribution with 5.10 LTS kernel (as 'ide' was removed from the Linux kernel starting with 5.13).

from pata-gpio.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.