Re: How to disable console on serial when needed ?
- From: jj@xxxxxxxxxxxxxx (Jim Jackson)
- Date: Fri, 22 Dec 2006 23:15:23 +0000 (UTC)
Raymond <skyflame@xxxxxxxx> wrote:
"Jim Jackson" <jj@xxxxxxxxxxxxxx> ????????????:emf1al$ls2$1$830fa17d@xxxxxxxxxxxxxxxxxxx
Raymond <skyflame@xxxxxxxx> wrote:
Hi
I want to disable console on serial when I need to use the serial
port
to control some serial device.
"console on a serial line" is simply a "getty" (or similar, often agetty
or mgetty) program running connected to the serial line. These are usually
controlled by the "init" program, by entries in /etc/inittab
However this does not have to be the case. First comment out any lines in
/etc/inittab to prevent init from starting any "getty" process attached to
the serial line. Then arrange for the getty process to be started instead
by one of the initialise scripts. When you want to use the serial line,
then simple kill the getty process, use the line then restart the getty
when you have finished
But I still need to use it for log on when these serial device are
not
in use. So I can't just remove the console on serial support from kernel
at
compile time.
You are confusing things.
"Console on Serial" is not required for you to be able to login
on a serial line.
When the kernel starts, or needs to send diagnostic messages it does it to
a "Console", usually the first virtual terminal device (VT0). "Console on
Serial" makes the kernel send these messages out on a nominated serial
line.
If you do have serial console enabled on the line then you have got
problems. The kernel may generate output that may interfer with your
application.
And what I need is the ability to detach / attach console to serial
port
after bootup.
see above
Hi Jim
Thanks for the advise.
However , I might not get my situation clear enough.
My platform is an Arm embeded board.
And the /Dev/Console is not a link to first VT but with dev node major 5
minor 1
And in the inittab there are no getty to direct console to ttyS0
infact I even do not need a inittab.
instead in the kernel's main.c , there are something like :
static int init(void * unused)
{
lock_kernel();
do_basic_setup();
prepare_namespace();
/*
* Ok, we have completed the initial bootup, and
* we're essentially up and running. Get rid of the
* initmem segments and start the user-mode stuff..
*/
free_initmem();
unlock_kernel();
if (open("/dev/console", O_RDWR, 0) < 0)
printk("Warning: unable to open an initial console.\n");
(void) dup(0);
(void) dup(0);
.
.
.
}
So , What can I do now ?
I have explained. You have NOT understood what I said. I explained what
the linux console is - it is has NOTHING to do with user logins!!! The
kernel has absolutely no knowledge of how a user "logs in" - that is all
handled in user space.
See
http://www.vanemery.com/Linux/Serial/serial-console.txt
for more info on the Serial console.
.
- Follow-Ups:
- Re: How to disable console on serial when needed ?
- From: Sebastian
- Re: How to disable console on serial when needed ?
- References:
- Re: How to disable console on serial when needed ?
- From: Jim Jackson
- Re: How to disable console on serial when needed ?
- Prev by Date: Re: Best Scheduler for BTS
- Next by Date: Re: How to disable console on serial when needed ?
- Previous by thread: Re: How to disable console on serial when needed ?
- Next by thread: Re: How to disable console on serial when needed ?
- Index(es):
Relevant Pages
|