## common/log.c 暂不分析***
文章作者: Liya Huang
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 wdfk-prog的个人博客!
相关推荐
2025-10-03
autoboot
autoboot.cautoboot_command 自动启动命令1234567891011121314151617181920212223242526272829void autoboot_command(const char *s){ debug("### main_loop: bootcmd=\"%s\"\n", s ? s : "<UNDEFINED>"); if (s //有bootcmd && (stored_bootdelay == -2 || //有延迟时间,且没有按键中断 (stored_bootdelay != -1 && !abortboot(stored_bootdelay)))) { bool lock; int prev; lock = autoboot_keyed() && !IS_ENABLED(CO...
2025-10-03
board
[TOC] init/board_init.cboard_init_f_alloc_reserve 板级初始化第一次分配保留空间12345678910111213141516// //Fast alloc// top:栈顶地址,即堆栈指针地址sp传入ulong board_init_f_alloc_reserve(ulong top){ /* Reserve early malloc arena */#ifndef CFG_MALLOC_F_ADDR //没有定义快速分配地址#if CONFIG_IS_ENABLED(SYS_MALLOC_F) //配置系统自动快速分配 top -= CONFIG_VAL(SYS_MALLOC_F_LEN);#endif#endif /* LAST : 保留 GD (四舍五入为 16 字节的倍数) */ top = rounddown(top-sizeof(struct global_data), 16); return top;} board_init_f_init_reserve 板级初始化第一次始化保留 将传...
2025-10-03
command
command.cU_BOOT_CMD12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273#ifdef CONFIG_AUTO_COMPLETE# define _CMD_COMPLETE(x) x,#else# define _CMD_COMPLETE(x)#endif#ifdef CONFIG_SYS_LONGHELP# define _CMD_HELP(x) x,#else# define _CMD_HELP(x)#endif//cmd名称,最大参数个数,是否可重复,cmd调用函数,使用说明,帮助信息#define U_BOOT_CMD(_name, _maxargs, _rep, _cmd, _usage, _help) \ U_BOOT_CMD_COMPLETE(_name, _maxargs, _rep, _cmd, _usage, ...
2025-10-03
export
exports.cjumptable_init malloc分配jt_funcs结构体,并将函数指针赋值给jt_funcs结构体 jt_funcs结构体中的函数指针是在_exports.h中定义的 这些函数在u-boot中是代码段中的函数,在u-boot中是通过函数指针调用的 jt跳转表包含指向导出函数的指针。指向跳转表将传递给独立应用程序。 123456789101112131415161718192021EXPORT_FUNC(get_version, unsigned long, get_version, void)EXPORT_FUNC(getchar, int, getc, void)EXPORT_FUNC(tstc, int, tstc, void)EXPORT_FUNC(putc, void, putc, const char)EXPORT_FUNC(puts, void, puts, const char *)struct jt_funcs {#define EXPORT_FUNC(impl, res, func, ...) res(*func)(__...
2025-10-03
cli
CTL_CH 转换为控制字符1#define CTL_CH(c) ((c) - 'a' + 1) 控制字符通常用于表示特定的控制操作,例如回车、换行、退格等。在 ASCII 码表中,控制字符的值通常在 1 到 31 之间。 cli.ccli_init u_boot_hush_start(); 123456789101112int u_boot_hush_start(void){ if (top_vars == NULL) { top_vars = malloc(sizeof(struct variables)); top_vars->name = "HUSH_VERSION"; top_vars->value = "0.01"; top_vars->next = NULL; top_vars->flg_export = 0; top_vars->flg_read_only = 1; } return 0;} cli_process...
2025-10-03
main
main.c123456789101112131415161718192021/* We come here after U-Boot is initialised and ready to process commands */void main_loop(void){ const char *s; bootstage_mark_name(BOOTSTAGE_ID_MAIN_LOOP, "main_loop"); cli_init(); s = bootdelay_process(); //获取启动延迟时间 //从FDT中获取命令行参数 if (cli_process_fdt(&s)) //设置了bootsecure执行; //不使用命令行,避免被攻击 cli_secure_boot_cmd(s); //自动启动命令 autoboot_command(s); //命令行循环 cli_loop(); panic("No CLI available");}
评论