Changes between Version 14 and Version 15 of linux/kernel
- Timestamp:
- 07/24/2019 05:49:19 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
linux/kernel
v14 v15 252 252 [=#headers] 253 253 == Installing Kernel Headers 254 255 This section is in regards to installing kernel headers into the Linux kernel build detailed above. These instructions are not for installing headers on an already running target board (ie Gateworks SBC). 256 254 257 The 'make headers_install' command exports the kernel's header files in a form suitable for use by userspace programs. These headers describe the API for user space programs attempting to use kernel services and are used by the system's C library (ie glibc or uClibc) to define available system calls as well as constants and structures to be used with these system calls. The C library's header files are usually installed in /usr/include and the kernel's headers are usually in /usr/include/linux and /usr/include/asm. Kernel headers are backwards compatible but not forwards compatible meaning a program built against a C library using older kernel headers should run on a newr kernel (although possibly missing access to new features) but a program built against newer kernel headers may not work on an older kernel. 255 258 … … 258 261 Reference: 259 262 - https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt 263 264 260 265 261 266 … … 268 273 To build external modules you must have a prebuilt kernel available that contains the configuration and header files used in the build. Also the kernel must have been built with modules enabled. 269 274 275 * Newport prebuilt kernel: [http://dev.gateworks.com/newport/kernel/] 276 * Ventana prebuilt kernel: [http://dev.gateworks.com/ventana/images/] 277 * Note, for example, on a running Gateworks Newport SBC using Ubuntu, do not use the below command, because this will install the Ubuntu kernel headers which do not match the Gateworks kernel: 278 {{{ 279 apt-get install linux-headers-generic 280 }}} 281 270 282 To build an external kernel module you typically would use: 271 283 {{{#!bash … … 273 285 make -C <path-to-prebuilt-kernel> M=$PWD 274 286 }}} 275 * this will build the modules located in the current directory pointed to by the M param276 * you can then manually copy or load your kernel modules or use the modules_install make target to install them to a specific path277 * if cross-compiling make sure to define ARCH and CROSS_COMPILE env variables and have the $(CROSS_COMPILE)-gcc in your path287 * This will build the modules located in the current directory pointed to by the M param 288 * You can then manually copy or load your kernel modules or use the modules_install make target to install them to a specific path 289 * If cross-compiling make sure to define ARCH and CROSS_COMPILE env variables and have the $(CROSS_COMPILE)-gcc in your path 278 290 279 291 As an example consider the following files in a directory called 'hello-driver':