20145221 high its &20145326 Cai "The basic design of information security system" experimental two firmware design

Source: Internet
Author: User

20145221 high its &20145326 Cai "the foundation of Information security system Design" experimental two firmware design experiment purpose and requirements
    • 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

Configuration of the experimental process 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, and record the IP of the arm machine.

The IP of the arm machine is recorded as:192.168.0.121

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

In this experiment, the IP of the PC is set to 192.168.0.55 redhat virtual machine IP as192.168.0.234.

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 modify the PATH variable in the/root/.bashprofile 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/.bashprofile, 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 BC.

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 Pthread in HyperTerminal! Run the executable file term!

Problems encountered and their solutions

    • Issue 1: Run the executable file term on HyperTerminal error, prompting/dev/ttyS0: No such file or directory。

    • Solution: The teacher gave the experiment guide said: This problem is because the Linux serial file is located /dev under, generally in the old version of the core of the serial port, serial /dev/ttyS0 Two for /dev/ttyS1 , in our Development board in the serial device is located /dev/tts/ under the Because there is no ttyS0 this device in the Development Board, we have to establish a connection. The solution is to follow the instructions in the lab to enter the folder in the HyperTerminal /dev , enter the command ln –sf /dev/tts/0 ttyS0 (note the space and the letter L, the number 0. )
Experience

The second experiment is carried out on the basis of experiment one, as long as the environment is well-equipped in the experiment, the experiment two can be completed easily. We will follow Lou teacher to give the tutorial step by step, also did not encounter any big problem. To say harvest, is that we learned in this experiment to add-lpthread to the use of the command, because the two code of this experiment is multithreaded-related code, so compile the need to add-lpthread library. The two code used this time is significantly more complex than the hello.c of our first experiment, and contains a lot of knowledge, which requires us to spend more time to understand and realize.

20145221 high its &20145326 Cai "The basic design of information security system" experimental two firmware design

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.