当前位置: 首页 > news >正文

U-boot下netconsole实现

U-boot下netconsole实现


参考1.函数main_loop和u-boot命令执行

上面的do-while会循环命令解析器的"命令输入解析–执行"运行模式。
其中的函数run_list执行如下的函数调用流程:run_list–>run_list_real–>run_pipe_real->cmd_process

源码跟读

# u-boot/common/main.cvoid main_loop(void)cli_init();...s = bootdelay_process();	...autoboot_command(s);cli_loop();	# u-boot/common/board_r.c	
;...
static init_fnc_t init_sequence_r[] = {...stdio_init_tables,INIT_LIST_HEAD(&(devs.list));initr_serial,serial_initialize();	serial_init();		...stdio_add_devices,drv_system_init ();...strcpy (dev.name, "serial");dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;dev.putc  = stdio_serial_putc;		#ifdef CONFIG_NETCONSOLEdrv_nc_init ();...strcpy(dev.name, "nc");dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT;dev.start = nc_stdio_start;dev.putc  = nc_stdio_putc;...run_main_loop,for (;;)main_loop();		// 进入交互终端void main_loop(void)			cli_init();			#ifdef CONFIG_HUSH_PARSER		// 使用HUSH解释器u_boot_hush_start();if (top_vars == NULL) {top_vars = malloc(sizeof(struct variables));top_vars->name  = "HUSH_VERSION";			// 使用命令showvar可查看 top_vars->value = "0.01";		...s = bootdelay_process();s = env_get("bootdelay");		// 获取bootdelay信息bootdelay = s ? (int)simple_strtol(s, NULL, 10) : CONFIG_BOOTDELAY;#ifdef CONFIG_OF_CONTROLbootdelay = fdtdec_get_config_int(gd->fdt_blob, "bootdelay", bootdelay);			// 支持fdt中修改的bootdelay;...s = env_get("bootcmd");			// 获取默认引导命令;process_fdt_options(gd->fdt_blob);	// 获取:kernel-offset、rootdisk-offset信息;stored_bootdelay = bootdelay;	// 记录引导倒计时:bootdelayreturn s;						// 返回引导命令:bootcmd...autoboot_command(s);				// 执行引导命令:bootcmdif (stored_bootdelay != -1 && s && !abortboot(stored_bootdelay)) {		// 有设置bootdelay,引导命令非空,无人为打断run_command_list(s, -1, 0);			// 执行autoboot_command_fail_handle();cli_loop();							// 自动引导未正常进行后,进入命令行交互#ifndef CONFIG_CONSOLE_DISABLE_CLI
void cli_loop(void)#ifdef CONFIG_HUSH_PARSER				// rk3568_defconfig, 开启parse_file_outer();struct in_str input;setup_file_in_str(&input);i->peek = file_peek;i->get  = file_get;				// 与b_getch 关联:#define b_getch(input) ((input)->get(input))...rcode = parse_stream_outer(&input, FLAG_PARSE_SEMICOLON);			// flags标记:分号...do {...rcode = parse_stream(&temp, &ctx, inp, flag & FLAG_CONT_ON_NEWLINE ? -1 : '\n');/* This point is never reached */	// 不应运行到此for (;;);
http://www.lryc.cn/news/187106.html

相关文章:

  • Unity设计模式——原型模式
  • leetcode 96 不同的二叉搜索树
  • http发送和接收图片json文件
  • MM-Camera架构-ProcessCaptureRequest 流程分析
  • 196、管理 RabbitMQ 的用户
  • 【已解决】Python读取sql数据,报错:Not an executable object,解决方案
  • STM32 CubeMX ADC采集(HAL库)
  • [UUCTF 2022 新生赛]ezpop - 反序列化+字符串逃逸【***】
  • Selenium进行无界面爬虫开发
  • 万宾荣获深圳应博会“全球应急产业先锋奖”创始人发表峰会演讲
  • 某果的一个小参数分析
  • java学习--day22(进程线程)
  • 对音频切分成小音频(机器学习用)
  • TensorFlow案例学习:对服装图像进行分类
  • 单目3D目标检测——SMOKE 模型推理 | 可视化结果
  • C++智能指针shared_ptr使用详解
  • 基于Java的个性化旅游攻略系统设计与实现(源码+lw+ppt+部署文档+视频讲解等)
  • 中国替代方案探索:替代谷歌企业邮箱的选择
  • Holographic MIMO Surfaces (HMIMOS)以及Reconfigurable Holographic Surface(RHS)仿真
  • RK3568笔记一:RKNN开发环境搭建
  • 设计模式 - 行为型模式:策略模式(概述 | 案例实现 | 优缺点 | 使用场景)
  • rancher部署pv、pvc、离线部署nfs
  • 视频拍摄教程分享
  • IP组成,分类,子网划分
  • Python视频剪辑-Moviepy视频内容变换技术
  • OceanBase 数据库入门知识
  • 自定义无边框窗口
  • 【网络安全 --- kali2023安装】超详细的kali2023安装教程(提供镜像资源)
  • 机器学习笔记(二)
  • Java @Override 注解