kernel移植(linux5.1571移植)
移植版本5.1571
1、拿到源码编译测试
1、下载源码
2、编译123456#!/bin/bashpath="/home/ygc/Desktop/linux-gcc/2021-6ull/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin"make ARCH=arm CROSS_COMPILE=${path}/arm-none-linux-gnueabihf- distcleanmake ARCH=arm CROSS_COMPILE=${path}/arm-none-linux-gnueabihf- imx_v7_defconfigmake ARCH=arm CROSS_COMPILE=${path}/arm-none-linux-gnueabihf- menuconfigmake ARCH=arm CROSS_COMPILE=${path}/arm-none-linux-gnueabihf- all -j16
测试编译。链接 ...
rootfs移植(rootfs移植)
1、下载源码,官网下载比较简单,略
1-1、添加中文支持printable_string.c中将下面删除
12if (c >= 0x7f) break;
往下找下面
1234break; if (c < ' ' || c >= 0x7f) *d = '?'; d++;
改为
1234break; if (c < ' ') *d = '?'; d++;
unicode.c中
123/* *d++ = (c >= ' ' && c < 0x7f) ? c : '?'; */ *d++ = (c >= ' ') ? c : '?'; src++;
下面还有一个
1234/* if (c < ' ' || c >= 0x7f) */ if (c < ' ') *d = ...
linuxCpp
1、c++对c的扩展1-1、冒号作用域:: 运算符是一个作用域,::代表是全局作用域。
1234567891011121314#include <iostream>using namespace std;int a = 100;void test01(){ int a = 10; cout << a << endl;//输出局部变量a cout << ::a << endl;//输出全局变量a}int main(){ test01(); return 0;}
1-2、名字控制1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677#include <iostream>using namespace std;names ...
uboot移植(uboot2024.4移植)
imx6ull板子为例:下载源码:https://github.com/nxp-imx/uboot-imx/tree/lf_v2024.04注意设备树的语法最后要空行
1、编译拿到源码后,先编译一遍和自己要移植的板子所用的芯片匹配的配置文件。如我这里用的是imx6ull的板子,就需要编译imx6ull的配置文件。编译过后,需要改的目录下生成了一些文件,可以按照文件去判定编译的配置文件是否和自己板子匹配。
12345678910#!/bin/bashpath="arm CROSS_COMPILE=/home/ygc/Desktop/linux-gcc/2021-6ull/gcc-arm-10.3-2021.07-x86_64-arm-none-linux-gnueabihf/bin/arm-none-linux-gnueabihf-"make ARCH=arm CROSS_COMPILE=${path} distcleanmake ARCH=arm CROSS_COMPILE=${path} menuconfigmake ARC ...