2019-2020-1 20,175,234 2,017,520,520,175,217 third experiment real-time systems

2019-2020-1 20,175,234 2,017,520,520,175,217 third experiment real-time systems


Panel members 2,017,520,520,175,217 20,175,234


A task

  • Experimental requirements
学习使用Linux命令wc(1)
基于Linux Socket程序设计实现wc(1)服务器(端口号是你学号的后6位)和客户端
客户端传一个文本文件给服务器
服务器返加文本文件中的单词数
  • Experimental Procedure
    • Use man wclearning to use the wc, and try to use.


      Can be found in wc -l +文件print out the file number of rows, wc -c +文件the number of bytes statistics, wc -w +文件word count, wc -m+文件count the number of words.
    • Try the code to achieve wcthe function
    • Test shots.

    • Try the code to achieve wcthe function


Task II

  • Experimental requirements
使用多线程实现wc服务器并使用同步互斥机制保证计数正确
  • Experimental Procedure
    • Use man -k thread |grep creatto create multi-threaded learning, looking to play to learnpthread_create

    • Test shots.


Task three

交叉编译多线程版本服务器并部署到实验箱中
PC机作客户端测试wc服务器
  • Experimental Procedure
    • In a virtual machine, use arm-none-linux-gnuenbi-gccthe program to cross-compile
    • NFC mount configuration / etc / exports, i.e., inputsudo vim /etc/exports
    • Add a line / home / linux / end of the file / etc / exports in linux中文件名* (rw, sync, no_root_squash, no_subtree_check)
    • Restart the service, namely the input terminalsudo /etc/init.d/nfs-kernel-server restart
    • In using HyperTerminalmkdir //arm_1
    • Running in the terminal mount -t nfs -o nolock 192.168.0.230 (host the IP): / Home / linux / linux中文件名/ linux arm_1 by NFS file mapping the host machine to the target machine "/ arm_1
    • HyperTerminal running cd / arm_1 file and run
    • HyperTerminal running ./armserver

    • Test shots.


Problems encountered

  • One problem: a hardware problem

    • After 1 connect the data cable, the interface display is connected, but HyperTerminal was inoperable state;
    • After replacing the 2 experimental box, found between the virtual machine can ping, the ping may HyperTerminal their own. But HyperTerminal with the outside world can not ping.

    • Solutions
      by trying to analyze concluded that the problem is a hardware problem, after several replacement test box solves the problem.

  • Second problem: the failure to mount, mount the statement error
    • Solutions
      found to be modified in / etc / exports file errors, the last line of the file should be changed to / home / your Ubuntu file name * (rw, sync, no_root_squash, no_subtree_check).
      Filename mount -t nfs -o nolock 192.168.0.230:/home/linux/ your file name / New super terminal: Then use the command with the mount command

Cloud link code

Reference material


Guess you like

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