简体   繁体   English

__turn_mmu_on阶段之后如何调试Linux内核启动过程?

[英]How to debug Linux kernel Boot process after __turn_mmu_on stage?

I am trying to Boot Android 4.0.1 (Ice Cream Sandwich), based on Linux kernel 3.0.1 on a custom hardware. 我正在尝试在自定义硬件上基于Linux内核3.0.1引导Android 4.0.1(冰淇淋三明治)。

I am able to debug the Linux Kernel 3.0.1 boot process till __enable_mmu function defined in head.S, using serial port. 我可以使用串行端口调试Linux Kernel 3.0.1的启动过程,直到在head.S中定义的__enable_mmu函数为止。

But as soon as __turn_mmu_on function is performed I am not able to debug the boot process. 但是一旦执行__turn_mmu_on函数,我就无法调试引导过程。

I have gone through linux-arm-kernel mailing list archives & i have tried their printascii() work around. 我查看了linux-arm-kernel邮件列表档案,并尝试了他们的printascii()解决方法。 But still I am not able to see any boot logs on serial console after __turn_mmu_on . 但是在__turn_mmu_on之后,我仍然无法在串行控制台上看到任何启动日志。

Here I am able to get logs before __turn_mmu_on so my serial console port is working fine. 在这里,我可以在__turn_mmu_on之前获取日志,因此我的串行控制台端口可以正常工作。

And one more thing - I don't have JTAG. 还有一件事-我没有JTAG。

Can anyone provide the solution how to debug Linux kernel Boot process after turn MMU on? 谁能提供打开MMU后如何调试Linux内核启动过程的解决方案?

- --

Hi, there, I have no idea on your question, but some thoughts. 嗨,在那里,我对您的问题一无所知,但有一些想法。

in Linux source code, there are some points below, 在Linux源代码中,下面有几点,

/* * Enable the MMU. / * *启用MMU。 This completely changes the structure of the visible 这完全改变了可见光的结构
* memory space. *内存空间。 You will not be able to trace execution through this. 您将无法通过此跟踪执行。
* If you have an enquiry about this, please check the linux-arm-kernel *如果对此有疑问, 检查linux-arm-kernel
* mailing list archives BEFORE sending another post to the list. *在将另一个帖子发送到列表之前,邮件列表存档。
* *
* r0 = cp#15 control register * r0 = cp#15控制寄存器
* r1 = machine ID * r1 =机器ID
* r2 = atags or dtb pointer * r2 =标记或dtb指针
* r9 = processor ID * r9 =处理器ID
* r13 = virtual address to jump to upon completion * r13 =完成时跳转到的虚拟地址
* *
* other registers depend on the function called upon completion *其他寄存器取决于完成时调用的功能
*/ .align 5 * / .align 5
.pushsection .idmap.text, "ax" .pushsection .idmap.text,“ ax”
ENTRY(__turn_mmu_on) ENTRY(__ turn_mmu_on)
.... ....
.... ....
__turn_mmu_on_end: __turn_mmu_on_end:
ENDPROC(__turn_mmu_on) ENDPROC(__ turn_mmu_on)
.popsection .popsection

So, it seems very normal that you can not trace the flow after the __turn_mmu_on is called. 因此,在调用__turn_mmu_on之后无法跟踪流似乎很正常。

But, with your result of using printascii(), have you debugged why it cannot be available to you? 但是,使用printascii()的结果是,您是否调试了为什么无法使用它?

Do you know whether or not printascii() is easy to use without any configures? 您是否知道printascii()是否易于使用而无需任何配置? Are there any necessary settings prior to using it? 使用前是否有任何必要的设置? Have you provided a runnable environment for it? 您是否为此提供了可运行的环境?

Because of lack of JTAG, printing may be the only one method left, so debugging printascii() may be a MUST for you. 由于缺少JTAG,打印可能是剩下的唯一一种方法,因此调试printascii()可能对您来说是必须的。

Thanks. 谢谢。

Most probably you have a memory translation configuration issue. 最有可能您遇到了内存转换配置问题。 After turning on the MMU, the serial device must be accessed using a virtual address that has been mapped to the original hardware address (that you were using previously.) 在打开MMU之后,必须使用已映射到原始硬件地址(您以前使用的虚拟地址)的虚拟地址访问串行设备。

To debug your problem, you need to make sure that you have set up the correct virtual address and that the memory mapping configuration is that of a device. 要调试问题,您需要确保设置了正确的虚拟地址,并且内存映射配置是设备的。 Generally devices memory mapping is done statically so if you can't see what is wrong in the source file you should also be able to output the values just before the call to __enable_mmu . 通常,设备内存映射是静态完成的,因此,如果您看不到源文件中的错误,则还应该能够在调用__enable_mmu之前输出值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM