首先搭建 standalone 环境
然后 再验证 initr_jumptable
standalone 环境的搭建
其实就是 一个 加载,执行的过程
加载可用 tftp // 当然也可以用 fatload 或者其他方法,之所以用tftp ,是因为 在这种情况下tftp 是最快速的验证方法
执行可用 go
- 1先完成tftp 服务器的安装
- 2再完成网络的设置
- 3再放置一个 可执行的bin 文件到 tftp 服务器的下载目录中
- 4然后在u-boot cmdline 中执行下列code
// 为什么 tftp 到 51000000 , 是因为, 这个地址存在且没被使用
tftp 51000000 2led_c.bin
go 51000000
- 5 观察板子的led
// 结果就是4个led 在闪烁
initr_jumptable 的验证
-
已经验证成功,代码在这里
-
部分代码展示
#include "u-boot.h"
typedef int (*printf_t)(const char *fmt, ...);
static void * memcpy(void * dest,const void *src,unsigned int count)
{
char *tmp = (char *) dest, *s = (char *) src;
while (count--)
*tmp++ = *s++;
return dest;
}
int main(void){
struct jt_funcs ** jt = 0;
jt = (struct jt_funcs **)(&(gd->jt));
printf_t printf;
printf = (*jt)->printf;
printf("SUDEBUG : %s,%s,line = %d\n",__FILE__,__func__,__LINE__);
}