LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 09-15-2011, 04:05 PM   #1
crunchytheory
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Rep: Reputation: Disabled
Line wrap on embedded system issues carriage return but no linefeed


I'm working on a terminal I/O bug in my embedded linux system. When the data typed on the shell via a terminal serial UART connection exceeds 80 lines, further input continues at the beginning of the same line rather than jumping down to the next, overwriting the initial data entered.

Everything else about the terminal I/O works correctly and this issue is not present over a remote telnet session.

Can anyone venture a guess as to why this might be happening? Keywords and search terms would be greatly appreciated as well, since admittedly I don't have a great understanding of how the terminal display works within the kernel and I'm not sure where to start. Thanks!
 
Old 09-15-2011, 07:10 PM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
I've seen similar behavior in bash if ansi color codes aren't escaped properly in the PS1 prompt. The escape codes must be enclosed in \[ and \] brackets.
 
Old 09-16-2011, 12:09 PM   #3
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
This, and other similar behaviors, usually result from a mismatch between what the shell &/or application expects as a terminal type, and what the actual terminal (more commonly, terminal emulator, these days) is. I've worked at solving these kinds of problems, and have never really developed a fool-proof method to solve them. I think part of the difficulty is that there are different ways of setting and configuring terminal settings (termcap vs terminfo), and also there are varying degrees of compatibility by various terminal emulations. The command stty can often be used to fix row/column settings (as well as many other configurations).
I would love to find a really good tutorial that explains all of the underlying mechanisms and related utilities well enough that I could use it to fix these kinds of problems.
--- rod.
 
Old 09-16-2011, 02:06 PM   #4
crunchytheory
LQ Newbie
 
Registered: Sep 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
Thanks for the response guys. You both are suggesting that the issue is in the terminal application (this issue occurs in all PC host-side applications: teratermpro, hyperterm, secureCRT, etc.) or in the shell formatting. Does it make sense to rule out the possibility of how kernel console graphics is configured being the cause?

I've done a little more research and found this little wikipedia entry offers a brief overview of the console system in linux: http://en.wikipedia.org/wiki/Linux_console
I know bugs in the kernel are very very rare, especially in systems like this that are near the core of the kernel. Again, I don't know exactly how it works, but is there a setting in the kernel config that can affect this system?
 
Old 09-18-2011, 01:20 AM   #5
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,399
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
Quote:
Originally Posted by crunchytheory View Post
Thanks for the response guys. You both are suggesting that the issue is in the terminal application
No, I'm suggesting that there is a difference between what kind of terminal is being emulated, and what kind of terminal your shell &/or application thinks exists. Or perhaps a disagreement about the size (number of lines) of the terminal. Have you tried something like
Code:
stty rows 50
(use whatever number makes sense to you; see what effect it has). A link with some interesting information, but little that ever seems to help resolve problems like yours is
Text-Terminal-HOWTO

--- rod.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
grep detecting carriage return, how ? Grafbak Programming 22 01-13-2010 02:19 PM
carriage return mike2008 Linux - Newbie 3 10-15-2009 01:03 AM
variable length string using GD (word wrap, carriage return, word/character count)? frieza Programming 1 02-14-2009 06:21 PM
Remove New Line or Carriage return from Text File DIMonS Programming 13 10-01-2007 11:31 AM
pppd...carriage return?!? icyfire Linux - Software 1 02-14-2002 08:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 08:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration