您的位置:首页 > 运维架构 > Linux

linux kernel learning notes

2015-09-24 21:35 696 查看
[b]问题:1.insmod: ERROR: could not insert module hello.ko: Invalid module format

解决:使用modprobe --force-modversion 强制插入 找相同版本内核

1.linux体系结构:user space和kernel space。他们是程序执行的两种不同状态。通过系统调用和硬件中断能够完成从用户控件内核控件的转换

2.ARM7种工作模式:用户模式(usr)。快速中断(fiq)。外部中断(irq)。管理模式(svc)。数据访问终止(abt)。系统模式(sys)。未定义指令异常(und)

3.x86,用户代码运行在Ring3,内核代码运行在Ring0

4.linux内核架构:System call interface(SCI) Process Management(P,M)

Virtual File System(VFS) Memory Management(MM) Network Stack

Arch(体系结构相关的代码) 。Devic Drivers(DD)。

5.make clean (remove most generated files but keep the config)

make mrproper (remov all generated file+config files)

6.make menuconfig :基于文本模式的菜单型配

7.编译内核:make zImage 获取详细编译信息:make zImage V=1

编译好的内核位于arch/<cpu>/boot/

5.内核模块的特点:模块本身并不被编译进内核文件

模块加载函数(必须)module_init();

模块卸载函数(必须)module_exit();

6.进入内核模块文件:insmod ---加载 rmmod--卸载(rmmod hello) lsmod--查看 modprobe---加载(会更加强大,能够自动找到依赖模块,直接加上hello)

7.GPL:开源代码的协议

8.模块参数:module_param module_param(name,type,perm(访问权限));type常见值:bool,int,charp

9. uname -r 查看当前内核版本号

10.
[/b]
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: