All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brad Boyer <flar@allandria.com>
To: Siva Prasad <sprasad@bivio.net>
Cc: linuxppc-dev@ozlabs.org, Nicholas Mc Guire <der.herr@hofr.at>,
	linuxppc-embedded@ozlabs.org
Subject: Re: Device node - How does kernel know about it
Date: Sun, 30 Dec 2007 15:43:32 -0800	[thread overview]
Message-ID: <20071230234332.GC2203@cynthia.pants.nu> (raw)
In-Reply-To: <D83235F0F3C86D4D889D8B9A0DA8C6D7012AFA2D@corpexc01.corp.networkrobots.com>

On Thu, Dec 27, 2007 at 07:27:17PM -0800, Siva Prasad wrote:
> What is the kernel routine that is first called when there is, for
> example a read() function call from user program? 
> I would like to start debugging from there and see if any thing at all
> happens when there is a call. Appreciate your help with this question.

I don't generally recommend starting debugging at that level, but I'll
try to give you some pointers. Every system call coming into the kernel
from a user space program initially runs a little piece of assembly
language code that looks up a handler (by number) in the system call
table and sets up the proper environment to call the appropriate function
that implements that call (which is written in C). Normally, those
functions are named with a prefix of sys_ and the name of the system
call. For example, the implementation of read(2) is called sys_read. You
should be able to find it in fs/read_write.c. Other system call
implementations are scattered around to be with code related to that
call. Most of the file related ones can be found someplace under the
fs directory.

	Brad Boyer
	flar@allandria.com

  parent reply	other threads:[~2007-12-30 23:43 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-27  1:31 Device node - How does kernel know about it Siva Prasad
2007-12-27  2:55 ` Jon Smirl
2007-12-28  8:39 ` Nicholas Mc Guire
2007-12-28  3:27   ` Siva Prasad
2007-12-28  4:15     ` Jon Smirl
2007-12-28  4:55       ` Siva Prasad
2007-12-30 23:43     ` Brad Boyer [this message]
  -- strict thread matches above, loose matches on Subject: below --
2007-12-27  1:34 Siva Prasad
2007-12-27 20:10 ` Phillip Susi
2007-12-28  3:23   ` Siva Prasad

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=20071230234332.GC2203@cynthia.pants.nu \
    --to=flar@allandria.com \
    --cc=der.herr@hofr.at \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=linuxppc-embedded@ozlabs.org \
    --cc=sprasad@bivio.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.