• Keith Wansbrough's avatar
    floppy: support arbitrary first-sector numbers · 9e49184c
    Keith Wansbrough authored
    The current floppy_struct allows floppies to number sectors starting
    from 0 or 1.  This patch allows arbitrary first-sector numbers - for
    example, 0xC1 for Amstrad CPC disks.
    
    This extends the existing 1-bit field (FD_ZEROBASED, bit 2 of stretch)
    to 8 bits (FD_SECTMASK, bits 2 to 9).
    
    Currently 0x00 denotes a first sector number of 1, and 0x01 denotes a
    first sector number of 0.  We extend this by interpreting FD_SECTMASK
    as the first sector number with the LSB flipped.
    Signed-off-by: default avatarKeith Wansbrough <keith@lochan.org>
    Cc: Alain Knaff <alain@linux.lu>
    Cc: Michael Kerrisk <mtk.manpages@googlemail.com>
    Cc: Karel Zak <kzak@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarJens Axboe <jens.axboe@oracle.com>
    9e49184c
floppy.c 116 KB