Hi Robie,
> > Well, that is not really needed but might be convenient. You have
> > access to the header segments via the MTIOCRDFTSEG ioctls. Afterwards
> > you can parse the data and get the bad sector information.
>
> Ah - I wasn't aware that bad segment information was in the header
> segments; I'll be reading up the specs on that - thanks.
... and maybe have a look at ftape-4.x/ftape/lowlevel/ftape-bsm.c. The
point is that the kernel driver already contains code which decodes
the header segment. You possibly can clone part of the code, no need
to invent the wheel a second time. Also the "ftformat" program of the
ftape-tools package already contains code which handles the bad sector
map. Have a look at ftape-tools-1.08/src/ftformat/ftfmt-bsm.[ch].
> BTW, when using MTIOCWRFTSEG, do I have to leave gaps in the buffer
> which correspond to bad bits, and when using MTIOCRDFTSEG, do I get
> regions in the buffer which correspond to bad bits, and therefore
> undefined? It just occurred to be that this might be one of the things
> that is going wrong ATM.
No, you don't need to leave gaps. The buffer supplied to MTIOCWRFTSEG
is treated as a contiguous data region. So if there is a single bad
sector, then only 28kb of the buffer are used, the last kb is ignored.
Likewise MTIOCRDFTSEG returns a contiguous memory region holding the
data of the segment. In the presence of bad sectors less data is
returned, but it is still a contiguous memory region.
> I assume you mean patents? Do you happen know which countries these
Yep.
> apply to, or who owns them? I live in the UK, which AFAIK doesn't
> support software patents (although the EU may soon :-(
> Of course, I don't like the idea of running the risk of being sued the
> moment I set foot in the US.
I'm not really sure. When starting to hack ftape years ago I just read
about that patents and left them alone. The QIC organisation probably
can answer that question. The standard describing the compression
algorithm is labeled QIC-130. It just contains a disclaimer that the
QIC standards organisation does not guarantee that the algorithm is
not protected by patents. So maybe there is no problem.
Cheers
Claus
--
Claus-Justus Heine
[EMAIL PROTECTED]
http://www.instmath.rwth-aachen.de/~heine/
Ftape - the Linux Floppy Tape Project
Home Page : http://www.instmath.rwth-aachen.de/~heine/ftape/
Mailing-list: [EMAIL PROTECTED]