On Sunday 07 September 2008 14:47:51 Hannu Savolainen wrote: > Yair K. kirjoitti: > > Hi, > > > > The attached patch (oss-freebsd.diff.gz) does the following: > > > > 1) Add support for module parameters under FreeBSD > > 2) soundoff now checks if programs are using /dev/dsp*, etc. under > > FreeBSD > > 3) clean up BeOS install a bit (OK: François Revol on IRC) > > > > > > > Ok. In hg now.
setup/FreeBSD/confgen.c wasn't added. It should be the same as the Linux one. [snip] > The idea is that the "original" minor number is used as an index to the > oss_cdevs[] array. Then oss_cdevs[minor]->d->open() is called. The last > parameter of it is a pointer to an integer where new (redirected) minor > number can be returned. If this value is !=-1after the call then > oss_open() should set cdev->priv to this "new" minor number. Otherwise > it needs to be set to the "old" minor. This doesn't seem to get done by > your diff (or is it). It wasn't done by the diff. Now that I've added this and used D_TRACKCLOSE in flags, it works under VBox - I can have several programs playing to /dev/dsp. One thing though is that some versions of FreeBSD 7 don't have this API and some do. Since VDEV_SUPPORT affects some files outside the wrapper, using a binary package compiled on a system of one type on the other type will probably fail. I guess the only solution would be a separate package for 7.1-RELEASE when it's out? > The big question is does this "cdevpriv" get shared by all applications > that use given device file (say /dev/dsp0) or will each application > using the device at the same time have distinct number. The attempt to > implement open redirection we did earlier failed because all > applications that had the device open got redirected to the same engine. > They conflicted with each other and nothing worked. If I read this correctly, each file descriptor is supposed to have its own private data and it's implemented in this manner: Each thread has a queue which stores pointers to file structs, which point to the private data. The VFS sets td_fpop member of thread to the current fp each time devfs_open is used, and that is used by devfs_set_cdevpriv etc. functions. [1] http://lists.freebsd.org/pipermail/cvs-src/2008-August/094386.html [2] http://people.freebsd.org/~kib/misc/fdpriv.6.patch Yours, Yair K.
oss-freebsd-support-vdev.diff.gz
Description: GNU Zip compressed data
_______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel