How to dump boot message without adb

1,491 views
Skip to first unread message

Jie

unread,
Jul 13, 2010, 11:51:54 PM7/13/10
to Android Linux Kernel Development
Hi, all

I've ported the HTC drivers for 2.6.29 to kernel-msm-2.6.32.9 on my
HTC Tattoo. After a long time debugging, I completed the compilation
without any errors. I've compared the .config files of both HTC(.29)
and android(.32.9) carefully, nothing strange was found. However, the
phone got stuck after the new boot.img flashed and the adbd had not
started yet, so I couldn't find any useful debug messages from the new
kernel. My question is how to debug the kernel on my HTC Tattoo
without adb. Thanks a lot!

Regards,

Vishnu Pratap Singh

unread,
Jul 14, 2010, 12:10:29 AM7/14/10
to android...@googlegroups.com
Hi Jie,

you can use serial port for getting the logs. on serail port go to boot prompt and there you just change the log level from 4 to 8 like below
execute -> printenv 
it will show the environment there you will see following

CMDLINE=console=ttySAC2,115200 loglevel=4 

then execute 
setenv CMDLINE=console=ttySAC2,115200 loglevel=8
saveenv

reboot your target, you will get all printk logs.

regards,
vishnu

Jie

unread,
Jul 14, 2010, 2:54:33 AM7/14/10
to Android Linux Kernel Development
Hi, vishnu

Thanks for quick reply. I've executed 'printenv' on my Tattoo device,
'CMDLINE' environment value isn't there. I guess it should be set in
BoardConfig.mk file, right? There is an item named
'BOARD_KERNEL_CMDLINE' in this file. Right now, I set it to
'no_console_suspend=1 console=null' as Google did for other devices.

Is this correct?

Regards,


On Jul 14, 12:10 pm, Vishnu Pratap Singh <vishu13...@gmail.com> wrote:
> Hi Jie,
>
> you can use serial port for getting the logs. on serail port go to boot
> prompt and there you just change the log level from 4 to 8 like below
> execute -> printenv
> it will show the environment there you will see following
>
> CMDLINE=console=ttySAC2,115200 loglevel=4
>
> then execute
> setenv CMDLINE=console=ttySAC2,115200 loglevel=*8*
> saveenv
> *
> *
> reboot your target, you will get all printk logs.
>
> regards,
> vishnu
>
>
>
>
>
>
>
> On Wed, Jul 14, 2010 at 9:21 AM, Jie <cn.fyo...@gmail.com> wrote:
> > Hi, all
>
> > I've ported the HTC drivers for 2.6.29 to kernel-msm-2.6.32.9 on my
> > HTC Tattoo. After a long time debugging, I completed the compilation
> > without any errors. I've compared the .config files of both HTC(.29)
> > and android(.32.9) carefully, nothing strange was found. However, the
> > phone got stuck after the new boot.img flashed and the adbd had not
> > started yet, so I couldn't find any useful debug messages from the new
> > kernel. My question is how to debug the kernel on my HTC Tattoo
> > without adb. Thanks a lot!
>
> > Regards,
>
> > --
> > unsubscribe: android-kerne...@googlegroups.com<android-kernel%2Bunsu...@googlegroups.com>
> > website:http://groups.google.com/group/android-kernel

Vishnu Pratap Singh

unread,
Jul 14, 2010, 3:50:41 AM7/14/10
to android...@googlegroups.com
yes, you can try it out.




--
Vishnu Pratap Singh

Vishnu Pratap Singh

unread,
Jul 14, 2010, 3:54:23 AM7/14/10
to android...@googlegroups.com
actually if you want you can change the debug level in boot parameters also, this  should be present in your bootloader code.
--
Vishnu Pratap Singh

Jie

unread,
Jul 14, 2010, 4:58:48 AM7/14/10
to Android Linux Kernel Development
But Tattoo device booted with a TATTOO logo screen and no ttys will
appear to check out the dmesg. It seems like a paradox for android
devices.

I've changed the CMDLINE for mkbootimg command but no luck. The
bootloader on HTC Tattoo hasn't been hacked so far. Any suggestions?


PS, I'll try it on emulators.

Regards,

On Jul 14, 3:54 pm, Vishnu Pratap Singh <vishu13...@gmail.com> wrote:
> actually if you want you can change the debug level in boot parameters also,
> this  should be present in your bootloader code.
>
> On Wed, Jul 14, 2010 at 1:20 PM, Vishnu Pratap Singh
> <vishu13...@gmail.com>wrote:
>
>
>
>
>
>
>
>
>
> > yes, you can try it out.
>
> >> <android-kernel%2Bunsu...@googlegroups.com<android-kernel%252Buns...@googlegroups.com>

