- 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.
推薦閱讀
- Getting Started with oVirt 3.3
- Linux系統(tǒng)文件安全實戰(zhàn)全攻略
- Linux性能優(yōu)化
- 混沌工程實戰(zhàn):手把手教你實現(xiàn)系統(tǒng)穩(wěn)定性
- Kubernetes從入門到實踐
- Java EE 8 Design Patterns and Best Practices
- 嵌入式實時操作系統(tǒng):RT-Thread設(shè)計與實現(xiàn)
- Delphi Programming Projects
- OpenStack系統(tǒng)架構(gòu)設(shè)計實戰(zhàn)
- Linux網(wǎng)絡(luò)配置與安全管理
- 鴻蒙操作系統(tǒng)設(shè)計原理與架構(gòu)
- Linux集群之美
- Learning Joomla! 3 Extension Development(Third Edition)
- Website Development with PyroCMS
- 電腦辦公(Windows10+Office2016)從新手到高手