lkml.org 
[lkml]   [2003]   [Feb]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Help !! calling function in module from a user program
From
Date
On Tue, 2003-02-18 at 13:43, Srinivas Chinta wrote:
> Hi,
> One way of doing this is , by hooking up your function
> inside the module as a system call.
> Here i'm sending two files, module.c and user_space.c.
> first do "insmod module.o" and then run
> "./user_space".
> As i'm also a newbee, i'm not aware of the
> disadvantages of this approach.

The main disadvantage is your driver/module becomes a specialized device
that can only be accessed by special syscall incantaion by one
application. The Un*x way is about keeping every thing as standard as
possible so there is easy interaction between user-mode programs
accessing the device even if they don't know the details of the
internals.

Most devices can be treated as char devices or block devices and are
coded as such. This way you can dump the contents of your hard-drive by
doing "cat /dev/hda1 > dump" without cat having intimate knowledge of
what a hard drive is and how to access one.

Of course there will always be times when new system calls need to be
added but generally this should be done sparinginly.

--
Alex, homepage: http://www.bennee.com/~alex/

He missed an invaluable opportunity to hold his tongue.
-- Andrew Lang

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.024 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site