Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 May 2007 15:04:18 +0200
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        freebsd-hackers@freebsd.org
Subject:   Re: module for kernel
Message-ID:  <200705201504.18871.hselasky@c2i.net>
In-Reply-To: <20070520163622.D72989@mp2.macomnet.net>
References:  <e420c1bd0705200529n49a57cbdgde6357c9c9203dc7@mail.gmail.com> <20070520163622.D72989@mp2.macomnet.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sunday 20 May 2007 14:36, Maxim Konovalov wrote:
> On Sun, 20 May 2007, 15:59+0330, Mohsen Pahlevanzadeh wrote:
> > Dear all,
> > When you wanna write a module for linux kernel,you have 2 function:
> > init_module() & cleanup_module()
> > But now i need to write a little module for FreeBSD kernel.Please guide
> > me.....
>
> Check /usr/share/examples/kld/ .

Also check out SYSINIT() :

  SYSINIT(id,SI_SUB_KLD,SI_ORDER_FIRST,usb_linux_register,p_usb_drv);
  SYSUNINIT(id,SI_SUB_KLD,SI_ORDER_ANY,usb_linux_deregister,p_usb_drv);

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200705201504.18871.hselasky>