KLD loading, liking

Alexandre Fiveg arhimed at gmx.net
Mon Nov 17 09:52:38 PST 2008


On Mon, Nov 17, 2008 at 02:34:28PM +0100, Dag-Erling Smørgrav wrote:
> Alexej Sokolov <bsd.quest at googlemail.com> writes:
> > Not only that. The use of the MODULE_DEPEND macro allows one module to
> > access the variables of modules on which it depends.
> 
> No.  Any module X can access any public variable or function in the
> kernel or in any other module Y, but loading X will fail if Y is not
> already loaded.  The only effect of MODULE_DEPEND is to tell the loader
> that Y must be loaded before X.
No, 
Example: 
two modules kld.c and kld1.1: 
kld: 	http://pastebin.com/m67799565    Makefile: http://pastebin.com/m5418e5a7
kld1:	http://pastebin.com/d154e8474    Makefile: http://pastebin.com/m79723138

In kld is public int var_from_kld declared. To access this variable from
kld1 you have to uncomment macro MODULE_DEPEND

My system:
% uname -v
FreeBSD 7.0-RELEASE-p5 #0: Tue Oct  7 19:05:20 CEST 2008

Tell me please if I do something wrong!

Thanx

 
> 
> DES
> -- 
> Dag-Erling Smørgrav - des at des.no
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"

-- 
Alexandre Fiveg <arhimed at gmx.net>
Key fingerprint = 0B23 EB52 3944 E440 CFF3  C1F1 7D05 8D00 34F7 A6BD


More information about the freebsd-hackers mailing list