1 . make config的时候报下面的错误,意思是变量没有初始化,手动初始化成’NULL’,就行了。html
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/conf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
SHIPPED scripts/kconfig/zconf.hash.c
HOSTCC scripts/kconfig/zconf.tab.o
In file included from scripts/kconfig/zconf.tab.c:2537:0:
scripts/kconfig/menu.c: In function ‘get_symbol_str’:
scripts/kconfig/menu.c:590:18: warning: ‘jump’ may be used uninitialized in this function [-Wmaybe-uninitialized]
jump->offset = strlen(r->s);
~~~~~~~~~~~~~^~~~~~~~~~~~~~
scripts/kconfig/menu.c:551:19: note: ‘jump’ was declared here
struct jump_key *jump;
^~~~
HOSTLD scripts/kconfig/conflinux
2. 如何给upstream内核打patchdom
xzcat ../patch-4.15.12.xz | patch -p1 –Ride
3. 内核config网站
使用make help 查看可用的configthis
make i386_defconfig.net
make menuconfigdebug
在原来配置的基础上,make menuconfig选中以下选项从新配置Linux,使之携带调试信息
kernel hacking—>
[*] compile the kernel with debug info
make从新编译(时间较长)3d
make clean调试
make –j 4
4. 解决gcc找不到文件的问题
http://www.javashuo.com/article/p-pggyvtkt-cc.html
5. 关于printk的级别,console最大数字支持15,可是最好不要设置,定位问题可设置为10
https://blog.csdn.net/weixin_38227420/article/details/79329491
https://www.aliyun.com/jiaocheng/183702.html
6. 关于4.0以上版本gdb调试时设置不了断点的问题
https://blog.csdn.net/WANG__RONGWEI/article/details/79207536?utm_source=blogxgwz3
取消选项:
[ ] Randomize the address of the kernel image (KASLR)
7. qemu-system-i386 -curses -kernel ./linux-4.15.12/arch/x86/boot/bzImage -initrd ./rootfs.img -S –s
4.15的qemu gdb断点调试,最新内核配置以下
除了上面的,别的都不选,编译出来的内核1.2M
http://www.javashuo.com/article/p-uwhvgchu-m.html
https://blog.csdn.net/yejingx/article/details/6525405
还有两个参考别人的网站