Re: exposing kernel driver to user space app

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi ilya,
yes, sysfs is based on kobjects. You can make your own kobjects for your pci card also.
i think kobjects is much advance technique ( introduced in 2.6.x kernels) and kernel also use this for kernel-user space communication as you can see in
 ls /sys
and
/sys/devices/pci0000:00

kashif,

ilya <jibberboosh@xxxxxxxxx> wrote:
hello kashif, thank you for your input.

i did some reading and seems like netlink sockets
should be perfect for my needs. as for kobjects,
i understand that sysfs is based on them, is
that correct? i had hard time finding any info on
how to utilize kobjects directly.

-- ilya

On 8/8/07, kashif saeed wrote:
> For communication between user space application and kernel module you can
> use
> a) K objects
> b) netlink sockets
>
>
> ilya wrote:
> hello,
>
> my name is ilya, i am a kernel newbie, and i just
> joined the list in hopes of getting some insight on
> linux device driver development.
>
> i am writing a kernel-mode driver for a pci card and
> i need a mechanism to control the device via user-space
> application. at first i had an additional character driver
> initialized along with my driver and using fread/fwrite
> i would transfer info back and forth. then i found out
> about sysfs, so now i am using files in sysfs to
> send "commands" to the driver and receive data back.
>
> i have a feeling, however, that i am abusing this method.
> what is the appropriate way of setting this up? is there
> a way for the module to notify an application of some
> event happening? because right now i do this by
> constantly reading from one of the files in sysfs until
> the value it holds changes. i also know that reading
> files from kernel-mode is not a good thing, but i want
> to implement something of a config file that can be
> modified from user-space but would be read in by
> the module. what is the best way of doing this?
>
> any info is much appreciated.
>
> -- ilya
>
> --
> To unsubscribe from this list: send an email with
> "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> Please read the FAQ at http://kernelnewbies.org/FAQ
>
>
>
>
> ________________________________
> Boardwalk for $500? In 2007? Ha!
> Play Monopoly Here and Now (it's updated for today's economy) at Yahoo!
> Games.
>
>


Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux