tangrs
tangrs

Reputation: 9930

Debugging kernel very early in boot process

I'm porting the Linux kernel to a new platform and I'm having a little trouble debugging.

The kernel seems to hang after Uncompressing Linux... done, booting the kernel. is printed to UART. I've enabled early printk but it still doesn't print anything new so I'm assuming it's hanging very early in the boot process.

The platform I'm porting to does have a LED I can use to try and pinpoint where it is actually hanging. The problem with this is that it's messy and I don't know when the MMU is going to be switched on so I can't reliably access the port.

Are there other ways to try and pinpoint where the kernel is hanging?

Upvotes: 3

Views: 3906

Answers (3)

SleepyProgrammer
SleepyProgrammer

Reputation: 86

The kernel do have an EARLY_PRINTK config. Enable this option will print debug messages before the standard console is started.

Notice this option depends on the DEBUG_LL option.

Upvotes: 0

Igor Skochinsky
Igor Skochinsky

Reputation: 25288

The MMU is turned on in the kernel bootstrap (head.S), so just add some LED poking around there. See this slightly outdated file for overview of the boot sequence on ARM Linux.

Upvotes: 2

marko
marko

Reputation: 9159

It sounds to me as if the only real option here is a JTAG debug probe. There are some relatively inexpensive devices on the market.

Not sure which family of SoC you're using, but if it's one TI, Code Composer Studio and XDS560 system tracer might be worth a go.

The Pandaboard community is possibly also a good place to look - emphasis here being on low-cost solutions.

Whilst these are both TI focused, the probes often support different vendors' devices.

Upvotes: 1

Related Questions