mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alex Bennee <kernel-hacker@bennee.com>
To: Srinivas Chinta <chintasrinivas_tech@yahoo.com>
Cc: Sudharsan Vijayaraghavan <svijayar@cisco.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Help !! calling function in module from a user program
Date: 18 Feb 2003 14:04:17 +0000	[thread overview]
Message-ID: <1045577057.2506.122.camel@cambridge.braddahead> (raw)
In-Reply-To: <20030218134315.91052.qmail@web21206.mail.yahoo.com>

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


  reply	other threads:[~2003-02-18 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-18 12:50 Sudharsan Vijayaraghavan
2003-02-18 13:00 ` Alex Bennee
2003-02-18 13:43 ` Srinivas Chinta
2003-02-18 14:04   ` Alex Bennee [this message]
2003-02-18 13:44 ` Richard B. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1045577057.2506.122.camel@cambridge.braddahead \
    --to=kernel-hacker@bennee.com \
    --cc=chintasrinivas_tech@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=svijayar@cisco.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®