The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Porting OSE to Linux roshantraj30 Filesystems, Disks and Memory 4 06-19-2009 01:19 AM
when porting from HP-UX to Linux amitpansuria Linux 1 04-18-2008 02:08 AM
porting shell script from Linux to AIX. joy_1 Shell Programming and Scripting 6 12-27-2007 02:57 AM
Porting of Shell to AIX dhanamurthy High Level Programming 5 03-07-2007 10:37 AM
HP-UX to linux porting arunprakash UNIX for Dummies Questions & Answers 0 02-21-2005 05:49 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-24-2009
Interloper Interloper is offline
Registered User
  
 

Join Date: Jun 2009
Location: Freising, Germany
Posts: 3
Post Porting Linux and TTY / Shell problems

Hello all,

I am porting the linux 2.6.30rc2 kernel from one ARM architecture, /arch/arm/mach-davinci, to a new device, called Jacinto2.

I am using the serial port ttyS0 as the default console. The bootloader is U-Boot and I am using busybox mounted as a ramdisk in internal SDRAM. I have got the kernel to the point where it will boot into the shell, however at this point I experience a weird error.

The kernel displays the '/# ' shell prompt, but the shell cannot take keyboard input. It will not react to any key presses, but can display text.

However, the serial interrupt functions properly, and if I use printk's to print the serial buffer (in function uart_insert_char in /include/linux/serial_core.h), it outputs the characters I type.

I'm pretty sure my busybox fs works fine, because when I pass init=/bin/ls (redirects to busybox.ls), I can see my fs properly, and passing a simple hello world program (init=/hello) outputs text like I expect.

I feel like somehow the tty_buffer is not passing the characters to the shell. I've determined that the characters are being stored in the "tty_buffer" struct. As I keep typing, the buffer fills up with these chars (In the tty_insert_flip_char function in /include/linux/tty_flip.h) but never empties.

Am I mistaken, or should this be cleared as the chars are flushed to the user space? Also, does anyone know how the tty passes its buffer to user space programs such as the shell?

Has anyone seen this before or have suggestions to try?

Thanks,
Joe


---------Log--------------------
...
RAMDISK: gzip image found at block 0
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
VFS: Mounted root (ext2 filesystem) on device 1:0.
Freeing init memory: 144K
uart_open(0) called
ttyS0 - using backup timer
*** trying init processes: </bin/sh>
*** run_init_process(/bin/sh)
/#
--------------------------------
at this point, my printk's/serial IRQ's will work, but the shell doesn't react to keyboard input
  #2 (permalink)  
Old 06-24-2009
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,717
I have no experience with arch. However, we did recompile a Linux kernel to use a remote ttyS0 as the console. tldp.org has several docsets for different architectures for setting up serial consoles. This is generic for all linux kernels:

Remote Serial Console HOWTO
  #3 (permalink)  
Old 06-25-2009
Interloper Interloper is offline
Registered User
  
 

Join Date: Jun 2009
Location: Freising, Germany
Posts: 3
So, as it turns out, the TTY and serial layers were fine.
The actual problem I'm having is with the schedule_delayed_work call.

The function tty_flip_buffer_push in drivers/char/tty_buffer.c calls flush_to_ldisc, which pushes the data to user space, if the tty->low_latency flag is set. Otherwise, it will push onto the scheduler with schedule_delayed_work. The problem here is that this delayed work is never revisited. Thus, my character input was never sent through to user space because the scheduler never called the process to do it again.

For the time being, I have hard coded it to always call flush_to_ldisc instead of the schedule_delayed_work, but this is not a fix, this is a workaround. Does anyone have any suggestions as to why this scheduling call wouldn't behave correctly?
  #4 (permalink)  
Old 06-25-2009
mgessner mgessner is offline
Registered User
  
 

Join Date: Oct 2007
Posts: 50
There are mailing lists which will give you much better targeted feedback than this one.

irc.freenode.net has #u-boot and irc.oftc.net has #kernelnewbies. There also the mailing list for the ARM kernel.

You may have much better luck getting targeted feedback from them.

I would look in your .config. If this is a supported platform, I bet there's a small configuration issue.
  #5 (permalink)  
Old 06-25-2009
Interloper Interloper is offline
Registered User
  
 

Join Date: Jun 2009
Location: Freising, Germany
Posts: 3
Thanks mgessner, I'll try the irc lists out.
Reply

Bookmarks

Tags
boot process, porting linux, serial port, shell, tty

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:03 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0