www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1998/09/17/17:59:14

From: corinna DOT vinschen AT cityweb DOT de (Corinna Vinschen)
Subject: Re: New winsup snapshot 9/14/98
17 Sep 1998 17:59:14 -0700 :
Message-ID: <3601A6E1.6A75E852.cygnus.cygwin32.developers@cityweb.de>
References: <199809171238 DOT IAA18832 AT indy DOT delorie DOT com>
Mime-Version: 1.0
To: DJ Delorie <dj AT delorie DOT com>, Christopher Faylor <cgf AT cygnus DOT com>,
cygwin32-developers AT cygnus DOT com

DJ Delorie wrote:
> Why not have the /dev file contain the name of the dll?

I see an advantage in the possibility, that the device
entry leaves unchanged, while you move the device driver
around, e.g. in case of testing. This could work in
running cygwin environment :-)

> !<device>dllname major minor type other-parms
> 
> Example:
> 
> /dev/audio:
> !<device>cygaudio.dll 9 0 c dsp-codec 44100 16
> 
> All the parameters after the dll name would be passed as argv[]
> (paramv[] ?)  to the dll "open" function, allowing additional
> parameters on a dll-by-dll basis.

The parameters are an absolute nice idea! I think, our mknod should
support this.

> This syntax also eliminates the need to search the directory for
> matching dll names, and avoids conflicts between, say, foo.1.dll and
> bar.1.dll.

On the other hand, see above. Also I wouldn't really search:
One simple FindFirstFile("*.1.dll",...) will do it. First comes,
first drives. And, of course, if any device driver for a given
major number is already loaded, not one FindFile is necessary.
(BTW: We shouldn't forget commands like `ldmod, rmmod, lsmod')

> For mknod, we'd need to maintain or document a major-to-dll mapping
> file, like "majors.txt" or "cygmaj.txt":
> 
> 1 cygnull.dll
> 2 djfake.dll
> 9 cygaudio.dll
> Or, we can let mknod scan the dlls and have the dlls include a
> function that returns their major numbers.

Hmm... sorry, but IMHO, both techniques are roundabouts. And
with the second one you only will be able, to solve a problem
with two device drivers, using the same major number, by
recompiling one of them. If it's coded in filename (or in mapping
file as above) simple `mv' (or `vi') will do it.

> > The interface is a generalized fhandler class.
> 
> Ooo, I like that.

So do I!

Corinna

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019