Debugging Android kernel: Passing arguments to android kernel while booting
Asked Answered
S

2

0

I am trying to get kgdb working with Android kernel using http://bootloader.wikidot.com/android:kgdb. I got stucked at following step:

    Configure kernel command line

    Specify ttyGS0 as the kgdboc device. Add the following into the kernel command line (possibly in BoardConfig.mk)

    kgdboc=ttyGS0 kgdbretry=4

    The second option "kgdbretry=4" is a new parameter added to kgdboc.c. 
    It means that if kgdb cannot find the device "ttyGS0" in early boot, 
    it will retry once after the specified number of seconds. 
    This is a work-around if the USB device is not immediately initialized during system boot.

Could anybody please tell me which BoardConfig.mk is it referring? Or is there any other method for passing these arguments to the kernel while booting?

Stilly answered 24/9, 2013 at 5:36 Comment(1)
There will be no uniform answer for "Android" - it depends on the bootloader and related systems used on a given device and install.Closelipped
P
0

An old post, but I've been looking at KGDB recently so thought I'd share:

For Android, I've been passing boot params in via the bootimg.cfg file which can be specified when you create (or update) your boot image. For example, I am updating an existing boot image with a new config file and new kernel using the following:

abootimg -u boot.img -f bootimg.cfg -u zImage-dtb

One of the params within this config file is "cmdline" where you can append your options.

Alternatively, for a quick and dirty modification you can pass the '-c "param=value"' option to abootimg which will allow you to specify new options on the fly.

Pastry answered 30/5, 2015 at 12:9 Comment(1)
This would be more helpful if it contained a pointer to bootimg.cfg documentation (or an existing bootimg.cfg that can be edited).Questa
C
-1

http://www.stlinux.com/u-boot/kernel-booting

You can Change kernel command line like this:

setenv bootargs mem=128M kgdboc=ttyGS0 kgdbretry=4

saveenv

you may need to delete console=ttyAS0,115200 for kgdb to work properly.

Cordwood answered 24/9, 2013 at 5:47 Comment(1)
Note that this answer is specific to some unspecified platform. How the kernel gets loaded is not standard across Android in general.Closelipped

© 2022 - 2024 — McMap. All rights reserved.