Bilibili’s Linux Driver Introduction Video has been updated to 25 episodes,
with a few more to go, the first episode of the driver has been completed.
Many fans have messaged me asking how to set up the virtual machine environment shown in the video,
This article will teach you step by step.
If you want to save time, you can directly obtain the virtual machine installed by Teacher Peng,
or reply in the background: ubuntu
0. Environment Description
To install a Linux environment that can cross-compile driver programs and ARM assembly code, you need to install the following 3 software:
-
VMware : You can install other operating systems in this software -
Ubuntu 16.04: All compilation programs are compiled in Ubuntu -
Cross Compiler : This tool needs to be installed to compile code that can run on the development board.
1. Install VMware
Download link: https://www.vmware.com/go/getworkstation-win
Installation steps
(1) Double-click VMware-workstation-full.exe, then next
(2) Check I accept the license agreement, next
(3) Change the installation location of the software, next or directly next without changing the location
(4) If you do not want to automatically check for software updates, do not check and directly next
(5) Check both to create software icons on the desktop and menu bar, next
(6) After next, choose to install
(7) Installation completed
(8) Then double-click to start VMware and enter the key
Click I want to try it.
【Actually, you can… you know!】
2. Install Ubuntu
Download link:
http://mirrors.aliyun.com/ubuntu-releases/20.04.2/ubuntu-20.04.2.0-desktop-amd64.iso
Click to create a new virtual machine
Select typical, click next, and select the downloaded iso file.
Fill in the username and password, for convenience, set the password to 1
Name the virtual machine:
3. Install Essential Tools
To conveniently copy files to Ubuntu, you also need to install VM tools,
Execute the following operations:
1. Click anywhere in Ubuntu, then press the combination key: ctrl+alt + t, to open the command terminal.
Execute the following commands
peng@ubuntu:~$sudo apt-get autoremove open-vm-tools
peng@ubuntu:~$sudo apt-get install open-vm-tools-desktop
It will prompt for a password, enter the password set during installation.
After completion, you can easily copy files from Windows to Ubuntu.
4. Install Cross Compilation Tools
Execute the following operations: create a directory toolchain and modify permissions
1. root@ubuntu:/home/peng# mkdir toolchain
2. root@ubuntu:/home/peng# chmod 777 toolchain
Copy gcc-4.6.4.tar.xz to the toolchain directory.
Unzip the compressed package:
root@ubuntu:/home/peng# cd toolchain/
root@ubuntu:/home/peng/toolchain# tar xvf gcc-4.6.4.tar.xz
Modify the file /etc/bash.bashrc and add the following content
export PATH=$PATH:/home/peng/toolchain/gcc-4.6.4/bin
Restart the configuration file:
root@ubuntu:/home/peng/toolchain#source /etc/bash.bashrc
Install third-party libraries:
root@ubuntu:/home/peng/toolchain# apt-get install lsb-core
Testing the toolchain:
root@ubuntu:/home/peng/toolchain# arm-none-linux-gnueabi-gcc –v
If you get the following result, it indicates that 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/gcc-4.6.4/bin/../libexec/gcc/arm-arm1176jzfssf-linux-gnueabi/4.6.4/lto-wrapper
Target: arm-arm1176jzfssf-linux-gnueabi
Configured with: /work/builddir/src/gcc-4.6.4/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/gcc-4.6.4 --with-sysroot=/opt/TuxamitoSoftToolchains/arm-arm1176jzfssf-linux-gnueabi/gcc-4.6.4/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/gcc-4.6.4/arm-arm1176jzfssf-linux-gnueabi/sysroot --enable-c99 --enable-long-long
Thread model: posix
gcc version 4.6.4 (crosstool-NG hg+default-2685dfa9de14 - tc0002)
With this environment, the Linux driver learning environment is set up,
In the future, Teacher Peng will continue to update the Learn ARM from 0 series videos,
and will also use this environment.
What are you waiting for? Let’s start learning!
Leave a Comment
Your email address will not be published. Required fields are marked *