- Linux Device Driver Development Cookbook
- Rodolfo Giometti
- 181字
- 2021-06-24 13:54:12
Getting ready
Since we need to add our code to the Linux sources, let's go into the directory where all sources are located. On my system, I use the Projects/ldddc/linux/ path located in my home directory. Here is what the kernel sources look like:
$ cd Projects/ldddc/linux/
$ ls
arch Documentation Kbuild mm scripts virt
block drivers Kconfig modules.builtin security vmlinux
built-in.a firmware kernel modules.order sound vmlinux.o
certs fs lib Module.symvers stNXtP40
COPYING include LICENSES net System.map
CREDITS init MAINTAINERS README tools
crypto ipc Makefile samples usr
Now, we need to set the environment variables, ARCH and CROSS_COMPILE, as follows in order to be able to cross-compile code for the ESPRESSObin:
$ export ARCH=arm64
$ export CROSS_COMPILE=aarch64-linux-gnu-
So, if we try to execute a make command as follows, the system should start compiling the kernel as usual:
$ make Image dtbs modules
CALL scripts/checksyscalls.sh
...
Note that you may avoid exporting preceding variables by just specifying them on the following command line:
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
Image dtbs modules
$ make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- \
Image dtbs modules
At this point, kernel sources and the compiling environment are ready.
推薦閱讀
- 從零開始寫Linux內核:一書學透核心原理與實現
- Kali Linux滲透測試全流程詳解
- WordPress Mobile Web Development:Beginner's Guide
- 操作系統基礎與實踐:基于openEuler平臺
- Ganglia系統監控
- Implementing Azure DevOps Solutions
- 嵌入式操作系統(Linux篇)(微課版)
- Linux自動化運維:Shell與Ansible(微課版)
- Linux命令行大全(第2版)
- Fedora 12 Linux應用基礎
- Django Project Blueprints
- AWS SysOps Cookbook
- Windows 7實戰從入門到精通
- Hadoop Real-World Solutions Cookbook
- Linux應用大全 基礎與管理