技术专栏
【海思内核驱动篇】-(3)uboot命令行ctrl+c
【海思内核驱动篇】-(3)uboot命令行ctrl+c
1.前言
海思uboot默认进入到uboot命令行是任意键进入,这样有可能串口输入会影响uboot正常启动,导致进入到uboot命令行模式。这个可以在uboot源码中修改。
2.修改uboot命令行
uboot进入uboot命令行模式任意键进去,现在要改成ctrl+c进入。
1.上电进board_init_r-->init_sequence_r-->run_main_loop
-->main_loop-->bootdelay_process-->autoboot_command主要就是这么个流程
2.具体怎么决定是进命令行还是启动kernel是在autoboot_command决定的
如果要设置组合按键,需要修改的是/common/main.c 文件,具体调用流程自行跟踪。
static int __abortboot(int bootdelay)
{
int abort = 0;
unsigned long ts;
#ifdef CONFIG_MENUPROMPT
printf(CONFIG_MENUPROMPT);
#else
printf("Hit ctrl+c to stop autoboot: %2d ", bootdelay);
#endif
#if defined CONFIG_ZERO_BOOTDELAY_CHECK //20200518
/*
* Check if key already pressed
*/
if (tstc()) { /* we got a key press */
(void) getc(); /* consume input */
puts("\b\b\b 0");
abort = 1; /* don't auto boot */
}
#endif
while ((bootdelay > 0) && (!abort)) {
--bootdelay;
/* delay 1000 ms */
ts = get_timer(0);
do {
if (tstc()) { /* we got a key press */
if(0x03 == getc()){ //新增 ctrl+c ascii为0x03 20200518
abort = 1; /* don't auto boot */
bootdelay = 0; /* no more delay */
# ifdef CONFIG_MENUKEY
menukey = getc();
# else
(void) getc(); /* consume input */
# endif
break;
}
}
udelay(10000);
} while (!abort && get_timer(ts) < 1000);
printf("\b\b\b%2d ", bootdelay);
}
putc('\n');
return abort;
}
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
<
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
1
1
评论
打赏
- 分享
- 举报
评论
1个
手气红包
相关专栏
-
浏览量:10108次2020-08-30 15:32:16
-
浏览量:3710次2020-08-30 15:59:35
-
浏览量:6177次2021-12-10 16:15:34
-
浏览量:1289次2023-12-21 17:20:27
-
浏览量:3483次2020-08-30 15:44:39
-
浏览量:4250次2020-08-30 12:27:19
-
浏览量:6247次2017-12-12 21:37:12
-
浏览量:3635次2020-08-30 10:04:00
-
浏览量:2179次2020-08-14 18:20:33
-
浏览量:4102次2020-08-31 08:41:19
-
浏览量:5533次2020-08-29 21:41:37
-
浏览量:3966次2020-07-17 16:50:14
-
浏览量:3942次2020-08-30 09:57:38
-
浏览量:1895次2023-06-12 14:34:37
-
浏览量:1576次2023-10-12 14:39:21
-
浏览量:7344次2020-08-14 11:34:19
-
浏览量:5831次2017-11-21 13:45:07
-
浏览量:1591次2023-12-06 12:30:38
-
浏览量:2300次2020-12-17 09:40:04
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者

xclshwd
您的支持将鼓励我继续创作!
打赏金额:
¥1

¥5

¥10

¥50

¥100

支付方式:

举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注
学习了。