android console shell

2,130 views
Skip to first unread message

pavan savoy

unread,
Feb 26, 2010, 1:30:16 AM2/26/10
to Android Linux Kernel Development
Hi,

I tried searching this on few other lists - no hits
How do I get an android shell (console which is run from /init.rc) to
work on /dev/tty* devices ?

I am not sure how it worked on few other hardware that I have been working with.
But recently the device got changed from the generic /dev/ttyS to
/dev/ttyO because of change in the UART driver.
hence would like to know how exactly does it work ?

I had my bootargs point to the new device created, and the error logs,
kernel messages, seem to appear properly - but still no shell.

--
--Pavan Savoy

Tirtha Kanti Ghosh

unread,
Feb 26, 2010, 6:21:02 AM2/26/10
to android...@googlegroups.com
Hi Pavan,

First of all the kernel boot argument (like console=ttySx) is diffrent from what you see the ttyX# in Android sysfs.
When Kernel comes up there is no concept of sysfs and driver model of linux.

>But recently the device got changed from the generic /dev/ttyS to
>/dev/ttyO because of change in the UART driver.

This change I guess, in Android sysfs, right??

Normally, your init.rc starts console service from /system/bin/sh. (when init.rc comes by that time proper driver framework has been initialized)
The "sh" app, will enquire the TTY core to get the proper console id and do all rd/wr on that. Note that this console can be connected with any serial means UART, USB etc. The console should properly registered so that any user application use this console in generic way.

Though there could be multiple reason behind your problem to not to get the Android Shell. But this is the way, it works.
I would suggest you to consult the problem with BSP(linux kernel porting) team members of your new board.

Regards,
Tirtha





pavan savoy

unread,
Feb 26, 2010, 6:28:57 AM2/26/10
to android...@googlegroups.com
Exactly the reason why I posted this on android-kernel.
However, to put it in simple words,

busybox has /etc/initab where I can start getty on serial console and hence get me a login shell or use the askfirst action to get a shell on serial device.

what is it's android equivalent ?

regards,
Pavan
--
--Pavan Savoy

Tirtha Kanti Ghosh

unread,
Feb 26, 2010, 6:34:29 AM2/26/10
to android...@googlegroups.com
I am not sure...but mostly /dev/tty

Deva R

unread,
Mar 5, 2010, 9:55:24 AM3/5/10
to android...@googlegroups.com

android init scans for few parameters from kernel boot args.. like androidboot.console, androidboot.hardware

havent used though.. complete list here. http://android.git.kernel.org/?p=platform/system/core.git;a=blob;f=init/init.c;h=f76eb36b5480931b85f253df655abed870f670f3;hb=HEAD#l553

-Deva
Reply all
Reply to author
Forward
0 new messages