Problems with /dev/console

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 21.12.2009 um 22:30 schrieb Christoffer Dall <cd2436 at columbia.edu>:

> Hi there.
>
> I managed to use the patch suggested by Baruch Siach on the arm-linux
> mailing list to get an early console output:
> http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=93fd03a8c6728b58879f8af20ffd55d9c32a778b
>
> Eventually, I tracked down that the initcalls problem was simply that
> the kernel was configured to update the LEDs on timer interrupt and
> ended up sitting in a tight loop waiting for a device to respond,
> which wasn't there. Configuring the kernel without LED timers solved
> that issue.

Oh? Why does the same kernel work in qemu then?

>
> Then I encountered some "wait for interrupt" instructions, which I am
> so far handling by simply calling schedule() until there's a a signal
> to QEMU and QEMU injects an interrupt into the guest. I'm thinking
> that I'll need to do something more clever here, which will actually
> cause the process itself to wait for signal, but this is a quick hack
> for now.

That sounds very close to the hlt instruction on x86. PPC has  
different SPRs that can set the CPU in a similar mode.

Just look at the other architectures. There's a pretty cool helper to  
sleep until a signal / timer occurs.

>
> Finally, all the initcalls go through (although no with the best
> performance), and I end up with the "Warning: Unable to open an
> initial console" error message.
>
> The reason is that /dev/console is not there. I looked into the
> initrd, and sure enough, there are no devices in there. Curiously,
> using the same kernel with the same disk image on QEMU without KVM
> gives a console just fine. The kernel gets "console=ttyAMA0" as
> command line parameter. I can also see that the UART
>
> I am trying to track down when the /dev/console should be created, but
> if someone on this list can clarify these questions, it will probably
> save me much time:
> - Is /dev/console supposed to be created in the initrd, by the init
> process, by the kernel or a combination thereof?

A combination. The actual device is created by the kernel. The device  
node on your initrd fs is just a device node. /linuxrc should create  
that one.

> - If created by the kernel, who takes care of this?
> - How is /dev/console linked to /dev/ttyXXXX?

Usually using console=xxx on the kernel command line. Some  
distributions also ship tools to redirect the output (blogd).

In your case I guess the kernel couldn't find the specified device to  
link /dev/console to. Double-check that the uart init code was  
successful.

Alex


[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux