Experimental report on the basic design of 2014520&20145209&20145309 information security system

Source: Internet
Author: User

Experimental report on the basic design of 20145215&20145307 information security system

PART1

First, the principle of experiment

Cross-compiling, simply put, is to generate executable code on another platform on one platform. The same architecture can run different operating systems, and similarly, the same operating system can run on different architectures. On a Linux PC, the ARM-LINUX-GCC compiler is used to compile executable code for the Linux arm platform.

Second, the contents and steps of the experiment

1. Connecting the ARM Development Board

First connect the power cord, so that the development Board switch is closed, and then the serial line, the line, cable and USB cable and the PC connected. Connect the serial line to the left side of the serial port.

2. Build HyperTerminal

Create a new communication terminal, named Arm. In the Properties dialog box, set the baud rate to 115200, the data bit to 8, no parity, stop bit 1, no data flow control

3. Start the experimental platform

Turn on the HyperTerminal first, and then turn on the arm machine power switch. The information for the arm machine is displayed in the HyperTerminal window. Enter the Ifconfig command to record the IP of the arm machine

4. Modify the XP system and the IP of the Redhat virtual machine on the same network segment as the IP of the arm machine.

The IP address of the XP system is in the local Connection Properties tab, Internet Protocol (TCP/IP) options; The IP address of Rad hat is set in "System Settings-network-edit-static IP address" and the IP will not take effect until the virtual machine is restarted after setting is complete.

5. Installing the ARM compiler

Access the shared folder through the PC and copy the compiler to the shared folder so that the virtual machine can also be accessed. Install the extracted files.

6. Configure Environment variables

Use VI in the virtual machine to modify the PATH variable in the/root/.bash_profile file to path=path:home/bin:/opt/host/armv4l/bin/, after disk execution: Source/root/.bash_ Profile, the armv4l-unknown-linux-gcc will be automatically searched later, can be entered on the terminal.

7. Build the. c File and compile it

Enter the folder/ROOT/BC in the virtual machine and write the hello.c file in this directory. Compile the hello.c with the command ARMV4L-UNKNOWN-LINUX-GCC and generate a hello executable file.

8. Download and debug

Mount the shared folder in HyperTerminal to establish communication between the Development Board and the virtual machine. Enter the command "mount-t nfs-o nolock 192.168.0.234:/home/bc/host" (note that there are spaces behind BC to mount the BC file to the/host directory, or a subdirectory if no spaces are available.) )

PART2

Purpose and requirements of the experiment

    • Learn the basic principles of multi-threaded programming and learn the use of Pthread library functions.
    • Understand the basic methods of serial programming in Linux environment.
    • Master the main properties of the terminal and set up methods, familiar with the use of terminal I/O functions. Learn to use multithreading to complete the serial port processing.
    • Familiar with Linux development environment, learn the configuration and use of Linux development environment based on s3c2410. Use Linux ARMV4L-UNKNOWN-LINUX-GCC compilation, use NFS-based download debugging to understand the basic process of embedded development
      Experimental process
      Configuration of the development environment
      1. Connecting Arm Development Board
      Connect the ARM Development Board power Cord to keep the board switch closed. And then the serial line, the line and the network cable and the PC connection is good.
      2. Build HyperTerminal
      Run the Windows XP system under Start, all programs, accessories, communications, HyperTerminal.
      Create a new communication terminal, named Arm. In the Properties dialog box, set the baud rate to 115200, the data bit to 8, no parity, stop bit 1, no data flow control.
      3. Start the experimental platform
      Open the HyperTerminal and turn on the arm machine power switch. Wait a minute and the information from the arm machine is displayed in the HyperTerminal window.
      Continue waiting, enter the Ifconfig command, record the IP of the arm machine
      4, modify the XP system and the IP of the Redhat virtual machine, make them all with the arm machine IP in the same network segment. After modifying the IP, restart the virtual machine, IP to start the role. Use ifconfig on the command line after reboot to confirm correct modification
      5, install the arm compiler. In the PC "Start", "Run", enter the virtual machine's IP, enter the user name BC, password 123456 and then make sure you can access the virtual machine files. Then extract the required files to the shared folder BC.
      Enter the virtual machine, enter the./install.sh on the command line, and the setup script will automatically establish the directory and configure the compilation environment.
      6, configure the environment variables in the virtual machine using VI to modify the PATH variable in the/root/.bash_profile file to path=path:home/bin:/opt/host/armv4l/bin/(because the file is a hidden system file, So using the LS command is not visible), after disk execution: Source/root/.bash_profile, then ARMV4L-UNKNOWN-LINUX-GCC will automatically search, you can enter on the terminal.
      Validating the Experiment Code
      1. Copy the experiment code to the shared folder.
      2. Compile the code in the virtual machine. For multithreaded-related code, compile-time libraries are required to add-lpthread
      Download debug run executable file in HyperTerminal pthread!
      Run the executable file term.

Experimental report on the basic design of 2014520&20145209&20145309 information security system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.