Thomas De Schampheleire wrote:
Well, I actually do not know.
The code I am writing does not really handle a certain device, so I
guess a device driver is not what I am aiming at.
A loadable module sounds ok to me.
That's pretty much the choice you have :-) (unless you're changing the
base kernel
code, which doesn't appear to be required).
How do I tell OpenSolaris that this module should be loaded? Is there
any documentation regarding developing modules for OpenSolaris?
Can a user also load and unload modules?
I'd start by studying how to develop device drivers for Solaris, even if
you don't
expect to build a conventional device driver. Have a look at:
http://www.opensolaris.org/os/community/device_drivers/
for a good place to get started; in particular, "Writing Device Drivers" is
indispensable documentation. The basics of loadable modules and kernel
services are covered in good detail.
Cheers,
Dana
Thanks, thomas
On 5/2/07, *Dana H. Myers* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> > wrote:
Thomas De Schampheleire wrote:
> Hi all,
>
> I will try using the timeout() first, but I am wondering where I
> should start the first invocation of my function.
>
> The code I would like to run could be considered to be related to
> power management. Is there a certain file or function from where I
> should call my function? For this start, should I use a taskq then?
What module are you delivering your code in? If you're delivering a
device driver,
you'd probably initiate the thread as part of driver open(), and shut
the thread the
down as part of driver close(). For a non-driver loadable module,
you may
initiate the thread as part of the module attach() and shut the thread
down as
part of the module detach(). In any case, for a loadable module,
you must
make sure that the thread is shutdown before the module is
unloaded or
arrange
to fail the unload. So the answer is, it really depends on what
you are
delivering
and what it needs to do.
Cheers,
Dana
_______________________________________________
opensolaris-code mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/opensolaris-code