补充 8.4 内核的配置和编译.
Signed-off-by: lion.chan <cy187lion@sina.com>
This commit is contained in:
parent
ce1749b18c
commit
af1154d16c
@ -23,6 +23,7 @@ Linux 分为内核态和用户态,内核态为受保护的代码,用户态
|
||||
## Linux 内核源代码目录结构
|
||||
|
||||
* arch:包含和硬件体系结构相关的代码,每种平台占一个相应的目录,如 i386、ARM、PowerPC、MIPS 等。
|
||||
* arch/\<arch\>/configs:各种 defconfig 文件。
|
||||
* block:块设备驱动程序 I/O 调度。
|
||||
* Documentation:内核各部分的通用解释和注释。
|
||||
* drivers:设备驱动程序,每个不同的驱动占用一个子目录,如 char、block、net、mtd、i2c 等。
|
||||
|
@ -70,7 +70,8 @@
|
||||
|
||||
```bash
|
||||
sudo apt update
|
||||
sudo apt install bison build-essential linux-headers-$(uname -r)
|
||||
sudo apt install linux-headers-$(uname -r)
|
||||
sudo apt install build-essential git git-core libncurses-dev flex bison texinfo zip unzip zlib1g-dev gettext u-boot-tools g++ xz-utils mtd-utils gawk diffstat gcc-multilib python git make gcc g++ diffstat bzip2 gawk chrpath wget cpio texinfo lzop libssl-dev libncurses5-dev libncursesw5-dev
|
||||
```
|
||||
|
||||
## 安装虚拟机工具
|
||||
|
@ -1 +1,46 @@
|
||||
# 8.4 内核的配置和编译
|
||||
|
||||
获取 Linux 内核源码的途径有很多,可以直接从 <www.kernel.org> 下载,或者来自于 BSP 厂商提供的软件包。
|
||||
|
||||
内核源码解压后,需要经过配置才能够编译。
|
||||
|
||||
```bash
|
||||
# 生成 .config
|
||||
make ARCH=arm yuzhen_iot_defconfig
|
||||
# 进入内核配置页面
|
||||
make menuconfig
|
||||
```
|
||||
|
||||

|
||||
|
||||
```bash
|
||||
# 指定 LOCALVERSION 并以 n 个进程进行编译。
|
||||
make LOCALVERSION="" -j<n>
|
||||
# 编译独立内核模块并安装到指定目录下。
|
||||
make modules_install INSTALL_MOD_PATH=<target dir>
|
||||
# 生成设备树文件。
|
||||
make dtbs
|
||||
# 清除之前编译的可执行文件及配置文件。
|
||||
make clean
|
||||
# 类似 make clean,但同时也将configure生成的文件全部删除掉,包括Makefile。
|
||||
make distclean
|
||||
```
|
||||
|
||||
## i2som PanGuBoard
|
||||
|
||||
```bash
|
||||
chmod a+x i2som-image-weston-openstlinux-weston-pangu-x86_64-toolchain-2.6-snapshot.sh
|
||||
./i2som-image-weston-openstlinux-weston-pangu-x86_64-toolchain-2.6-snapshot.sh
|
||||
source /opt/st/pangu/2.6-snapshot/environment-setup-cortexa7t2hf-neon-vfpv4-openstlinux_weston-linux-gnueabi
|
||||
|
||||
tar -xvf linux-st-44c0cc69.tar.gz
|
||||
cd linux-st
|
||||
make i2som_panguboard_defconfig
|
||||
make uImage LOADADDR=0xC2000040 -j<n>
|
||||
make dtbs
|
||||
```
|
||||
|
||||
### 参考链接
|
||||
|
||||
* [配置开发环境](https://i2som.atlassian.net/wiki/spaces/PanGuBoard/pages/389251162)
|
||||
* [Linux 编译](https://i2som.atlassian.net/wiki/spaces/PanGuBoard/pages/389251165/Linux)
|
||||
|
BIN
Chapter8_SOC_与_Linux/imgs/8.4_内核的配置和编译/001.png
Normal file
BIN
Chapter8_SOC_与_Linux/imgs/8.4_内核的配置和编译/001.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 145 KiB |
Loading…
x
Reference in New Issue
Block a user