bootretry
[TOC] BOOT_RETRY 允许 U-Boot 命令提示符超时并尝试以再次启动。 如果找到环境变量 “bootretry”,则使用其值,否则重试超时为CONFIG_BOOT_RETRY_TIME。 CONFIG_BOOT_RETRY_MIN 是可选的,并且默认为 CONFIG_BOOT_RETRY_TIME。所有时间均以秒为单位。 如果重试超时为负数,则 U-Boot 命令提示符永不超时。否则,它将被强制为至少CONFIG_BOOT_RETRY_MIN 秒。如果没有有效的 U-Boot 命令在指定时间之前输入,则引导延迟序列为重新启动。U-Boot 执行的每个命令都会重新启动超时。 如果CONFIG_BOOT_RETRY_TIME < 0,则该功能存在,但除非环境变量 “bootretry” >= 0,否则不会执行任何操作。 bootretry_init_cmd_timeout 从env中获取bootretry的值,如果没有配置,则使用CONFIG_BOOT_RETRY_TIME的值 如果0 < CONFIG_BOOT_RETRY_TIME &...
bootz
[TOC] bootz12345678910111213141516171819U_BOOT_LONGHELP(bootz, "[addr [initrd[:size]] [fdt]]\n" " - boot Linux zImage stored in memory\n" "\tThe argument 'initrd' is optional and specifies the address\n" "\tof the initrd in memory. The optional argument ':size' allows\n" "\tspecifying the size of RAW initrd.\n"#if defined(CONFIG_OF_LIBFDT) "\tWhen booting a Linux kernel which requires a flat device-tree\n" &quo...
image
image-board.cgenimg_get_kernel_addr_fit1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253/** * genimg_get_kernel_addr_fit() - 解析 FIT 说明符 * * 从通常为第一个的字符串中获取真正的内核起始地址 bootm/bootz 的 argv * 这些情况根据 @img_addr 的值进行处理: * NULL:返回 image_load_addr,不设置最后两个参数 * “<addr>”:返回地址 * 对于 FIT: * “[<addr>]#<conf>”:返回地址(或image_load_addr)、 * 将 fit_uname_config 设置为 Config Name * “[<addr>]:<subimage>”:返回地址(或 image_load_addr)并设置 * fit_uname_ker...
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...
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 板级初始化第一次始化保留 将传...
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...
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, ...
console
common/console.cputs 输出字符串 暂不分析***
dmalloc
dlmalloc.cdlmalloc 是 Doug Lea 实现的一种动态内存分配器,广泛用于嵌入式系统和操作系统中。它以其高效和灵活的内存管理机制而著称。以下是 dlmalloc 的工作原理和关键概念: 内存池(Memory Pool)dlmalloc 使用一个或多个内存池来管理内存。内存池是由操作系统分配的一大块连续内存区域,dlmalloc 在这个区域内进行内存分配和释放操作。 空闲块和已分配块(Free and Allocated Blocks)内存池被分割成多个块,每个块可以是空闲的或已分配的。每个块都有一个头部(header),包含块的大小和状态(空闲或已分配)。 双向链表(Doubly Linked List)空闲块通过双向链表链接在一起。每个空闲块的头部包含指向前一个和后一个空闲块的指针。这使得 dlmalloc 可以高效地插入和删除空闲块。 分割和合并(Splitting and Coalescing)分割:当请求的内存大小小于某个空闲块的大小时,dlmalloc 会将这个空闲块分割成两个块,一个满足请求大小,另一个继续作为空闲块。合并:当释放一个块时,...
event
event.c event 声明事件类型12345678910//复杂事件声明#define EVENT_SPY_FULL(_type, _func) \ __used ll_entry_declare(struct evspy_info, _type ## _3_ ## _func, \ evspy_info) = _ESPY_REC(_type, _func)//简单事件声明#define EVENT_SPY_SIMPLE(_type, _func) \ __used ll_entry_declare(struct evspy_info_simple, \ _type ## _3_ ## _func, \ evspy_info) = _ESPY_REC_SIMPLE(_type, _func) notify_static 以静态方式通知事件12345678910111213141516171819202122232425262728293031323334static int notify_static(struct event *ev){ struct ...








