Anupam Chomal wrote:
> Hi All,
> 
> I am trying to write drivers that should be "Solaris compliant". By
> this I mean that the driver should be - DDI or DKI or LDI compliant.
> Now my doubts are:
> 
> 1. There are extern decelerations in header files available in
> solaris. Can we use then directly while writing our kernel modules or
> not?

Symbols in header files are not necessarily reliable.  What's reliable
is the documentation -- section 7 (and 7i, 7m, and so on).

By all means, use the header files to help locate things you need, to
augment your understanding of the system, and to confirm the expected
usage.  They're certainly not "secrets" of any sort.  But don't believe
that because you find something there that it'll be stable over time.

> 2. I assume the LDI is a subset of DDI/DKI interfaces...now my
> confusion is, should a driver be DDI or DKI or LDI complient or all?

I wouldn't say that's really an important distinction or consideration
for any real software.  The real issue is whether or not you rely on
undocumented interfaces or behavior.  If you do, then your driver may
cease to operate properly (and may even cause panics or system crashes)
after a patch or other upgrade to the system.  It may do so without
warning, and regardless of how much testing you think you've done, and
the OS vendor may not necessarily expend much effort trying to fix your
problems.

If you stick to the documented interfaces and use them in the ways and
contexts in which they're documented to be used, then the above sort of
trouble is very much less likely to happen, and the vendor has a much
keener interest in making things right.  The documented interfaces form
a sort of contract between the OS developers and the third party
software writers: the OS people promise not to change these things in
incompatible ways without substantial advance notice and without a
really good reason, and the driver writers in turn promise not to wander
off the reservation.

> 3. Certain DDI interfaces, like ddi_pathname_to_dev_t, do not have man
> pages. Does this mean that it is not a public interface? Then why is
> it a DDI interface? DDI is supposed to be public and make drivers
> portable right?

The sys/sunddi.h header file is a bit of a grab-bag.  It contains some
things that are documented and public, and others that are clearly
private.  I believe that ddi_pathname_to_dev_t (which is not documented)
was once classified as "Sun Private."  I wouldn't suggest confusing the
letters "ddi" in the symbol name or in the header file name as any sort
of promise of stability.  If you care about writing a good, stable
driver, don't use it.

OpenSolaris is no more.  If your question is about Solaris, then you
need to talk to your local Oracle representative to find out whether
this function could be made public (and thus documented and stable for
use by independent driver writers).  If your question is about
OpenIndiana, then one of the OpenIndiana mailing lists is probably your
best bet.

-- 
James Carlson         42.703N 71.076W         <carls...@workingcode.com>
_______________________________________________
opensolaris-code mailing list
opensolaris-code@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code

Reply via email to