All of lore.kernel.org
 help / color / mirror / Atom feed
From: j.neuschaefer@gmx.net (Jonathan Neuschäfer)
To: kernelnewbies@lists.kernelnewbies.org
Subject: stdout to console
Date: Mon, 23 Apr 2012 14:09:06 +0200	[thread overview]
Message-ID: <20120423120906.GA2276@debian.debian> (raw)
In-Reply-To: <CABOM9ZoztPqvvqHNP1-6=q8cXA7cH8ukT_13Lx8pwmHdKH_q9g@mail.gmail.com>

On Mon, Apr 23, 2012 at 03:45:00PM +0530, Arun KS wrote:
> Hello Guys,
> 
> We all know that when an application writes to stdout, data ends up in
> the console.
> 
> Okey so if I m on my development board and if I run an app, all the
> prints comes to the console (eg /dev/ttyS0).
> If I m on any server using ssh and all apps prints comes on my putty
> (eg through /dev/pts/176).
> 
> Where is the code which maps fd 1 to the console in kernel?
> If you guys have any pointers, please share.
> 
> While opening a device (for eg /dev/something), the vfs calls that
> drivers, whose major and minor number matches.
> But in case of stdout, how vfs resolves the write to the fd 1 and send
> it to the corresponding console driver?
> 
> Thanks,
> Arun

It's in init/main.c, around line 823.

"strace" is a useful tool for trying to figure out what exactly a user
space process does.

The man pages of various system calls (open, fork, exec, dup, etc.) may
also provide valuable information.


Thanks,
	Jonathan Neusch?fer

  reply	other threads:[~2012-04-23 12:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABOM9Zq_8+c+RV_kunwbvgFp0454-s4eAd_HQTCRQpR9ZbmZyg@mail.gmail.com>
2012-04-23 10:15 ` stdout to console Arun KS
2012-04-23 12:09   ` Jonathan Neuschäfer [this message]
2012-04-25 18:09   ` Sri Ram Vemulpali
2012-04-25 18:59     ` Jonathan Neuschäfer
2012-04-26  3:56     ` Arun KS
2012-04-27  5:46       ` Sri Ram Vemulpali

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=20120423120906.GA2276@debian.debian \
    --to=j.neuschaefer@gmx.net \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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.