How to do it...

We need a virtual environment that, unlike Docker, can emulate processors with architectures that differ from the architecture of our computer:

  1. Navigate to https://www.qemu.org/download/ and click on the tab that matches your operating system—Linux, macOS, or Windows—and follow the installation instructions.
  2. Create a test directory, unless one already exists:
 $ mkdir -p $HOME/raspberry
  1. Download the following files and copy them over to the ~/raspberry directory you created in the previous step:
  1. Change the directory to ~/raspberry and extract the Raspbian Lite zip archive downloaded in the previous step. It contains a single file named  2019-07-10-raspbian-buster-lite.img.
  2. Open a terminal window and run QEMU. For Windows and Linux, the command line is as follows:
$ qemu-system-arm -M versatilepb -dtb versatile-pb.dtb -cpu arm1176 -kernel kernel-qemu-4.14.79-stretch -m 256 -drive file=2019-07-10-raspbian-buster-lite.img,format=raw -append "rw console=ttyAMA0 rootfstype=ext4 root=/dev/sda2 loglevel=8" -net user,hostfwd=tcp::22023-:22,hostfwd=tcp::9090-:9090 -net nic -serial stdio
  1. A new window should show up, displaying the Linux boot process. In a few seconds, a login prompt will be displayed. 
  2. Log in using pi as the username and raspberry as the password. Then, type the following command:
 # uname -a
  1. Check the output of the command. It indicates that our system architecture is ARM, not x86. Now we can use this environment to test applications built for the ARM platform.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.137.161.222