linux课程-指令

本文档介绍了Linux内核的配置和启动流程,包括使用`defconfig`和厂家配置文件来定制内核,并通过`make menuconfig`进行图形化配置。此外,还详细展示了Busybox的配置和安装过程,用于构建根文件系统。内容涵盖了从内核编译到根文件系统初始化的重要步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

003课:第001节_内核启动流程分析之编译体验

book@www.100ask.org:/work/system/linux-2.6.22.6$ find -name “defconfig”
book@www.100ask.org:/work/system/linux-2.6.22.6$ find -name “*defconfig”
第二条多了通配符,能够搜索出更多的东西

book@www.100ask.org:/work/system/linux-2.6.22.6$ cd ./arch/arm/configs
book@www.100ask.org:/work/system/linux-2.6.22.6/arch/arm/configs$ ls

book@www.100ask.org:/work/system/linux-2.6.22.6$ make s3c2410_defconfig

备注:configuration written to .config 所有的配置项被写到.config里面去了

make menuconfig /* 读取.config文件,出现一个配置界面 */
第三种方法:使用厂家提供的配置文件
book@www.100ask.org:/work/system/linux-2.6.22.6$ ls config_ok
book@www.100ask.org:/work/system/linux-2.6.22.6$ cp config_ok .config
book@www.100ask.org:/work/system/linux-2.6.22.6$ make menuconfig

生成uImage,uImage:内核+头部。uboot支持的内核为 头部+内核

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-96SGHyez-1623026699934)(file:///C:\Users\chguy\AppData\Roaming\Tencent\Users\279896210\QQ\WinTemp\RichOle\CTZ[P$[37KO%2H3TAP880%5.png)]

003课:第002节_内核启动流程分析之配置

book@www.100ask.org:/work/system/linux-2.6.22.6$ vi .config /* 查看 .config文件 */

/DM9000 /* 在当前文档查找 DM9000 */

book@www.100ask.org:/work/system/linux-2.6.22.6$ grep “CONFIG_DM9000” * -nwR /* 查找哪些文件使用CONFIG_DM9000 */

003课:第003节_内核启动流程分析之Makefile

F:\006_u-boot(JZ2440V3)\system\linux-2.6.22.6\Documentation\kbuild makefiles.txt /* 内核makefile讲解 */

004课:第003节_构建根文件系统之busybox
tar xjf busybox-1.7.0.tar.bz2 /* 解压缩 /
book@www.100ask.org:/work/system/busybox-1.7.0$ make menuconfig
界面配置完成以后执行 make
book@www.100ask.org:/work/system/busybox-1.7.0$ ls /work/nfs_root
book@www.100ask.org:/work/system/busybox-1.7.0$ mkdir -p /work/nfs-root/first_fs /
* 创建 /
book@www.100ask.org:/work/system/busybox-1.7.0$ make CONFIG_PREFIX=/work/nfs_noot/first_fs install /
* 安装first_fs 文件夹 /
book@www.100ask.org:/work/system/busybox-1.7.0$ cd /work/nfs-root/first_fs /
* 到该文件夹下 */

004课:第004节_构建根文件系统之构建根文件系统
book@www.100ask.org:/work/nfs_root/first_fs$ ls /dev/console /dev/null -l
crw------- 1 root root 5, 1 6月 2 06:47 /dev/console
crw-rw-rw- 1 root root 1, 3 6月 2 06:46 /dev/null
book@www.100ask.org:/work/nfs_root/first_fs$ mkdir dev
book@www.100ask.org:/work/nfs_root/first_fs$ cd dev/
book@www.100ask.org:/work/nfs_root/first_fs/dev$ mknod console c 5 1
mknod: ‘console’ : operation not permitted
book@www.100ask.org:/work/nfs_root/first_fs/dev$ sudo mknod console c 5 1
book@www.100ask.org:/work/nfs_root/first_fs/dev$ sudo mknod null c 1 3

ork/nfs_root/first_fs/dev$ sudo mknod null c 1 3

book@www.100ask.org:/work$ rm -rf nfs-root /* 删除文件夹 */

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值