- Linux Device Driver Development Cookbook
- Rodolfo Giometti
- 273字
- 2021-06-24 13:54:12
Configuring the emulated OS
What we just saw about schroot is nothing if we do not configure our new system to do native compilation, and to do so, we can use every Debian tool we use on our host PC:
- To install a complete compiling environment, we can issue the following command once inside the schroot environment:
$ sudo apt install gcc make \
bison flex ncurses-dev libssl-dev
Note that sudo will ask your usual password, that is, the password you currently use to log in to your host PC.
You might not get a password request from sudo with the following error message:
sudo: no tty present and no askpass program specified
You can try executing the preceding sudo command again, adding to it the -S option argument.
It could be possible that the apt command will notify you that some packages cannot be authenticated. Just ignore this warning and continue installation, answering yes by pressing the Y key.
sudo: no tty present and no askpass program specified
You can try executing the preceding sudo command again, adding to it the -S option argument.
It could be possible that the apt command will notify you that some packages cannot be authenticated. Just ignore this warning and continue installation, answering yes by pressing the Y key.
If everything works well, we should now be able to execute every compiling command we used before. For instance, we can try to recompile the helloworld program again but natively (we should remove the current executable in order; make will try to recompile it again):
$ rm helloworld
$ make CFLAGS="-Wall -O2" helloworld
cc -Wall -O2 helloworld.c -o helloworld
$ file helloworld
helloworld: ELF 64-bit LSB shared object, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=1393450a08fb9eea22babfb9296ce848bb806c21, not stripped
$ ./helloworld
Hello World!
Note that networking support is fully functional so we're now working on an emulated ARM64 environment on our hosts PC as we were on the ESPRESSObin.
推薦閱讀
- Kubernetes修煉手冊
- Linux設(shè)備驅(qū)動開發(fā)詳解(第2版)
- STM32庫開發(fā)實戰(zhàn)指南:基于STM32F4
- 網(wǎng)絡(luò)操作系統(tǒng)教程:Windows Server 2016管理與配置
- Mobile First Design with HTML5 and CSS3
- 嵌入式系統(tǒng)及其應(yīng)用(第三版)
- 無蘋果不生活 The New iPad隨身寶典
- OpenSolaris設(shè)備驅(qū)動原理與開發(fā)
- Cassandra 3.x High Availability(Second Edition)
- 寫給架構(gòu)師的Linux實踐:設(shè)計并實現(xiàn)基于Linux的IT解決方案
- Windows Vista終極技巧金典
- bash shell腳本編程經(jīng)典實例(第2版)
- iOS 10快速開發(fā):18天零基礎(chǔ)開發(fā)一個商業(yè)應(yīng)用
- OpenVZ Essentials
- VMware vSphere 5.1 Cookbook