On Mon, 2 Apr 2001, Jay R. Ashworth wrote:
>
> Well, if you're skipping init, you're depending on the kernel to get
> the port right (I assume you're using init=/bin/bash), and I don't know
> if it's actually that damned smart or not. You might need to init= a
> shell script with #!/bin/bash and exec another shell with the
> appropriate redirects. This will, *I think*, work on Linux where it
> might not work on other systems, since #! is handled directly by the
> exec(2) call, as I understand the thing.
Good point. The kernel (in init/main.c:init()) does open "/dev/console"
and sets it to be stdin and stdout. Then it execs whatever you've set for
init (or /bin/sh).
So if you have your own init, then it should expect to have console as the
controlling terminal, right?
> Anyone actually sure on this one, as opposed to my mere speculations?
So now the question is, when told to use a serial console, does it
properly map /dev/console to the serial port?
[rummages around a 2.2.5 kernel for a moment...]
drivers/char/serial.c defines a 'struct console sercons' and then calls
'register_console(&sercons)'. register_console() adds it the list of
registered consoles (console_devices). (But it might not be the
"preferred console")
Looking at drivers/char/tty_io.c:tty_open() suggests yes, /dev/console
will be properly mapped to the serial port.
But as I said, if you have multple consoles registered, then the serial
console may not be preferred. I can't figure out where you define what
the preferred console is. Maybe setting "serial=???" in lilo.conf?
Jeremy Impson
Sr. Associate Network Engineer
Advanced Technologies Department
Lockheed Martin Systems Integration
email: [EMAIL PROTECTED]
phone: 607-751-5618
fax: 607-751-6025
--
To unsubscribe from this list, send a message to [EMAIL PROTECTED]
with the command "unsubscribe linux-embedded" in the message body.
For more information, see <http://waste.org/mail/linux-embedded>.