调试安卓内核。启动时向安卓内核传递参数[英] Debugging Android kernel: Passing arguments to android kernel while booting

本文是小编为大家收集整理的关于调试安卓内核。启动时向安卓内核传递参数的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

我正在尝试使用 http://bootloader.wikidot.com/android :KGDB .我暂停了下一步:

    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.

有人可以告诉我哪个董事会文件是指的?或者是否有任何其他方法在引导时将这些参数传递给内核?

推荐答案

一个旧的帖子,但我一直在看kgdb所以认为我会分享:

for android,我一直通过bootimg.cfg文件传递启动参数,可以在创建(或更新)引导映像时指定.例如,我正在使用以下内容使用新配置文件和新内核更新现有引导映像:

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

此配置文件中的一个参数是"cmdline",您可以在其中追加选项.

或者,对于快速且肮脏的修改,您可以将"-c"param = value"'选项传递给abootimg,这将允许您在飞行中指定新选项.

其他推荐答案

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

您可以如下更改kernel命令行:

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

saveenv

您可能需要删除console=ttyAS0,115200以便kgdb正常工作.

本文地址:https://www.itbaoku.cn/post/102784.html

问题描述

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?

推荐答案

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.

其他推荐答案

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.