Vishnu Pratap Singh

unread,
Jul 14, 2010, 5:08:26 AM7/14/10
to android...@googlegroups.com
Dear Jie,

Can you make clear, how you are going to boot prompt, are you using jig box for getting boot prompt or serial logs ?

Vishnu Pratap Singh

unread,
Jul 14, 2010, 5:21:59 AM7/14/10
to android...@googlegroups.com
set BOARD_KERNEL_CMDLINE to no_console_suspend=1 console=<Serial TTY device> <Baud rate of serial port> <loglevel=8> 

Regards
--
Vishnu Pratap Singh

Danke Xie

unread,
Jul 14, 2010, 12:36:18 PM7/14/10
to Android Linux Kernel Development
To Jie,

You are right that when Android boots up, you will see the logo
screen, instead of the Linux console output. I guess this is what you
mean by the "tty". What Vishnu said is you won't get the kernel
messages on the LCD, but you can get it from a host PC to which you
have connected the Android device.

When you specify the "console=<serial tty device>" in the kernel
command line (BoardConfig.mk), printk will send kernel messages to the
tty device -- if it supports the "console" functionality (not all tty
devices do; they have to call "register_console" in the driver).

By default, just by setting console=<serial tty device> won't directly
display the kernel messages, you will need to connect the device to
the host PC (depends on the serial device, it could be a serial cable,
or USB cable), and then find the serial device on the host PC (e.g.,
ttyS0 or ttyUSB1), then you can use "cat" to get the messages.

For a quick start, I would suggest that you try "console=tty0", and
the kernel messages will be dumped to the screen, and of course, if
you only need the kernel, but not the framework for debugging, you can
comment out "service zygote" in system/core/rootdir/init.rc to prevent
the whole system from booting up. Good luck.

Thanks,
Danke

On Jul 14, 2:21 am, Vishnu Pratap Singh <vishu13...@gmail.com> wrote:
> set BOARD_KERNEL_CMDLINE to no_console_suspend=1 console=<Serial TTY device>
> <Baud rate of serial port> <loglevel=8>
>
> Regards
>
> On Wed, Jul 14, 2010 at 2:38 PM, Vishnu Pratap Singh
> <vishu13...@gmail.com>wrote:
>
>
>
>
>
> > Dear Jie,
>
> > Can you make clear, how you are going to boot prompt, are you using jig box
> > for getting boot prompt or serial logs ?
>
> >> > >> > > unsubscribe: android-kerne...@googlegroups.com<android-kernel%2Bunsubscribe@go oglegroups.com>
> >> <android-kernel%2Bunsu...@googlegroups.com<android-kernel%252Bunsubscri b...@googlegroups.com>
>
> >> > >> <android-kernel%2Bunsu...@googlegroups.com<android-kernel%252Bunsubscri b...@googlegroups.com>
> >> <android-kernel%252Buns...@googlegroups.com<android-kernel%25252Bunsub scr...@googlegroups.com>
>
> >> > >> > > website:http://groups.google.com/group/android-kernel
>
> >> > >> --
> >> > >> unsubscribe: android-kerne...@googlegroups.com<android-kernel%2Bunsubscribe@go oglegroups.com>
> >> <android-kernel%2Bunsu...@googlegroups.com<android-kernel%252Bunsubscri b...@googlegroups.com>
>
> >> > >> website:http://groups.google.com/group/android-kernel
>
> >> > > --
> >> > > Vishnu Pratap Singh
>
> >> > --
> >> > Vishnu Pratap Singh
>
> >> --
> >> unsubscribe: android-kerne...@googlegroups.com<android-kernel%2Bunsubscribe@go oglegroups.com>

Hiju

unread,
Jul 14, 2010, 10:03:06 PM7/14/10
to android...@googlegroups.com

Jie

unread,
Jul 17, 2010, 9:41:03 AM7/17/10
to Android Linux Kernel Development
Hi Danke,

Thanks a lot at first. I've enabled the MSM_SERIAL_DEBUGGER_CONSOLE
config in the kernel, and tried tty0 or ttyS0 to forward the android
kernel message to my PC(Debian host), but always no joy. I guess the
kernel would be stuck at the very early stage and usb drivers had not
been powered by the kernel, so I got nothing.

I also have tried android emulator with my customized kernel, even the
emulator UI didn't pop up, as well as the HTC stock kernel image. I
don't know the reason why android emulator always loaded the prebuilt
kernel, not the customized one. That was very disappointed.

Regards,
Jie
Reply all
Reply to author
Forward
0 new messages