R329开发板的初步认知——系统
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">R329</font><font face="宋体">开发板的初步认知——系统</font></span></span></span></span></p><p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在上周的报告(</font><font face="Calibri">https://bbs.eeworld.com.cn/thread-1179439-1-1.html</font><font face="宋体">)报告中,已经装好了系统,并且可以正常启动。本篇试图进一步学习一下这个定制的</font><font face="Calibri">armbian</font><font face="宋体">系统,查看内核,对性能进行评估,并且尝试其开发环境。</font></span></span></span></span></p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">Linux</font><font face="宋体">内核篇</font></span></span></span></span></li>
</ul>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">我们知道在</font><font face="Calibri">Linux</font><font face="宋体">系统中,内核一般可以通过</font><font face="Calibri">/proc</font><font face="宋体">中文件访问,比如有关内核的状态、</font><font face="Calibri">cpu</font><font face="宋体">属性、正在运行的进程等等。</font></span></span></span></span></p>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">内核版本和启动参数</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在</font><font face="Calibri">/proc/version</font><font face="宋体">中,包含了系统内核版本,而在</font><font face="Calibri">/proc/cmdline</font><font face="宋体">中可以查看系统启动时输入的内核命令行参数。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<ol start="2">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">CPU </font><font face="宋体">的信息</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">可以通过</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">/proc/cpuinfo</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">查看</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cpu</font><font face="宋体">信息</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">可以看到这是一个双核的</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cpu</font><font face="宋体">,两个核都是</font><font face="Calibri">ARM8</font><font face="宋体">架构,</font><font face="Calibri">BogoMIPS</font><font face="宋体">值为</font><font face="Calibri">48.00</font><font face="宋体">,支持</font><font face="Calibri">fp</font><font face="宋体">、</font><font face="Calibri">asimd</font><font face="宋体">、</font><font face="Calibri">evtstrm</font><font face="宋体">、</font><font face="Calibri">aes</font><font face="宋体">、</font><font face="Calibri">pmull</font><font face="宋体">、</font><font face="Calibri">sha1</font><font face="宋体">、</font><font face="Calibri">sha2</font><font face="宋体">、</font><font face="Calibri">crc32</font><font face="宋体">、</font><font face="Calibri">cpuid</font><font face="宋体">特性。这个结果与</font><font face="Calibri">lscpu</font><font face="宋体">结果是类似的。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<ol start="3">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">内存</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">可以通过</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">/proc/meminfo</font><font face="宋体">查看内存信息。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<ol start="4">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">已加载的文件系统和模块</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">通过</font><font face="Calibri">/proc/mounts</font><font face="宋体">查看加载的文件系统。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">还可以通过</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">/proc/modules</font><font face="宋体">查看已加载的模块</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">5</font><font face="宋体">、其它</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在</font><font face="Calibri">/proc</font><font face="宋体">中还可以查询大量信息,如</font><font face="Calibri">/proc/uptime</font><font face="宋体">(系统启动时间)、</font><font face="Calibri">/proc/devices</font><font face="宋体">(可用设备列表)、</font><font face="Calibri">/proc/iomem</font><font face="宋体">(内核</font><font face="Calibri">IO</font><font face="宋体">地址映射)、</font><font face="Calibri">/proc/kallsyms</font><font face="宋体">(内核函数)、</font><font face="Calibri">/proc/filesystems </font><font face="宋体">(支持的文件系统)、</font><font face="Calibri">/proc/diskstats</font><font face="宋体">(磁盘信息)、</font><font face="Calibri">/proc/interrupts</font><font face="宋体">(中断)等。这里不一一截图。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">性能测试</font></span></span></span></span></li>
</ul>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在上一篇中,使用</font><font face="Calibri">sysbench</font><font face="宋体">跑分,这一篇再使用</font><font face="Calibri">nbench</font><font face="宋体">性能测试,测试项包括数字、字符串排序、位操作、浮点运算、傅里叶变化、内存分配算法、哈夫曼压缩、鲁棒算法解线性方程组等,详细说明可以通过</font><font face="Calibri">wiki</font><font face="宋体">参考链接</font><font face="Calibri">https://en.wikipedia.org/wiki/NBench</font><font face="宋体">查询。</font></span></span></span></span></p>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">安装和使用</font><font face="Calibri">nbench</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">在</font><font face="Calibri">http://www.math.utah.edu/~mayer/linux/bmark.html</font><font face="宋体">中下载并编译,具体步骤:包括下载、解压、编译、执行,如下:</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">wget http://www.math.utah.edu/~mayer/linux/nbench-byte-2.2.3.tar.gz</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">tar -xvzf nbench-byte-2.2.3.tar.gz</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">cd nbench-byte-2.2.3</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">make</font></span></span></span></span></p>
<p style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">./nbench</font></span></span></span></span></p>
<ol start="2">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">结果分析</font></span></span></span></span></li>
</ol>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">从上述结果来看,在</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">armbian</font><font face="宋体">系统中,</font><font face="Calibri">R329</font><font face="宋体">开发板的性能远高于参考的</font><font face="Calibri">Intel Pentium90</font><font face="宋体">和</font><font face="Calibri">AMD K6/233</font><font face="宋体">。</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">但我的印象里面</font><font face="Calibri">Intel Pentium90</font><font face="宋体">和</font><font face="Calibri">AMD K6/233</font><font face="宋体">参考值似乎和本次测试结果不同,可能是操作系统的原因,有空我在树莓派上再试。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<ul>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">开发环境</font></span></span></span></span></li>
</ul>
<ol>
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">远程管理</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">系统缺省已经开启了</font><font face="Calibri">sshd</font><font face="宋体">,但使用</font><font face="Calibri">SecureCRT</font><font face="宋体">连接时,出现了“</font><font face="Calibri">Key exchange failed.</font></span></span></span></span></p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256</font><font face="宋体">”提示,这个提示表明服务器所支持的密钥认证方式与终端支持的有所不同。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">但更换</font><font face="Calibri">putty</font><font face="宋体">则可以正常连接。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<ol start="2">
<li style="text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">编译器</font></span></span></span></span></li>
</ol>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">从之前模拟的情况看来,主要用</font></span></span><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="Calibri">C</font><font face="宋体">和</font><font face="Calibri">python</font><font face="宋体">作为主要编程语言,因此可以查看系统中的开发环境,系统中已经自带了</font><font face="Calibri">python3</font><font face="宋体">、</font><font face="Calibri">gcc</font><font face="宋体">,尝试查看编译器版本:</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-indent:21.0000pt; text-align:justify"><span style="font-size:10.5pt"><span style="font-family:Calibri"><span style="font-size:10.5000pt"><span style="font-family:宋体"><font face="宋体">可以看到采用的</font><font face="Calibri">gcc</font><font face="宋体">的版本是</font><font face="Calibri">9.3.0</font><font face="宋体">,</font><font face="Calibri">python</font><font face="宋体">的版本是</font><font face="Calibri">3.8.10</font><font face="宋体">。按照习惯,一般都需要再编一个“</font><font face="Calibri">hello world</font><font face="宋体">”来试用。</font></span></span></span></span></p>
<p style="text-align:justify"> </p>
<p style="text-align:justify"> </p>
<p><span style="color:#333333">这个板载cpu</span>,<span style="color:#333333">双核的cpu,两个核都是ARM8架构,支持fp、asimd、evtstrm、aes、pmull、sha1、sha2、crc32、cpuid特性,还是挺强悍的</span></p>
页:
[1]