Re: Clone Drivers

Stephen Williams (steve@icarus.com)
Mon, 28 Sep 1998 10:46:10 -0700


On Fri, 25 Sep 1998, David Grothe wrote:

> Now comes the question: I am going to have to write pretty much the
> same piece of code either under the covers of LiS or as an addition to
> the sys_open routine. If I do the former then the feature will be
> available to LiS STREAMS drivers only. If I do the latter, and you
> accept the code into the kernel, then the feature will be available to
> any character special device driver.

mike@roan.co.uk said:
> Have you considered making a separate clone device driver? The major
> number is used to identify the clone device. When opened it uses the
> node's minor number as the real major number, allocates an unused
> minor and punts the open to the constructed device.

That is *exactly* how it was done in SVR3. The major number got you the
clone device, which used the minor number as the major number of the
stream head. The stream head was called with magic parameters (I forget
the details, I think there was a flag) that told the device to clone
itself.

-- 
Steve Williams                "The woods are lovely, dark and deep.
steve@icarus.com              But I have promises to keep,
steve@picturel.com            and lines to code before I sleep,
http://www.picturel.com       And lines to code before I sleep."

- 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/