2019-2020-1 20,175,234 2,017,520,520,175,217 experiment a familiar development environment

2019-2020-1 20,175,234 2,017,520,520,175,217 experiment a familiar development environment


Members of this group: 2,017,520,520,175,217 20,175,234

Experimental Procedure

1- cross-compiler environment - (use your own laptop)

  • Experimental requirements
  1. Installation software directory provides teacher in "VMware-workstation-full-10.0.1-1379776.exe"
  2. Decompression teacher provides software directory "Ubuntu1204.rar"
  3. Open Ubuntu, the user name VMWare: linux, password: 1
  4. Establishment of experimental directory "mkdir linux_ crew members _ No. 1 school 2 school No. 3 crew _ study"
  5. Write "hello word" experiment program in the directory, add another few lines of print names of all members of the Student ID
  6. Reference bocsd script armc.sh directory, respectively and gcc cross compiler arm-none-linux-gnuenbi-gcc hello.c compiler, gcc compiler executable by naming linuxhello: gcc hello.c -o linuxhello; with arm-none-linux-gnuenbi-gcc compiler named armhello: /usr/local/toolchain/toolchain4.3.2/bin/arm-none-linux-gnuenbi-gcc hello.c -o armhello
  7. Each running linuxhello, armhello, what was the result? Submit a screenshot and analyze the reasons with the file command.

It is easy to find after a run, you can only run using the gcc compiler linuxhello in Linux, and can not be run using gcc cross-compiler arm-none-linux-gnuenbi- gcc compiler armhello.
We try to use file analysis file, and finally we conclude, linuxhello is run under linux x86-64 systems, and armhello is running under ARM system, because different operating systems can not run.
So we learn road cross -compiler environment concept.

交叉编译(cross-compilation)是指,在某个主机平台上(比如PC上)用交叉编译器编译出可在其他平台上(比如ARM上)运行的代码的过程。

Therefore, we want to achieve on the arm to compile files on Linux, we need to build an embedded ARM systems in Linux.


2- target host Unicom

  • Experimental requirements
  1. To use their own laptops, extract super terminal software "windows7st (Windows) .rar", and create a shortcut on the desktop (do not do this in the lab)
  2. Use your own laptop to the lab "USB to serial cable" is inserted into the USB port of your computer, connect to the serial port COM0 Experiment Box
  3. HyperTerminal reference video configuration, HyperTerminal display terminal as Experiment Box
  4. See experimental box with ifconfig IP (target) in the terminal, (host) in view IP with ifconfig command line in Ubuntu
  5. Connection laboratory desktop (or your own laptop) and ARM experimental box with a cable network port NET1 (next to the largest screen)
  6. With the ping command to ensure the function of the target and host ping each other, submitted to ping screenshot
  • experiment procedure

    • Open Virtual Machine installed win7, Ubuntu virtual machine

    • Open Device Manager, view the port number of experimental box

    • The network connection is set to bridge mode, and to establish a network connection between the host and the virtual machines

    • Open Super Terminal, the port selection step to see, and "bits / second" is set at 115200, the rest with the default settings.
    • In the super terminal input ifconfig, view the target machine ip address 192.168.0.232.
    • In Ubuntu input terminal ifconfig, see id host address 192.168.0.230.
    • HyperTerminal, respectively, Ubuntu virtual machine mutual ping, can ping each other.


3- target program running

  • Experimental requirements
  1. Chapter fifth week of learning resources in the "ARM Experiment guide book box", understanding the role of tftp and nfs
  2. In using HyperTerminal "mkdir / arm_ crew No. 1 school student number _ _ 2 crew 3 crew study" established test chamber run directory "arm_ crew members 1 Studies No. _ _ No. 2 Science 3 crew Student ID "
  3. HyperTerminal run "mount -t nfs -o nolock host IP: / home / linux / linux_ crew members 1 _ 2 school student ID number / arm_ crew No. 1 school student number 2 crew _ _ _ 3 crew study "by the host in the NFS" linux_ crew members _ 1 No. 2 Science study "mapped to the target machine" / arm_ crew members 1 _ 2 school student ID number _ school No. 3 crew "
  4. HyperTerminal Run "cd / arm_ crew No. 1 school student number _ _ 2 crew 3 crew study"
  5. HyperTerminal run "./armhello", filed run shot, and in-depth understanding of cross-compiler
  • experiment procedure

    • Open a virtual machine running Ubuntu system
    • Configuration / etc / exports, i.e., the input terminalsudo vim /etc/exports
    • Because NFS mount allows the directory and authority were defined in the file / etc / exports, and thus we need to add a line in / etc / exports file at the end of/home/linux/linux_20175205_20175217_20175234 *(rw,sync,no_root_squash,no_subtree_check)
    • Restart the service, namely the input terminalsudo /etc/init.d/nfs-kernel-server restart
    • In using HyperTerminal mkdir //arm_20175205_20175217_20175234(due to the experimental hurry, we arm the file is set to "/ arm_5)
    • Running in the terminal mount -t nfs -o nolock 192.168.0.230(宿主机IP):/home/linux/linux_20175205_20175217_20175234/arm_20175205_20175217_20175234by the host in the NFS "linux_20175205_20175217_20175234" mapped to the target machine "/ arm_5
    • HyperTerminal runcd /arm_5
    • Run HyperTerminal ./armhellosubmit run shot, and in-depth understanding of cross-compiler


Experiments and solving process

  • Question 1: 20,175,234 members following problems installing VMware appear,

  • Problem 1 Solution: Because it is the first installation of VMware Workatation Pro do not know whether it is due to the widespread online Windows patch caused problems, try to delete the network transmission results in the latest patch of the reasons, but not resolved

Finally, install the VMware Player


  • Question 2: the beginning win7 virtual machine, ping barrier between linux virtual machine, and the target machine, the host

  • Problem 2 Solution: The network connection mode to bridge mode, and establish a connection between the virtual machine and the host


  • Question 3: Use the mount command display command is invalid

  • Question 3 solutions: Discovery is not configured / etc / exports, after successful configuration change

  • The problem to be solved: Chamber output is garbled


Newly acquired knowledge

  • Cross compiler
  • Host and target machines
  • NFS
  • HyperTerminal
  • file command

Other (perception, thinking, etc., optional)

The experiment began very well, the target machine and the host still can not ping, and later found that virtual machine networking is the way nat mode, and then with the help of students, and finally the nat mode to bridge, and finally in front of the class one second completed this trial.


Reference material


END

Guess you like

Origin www.cnblogs.com/ysz-123/p/11825018.html