centos 内核调试技巧

centos 内核调试技巧

参考网址

参考命令手册

[lhx@lhx-master ~]$ man dracut.cmdline
[lhx@lhx-master ~]$ man dracut
[lhx@lhx-master ~]$ man bootup

修改grub.cfg

  • 通过串口调试内核(上位机需要安装minicom工具包)
....
linux   /vmlinuz-4.19.113-300.axs7.mips64el root=UUID=7f35f299-b9ee-46c7-bb1b-b7ae7464c764 ro crashkernel=auto  loglevel=7 console=ttyS0,115200 console=tty0
....
  • 通过dracut中提供的shell进行调试(参见dracut.cmdline / dracut的帮助文档)
.....
linux16 /vmlinuz-3.10.0-862.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap LANG=zh_CN.UTF-8 rd.debug rd.break=cleanup
.....

上位机minicom配置

[root@localhost ~]# minicom -s ==>进入配置界面

            +-----[configuration]------+
            | Filenames and paths      |
            | File transfer protocols  |
            | Serial port setup        |
            | Modem and dialing        |
            | Screen and keyboard      |
            | Save setup as dfl        |
            | Save setup as..          |
            | Exit                     |
            | Exit from Minicom        |
            +--------------------------+
    +-----------------------------------------------------------------------+
    | A -    Serial Device      : /dev/ttyUSB0                              | ==>插上usb转串口的线在上位机上就可以在/dev下出现ttyUSB0 设备
    |                                                                       |
    | C -   Callin Program      :                                           |
    | D -  Callout Program      :                                           |
    | E -    Bps/Par/Bits       : 115200 8N1                                |
    | F - Hardware Flow Control : Yes                                       |
    | G - Software Flow Control : No                                        |
    |                                                                       |
    |    Change which setting?                                              |
    +-----------------------------------------------------------------------+

            
posted @ 2021-08-31 14:44  刘大侠GG_B  阅读(224)  评论(0编辑  收藏  举报