<p>How compatible is code written under Solaris with Open Solaris ? I would be interested specifically in some kernel modules .</p>

I think it is hard to quantify software compatibility, but I'd say code written for Solaris is quite forward compatible with OpenSolaris kernel. OpenSolaris source code evolves into what will be Solaris 11, and Sun's commitment to backwards compatibility is quite a fact.