Re: How to use DEBUG macros in compressed/head.S

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On 01/16/2013 02:17:39 AM, zhaoyilong wrote:
When I open the macro DEBUG in the front of  file
arch/arm/boot/decompressed/head.S,the kernel runs and stops at"Uncompressing
Linux... done, booting the kernel."

No, that's just the last thing it output.

I seldom find other people's debug code useful. I stick a printf() variant in the code at a place I want to see what it's doing, and then I know what the output means. I only enable their debug code if I'm sending the output to the person who wrote said debug code. (There are exceptions, but they're exceptions to a useful rule of thumb.)

At this level, you can do direct writes to the serial chip ala:

Note that's for qemu, which pauses when it gets a port write. For real hardware you need to check the status bit before sending the next character, basically spinning on a port read until the relevant bit gets set/cleared to indicate the hardware's done with the last thing you sent it. I don't remember the check off the top of my head (last time I needed it I dug it out of the uboot source), but if you're just debugging you can do a delay loop between each write. (This is assuming your serial port is already set to the right speed, which it had to be to spit out the above message. Presumably the bootloader did it for you.)

(And this is assuming your board layout has an 8250/16550a UART variant mapped at a knowable address, which basically they all do because it's dirt simple and the patents expired years ago. They get weird and bespoke about setting buffer sizes but you don't really have to care at this level.)

Most likely you can find whatever spit out the text you _did_ see, and copy it to produce more text from places in the code you'd like visibility into.

To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Index of Archives]     [Gstreamer Embedded]     [Linux MMC Devel]     [U-Boot V2]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux ARM Kernel]     [Linux OMAP]     [Linux SCSI]

  Powered by Linux