课程: Advanced Linux: The Linux Kernel (2020)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Identifying how LKMs work
- [Instructor] Now let's look at source code for a simple module to see what it takes to write a loadable kernel module. Let's start with how do we compile a module once we have one. We're going to use the make command and we're going to have a make file. Now this make command to compile a module is kind of complicated. To compile a loadable kernel module for a kernel, we want to use that kernel's make file. So, when we use the make command, we're going to use the the dash capital C option and we're going to give the path name to where the kernel source is or at least where the kernel headers are. So with your distro, maybe you installed the package for kernel development, which would have the kernel headers that you need. So as long as that's installed right underneath lib modules, kernel version is a soft link called build that will point at that directory. When we compile our module, we're going to need the…
随堂练习,边学边练
下载课堂讲义。学练结合,紧跟进度,轻松巩固知识。