From 6029fd4a574baaaf8baef4fefa4d1ca5c082729f Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Mon, 5 May 2014 08:52:02 -0600 Subject: The alternate console device CONFIG_NSH_CONDEV must not be defined unconditionally. This causes errors when using Telnet sessions. This was solved by adding CONFIG_NSH_ALTCONDEV: CONFIG_NSH_ALTCONDEV enables or disables the feature then, if enabled, CONFIG_NSH_CONDEV provides the alternative console device name --- apps/nshlib/Kconfig | 63 ++++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 13 deletions(-) (limited to 'apps/nshlib/Kconfig') diff --git a/apps/nshlib/Kconfig b/apps/nshlib/Kconfig index 3f48f76db..4440fcaca 100644 --- a/apps/nshlib/Kconfig +++ b/apps/nshlib/Kconfig @@ -675,26 +675,63 @@ config NSH_USBDEV_TRACEINTERRUPTS endif # NSH_USBDEV_TRACE +config NSH_ALTCONDEV + bool "Alternative console device" + default n + depends on NSH_CONSOLE && !NSH_USBCONSOLE && !NSH_TELNET + ---help--- + If CONFIG_NSH_CONSOLE is set to y, then CONFIG_NSH_ALTCONDEV may + also be selected to enable use of an alternate character device + to support the NSH console. If CONFIG_NSH_ALTCONDEV is selected, + then NSH_CONDEV must be set to select the serial device used to + support the NSH console. This may be useful, for example, to + separate the NSH command line from the system console when the + system console is used to provide debug output. Default: stdin + and stdout (probably "/dev/console") + + NOTE 1: When any other device other than /dev/console is used + for a user interface, (1) linefeeds (\n) will not be expanded to + carriage return / linefeeds (\r\n). You will need to set + your terminal program to account for this. And (2) input is + not automatically echoed so you will have to turn local echo on. + + NOTE 2: This option forces the console of all sessions to use + NSH_CONDEV. Hence, this option only makes sense for a system + that supports only a single session. This option is, in + particular, incompatible with Telnet sessions because each Telnet + session must use a different console device. + +if NSH_ALTCONDEV + config NSH_CONDEV - string "Default console device" + string "Alternative console device name" default "/dev/console" - depends on NSH_CONSOLE && !NSH_USBCONSOLE - ---help--- - If NSH_CONSOLE is set to 'y', then NSH_CONDEV - may also be set to select the serial device used to support - the NSH console. This should be set to the quoted name of a - readable/write-able character driver such as: - NSH_CONDEV="/dev/ttyS1". This is useful, for example, - to separate the NSH command line from the system console when - the system console is used to provide debug output. Default: - stdin and stdout (probably "/dev/console") - - NOTE: When any other device other than /dev/console is used + ---help--- + If CONFIG_NSH_CONSOLE is set to y, then CONFIG_NSH_ALTCONDEV may + also be selected to enable use of an alternate character device + to support the NSH console. If CONFIG_NSH_ALTCONDEV is selected, + then NSH_CONDEV must be set to select the serial device used to + support the NSH console. This should be set to the quoted name + of a readable/write-able character driver such as: + NSH_CONDEV="/dev/ttyS1". This is useful, for example, to separate + the NSH command line from the system console when the system console + is used to provide debug output. Default: stdin and stdout + (probably "/dev/console") + + NOTE 1: When any other device other than /dev/console is used for a user interface, (1) linefeeds (\n) will not be expanded to carriage return / linefeeds (\r\n). You will need to set your terminal program to account for this. And (2) input is not automatically echoed so you will have to turn local echo on. + NOTE 2: This option forces the console of all sessions to use + NSH_CONDEV. Hence, this option only makes sense for a system + that supports only a single session. This option is, in + particular, incompatible with Telnet sessions because each Telnet + session must use a different console device. + +endif # NSH_ALTCONDEV + config NSH_ARCHINIT bool "Have architecture-specific initialization" default n -- cgit v1.2.3