From: dhylands@gmail.com (Dave Hylands)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How logs will come to UART serial console?
Date: Tue, 17 May 2011 09:09:28 -0700 [thread overview]
Message-ID: <BANLkTi=hTe1Co+wHts3DECUR2M2Pg=JVXQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTinW5TEsr03Y1Dmw-mXnxP6ji3zmSg@mail.gmail.com>
Hi sandeep,
On Tue, May 17, 2011 at 12:52 AM, sandeep kumar
<coolsandyforyou@gmail.com> wrote:
>
> Hi ,
> Here is my question.
> when we put 'printk's in kernel code the logs will go to the log_buffer.(i observed that from implementation)
> But when UART is enabled(in the bootloader), the same printk logs?are going to the serial console.
> As per my study printk doesnot implementing anything that writes to the UART console.
>
> Now here are?my questions,
> how this is being achieved??Where this is implemented?(which file)
When you register your UART driver there is typically an option to
register a console driver at the same time.
For example, let's take a look at the 8250 serial driver. We'll look
at the file drivers/serial/8250.c
Search for the function serial8250_console_init, which has a call to
register_console.
That's the starting point that sets up the console driver. You can
have other drivers call register_console and get your console messages
sent out whatever bizarre device you may have connected to your
system.
You can also have multiple consoles registered at the same time.
> Where wil be the parsing of the cmdline string sent from the bootloader is done?
The function console_setup is called when the console= parameter is
passed on the kernel command line.
<http://lxr.linux.no/linux+v2.6.38/kernel/printk.c#L904>
The __setup just after the end of the function is what causes it to
call that function when the console= parameter is passed.
--
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com
next prev parent reply other threads:[~2011-05-17 16:09 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-17 7:52 How logs will come to UART serial console? sandeep kumar
2011-05-17 15:09 ` Haojian Zhuang
2011-05-17 16:09 ` Dave Hylands [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-05-18 18:49 Haphazard H
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='BANLkTi=hTe1Co+wHts3DECUR2M2Pg=JVXQ@mail.gmail.com' \
--to=dhylands@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).