调试Linux内核pre-DECOM pression阶段 [英] Debug Linux kernel pre-decompression stage

查看:178
本文介绍了调试Linux内核pre-DECOM pression阶段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用GDB调试Linux内核的zImage之前,它是DECOM pressed。内核是在ARM目标上运行,我必须连接到其与GDB服务器存根一个JTAG调试器。目标有加载引导程序。引导加载程序从闪存中读取内核映像,并在 0x20008000 所说的那样在RAM中,然后跳转到该位置。

I am trying to use GDB to debug a Linux kernel zImage before it is decompressed. The kernel is running on an ARM target and I have a JTAG debugger connected to it with a GDB server stub. The target has to load a boot loader. The boot loader reads the kernel image from flash and puts it in RAM at 0x20008000, then branches to that location.

我已经开始GDB并连接到远程目标,然后使用GDB的添加符号文件命令,像这样:

I have started GDB and connected to the remote target, then I use GDB's add-symbol-file command like so:

add-symbol-file arch/arm/boot/compressed/vmlinux 0x20008000 -readnow

当我设置一个断点该地址,但它在陷阱正确的地方 - 权当跳转到内核。然而, GDB显示了弓/ ARM /开机/ COM pressed / head.S中来源错行。它的背后4行。我该如何解决这个问题?

When I set a breakpoint for that address, it does trap at the correct place - right when it branches to the kernel. However, GDB shows the wrong line from the source of arch/arm/boot/compressed/head.S. It's 4 lines behind. How can I fix this?

我也试图加入 -s部分地址选项添加符号文件 -s。开始0x20008000 ;这导致在完全相同的问题

I also have tried adding the -s section addr option to add-symbol-file with -s .start 0x20008000; this results in exactly the same problem.

推荐答案

有与的低电平的调试编译时打印出的东西汇编器宏。你必须确保宏是适合您的主板。

There are assembler macros that print out stuff when compiling with low level debug. You have to make sure the macros are appropriate for your board.

linux-latest/arch/arm$ find . -name debug-macro.S | wc
 56      56    2306

查找您的主板的文件,并确保正确的串行端口寄存器被击中。您可以在仪表$ C $与出c。使用JTAG。这些宏在DECOM preSS code使用。当然,与* CONFIG_DEBUG_LL配置*。

Find the file for your board and ensure the correct serial port registers are hit. You can instrument the code with out using JTAG. These macros are used in the decompress code. Of course configure with *CONFIG_DEBUG_LL*.

最有可能的ATAGs不正确或其他要求之一。结帐的文档/ ARM /引导的,以确保您已设置寄存器正常。注意,最近的内核的新要求发送的 DT 名单。

Most likely the ATAGs are not correct or one of the other requirements. Checkout Documentation/arm/Booting to make sure you have registers set properly. Note there is a new requirement with recent kernels to send a dt list.

这篇关于调试Linux内核pre-DECOM pression阶段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