作为一名过来人,uboot、kernel对每个学linux的来说都有很深的情谊,因为它们是一个系统跑起来的最基础,每个学linux的都会首先接触到。而它们本身就是一个精美的小系统,里边代码所体现的逻辑、算法以及每个绝妙的C知识点都让你沉醉其中。
uboot 属于bootloader的一种,是用来引导启动内核的,它的最终目的就是,从flash中读出内核,放到内存中,启动内核。具体内容如下:
1 uboot 的介绍及系统结构
1.1 uboot 介绍
1.2 获取 uboot
1.3 uboot 体系结构
1.3.1 uboot 目录结构
2 uboot 的启动过程及工作原理
2.1 启动模式介绍
2.2 阶段 1 介绍
2.2.1 定义入口
2.2.2 设置异常向量
2.2.3 设置 CPU 的模式为 SVC 模式
2.2.4 关闭看门狗
2.2.5 禁掉所有中断
2.2.6 设置以 CPU 的频率
2.2.7 设置 CP15
2.2.8 配置内存区控制寄存器
2.2.9 安装 UBOOT 使的栈空间
2.2.10 BSS 段清 0
2.2.11 搬移 Nand Flash 代码
2.2.12 进入 C 代码部分
2.3 阶段 2 的 C 语言代码部分
2.3.1 调用一系列的初始化函数
2.3.2 初始化网络设备
2.3.3 进入主 UBOOT 命令行
2.4 代码搬运
3 uboot 的移 植过程
3.1 环境
3.2 步骤
3.2.1 修改 Makefile
3.2.2 在 board 子目录中建立 crane2410
3.2.3 在 include/configs/中建立配置头文件
3.2.4 指定交叉编译工具的路径
3.2.5 测试编译能否成功
3.2.6 修改 lowlevel_init.S 文件
2.9 UBOOT 的 Nand Flash 移植
3.2.8 重新编译 uboot
3.2.9 把 uboot 烧入 flash
![07a37319-1823-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/07a37319-1823-eb11-8da9-e4434bdf6706.png)
![08a37319-1823-eb11-8da9-e4434bdf6706.png](http://p02.5ceimg.com/content/08a37319-1823-eb11-8da9-e4434bdf6706.png)
![09a37319-1823-eb11-8da9-e4434bdf6706.png](http://p01.5ceimg.com/content/09a37319-1823-eb11-8da9-e4434bdf6706.png)
![0aa37319-1823-eb11-8da9-e4434bdf6706.png](http://p03.5ceimg.com/content/0aa37319-1823-eb11-8da9-e4434bdf6706.png)
![0ba37319-1823-eb11-8da9-e4434bdf6706.png](http://p02.5ceimg.com/content/0ba37319-1823-eb11-8da9-e4434bdf6706.png)
![0ca37319-1823-eb11-8da9-e4434bdf6706.png](http://p04.5ceimg.com/content/0ca37319-1823-eb11-8da9-e4434bdf6706.png)
![0da37319-1823-eb11-8da9-e4434bdf6706.png](http://p01.5ceimg.com/content/0da37319-1823-eb11-8da9-e4434bdf6706.png)
![0ea37319-1823-eb11-8da9-e4434bdf6706.png](http://p05.5ceimg.com/content/0ea37319-1823-eb11-8da9-e4434bdf6706.png)
![10a37319-1823-eb11-8da9-e4434bdf6706.png](http://p02.5ceimg.com/content/10a37319-1823-eb11-8da9-e4434bdf6706.png)
![11a37319-1823-eb11-8da9-e4434bdf6706.png](http://p03.5ceimg.com/content/11a37319-1823-eb11-8da9-e4434bdf6706.png)