* printk problems
@ 2003-04-08 11:57 Avinash S.
2003-04-08 15:37 ` Justin Carlson
2003-04-08 17:07 ` Jun Sun
0 siblings, 2 replies; 7+ messages in thread
From: Avinash S. @ 2003-04-08 11:57 UTC (permalink / raw)
To: linux
Hello,
I am trying to port linux to a custom built IDT MIPS board. I have
managed to get the UART working. My bootup code loads and prints some
debugging messages initially and then actual kernel bootup occurs.
However it hangs when it reaches the first printk function. i have tried
to debug this with some difficulty but with no effect. Could some one
tell me or atleast point me to where i can get some info on how printk
works or atleast how to debug my printk to see where the actual problem
lies?
Thanks in advance.
Avinash
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: printk problems
2003-04-08 11:57 Avinash S.
@ 2003-04-08 15:37 ` Justin Carlson
2003-04-08 18:24 ` Michael Pruznick
2003-04-08 17:07 ` Jun Sun
1 sibling, 1 reply; 7+ messages in thread
From: Justin Carlson @ 2003-04-08 15:37 UTC (permalink / raw)
To: Avinash S.; +Cc: linux
On Tue, 2003-04-08 at 07:57, Avinash S. wrote:
> Hello,
> I am trying to port linux to a custom built IDT MIPS board. I have
> managed to get the UART working. My bootup code loads and prints some
> debugging messages initially and then actual kernel bootup occurs.
> However it hangs when it reaches the first printk function. i have tried
> to debug this with some difficulty but with no effect. Could some one
> tell me or atleast point me to where i can get some info on how printk
> works or atleast how to debug my printk to see where the actual problem
> lies?
>
Couple quick questions:
1) I assume you want to do console over serial port. You have
SERIAL_CONSOLE enabled in your .config, right?
2) Is the UART standard, for which a driver is extant? If not, you'll
need to write one.
3) Are you sure it's hanging, or is it just not reporting anything
else? Do you have other status indicators (i.e. LED's of some sort?)
Here's the 30 second summary of what happens at bootup on a serial
console. This is mostly from memory a year old or so, so don't take
this as gospel:
Pretty early in the boot sequence (in init/main.c) console_init() is
called (in drivers/char/tty_io.c). If your serial driver is compiled in
with console support, the serial port is initialized here, and added to
a list of available consoles. The first(?) extant console is chosen for
console output, where your printk()s will end up.
Until this point, printk() calls are buffered in memory. If you have
printk()s not showing up, odds are pretty good you're failing to
initialize the serial console in some way.
Hope that helps...
-Justin
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: printk problems
2003-04-08 11:57 Avinash S.
2003-04-08 15:37 ` Justin Carlson
@ 2003-04-08 17:07 ` Jun Sun
1 sibling, 0 replies; 7+ messages in thread
From: Jun Sun @ 2003-04-08 17:07 UTC (permalink / raw)
To: Avinash S.; +Cc: linux, jsun
On Tue, Apr 08, 2003 at 05:27:23PM +0530, Avinash S. wrote:
> Hello,
> I am trying to port linux to a custom built IDT MIPS board. I have
> managed to get the UART working. My bootup code loads and prints some
> debugging messages initially and then actual kernel bootup occurs.
> However it hangs when it reaches the first printk function. i have tried
> to debug this with some difficulty but with no effect. Could some one
> tell me or atleast point me to where i can get some info on how printk
> works or atleast how to debug my printk to see where the actual problem
> lies?
>
You might want to try the early printk approach. See
http://linux.junsun.net/porting-howto/
Jun
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: printk problems
2003-04-08 15:37 ` Justin Carlson
@ 2003-04-08 18:24 ` Michael Pruznick
0 siblings, 0 replies; 7+ messages in thread
From: Michael Pruznick @ 2003-04-08 18:24 UTC (permalink / raw)
To: Justin Carlson; +Cc: Avinash S., linux
> Until this point, printk() calls are buffered in memory.
This is what I like to use to bypass the buffering for
non-standard serial hardware.
The raw_output() function needs to be specific to
your serial driver. The one below is just an example
from a board I'm currently working on (that is not in
the linux-mips tree yet). Basically, raw_output() needs
to put the char in the serial hardware output register
and then wait for the serial hardware to indicate that
it put the char on the wire to prevent over-run.
Changes to kernel/printk.c
#define RAW_OUTPUT
static void emit_log_char(char c)
{
#ifdef RAW_OUTPUT
void raw_output(char c);
raw_output(c);
#else
LOG_BUF(log_end) = c;
log_end++;
if (log_end - log_start > LOG_BUF_LEN)
log_start = log_end - LOG_BUF_LEN;
if (log_end - con_start > LOG_BUF_LEN)
con_start = log_end - LOG_BUF_LEN;
if (logged_chars < LOG_BUF_LEN)
logged_chars++;
#endif
}
What I added to my serial driver. You will need to
do the similar for your specific serial hardware.
#ifdef RAW_OUTPUT
void raw_output(char c)
{
struct rs_port *port = &rs_ports[0];
if ( c == '\n' )
{
sio_out(port, TXX9_SITFIFO, '\r');
wait_for_xmitr(port);
}
sio_out(port, TXX9_SITFIFO, c);
wait_for_xmitr(port);
return;
}
#endif
--
Michael Pruznick, michael_pruznick@mvista.com, www.mvista.com
MontaVista Software, 1237 East Arques Ave, Sunnyvale, CA 94085
^ permalink raw reply [flat|nested] 7+ messages in thread
* printk problems
@ 2004-11-03 20:13 Arrigo Benedetti
2004-11-03 22:56 ` Benjamin Herrenschmidt
0 siblings, 1 reply; 7+ messages in thread
From: Arrigo Benedetti @ 2004-11-03 20:13 UTC (permalink / raw)
To: linuxppc-dev
For some reason I can't get printk() to work on a YDL 4.0 system. I have
followed all the instructions, like
setting the correct log level in /proc/sys/kernel/printk, killing klogd
and then
cat /proc/kmsg
but I do not see any message from printk. The printk is in a new kernel
system call that I wrote.
Any ideas?
thanks much
-Arrigo
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: printk problems
2004-11-03 20:13 printk problems Arrigo Benedetti
@ 2004-11-03 22:56 ` Benjamin Herrenschmidt
2004-11-04 1:50 ` Arrigo Benedetti
0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Herrenschmidt @ 2004-11-03 22:56 UTC (permalink / raw)
To: Arrigo Benedetti; +Cc: linuxppc-dev list
On Wed, 2004-11-03 at 12:13 -0800, Arrigo Benedetti wrote:
> For some reason I can't get printk() to work on a YDL 4.0 system. I have
> followed all the instructions, like
> setting the correct log level in /proc/sys/kernel/printk, killing klogd
> and then
>
> cat /proc/kmsg
>
> but I do not see any message from printk. The printk is in a new kernel
> system call that I wrote.
> Any ideas?
Are you sure you are reaching your syscall at all ? Besides, why are you
adding a syscall in the first place ? (just curious ... it's usually the
wrong solution :)
Ben.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: printk problems
2004-11-03 22:56 ` Benjamin Herrenschmidt
@ 2004-11-04 1:50 ` Arrigo Benedetti
0 siblings, 0 replies; 7+ messages in thread
From: Arrigo Benedetti @ 2004-11-04 1:50 UTC (permalink / raw)
To: linuxppc-dev
Benjamin Herrenschmidt wrote:
>On Wed, 2004-11-03 at 12:13 -0800, Arrigo Benedetti wrote:
>
>
>>For some reason I can't get printk() to work on a YDL 4.0 system. I have
>>followed all the instructions, like
>>setting the correct log level in /proc/sys/kernel/printk, killing klogd
>>and then
>>
>>cat /proc/kmsg
>>
>>but I do not see any message from printk. The printk is in a new kernel
>>system call that I wrote.
>>Any ideas?
>>
>>
>
>Are you sure you are reaching your syscall at all ? Besides, why are you
>adding a syscall in the first place ? (just curious ... it's usually the
>wrong solution :)
>
>
>
I'm pretty sure that the syscall is called, in fact at some point there
was a bug in the code which
froze the system... I made a syscall just to do some quick timing tests.
I agree that a module is a
better solution, and in fact I have just posted a message about that...
-Arrigo
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2004-11-04 1:50 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-03 20:13 printk problems Arrigo Benedetti
2004-11-03 22:56 ` Benjamin Herrenschmidt
2004-11-04 1:50 ` Arrigo Benedetti
-- strict thread matches above, loose matches on Subject: below --
2003-04-08 11:57 Avinash S.
2003-04-08 15:37 ` Justin Carlson
2003-04-08 18:24 ` Michael Pruznick
2003-04-08 17:07 ` Jun Sun
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.