Porting Linux and TTY / Shell problems


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Porting Linux and TTY / Shell problems
# 1  
Old 06-24-2009
Java 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  
Old 06-24-2009
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  
Old 06-25-2009
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  
Old 06-25-2009
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  
Old 06-25-2009
Thanks mgessner, I'll try the irc lists out.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Porting script from Solaris to Linux

I have a script which has commands that are located in different paths on my Linux o/s than on Solaris. For example, to make uname work, I need to do it this way in Solaris: my $host= `/usr/bin/uname -n` But in Linux it is: my $host = `/bin/uname -n`I have this issue with at least 5... (8 Replies)
Discussion started by: newbie2010
8 Replies

2. Shell Programming and Scripting

Porting from Solaris to Linux

Can any one please help the use of "cu command in Solaris" and as well as in Linux :confused: (1 Reply)
Discussion started by: sabee.prakash
1 Replies

3. Solaris

Porting a Linux Driver to Solaris

Hi all, Has anyone experience with proting a Linux driver (C-code) to Solaris 10? I have a Sunix SATA card with a inicio1622 chipset, but no driver available. From the website of inicio I downloaded the drivercode for Linux 2.4. Having done some investigation I found a Solaris driver... (4 Replies)
Discussion started by: longwave
4 Replies

4. Filesystems, Disks and Memory

Porting OSE to Linux

Hi, I was trying to port efs_mount(OSE system call) to a LInux.The efs_mount function is used to mount a volume on the indicated device dev.Upon successful completion of this OSE sytem call a volume manager (VM) will be available through which files on this volume are accessed. The Syntax for... (4 Replies)
Discussion started by: roshantraj30
4 Replies

5. Programming

Nucleus to Linux porting

I am new to Linux programming and my work involves changing an abstraction layer which made Nucleus calls, to Linux calls. In Case of Events Nucleus has calls like NU_Set_Events() NU_Retrieve_Events() Can I use the POSIX thread conditional variables for Linux? Can I use the System V calls... (1 Reply)
Discussion started by: taklubaba
1 Replies

6. Linux

when porting from HP-UX to Linux

helo, i m porting HP-UX socket application to Linux SSL-socket application. I have use htonl() in HP-UX. so when i use it in Linux, data transf is not done and application become soem time crashed. now when i remove htonl() in linux, then i got data but it will not proper order or some data may... (1 Reply)
Discussion started by: amitpansuria
1 Replies

7. Shell Programming and Scripting

porting shell script from Linux to AIX.

Hi, I am porting one shell script from Linux to AIX. I had .ksh file and i have changed it to .sh file for aix. on linux this script is running fine but on aix it gives me "unexpected end of file" error. Could any one suggest me what to do to port this script error free? Thanks in... (6 Replies)
Discussion started by: joy_1
6 Replies

8. Programming

Porting From Linux To Hpux

Gents, i'm a senior applications developer and need to port a Linux server application ( no additional / special libraries or unique header files ) to a HPUX enviroment. Any chance to compile it on the Linux using flags to create an HPUX binary with gcc? (8 Replies)
Discussion started by: anak0nda
8 Replies

9. UNIX for Dummies Questions & Answers

HP-UX to linux porting

Hi all, i wanted to port some HP-UX code to linux. can anybody point to some documents or resources that would help me in doing the porting.. thanks in advance Arun Prakash (0 Replies)
Discussion started by: arunprakash
0 Replies

10. Programming

Porting Win32 application into Linux

I need port Win32 console application, which was developed with MS Visual Studio 6.0 (without MFC using) into Linux. What is the best way to port project? Are there any standard tools or decisions? Thank you in advance, Sergey (0 Replies)
Discussion started by: Sergeyy
0 Replies
Login or Register to Ask a Question