preferable way to control kernel module
Vlad GALU
vladgalu at gmail.com
Wed Aug 10 20:36:57 GMT 2005
On 8/10/05, Sergey Uvarov <uvarovsl at mail.pnpi.spb.ru> wrote:
> Hello hackers,
>
> I'm writing a kernel module for my own needs. AFAIK the following
> methods could be used:
>
> 1) allocate not used system call with help of SYSCALL_MODULE macro
>
1 syscall
> 2) allocate proprieatry oid via SYSCTL_OID(OID_AUTO) and write an
> appropriate sysctl handler(s)
>
1 syscall + some work on the handler, but less flexibility. You
can't pass much information as an OID value.
> 3) add a file in /dev and use ioctl(2) call
>
at least 2 syscalls (open()/ioctl()). The flexibility would be the
same as 1), since you would also probably pass info packed in a
structure that is the argument for the ioctl(). But you'd have to do
slightly more work involving the /dev entry.
> What is a preferable way to control my module?
>
I would go for 1. But then again, I might be wrong. Better wait to
hear more suggestions before choosing a design.
> Thanks in advance,
> Sergey.
> _______________________________________________
> 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"
>
--
If it's there, and you can see it, it's real.
If it's not there, and you can see it, it's virtual.
If it's there, and you can't see it, it's transparent.
If it's not there, and you can't see it, you erased it.
More information about the freebsd-hackers
mailing list