[lkml]   [2000]   [Jul]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: linux-2.4.0 breaks grub install into partition
    Andries Brouwer wrote:
    > If a program needs the partition starting point, it can use the
    > HDIO_GETGEO ioctl which returns a
    > struct hd_geometry {
    > unsigned char heads;
    > unsigned char sectors;
    > unsigned short cylinders;
    > unsigned long start;
    > };

    Ah yes, this is what I was looking for. This should be sufficient for
    the time (at least until 2^32 sectors become an issue (2 TB disks).

    > If one needs the partition starting point from the command line,
    > there are various utilities (e.g., hdparm -g) that will print it.
    > > Nor does it seem that these exists an ioctl() to find the base
    > > device and offset for a partition subdevice, which I have to admit to
    > > being rather shocked to find out.
    > No. And that is an operation very often used, mostly inside
    > the kernel, and also the kernel has no mechanism.
    > One sees MKDEV(MAJOR(dev), MINOR(dev)&mask) or similar stuff
    > everywhere. In my big "large device number" rewrite, the minorstruct
    > of a subdevice has a pointer to the minorstruct of the whole device.
    > (Basically because MKDEV() becomes an expensive operation involving
    > a search and possibly a memory allocation.)

    This would be a very good thing to have.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:57    [W:0.036 / U:1.744 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site