Messages in this thread |  | | | Date | Mon, 10 Jul 2000 22:44:06 -0700 | | From | "H. Peter Anvin" <> | | Subject | Re: 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.
-hpa
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
|  |