[U-Boot] debug uboot from ram for x86 board
Lance Zhang
Lance.Zhang at taihootech.com
Fri Dec 26 07:45:07 CET 2008
> I carefully read the codes related to the do_go function, and I find
that(u
> boot 1.1.6):
> In do_go() functions:
> #if defined(CONFIG_I386)
> /*
> * x86 does not use a dedicated register to pass the pointer
> * to the global_data
> */
> argv[0] = (char *)gd;
> #endif
>
> But in app_startup function:
> void app_startup(char **argv)
> {
> unsigned long * cp = &__bss_start;
>
> /* Zero out BSS */
> while (cp < &_end) {
> *cp++ = 0;
> }
>
> #if defined(CONFIG_I386)
> /* x86 does not have a dedicated register for passing
global_data */
> global_data = (gd_t *)argv[-1];
> jt = global_data->jt;
> #endif
> }
>
> The gd is not in the same place :see do_go is argv[0], and app_startup
is (gd_t
> *)argv[-1].
>
> But later I modified the global_data = (gd_t *)argv[-1]; in
app_startup
> function to global_data = (gd_t *)argv[0], the change still does not
make sense.
>
> Any ideas? Maybe I should change the argv[0] = (char *)gd; in do_go
function
> to argv[-1] = (char *)gd;
>
Later, I tried remove the function bodies, and the main function like
this:
int _main (int argc, char *argv[])
{
return (8);
}
And got the following result:
boot > go 01000000
## Starting application at 0x01000000 ...
## Application terminated, rc = 0x8
I am sure app_startup and do_go are not consistent, so I can not use any
printf or some other function calls.
Currently I can not update the flash as I do not have jtag tools. Later
I will update flash and see if it could fix the problem.
Thanks in advance
More information about the U-Boot
mailing list