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

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

 



Hello zhaoyilong,

I do get your mails.

On Wed, Jan 16, 2013 at 04:17:39PM +0800, zhaoyilong wrote:
> CONFIG_DEBUG_ICEDCC is closed by default, so I am sure  the code runs tothe
> following branch:
...
> .macro kputc,val
...
> .macro kphex,val,len
...
> .macro debug_reloc_start
...

What do you mean by "branch"? Those are macro definitions that are
expanded inline by the assembler.


>     To debug this,I want to test the macro kputc provided in this file��
> using ok kernel.

So you have a vendor kernel that works on your board? That is good.


> I add a line "kputc #'a' " after the tag ".text", then make error says
> "undefined reference to `putc' ",it seems that compiler cant find "putc"
> used in
> the definition of macro �kputc�.
>     This is an ok kernel,so I cant say the serial port is not open��can
> this mean "putc" is defined already?.

We don't have your vendor's kernel, so no one except your vendor can
tell. Possibly DEBUG support for head.S is broken in that tree.


> 1?Why the error "  undefined reference to `putc'  " disappeared?

What do you mean by "disappeared"? Do I understand correctly, the vendor
kernel didn't build with DEBUG enabled, and still doesn't? And the
mainline kernel does build? If so, the vendor kernel is broken w.r.t.
DEBUG in head.S.


> 2?Why it stops at"Uncompressing Linux... done, booting the kernel."?

Often it's an exception somewhere. It may be an exception in kputc. So
it's important to know whether kputc works in a working kernel, which
you can't test since the vendor kernel doesn't build with DEBUG in
head.S.


> 3?Can this error ( undefined reference to `putc'  ) mean the serial port is
> not open? Where is it defined ?
> Is it refer to the C function or just an assembly macro?

Since it's called from the assembly code, I'd assume it's a macro. Grep
for it in the mainline kernel and see whether it exists at the same
location in the vendor kernel.


That said, in my experience, the problem start later. So if your goal is
to port the board support code from the vendor kernel to the mainline
one (which is a good idea), start with it: Copy the board support file
to the mainline kernel and run that kernel. If it doesn't work, there is
a couple of things to check, such as machine id and serial console. If
you can get a JTAG debugger (e.g., an OpenOCD one), it would help.


With kind regards,
Baurzhan.
--
To unsubscribe from this list: send the line "unsubscribe linux-embedded" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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