Deprecating / Removing floppy drive support

Warner Losh imp at bsdimp.com
Mon Dec 4 00:56:06 UTC 2017


On Sun, Dec 3, 2017 at 5:35 PM, Cy Schubert <Cy.Schubert at komquats.com>
wrote:

> In message <CANCZdfq=8VoHDG-_KFGoUc9v5vDH8fTgXP9-
> tVsHXqgqaNihuQ at mail.gmail.c
> om>
> , Warner Losh writes:
> > --001a11418b8c855b04055f789009
> > Content-Type: text/plain; charset="UTF-8"
> >
> > On Sun, Dec 3, 2017 at 4:48 PM, Adrian Chadd <adrian at freebsd.org> wrote:
> >
> > > [snip snip]
> > >
> > > If someone wants to support it, and it doesn't make things in other
> > > places harder ... why not do it!
> > >
> > > It at least keeps our APIs honest..
> > >
> >
> > If it actually works on real hardware, something we have conflicting
> > reports on at the moment...
> >
> > And we seem to be short of the 'someone' that would be able to take up
> the
> > banner of wanting to support it, having the skill to support it and
> > demonstrating the time is there by fixing bugs...
>
> Bruce was partially right. It does work on i386. My test on an i386 MP
> kernel worked.
>
> Just a guess, as I haven't really looked at it, I'm willing to bet the
> controller expects to use addresses below 4 GB.


The Floppy controller doesn't grok anything about addresses. The ISA DMA
chip (8237A) doesn't grok anything about 16MB. The floppy is hard wired to
channel 2 of the DMA controller and can only do 8-bit transfers. And it's
slow (maybe 400kB/s). It's so limited that it spawned creation of VLB and
then PCI.

One cause of problems is that fdc passes the raw address of the BIO that
generated the I/O down to isa_dma. Once there, there's a range check to
make sure that it's a cool address, and if not it bounces it into
dma_bouncebuf[] which is contig malloc'd early in an attempt to get that
elusive below 16MB memory (it panics it if can't get it). There was talk
about tweaks to the isa_dma interface to allow drivers to specify the
memory to use and using a hard-coded 64k array in the floppy driver to
ensure it is below 16MB (with linker script hacks, if necessary). That talk
never went anywhere, though. Also, if contigmalloc is broken such that it
no longer really honors the constraints in the arguments, the isa_dma code
has no checks for that either location or aligment (both of which would be
fatal to proper floppy operation). This would explain why it works for bde
and not for me or others I've chatted with about the deal. Adding sanity
checks here would be a good first start, I think, to making things less
insane. An even better start would be to just pre-allocate DMA channel 2
with 64k, aligned 64k in isa_dma and hack the code to use this. The other
channels... No One will ever use them anymore...  Just  a thought... Memory
is no longer so dear that this would be an issue.

Warner


More information about the freebsd-arch mailing list