Linux kernel hangs at “Starting kernel …”

armbootembeddedlinux-kernelu-boot

I have enabled Secure Boot on an embedded device successfully. The problem is that when I am booting in this mode the process seems to get stuck right after the line:

Starting kernel ...

once U-boot has copied the kernel in memory and issued a bootm command.

In a debugger I am able to capture that the PC is stuck on a yield instruction followed by an assignment to pc = pc-4 — so essentially a loop.

I have never brought up linux at this low of a level before so I am unsure where to begin looking. I did notice, though, that I was able to successfully boot the kernel image when not in secure mode, so this might be a more appropriate questions for the vendor.

1) In general, where can I find U-boot diagnostic information regarding the execution hand-off stage?

2) At what point is execution fully given to the kernel? i.e. when is U-boot defunct?

Best Answer

May be you can dump the memory of the linux early prints using following procedure. The cause may be, kernel is booting but it hung before console init. Also put prints in kernel entry point of uboot and confirm control is hand over to kernel.

Find the System.map file. Use below command to identify the log_buf address:

grep __log_buf System.map

This will output something like

c0352d88 B __log_buf

Warm boot the board (Contents in RAM should not be erased).

In Uboot dump the memory of __log_buf (c0352d88). It will dump the Kernel console prints. So you can identify where the extact hung happens.

Related Question