RE: printf internals




Yes!... this is a embedded system, and will not have monitor. So, serial
is the default console.

I pass cmdline as "root=/dev/ram rw console=ttyS0,115200"

Thanks
Siva


-----Original Message-----
From: Scott Russell [mailto:catfather@xxxxxxxxxx]
Sent: Wednesday, December 19, 2007 3:31 PM
To: Siva Prasad
Cc: Clemens Koller; David Newall; linux-kernel@xxxxxxxxxxxxxxx
Subject: RE: printf internals


On Wed, 2007-12-19 at 14:33 -0800, Siva Prasad wrote:
Thank you very much for your response Clemens.

I tried strace on a regular system. It does not show which tty, etc.,
as it uses the stdout (fd = 1) and write(1, ...) to it.

This is not a student project. I am trying to build my own kernel and
ramdisk. Kernel boots fine to a point where it starts accessing ramdisk
and executes init scripts. From there on nothing gets printed. I did
some debugging and found that prints of user land programs are not
coming to the serial console, while kernel prints are working fine. I
found all the programs getting executed, by placing a printk in execve
routine and printing the arguments.

So, I wanted to trace down the path from user program to the kernel
and see why it is not printing messages from user program. I placed a
printk in drivers/char/tty_io.c:tty_write() and it is not getting called
from my file system. I tried the same thing on my good system (say
regular PC) and it works as expected.

Any clues that can help debug this issue is highly appreciated.
How can I get access to the same printf string inside kernel.

This sounds like you're printing out the serial console instead.

--
Scott <catfather@xxxxxxxxxx>
AIM: BlueCame1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • RE: printf internals
    ... Subject: printf internals ... I tried strace on a regular system. ... Kernel boots fine to a point where it starts accessing ramdisk and ... I wanted to trace down the path from user program to the kernel and see ...
    (Linux-Kernel)
  • Re: printf internals
    ... You also want a inittab entry for console on serial device. ... Kernel boots fine to a point where it starts accessing ramdisk ... I wanted to trace down the path from user program to the kernel ... and see why it is not printing messages from user program. ...
    (Linux-Kernel)
  • miibus, ed0, and the realpath security advisory
    ... dmesg and kernel config below. ... miibus0: <MII bus> on dc0 ... sc0: <System console> on isa0 ... # The `bpf' pseudo-device enables the Berkeley Packet Filter. ...
    (freebsd-questions)
  • [parisc] 2.6.24-rc3 (64-bit, smp) fails to boot on 9000/785/J5600
    ... v2.6.24-rc3-19-g2ffbb83 fails very early in the boot procedure. ... kernel was compiled using gcc 4.1.2. ... you may need to switch your console. ... # IPVS transport protocol load balancing support ...
    (Linux-Kernel)
  • [parisc] 2.6.24-rc3 (64-bit, smp) fails to boot on 9000/785/J5600
    ... v2.6.24-rc3-19-g2ffbb83 fails very early in the boot procedure. ... kernel was compiled using gcc 4.1.2. ... you may need to switch your console. ... # IPVS transport protocol load balancing support ...
    (Linux-Kernel)