The station B Linux Driver introduction video has been updated to 25 sections,

There are still a few issues to go, and the first issue of the drive will be updated.

A lot of comments from my fans asking me how to set up the virtual machine environment in the video,

This article will give you a step-by-step guide.

To save time, directly obtain the virtual machine installed by Teacher Peng,

You can also reply: Ubuntu

0. Environment Description

Generally, a Linux environment that can compile ARM assembly code needs to be installed with the following three software:

  1. Vmware: Other operating systems can be installed in this software

  2. Ubuntu 16.04: Compilers are compiled in Ubuntu

  3. Cross-compiler: To compile code that can run on the development board, you need to install this tool.

1. Install vmware

Download address www.vmware.com/go/getworks…

Installation steps

(1) Double-click vmware-workstation-full. exe and then go to the next step

(2) check I accept the license agreement, next

(3) Change the installation location of the software, or go to the next step without changing the location

(4) If you do not want to automatically check and update the software, do not check and go to the next step

(5) Two check boxes on the desktop and menu bar to create the software icon, next

(6) Select install after the next step

(7) Complete the installation

(8) Then double-click to start VMware and enter the key

Click I hope to try it.

2. Install ubuntu

Download address: ubuntu 20.04 mirrors.aliyun.com/ubuntu-rele download address… Ubuntu 16.04 mirrors.aliyun.com/ubuntu-rele download address…

(1) Double-click VMware Workstation and click Create vm(2) Select classic and click Next

(3) Click Browse to select the Ubuntu installation image file: Ubuntu-16.04.7-desktop-amd64.iso

(4) Enter the user name and password, click Next, and set the password to 1 for easy memory

(5) Enter the VM name and select the VM installation location

(6) Select a larger disk size to facilitate subsequent software installation

(7) Click Next

(8) Click Finish to enter the installation process. It is recommended to disconnect the network for installation

(9) After the installation, enter the password 1 set in Step 4 on the following screen

3. Install required tools

To facilitate copying files to Ubuntu, you also need to install VM-Tools. Run the following command: Mouse anywhere in Ubuntu and press CTRL + Alt + T to open the command terminal. Execute the following command

peng@ubuntu:~$sudo apt-get autoremove open-vm-tools
peng@ubuntu:~$sudo apt-get install open-vm-tools-desktop
Copy the code

You will be prompted for a password. Enter the password of the previous setup. Once you’re done, you can copy files directly from Windows to Ubuntu, which is very convenient.

4. Install the cross-compile tool

Perform the following operations: Create a directory toolchain and change its permissions

1. root@ubuntu:/home/peng# mkdir toolchain
2. root@ubuntu:/home/peng# chmod 777 toolchain
Copy the code

Copy gcc-4.6.4.tar.xz to the toolchain directory.

Decompress the package:

root@ubuntu:/home/peng# cd toolchain/
root@ubuntu:/home/peng/toolchain# tar XVF GCC - 4.6.4. Tar. Xz
Copy the code

Add the following information to the /etc/bash.bashrc file

export  PATH=$PATH:/home/peng/toolchain/gcc4.64./bin
Copy the code

Restart the configuration file:

root@ubuntu:/home/peng/toolchain#source /etc/bash.bashrc
Copy the code

Installation Library Third party library:

root@ubuntu:/home/peng/toolchain# apt-get install lsb-core
Copy the code

Toolchain testing:

root@ubuntu:/home/peng/toolchain# arm - none - Linux - gnueabi - GCC - v
Copy the code

If the following information is displayed, the installation is successful:

root@ubuntu:/home/peng/toolchain# arm-none-linux-gnueabi-gcc -v
Using built-in specs.
COLLECT_GCC=arm-none-linux-gnueabi-gcc
COLLECT_LTO_WRAPPER=/home/peng/toolchain/gcc4.64./bin/.. /libexec/gcc/arm-arm1176jzfssf-linux-gnueabi/4.64./lto-wrapper
Target: arm-arm1176jzfssf-linux-gnueabi
Configured with: /work/builddir/src/gcc4.64./configure --build=i686-build_pc-linux-gnu --host=i686-build_pc-linux-gnu --target=arm-arm1176jzfssf-linux-gnueabi --prefix=/opt/TuxamitoSoftToolchains/arm-arm1176jzfssf-linux-gnueabi/gcc4.64. --with-sysroot=/opt/TuxamitoSoftToolchains/arm-arm1176jzfssf-linux-gnueabi/gcc4.64./arm-arm1176jzfssf-linux-gnueabi/sysroot --enable-languages=c,c++ --with-arch=armv6zk --with-cpu=arm1176jzf-s --with-tune=arm1176jzf-s --with-fpu=vfp --with-float=softfp --with-pkgversion='crosstool-NG hg+default-2685dfa9de14 - tc0002'--disable-sjlj-exceptions --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --with-gmp=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools  --with-mpfr=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools --with-mpc=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools --with-ppl=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools --with-cloog=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools --with-libelf=/work/builddir/arm-arm1176jzfssf-linux-gnueabi/buildtools --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --without-long-double- 128. --disable-nls --disable-multilib --with-local-prefix=/opt/TuxamitoSoftToolchains/arm-arm1176jzfssf-linux-gnueabi/gcc4.64./arm-arm1176jzfssf-linux-gnueabi/sysroot --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.64. (crosstool-NG hg+default- 2685.dfa9de14 - tc0002)
Copy the code