﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-textbox-随笔分类-Linux</title><link>http://www.cnitblog.com/textbox/category/8654.html</link><description /><language>zh-cn</language><lastBuildDate>Mon, 09 Jul 2012 03:31:04 GMT</lastBuildDate><pubDate>Mon, 09 Jul 2012 03:31:04 GMT</pubDate><ttl>60</ttl><item><title>Elf 文件</title><link>http://www.cnitblog.com/textbox/archive/2009/12/06/63018.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Sun, 06 Dec 2009 03:46:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/12/06/63018.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/63018.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/12/06/63018.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/63018.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/63018.html</trackback:ping><description><![CDATA[很早记接触这个缩写英文了。它是什么意思呢？要理解这个elf文件是还是比较容易的，如果要掌握它就花点功夫。ELF (Executable And Linkable)UNIX类操作系统中普遍采用的<b>目标文件格式</b> 。<br /><br /><b>首先要知道它有什么作用：<br /></b>工具接口标准委员会TIS已经将ELF作为运行在Intel32位架构之上的各类型操作系统的可导出对象文件格式标准。ELF标准为开发者提供了一组横跨多运行环境的二进制接口定义来组织软件开发 ；<br />ELF标准的目的是为软件开发人员提供一组二进制接口定义，这些接口可以延伸到多种操作环境，从而减少重新编码、重新编译程序的需要。接口的内容包括目标模块格式、可执行文件格式以及调试记录信息与格式等（以上的一段话引用网上的解释，比较抽象，好像说什么跨操作系统的二进制标准？？？呵呵 早不到北）<br /><br />在看一下这段引用：<br /><br />现在PC平台流行的<font color="#ff0000">可执行文件格式（Executable）</font>主要是Windows下的PE（Portable Executable）和Linux的<font color="#ff0000">ELF（Executable Linkable Format）</font>，它们都是COFF（Common file format）格式的变种。<br />不光是可执行文件（Windows的.exe和Linux下的ELF可执行文件）按照可执行文件格式存储。动态链接库（DLL，Dynamic
Linking Library）（Windows的.dll和Linux的.so）及静态链接库（Static Linking
Library）（Windows的.lib和Linux的.a）文件都按照可执行文件格式存储。它们在Windows下都按照PE-<b>COFF格式</b>存储，Linux下按照ELF格式存储。<br />什么又是<b>COFF格式呢？</b><br />COFF是由Unix System V Release
3首先提出并且使用的格式规范，后来微软公司基于COFF格式，制定了PE格式标准，并将其用于当时的Windows NT系统。System V
Release
4在COFF的基础上引入了ELF格式，目前流行的Linux系统也以ELF作为基本可执行文件格式。这也就是为什么目前PE和ELF如此相似的主要原
因，因为它们都是源于同一种可执行文件格式COFF。
<p class="cxy20">Unix最早的可执行文件格式为a.out格式，它的设计非常地简单，以至于后来共享库这个概念出现的时候，a.out格式就变得捉襟见肘了。于是人们设计了COFF格式来解决这些问题，这个设计非常通用，以至于COFF的继承者到目前还在被广泛地使用。</p><p class="cxy20">COFF的主要贡献是在目标文件里面引入了“段”的机制，不同的目标文件可以拥有不同数量及不同类型的“段”。另外，它还定义了调试数据格式。</p><p class="cxy20">总结：看完上面的资料你是已经知道ELF是什么作用了吧？其实就是Unix下的执行文件和动态库(*.so)和目标文件（*.o)文件格式。看前面的跨各类型操作系统。。。。呵呵有点夸张，顶多也就是<b>Unix类型的操作系统</b>，比如 fedora redhat unix 等等 利用wine工具不算。</p><p class="cxy20"><br /></p><p class="cxy20">好了知道他有作用了。现在就介绍一下他的具体结构把。都是基于COFF格式发出来的。</p><b>目标文件</b>有三种类型：<br />1. <b>可重定位文件</b>（Relocatable File） 包含适合于与其他目标文件链接来创建可执行文件或者共享目标文件的代码和数据。 <font color="#ff0000">(Linux的*.o 文件 Windows的 *.obj文件)</font><br />2. <b>可执行文件</b>（Executable File） 包含适合于执行的一个程序，此文件规定了 exec() 如何创建一个程序的进程映像。<font color="#ff0000">（比如/bin/bash文件；Windows的*.exe）</font><br />3. <b>共享目标文件</b>（Shared Object File） 包含可在两种上下文中链接的代码和数据。首先链接编辑器可以将它和其它可重定位文件和共享目标文件一起处理，生成另外一个目标文件。其次，动态链接器（Dynamic Linker）可能将它与某个可执行文件以及其它共享目标一起组合，创建进程映像。<br />目标文件全部是程序的二进制表示，目的是直接在某种处理器上直接执行<font color="#ff0000">（Linux的.so，如/lib/ glibc-2.5.so；Windows的DLL）</font><br /><br /><br />跟Windows的PE文件结构类似Linux的目标文件也是由一组结构体构成的。<br />下面利用Windows的PE文件结构来跟Linux的执行文件来进行一些比较。对比起来容易理解。顺便“复习”一下Win PE格式。<br /><br />一直都没有时间继续写下去不好意！！！<br /><br /><br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/63018.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-12-06 11:46 <a href="http://www.cnitblog.com/textbox/archive/2009/12/06/63018.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 的常用正则表达式</title><link>http://www.cnitblog.com/textbox/archive/2009/12/03/62988.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Thu, 03 Dec 2009 06:36:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/12/03/62988.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62988.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/12/03/62988.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62988.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62988.html</trackback:ping><description><![CDATA[
		<h2>
				<a id="ctl03_TitleUrl" href="http://www.cnblogs.com/caibird2005/archive/2009/04/14/1436008.html">linux正则表达式 grep egrep用法</a>
		</h2>
		<h2>shell<span style="font-family: 黑体;">命令执行的相应顺序</span></h2>
		<h3>&amp;&amp; </h3>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">令1 &amp;&amp; 命令2<span>     </span>如果这个命令1执行成功&amp; &amp;那么执行这个命2</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">mv myfile myfile2 &amp;&amp; echo "if you are seeing this then mv was success!"</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<h3>|| </h3>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">如果| |左边的命令（命令1）未执行成功，那么就执行| |右边的命令(命令2）</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">mv myfile myfile2 &amp;&amp; echo "if you are seeing this then mv was success! "</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">从一个审计文件中抽取第1个和第2个域，并将其输出到一个临时文件中，如果这一操作未成功，我希望能够收到一个相应邮件：</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">awk '{print$1,$2}' test3 &gt;test2 || echo "sorry the extraction didn't work " | mail root</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<h3>
				<span style="font-family: 宋体;">（命令</span>1;<span style="font-family: 宋体;">命令</span>2;. . .<span style="font-family: 宋体;">）</span></h3>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">如果使用{ }来代替（），那么相应的命令将在子s h e l l而不是当前s h e l l中作为一个整体被执行，只有在{ }中所有命令的输出作为一个整体被重定向时，其中的命令才被放到子s h e l l中执行，否则在当前s h e l l执行。</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">例子：</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">如果s o r t命令执行成功了，可以先将输出文件备份，然后再打印</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">test.sorted &amp;&amp; (cp test.sorted test.sorted_bak ;lp test.sorted)</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<h2>
				<span style="font-family: 黑体;">经常使用的正则表达式举例</span>
		</h2>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^<span>                                 </span><span style="font-family: 宋体;">行首</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">$<span>                                 </span><span style="font-family: 宋体;">行尾</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^ [ t h e ]<span>                      </span><span style="font-family: 宋体;">以</span>t h e<span style="font-family: 宋体;">开头行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ S s ] i g n a [ l L ]<span>              </span><span style="font-family: 宋体;">匹配单词</span>s i g n a l<span style="font-family: 宋体;">、</span>s i g n a L<span style="font-family: 宋体;">、</span>S i g n a l<span style="font-family: 宋体;">、</span>S i g n a L</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[Ss]igna[lL]".<span>                </span><span style="font-family: 宋体;">同上，但加一句点</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ m a y M A Y ]<span>             </span><span style="font-family: 宋体;">包含</span>m a y<span style="font-family: 宋体;">大写或小写字母的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^ U S E R $<span>                  </span><span style="font-family: 宋体;">只包含</span>U S E R<span style="font-family: 宋体;">的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[tty]$<span>                           </span><span style="font-family: 宋体;">以</span>t t y<span style="font-family: 宋体;">结尾的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">" .<span>                                </span><span style="font-family: 宋体;">带句点的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^ d . . x . . x . . x<span>          </span><span style="font-family: 宋体;">对用户、用户组及其他用户组成员有可执行权限的目录</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="color: red;">^ [ ^ l ]                        </span>
				<span style="color: red; font-family: 宋体;">排除关联目录的目录列表</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="color: red;">^[^d]                ls –l | grep ^[^d] </span>
				<span style="color: red; font-family: 宋体;">只显示非文件夹的文件</span>
				<span style="color: red;">          </span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ . * 0 ] <span>                      0</span><span style="font-family: 宋体;">之前或之后加任意字符</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ 0 0 0 * ] <span>                 0 0 0</span><span style="font-family: 宋体;">或更多个</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ iI]<span>                             </span><span style="font-family: 宋体;">大写或小写</span>I</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ i I ] [ n N ] <span>               </span><span style="font-family: 宋体;">大写或小写</span>i<span style="font-family: 宋体;">或</span>n</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ ^ $ ] <span>                        </span><span style="font-family: 宋体;">空行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ ^ . * $ ] <span>                    </span><span style="font-family: 宋体;">匹配行中任意字符串</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^ . . . . . . $ <span>                 </span><span style="font-family: 宋体;">包括</span>6<span style="font-family: 宋体;">个字符的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[a- zA-Z] <span>                    </span><span style="font-family: 宋体;">任意单字符</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="color: red;">[ a - z ] [ a - z ] *         </span>
				<span style="color: red; font-family: 宋体;">至少一个小写字母</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ ^ 0 - 9 " $ ] <span>               </span><span style="font-family: 宋体;">非数字或美元标识</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ ^ 0 - 0 A - Z a - z ] <span>    </span><span style="font-family: 宋体;">非数字或字母</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ 1 2 3 ] <span>                      1</span><span style="font-family: 宋体;">到</span>3<span style="font-family: 宋体;">中一个数字</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ D d ] e v i c e <span>           </span><span style="font-family: 宋体;">单词</span>d e v i c e<span style="font-family: 宋体;">或</span>D e v i c e</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">D e . . c e <span>                   </span><span style="font-family: 宋体;">前两个字母为</span>D e<span style="font-family: 宋体;">，后跟两个任意字符，最后为</span>c e</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">" ^ q <span>                           </span><span style="font-family: 宋体;">以</span>^ q<span style="font-family: 宋体;">开始行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^ . $ <span>                           </span><span style="font-family: 宋体;">仅有一个字符的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">^".[0-9][0-9] <span>               </span><span style="font-family: 宋体;">以一个句点和两个数字开始的行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="color: red;">' " D e v i c e " '            </span>
				<span style="color: red; font-family: 宋体;">单词</span>
				<span style="color: red;">d e v i c e</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="color: red;">D e [ V v ] i c e " .               </span>
				<span style="color: red; font-family: 宋体;">单词</span>
				<span style="color: red;">D e v i c e</span>
				<span style="color: red; font-family: 宋体;">或</span>
				<span style="color: red;">d e v i c e</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ 0 - 9 ] " { 2 " } - [ 0 - 9 ] " { 2 " } - [ 0 - 9 ] " { 4 " } <span>     </span><span style="font-family: 宋体;">对日期格式</span>d d - m m - y y y y</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ 0 - 9 ] " { 3 " } " . [ 0 - 9 ] " { 3 " } " . [ 0 - 9 ] " { 3 " } " . [ 0 - 9 ] " { 3 " } I P<span style="font-family: 宋体;">地址格式</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">[ ^ . * $ ] <span>                    </span><span style="font-family: 宋体;">匹配任意行</span></p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="color: red;">[A-Za-z]*            </span>
				<span style="color: red; font-family: 宋体;">匹配所有单词</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<h2>
				<span style="font-family: 黑体;">常用的</span>g r e p<span style="font-family: 黑体;">选项</span></h2>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">-c </span>
				<span style="font-size: 14pt; font-family: 宋体;">只输出匹配行的计数。</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">-i </span>
				<span style="font-size: 14pt; font-family: 宋体;">不区分大小写（只适用于单字符）。</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">-h </span>
				<span style="font-size: 14pt; font-family: 宋体;">查询多文件时不显示文件名。</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">-l </span>
				<span style="font-size: 14pt; font-family: 宋体;">查询多文件时只输出包含匹配字符的文件名。</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">-n </span>
				<span style="font-size: 14pt; font-family: 宋体;">显示匹配行及行号。</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">-s </span>
				<span style="font-size: 14pt; font-family: 宋体;">不显示不存在或无匹配文本的错误信息。</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">-v </span>
				<span style="font-size: 14pt; font-family: 宋体;">显示不包含匹配文本的所有行。</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">例子</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">grep -v "Sort" tab2     </span>
				<span style="font-size: 14pt; font-family: 宋体;">显示不包含匹配文本的所有行</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">grep -n "Sort" tab2     </span>
				<span style="font-size: 14pt; font-family: 宋体;">显示匹配行及行号</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">grep -c "Sort" tab2     </span>
				<span style="font-size: 14pt; font-family: 宋体;">只输出匹配行的计数</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">精确匹配： grep "01"&gt;" tab2</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">grep -in "code" tab2    </span>
				<span style="font-size: 14pt; font-family: 宋体;">忽略大小写</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">多次过滤</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">grep -in "code" tab2 | grep "02"</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">使用grep匹配“与”或者“或”模式</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">g r e p</span>
				<span style="font-size: 14pt; font-family: 宋体;">命令加- E参数，这一扩展允许使用扩展模式匹配。例如，要抽取城市代码为2 1 9或2 1 6，方法如下：</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">grep –E ‘219|216’ tab2</span>
		</p>
		<h2>g r e p<span style="font-family: 黑体;">允许使用国际字符模式匹配或匹配模式的类名形式。</span></h2>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">类<span>                        </span>等价的正则表达式</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">[ [ : u p p e r : ] ]       [ A - Z ] </span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">[ [ : a l n u m : ] ]          [ 0 - 9 a - zA-Z]</span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">[ [ : l o w e r : ] ]        [ a - z ] </span>
		</p>
		<p align="left">
				<span style="font-size: 14pt; font-family: 宋体;">[ [ : s p a c e : ] ]         </span>
				<span style="font-size: 14pt; font-family: 宋体;">空格或</span>
				<span style="font-size: 14pt; font-family: 宋体;">t a b</span>
				<span style="font-size: 14pt; font-family: 宋体;">键</span>
		</p>
		<p>
				<span style="font-size: 14pt; font-family: 宋体;">[ [ : d i g i t : ] ]         [ 0 - 9 ] </span>
		</p>
		<p>
				<span style="font-size: 14pt; font-family: 宋体;">[ [ : a l p h a : ] ]       [ a - z A - Z ]</span>
		</p>
		<p> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">大多数系统管理员称 </span>
				<span style="font-size: 14pt; font-family: 宋体;">/ d e v / n u l l</span>
				<span style="font-size: 14pt; font-family: 宋体;">为比特池</span>
				<span style="font-size: 14pt; font-family: 宋体;">, </span>
				<span style="font-size: 14pt; font-family: 宋体;">可以将之看成一个无底洞，有进没有出，永远也不会填满。</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">要查看</span>
				<span style="font-size: 14pt; font-family: 宋体;">D N S</span>
				<span style="font-size: 14pt; font-family: 宋体;">服务器是否正在运行（通常称为</span>
				<span style="font-size: 14pt; font-family: 宋体;">n a m e d</span>
				<span style="font-size: 14pt; font-family: 宋体;">），方法如下</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">ps -ef | grep "name"|grep -v "grep"</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;"> </p>
		<h2>e g r e p</h2>
		<p style="margin: 0cm -88.6pt 0pt 0cm; text-align: left;" align="left">
				<span style="font-size: 14pt; font-family: 宋体;">e g r e p</span>
				<span style="font-size: 14pt; font-family: 宋体;">接受所有的正则表达式，</span>
				<span style="font-size: 14pt; font-family: 宋体;">一个显著特性是可以以一个文件作为保存的字符串，然后将之传给</span>
				<span style="font-size: 14pt; font-family: 宋体;">e g r e p</span>
				<span style="font-size: 14pt; font-family: 宋体;">作为参数，为此使用</span>
				<span style="font-size: 14pt; font-family: 宋体;">- f</span>
				<span style="font-size: 14pt; font-family: 宋体;">开关。</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm; text-align: left;" align="left">
				<span style="font-size: 14pt; font-family: 宋体;">   egrep -f par2 tab2    par2是文件，里面包括各种匹配的具体格式</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm; text-align: left;" align="left"> </p>
		<p style="margin: 0cm -88.6pt 0pt 0cm;">
				<span style="font-size: 14pt; font-family: 宋体;">如果要查询存储代码</span>
				<span style="font-size: 14pt; font-family: 宋体;">3 2 L</span>
				<span style="font-size: 14pt; font-family: 宋体;">或</span>
				<span style="font-size: 14pt; font-family: 宋体;">2 C C</span>
				<span style="font-size: 14pt; font-family: 宋体;">，可以使用（</span>
				<span style="font-size: 14pt; font-family: 宋体;">|</span>
				<span style="font-size: 14pt; font-family: 宋体;">）符号，意即“</span>
				<span style="font-size: 14pt; font-family: 宋体;">|</span>
				<span style="font-size: 14pt; font-family: 宋体;">”符号两边之一或全部。</span>
		</p>
		<p style="margin: 0cm -88.6pt 0pt 0cm; text-indent: 28.5pt;">
				<span style="font-size: 14pt; font-family: 宋体;">egrep '(Code|Sort)' tab2</span>
		</p>
		<p> </p>
		<p> </p>
<img src ="http://www.cnitblog.com/textbox/aggbug/62988.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-12-03 14:36 <a href="http://www.cnitblog.com/textbox/archive/2009/12/03/62988.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Sed 命令 </title><link>http://www.cnitblog.com/textbox/archive/2009/12/02/62974.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 02 Dec 2009 08:26:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/12/02/62974.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62974.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/12/02/62974.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62974.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62974.html</trackback:ping><description><![CDATA[
		<br />刚接触sed命令真是要命。试图在它的命令行内找一些规则。让人深深的感觉到linux 不适合外行人用的原因。说真的一个命令搞得如此的复杂真是大大的提高了它的学习门槛。牢骚废话少了既然自己选择的路就要自己坚持的走下去。<br />下面是一些学习笔记。<br /><br /><b>何时使用 sed</b><br />在修改文件时 , 如果不断地重覆某些编辑动作 , 则可用 sed 自动一次执行这些编辑动作。例如要使 received <br />
档内 1000 封电子信件内的发信人属名 "Tom" 改成 "John" , 此时只要在命令列上执行一简单的 sed 命令就可 <br />
把档内所有的 "Tom" 字串替换成 "Joh“ 等等<br /><br /><b><br />sed 的功能</b><br />sed 可删除(delete)、改变(change)、添加(append)、插入(insert)、合、交换文件中的资料行 , 或读入其它 <br />
档的资料到文件中 , 也可替换(substuite)它们其中的字串、或转换(tranfer)其中的字母等等。例如将文件中的 <br />
连续空白行删成一行、 "local" 字串替换成 "remote" 、"t" 字母转换成 "T"、将第 10 行资料与第 11 资料合 <br />
等。<br /><br /><br /><b>sed工作原理</b><br /> 当 sed 由标准输入读入一行资料并放入 pattern space 时 , sed 依照 sed script 的编辑指令逐一对 pattern space 内的资料执行编辑 , 之後 , 再由 pattern space 内的结果送到标准输出 , 接着再将下一行资 <br />
料读入。如此重执行上述动作 , 直至读完所有资料行为止。<br /><br /><br /><b>sed 组成</b><br /><font dragover="true" color="#333333">Sed 命令列可分成<b>编辑指令</b>与<b>文件档部份</b>。其中 , 编辑指令负责控制所有的编辑工作 ; 文件档表示所处理的档案。 <br />
sed 的编辑指令均由位址(address)与函数(function)两部份组成 , 其中 , 在执行时 , sed 利用它的位址参数来 决定编辑的对象;而用它的函数参数(解[3])编辑。 </font><br /><br /><b>sed运行环境</b><br /><font dragover="true" color="#333333"> sed 编辑指令 , 除了可在命令列上执行 , 也可在档案内执行。其中差别只是在命令列上执行时 , 其前必须加上选项 -e ; 而在档案内时 , 则只需在其档名前加上选项 -f。另外 , sed 执行编辑指令是依照它 <br />
们在命令列上或档内的次序。 </font><br /><br /><br /><b>执行<font color="#ff0000">命令列</font>上的编辑指令 </b><br />格式：<font color="#0000ff">sed </font>-e '<font color="#ff1493">编辑指令</font>1' -e '<font color="#ff1493">编辑指令</font>2' ... 文件档<br /><br />备注：所有编辑指令都紧接在选项 -e 之後 , 并置於两个 " ' " 特殊字元间。另外 , 命令上编辑指令的执行是由 左而右。<br /><br /><br />例如 , 删除 yel.dat 内 1 至 10 行资料 , 并将其余文字中的 "yellow" 字串改成 "black" 字串。此时 , 可将编辑指令直接在命令上执行 , 其命令如下 :<br />sed -e '<font color="#0000ff">1,10d</font>' -e '<font color="#0000ff">s/yellow/black/g</font>' yel.dat<br />在命令中 , 编辑指令 '1,10d'执行删除 1 至 10 行资料 ; 编辑指令 's/yellow/black/g' 执行"yellow" 字串替换成 "black" 字串。<br />下面这句是来自 LinuxSir.Org  LFS 里的一句： <br />sed 's@\./fixinc\.sh@-c true@' gcc/Makefile.in.orig &gt; gcc/Makefile.in<br /><br /><font color="#ff1493"><b>编辑指令</b></font><br />编辑指令的格式如下 : <br />[address1[,address2]] function [argument]<br /><b>位址参数 </b>address1 、address2 为行数或 regular expression 字串 , 表示所执行编辑的资料行 （<b>源</b>）;<br /><b>功能参数是</b>function[argument] 为 sed 的内定函数 , 表示执行的<b>编辑动作</b> （<b>动作</b>）<br />可以理解成：找到符合匹配的（源）行执行编辑动作，匹配是使用正则表达式来匹配。<br /><br />例如一下一些编辑命令：<br />10,200d  -----------删除档内第 10 行到第 200 行资料 <b>位址参数是 ：10，200； </b><b>功能参数是</b>：<b>d</b><br />10,/man/d----------删除档内第 10 行到含 "man" 字串的资料行 <b>位址参数是 ：10，/man/； </b><b>功能参数是</b>：<b>d</b><br />10d------------------删除档内第 10 行 <b>位址参数是 ：10； </b><b>功能参数是</b>：<b>d</b><br /> /apple/,/orange/d 删除资料区 , 由档内含有 "apple" 字串至含有 "orange" 字串的资料行 <b>位址参数是 ：/apple/ ,/orange/； </b><b>功能参数是</b>：<b>d</b><br /><br />源的选择来自位置参数，执行的动作来自函数参数那有多少函数参数就说明sed有多少功能。<br />一下是函数参数：<br /><br />{ } 集合有相同位址参数的指令<br />
! 不执行函数参数<br />
= 印出资料行数( line number )<br />
a\ 添加使用者输入的资料<br />
b label 将执行的指令跳至由 : 建立的参考位置<br />
c\ 以使用者输入的资料取代资料<br />
d 删除资料。 <br />
D 删除 pattern space 内第一个 newline 字母 \ 前的资料<br />
g 拷贝资料从 hold space<br />
G 添加资料从 hold space 至 pattern space <br />
h 拷贝资料从 pattern space 至 hold space <br />
H 添加资料从 pattern space 至 hold space <br />
l 印出 l 资料中的 nonprinting character 用 ASCII 码<br />
i\ 插入添加使用者输入的资料行<br />
n 读入下一笔资料<br />
N 添加下一笔资料到 pattern space<br />
p 印出资料<br />
P 印出 pattern space 内第一个 newline 字母 \ 前的资料<br />
q 跳出 sed 编辑<br />
r 读入它档内容<br />
s 替换字串<br />
t label 先执行一替换的编辑指令 , 如果替换成牛p&gt;则将编辑指令跳至 : label 处执行<br />
w 写资料到它档内。<br />
x 交换 hold space 与 pattern space 内容<br />
y 转换(transform)字元<br />
虽然 , sed 只有上表所述几个拥有基本编辑功能的函数 , 但由指令中位址参数和指令与指令间的配合 , 也能使sed 完成大部份的编辑任务。<br /><br /><br /><b>执行档案内的编辑指令 </b><br />
当执行的指令太多 , 在命令列上撰写起来十分混乱 , 此时 , 可将这些指令整理储存在档案(譬如档名为 script_file )内 , 用选项 -f script_file , 则让 sed 执行 script_file 内的编辑指令。其命 <br />
令的格示如下 : <br />
sed -f script_file 文件档
<p>其中 , 执行 script_file 内编辑指令的顺序是由上而下。例如上一节的例子 , 其可改成如下命令: <br />
sed -f ysb.scr yel.dat</p><p>其中 , ysb.scr 档的内容如下 : <br />
1,10d <br />
s/yellow/black/g</p><p>另外 , 在命令列上可混合使用选项 -e 与 -f , sed 执行指令顺序依然是由命令列的左到右,如执行至 -f 後 档案内的指令 , 则由上而下执行。</p><p><b>执行多个文件档的编辑 </b><br />
在 sed 命令列上 , 一次可执行编辑多个文件档 , 它们跟在编辑指令之後。例如 , 替换 <br />
white.dat、red.dat、black.dat 档内的 "yellow" 字串成 "blue" , 其命令如下: <br />
sed -e 's/yellow/blue/g' white.dat red.dat black.dat
</p><p>上述命令执行时 , sed 依 white.dat、red.dat、black.dat 顺序 , 执行编辑指令 s/yellow/blue/(请参照[section 4.1] , 进行字串的替换。</p><p><b>执行输出的控制 </b><br />
在命令列上的选项 -n (解[7]) 表示输出由编辑指令控制。由前章内容得知 , sed 会 "自动的" 将资料由 pattern space 输送到标准输出档。但藉着选项 -n , 可将 sed 这 "自动的" 的动作改成 "被动的" 由它所执行的编辑指令(解[8])来决定结果是否输出。由上述可知 , 选项 -n 必须与编辑指令一起配合 , 否则无法获得结果。例如 , 印出 white.dat 档内含有 "white"字串的资料行 , 其命令如下:</p><p>sed -n -e '/white/p' white.dat</p><p>上面命令中 , 选项 -n 与编辑指令 /white/p (参照[section4.6]) 一起配合控制输出。其中 , 选项 -n 将输出控制权移给编辑指令;/white/p 将资料行中含有 "white" 字串印出萤幕。</p><p><br /></p><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62974.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-12-02 16:26 <a href="http://www.cnitblog.com/textbox/archive/2009/12/02/62974.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>lfs-1</title><link>http://www.cnitblog.com/textbox/archive/2009/11/25/62811.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 25 Nov 2009 06:50:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/25/62811.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62811.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/25/62811.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62811.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62811.html</trackback:ping><description><![CDATA[我开始本来决定用pc来做这个的，就是为了尽量避免一些不必要侧错误。由于环境条件不允许最后还是先从vmware上弄了。<br /><br />1.前期准备<br />    <br /><img src ="http://www.cnitblog.com/textbox/aggbug/62811.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-25 14:50 <a href="http://www.cnitblog.com/textbox/archive/2009/11/25/62811.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Linux 内部命令Source 命令和 exec 命令 区别</title><link>http://www.cnitblog.com/textbox/archive/2009/11/23/62772.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Mon, 23 Nov 2009 02:27:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/23/62772.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62772.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/23/62772.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62772.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62772.html</trackback:ping><description><![CDATA[shell的内建命令exec将并不启动新的shell，而是用要被执行命令替换当前的shell进程，并且将老进程的环境清理掉，而且exec命令后的其它命令将不再执行。<br />因此，如果你在一个shell里面，执行exec ls那么，当列出了当前目录后，这个shell就自己退出了，因为这个shell进程已被替换为仅仅执行ls命令的一个进程，执行结束自然也就退出了。为了避免这个影响我们的使用，一般将exec命令放到一个shell脚本里面，用主脚本调用这个脚本，调用点处可以用bash a.sh，（a.sh就是存放该命令的脚本），这样会为a.sh建立一个sub shell去执行，当执行到exec后，该子脚本进程就被替换成了相应的exec的命令。<br />source命令或者"."，不会为脚本新建shell，而只是将脚本包含的命令在当前shell执行。<br />不过，要注意一个例外，当exec命令来对文件描述符操作的时候，就不会替换shell，而且操作完成后，还会继续执行接下来的命令。<br />    exec 3&lt;&amp;0:这个命令就是将操作符3也指向标准输入。<br /> <br />别处,这个命令还可以作为find命令的一个选项,如下所示: <br />(1)在当前目录下(包含子目录)，查找所有txt文件并找出含有字符串"bin"的行<br />find ./ -name "*.txt" -exec grep "bin" {} <br />(2)在当前目录下(包含子目录)，删除所有txt文件<br />find ./ -name "*.txt" -exec rm {}<br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62772.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-23 10:27 <a href="http://www.cnitblog.com/textbox/archive/2009/11/23/62772.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>前些天在淘宝上买了一个 friendly ARM mini2440 开发板</title><link>http://www.cnitblog.com/textbox/archive/2009/11/19/62698.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Thu, 19 Nov 2009 15:50:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/19/62698.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62698.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/19/62698.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62698.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62698.html</trackback:ping><description><![CDATA[ <br />仔细看了一遍他的说明书。 <br />CPU: SANSUNG S3C2440 主频率是 440 最高可以到530 MHz <br />内存：64M SDRAM 频率100MHz 32bit 数据总线<br /><br />启动方式两种<br />1.Nand Flash 64M   速度块，写次数多<br />2.Nor Flash  2M<img src="file:///C:/DOCUME%7E1/LUCKYS%7E1/LOCALS%7E1/Temp/moz-screenshot.png" alt="" />    相对慢点，写次数相对少<br /><img src="file:///C:/DOCUME%7E1/LUCKYS%7E1/LOCALS%7E1/Temp/moz-screenshot-1.png" alt="" /><img src="http://www.cnitblog.com/images/cnitblog_com/textbox/8457/r_BootRam.JPG" height="483" width="576" /><br /><br /><br />在 NAND FLASH 启动模式下，内部的4K Bytes BootSRam 被映射到nGCS0 片选的<br />空间;在 Nor Flash 启动模式（非NAND FLASH 启动模式）下，与nGCS0 相连的外部存<br />储器Nor Flash 就被映射到nGCS0 片选的空间 ，（这两个东西有点类似桌面pc 上的硬盘。为什么这么说呢? 它们有保存持久数据的作用，而且开机时候的BootLoad 都是从他们里面取出来放到内存执行的，这点类似硬盘的MBR)由于嵌入式工作的环境很多都不怎么适合使用机械转动硬盘所有使用Flash来代替了，这是我猜想的原因之一，其中也有成本问题。<br /><br />困扰的问题。为什么要存在两个Flash 呢？既然Nand Flash 都已经足够了？为什么还有Nor呢?<br />分析一下Nor和Nand的优点和缺点：<br /><br /><b>Nor：</b><br />1.NOR的特点是芯片内执行(XIP, eXecute In Place)，这样应用程序可以直接在flash闪存内运行，不必再把代码读到系统RAM中。 <br />2.NOR的传输效率很高，在1～4MB的小容量时具有很高的成本效益，但是很低的写入和擦除速度大大影响了它的性能。 <br />3.NOR flash带有SRAM接口，有足够的地址引脚来寻址，可以很容易地存取其内部的每一个字节。 <br />4.NOR的擦写次数是十万次<br />5.在NOR器件上运行代码不需要任何的软件支持<br />6.NAND和NOR器件在进行写入和擦除操作时都需要MTD。 <br />7.NOR主要应用在代码存储介质中<br /><br /><b>Nand：</b><br />1.NAND结构能提供极高的单元密度，可以达到高存储密度，并且写入和擦除的速度也很快。应用NAND的困难在于flash的管理和需要特殊的系统接口。<br />2.NAND器件使用复杂的I/O口来串行地存取数据，各个产品或厂商的方法可能各不相同 。8个引脚用来传送控制、地址和数据信息。 <br />
            3.NAND读和写操作采用512字节的块，这一点有点像硬盘管理此类操作，很自然地，基于NAND的存储器就可以取代硬盘或其他块设备。<br />4.NAND flash的单元尺寸几乎是NOR器件的一半，由于生产过程更为简单，NAND结构可以在给定的模具尺寸内提供更高的容量，也就相应地降低了价格; <br />5.NAND闪存中每个块的最大擦写次数是一百万次;<br />6.NAND器件上进行运行代码操作时，通常需要驱动程序，也就是内存技术驱动程序(MTD)<br />7.NAND和NOR器件在进行写入和擦除操作时都需要MTD。 <br />8.NAND发生位交换的次数要比NOR多<br />9.NAND适合于数据存储<br /><br /><br /><font size="4" face="Times New Roman">基于 ARM 内核的CPU在复位时通常都从地址 0x00000000处取它的第一条指令</font>开始执行。<br />由于嵌入式板不像普通的pc主板那样拥有自己的bios 这样很多嵌入式板子是需要自己写BootLoad 。<br />不过很多厂家出厂的都带有这段引导代码（BootLoad)它的作用就好似我们桌面电脑的bios作用。但是是用什么来保存这段代码呢？ 一般是用Nor Flash或 Nand Flash 来保存这段代码 我买的这块板就出厂的时候就 在Nor Flash里面初始化了 Supervivi （BootLoad,Bios) 他的作用挺多的。<b>比如初始化板的各个硬件（usb 串口 内存 等外围接口）设备接口，这样我们就不用自己去写访问这些硬件的代码就可以把我们写的代码传输到内存中并执行</b>（这样有利我们的主要精力就集中在开发应用代码里面了）但是对于我这个arm学习者也很关心Supervivi 里面的原理。以后有空就来研究一下它的原理。<br /><br /><br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62698.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-19 23:50 <a href="http://www.cnitblog.com/textbox/archive/2009/11/19/62698.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>觉得自己要弄一下lfs和内核源码,主要是现在感觉还是在linux外围转圈</title><link>http://www.cnitblog.com/textbox/archive/2009/11/18/62662.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 18 Nov 2009 03:47:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/18/62662.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62662.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/18/62662.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62662.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62662.html</trackback:ping><description><![CDATA[
		<br />萌发这个想法还是在ChinaUnix里面看到一回帖上包含有“LFS”这个关键字，当时不知道这个是什么意思，于是百度了一下原来是：“根据自己的要求重编译定制一个适合自己的系统”。当时想哇晒。。。这"LFS"挺恐怖，平时只是在linux windows舞台上舞刀弄剑，而"LFS"是要自己去搭建这个舞台，根本没有胆量去想。现在的linux 已经发展到几百万行代码我以什么手段工具去管理这些代码。其中 的复杂程度可想而知。到底该不该做呢？ 还好让我看到了 linuxSir.Org 的 《Linux From Scratch - 版本 6.2》 这篇文章不然真不知道如何开头。在此谢谢linuxSir.Org 我也是写这篇文章的时候加入了 linuxSir.Org 论坛。 学习 linux 感觉就是积累根本没什么捷径。“实践+笔记+总结” 我必须保持坚定的专注之心。开始筹备中。。。。。。我会记下LFS之路的点点滴滴。<br /><h4><br /></h4><img src ="http://www.cnitblog.com/textbox/aggbug/62662.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-18 11:47 <a href="http://www.cnitblog.com/textbox/archive/2009/11/18/62662.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>yum 卸载依赖的包</title><link>http://www.cnitblog.com/textbox/archive/2009/11/17/62644.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 17 Nov 2009 07:15:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/17/62644.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62644.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/17/62644.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62644.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62644.html</trackback:ping><description><![CDATA[安装 yum-remove-with-leaves.noarch 插件就可以了！<br />在终端里面执行代码：<br />     #yum install yum-remove-with-leaves.noarch   <br /><img src ="http://www.cnitblog.com/textbox/aggbug/62644.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-17 15:15 <a href="http://www.cnitblog.com/textbox/archive/2009/11/17/62644.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>source命令</title><link>http://www.cnitblog.com/textbox/archive/2009/11/16/62620.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Mon, 16 Nov 2009 09:45:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/16/62620.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62620.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/16/62620.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62620.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62620.html</trackback:ping><description><![CDATA[        source命令(从 C Shell 而来)是bash shell的内置命令。点命令，就是一个点符号，(从Bourne
Shell而来)是source的另一名称。   <br />同样的，当前脚本中设置的变量也将作为脚本的环境，source(或点)命令通常用于重新执行刚修改的初始化
文件，<br />如 .bash_profile 和 .profile 等等。例如，如果在登录后对 .bash_profile 中的 EDITER 和
TERM 变量做了修改，<br />则可以用source命令重新执行 .bash_profile
中的命令而不用注销并重新登录。把两个命令用&amp;&amp;联接起来，如 make mrproper &amp;&amp;make
menuconfig ，表示要第一个命令执行成功才能执行第二个命令。
在编译核心时，常常要反复输入一长串命令，如
make mrproper
make menuconfig
make dep
make clean
make bzImage
.......
这些命令既长，又繁琐。而且有时候容易输错，浪费你的时间和精力。如果把这些命令做成一个文件，让它自动按顺序执行，对于需要多次反复编译核心的用户来
说，会很方便。用source命令可以办到这一点。它的作用就是把一个文件的内容当成是shell来执行。先在/usr/src/linux-
2.4.20目录下建立一个文件，取名为make_command：
在其中输入如下内容：
make mrproper &amp;&amp;
make menuconfig &amp;&amp;
make dep &amp;&amp;
make clean &amp;&amp;
make bzImage &amp;&amp;
make modules &amp;&amp;
make modules_install &amp;&amp;
cp arch/i386/boot/bzImge /boot/vmlinuz_new &amp;&amp;
cp System.map /boot &amp;&amp;
vi /etc/lilo.conf &amp;&amp;
lilo -v
文件建立好之后，以后每次编译核心，只需要在/usr/src/linux-2.4.20下输入
source make_command
就行了。这个文件也完全可以做成脚本，只需稍加改动即可。这里主要是让大家理解source的用法。如果你用的不是lilo来引导系统，可以把最后两句话
去掉。配置你自己的引导程序来引导新内核。
source命令的作用就是用来执行一个脚本，那么：
source a.sh 同直接执行 ./a.sh 有什么不同呢，比如你在一个脚本里export $KKK=111
,如果你用./a.sh执行该脚本，执行完毕后，你运行 echo $KKK ,发现没有值，如果你用source来执行 ，然后再echo
,就会发现KKK=111。因为调用./a.sh来执行shell是在一个子shell里运行的，所以执行后，结构并没有反应到父shell里，但是
source不同它就是在本shell中执行的，所以可以看到结果<br /><br /><br /><b>说白了就是执行一个文件内的脚本的命令。</b><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62620.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-16 17:45 <a href="http://www.cnitblog.com/textbox/archive/2009/11/16/62620.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>WINDOWS下访问LINUX分区工具汇总（转）</title><link>http://www.cnitblog.com/textbox/archive/2009/11/16/62610.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Sun, 15 Nov 2009 16:11:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/16/62610.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62610.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/16/62610.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62610.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62610.html</trackback:ping><description><![CDATA[
		<p>转贴自<a href="http://bbs.chinaunix.net/">http://bbs.chinaunix.net</a>     作者： <a target="_blank" href="http://bbs.chinaunix.net/profile-uid-271323.html"><font face="Fixedsys">traveller2</font></a>   <img alt="帅哥" src="http://bbs.chinaunix.net/images/default/icon_minigender_male.gif" border="0" /><span class="smalltxt">(旅行者2号)</span> 风云使者</p>
		<p>初入linux门槛的菜鸟，一般都体验过WINDOWS与LINUX系统分区无法互访的苦恼.关于在LINUX如何访问FAT32、NTFS分区的文章已
经很多，但指导WINDOWS访问ext2、reiserfs分区的文章却比较零星，今天心情好^_^我把WINDOWS中可以访问LINUX分区的工具
整理了一下，并对使用方法做点讲解(以下软件，未注明是中文版或汉化版者均为英文版,测试环境为WINDOWS XP SP2)。<br />
  <br />
先拣比较好用的说<br /><br /><font color="Red">1、explore2fs 1.00 pre 6b 汉化版 </font><br /><font color="blue">下载地址</font>： http://www.newhua.com/soft/19613.htm<br /><br />
使用相当简单，下载后解压缩，执行explore2fs.exe，程序会自动搜索ext2、ext3分区，使用效果如下<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815163606.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="Click here to open new window&#xD;&#xA;CTRL+Mouse wheel to zoom in/out" border="0" width="716" /><br /><br />
不过这个软件默认只能实现ext2、3分区的读访问，程序好像也设计有可写选项，不过打不开。<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815203912.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br />
若想提取文件，找到想要的文件后右击，选择“导出文件”保存即可。中文文件 文件名名无法正常显示。<br /><br /><br /><font color="Red">2、使用高级资源管理器Total Commander加Ext2+Reiser 插件实现Ext2和Reiser FS分区的只读访问</font><br />
Total Commander 6.55 绿色汉化精简版<br /><font color="blue">下载地址</font>： http://www.newhua.com/soft/5690.htm<br />
Ext2+Reiser 插件下载<br /><font color="blue">下载地址</font>： http://ghisler.fileburst.com/fsplugins/ex2fs.zip<br />
http://www.ghisler.com/plugins.htm  有许多插件可下载使用。<br /><br />
  下载并安装Total Commander，下载并解压缩Ext2+Reiser插件中的output目录到Total
Commander的安装目录内（或硬盘的其他固定位置，想使用就不能删除），运行Total
Commander，选择配置－－插件－－文件系统插件－－配置－－添加－－找到ex2fs.wfx并添加，最后“确定”插件添加成功。<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815204224.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="Click here to open new window&#xD;&#xA;CTRL+Mouse wheel to zoom in/out" border="0" width="716" /><br /><br />
然后你就可以使用Total Commander来读Ext2和Reiser FS分区内的资料了。到“网上邻居”里找“linux－drives”<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815204416.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br />
打开后就可以读了。<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815204655.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br /><br />
3、ext2ifs，这个工具与explore2fs都是John Newbigin使用Delphi写的，explore2fs Copyright
(C) 2000，Ext2IFS v0.3 Copyright (C)
2004，由此也可以推测下哪个程序更完善，ext2ifs默认支持ext分区的写操作，程序虽然英文版，但很容易看懂如何使用。<br /><font color="blue">下载地址</font>： http://uranus.it.swin.edu.au/~jn/linux/ext2ifs/ext2ifs-0.3.zip<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815204939.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br />
  建议将驱动设置为自动启动而不要使用默认的手动，否则分区即使被挂载到某一盘符下，也无法正常访问，会提示“要不要格式化”，启动驱动后才能正常访问。<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815204836.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815205152.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br />
设置好盘符后保存并确认。<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815205239.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815205334.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815205451.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br />
需重新启动系统。<br /><br /><br /><font color="Red">4、另一个ext2ifs（重名了^_^）Ext2 Installable File System 1.10b</font>，两个软件不是一个作者，不过实现的原理应该相似，驱动通用。这个软件安装后就能使用ext分区，可读写，但更改分区盘符很不方便，需要先到控制面板卸载，重启后重新安装程序重设盘符。<br /><font color="blue">下载地址</font>： http://www.fs-driver.org/download/Ext2IFS_1_10b.exe<br /><br />
安装很简单，一路next，到了如图画面设置盘符。<br /><br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815210240.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="Click here to open new window&#xD;&#xA;CTRL+Mouse wheel to zoom in/out" border="0" width="716" /><br /><br /><br /><br /><br /><font color="Red">5、Paragon Mount Everything Professional 3.0 汉化版</font>和Paragon
Ext2FS Anywhere 3.0，这两个软件是同一个公司出品，功能极其相似，Paragon Mount Everything
Professional里已经包含了Paragon Ext2FS Anywhere，当然卖的价格也高了10美元，我们只介绍Paragon
Mount Everything Professional 3.0 汉化版，先介绍下功能<br /><br /></p>
		<div class="msgbody">
				<div class="msgheader">
						<div class="right">
								<a href="http://bbs.chinaunix.net/viewthread.php?tid=811801###" class="smalltxt" onclick="copycode($('code0'));">[Copy to clipboard]</a>
								<a class="smalltxt" href="http://bbs.chinaunix.net/viewthread.php?tid=811801###" onclick="toggle_collapse('code0');">[ <span id="code0_symbol">-</span> ]</a>
						</div>CODE:</div>
				<div class="msgborder" &nbsp;&nbsp;style="font-family:Fixdays" id="code0"> Paragon Mount Everything Professional 是一款功能强劲的磁盘管理工具,程序<br />
可以让你挂载各种系统格式下文件的软件，让不同系统下的文件可以互相访问。<br /><br />
Mount Everything 用于解除各个操作系统（DOS，Windows，Linux）访问彼此文件<br />
系统的分区，使得访问计算机上别的操作系统的文件系统如同访问自己本来的文件系<br />
统一样方便，可以自如的浏览、读写、创建甚至运行在各个分区的文件。<br /><br />
－支持NTFS1.2 - 3.1（Windows NT/2000/XP）；<br />
－支持可压缩的NTFS；<br />
－支持Ex2和Ext3文件系统；<br />
－在各中环境－Windows、DOS、Linux－下都支持大于4GB的分区；<br />
－Windows平台支持：Windows 95/98/ME, Windows NT/2000 Workstation/Pro, <br />
  Windows XP；<br />
－任何Windows版本都可以无限制的访问Ext2/3FS和NTFS；<br />
－DOS下对NTFS只读；<br />
－Linux下对NTFS只读；<br />
－在任何环境都支持基于脚本的批处理；<br />
－Windows下提供了各种基本的分区功能；<br />
－WIndows和DOS下随意改变启动器号；<br />
－可建立能够访问NTFS以及其他各种移动存贮设备的DOS启动盘；<br />
－提供了一个启动光盘，可直接进入DOS或Linux，并且访问NTFS（只读）；</div>
		</div>
		<br />这个软件......我第一次安装测试时能正常使用，后来为了截图重新安装，装载分区后无法正常读写，问要不要格式化T_T，原因暂时未知，软件界面和PM极相似，如何使用请读者自行探索^_^<br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815210700.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="" border="0" /><br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815211140.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="Click here to open new window&#xD;&#xA;CTRL+Mouse wheel to zoom in/out" border="0" width="716" /><br /><br /><img src="http://www.cublog.cn/u/10500/photo/060815210950.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="Click here to open new window&#xD;&#xA;CTRL+Mouse wheel to zoom in/out" border="0" width="716" /><br /><br /><br />
Paragon Mount Everything Professional 3.0 汉化版<br /><font color="blue">下载地址</font>： http://www.newhua.com/soft/42757.htm<br />
Paragon Ext2FS Anywhere 3.0<br /><font color="blue">下载地址</font>： http://www.newhua.com/soft/34395.htm<br /><br /><br /><font color="Green">为测试软件不断重启，有些累了，发觉自己也实在罗唆，软件的安装使用方法看看readme就可以了。下面的这些软件暂不写使用方法了，有必要的话我再补。</font><br /><br /><br /><font color="Red">6、Ext2Fsd </font> 安装后使用mount命令对ext分区挂载卸载，可读写。<br /><font color="blue">下载地址</font>： http://switch.dl.sourceforge.net/sourceforge/ext2fsd/Ext2Fsd-0.25.exe<br /><br /><font size="4"><font color="Red">以下四款是读ReiserFS分区的工具。</font></font><br /><font color="Red">7、rfstool</font>  命令行工具<br /><font color="blue">下载地址</font>： http://freshmeat.net/redir/rfstool/33620/url_zip/rfstool-0.14.zip<br /><br /><br /><br /><font color="Red">8、rfsgui-2.2</font>  使用rfstool功能，gui界面。<br /><font color="blue">下载地址</font>： http://www.wolfsheep.com/map/rfsgui/rfsgui-2.2.zip<br /><img src="http://www.cublog.cn/u/10500/photo/060815211730.jpg" onload="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onmouseover="if(this.width&gt;screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open(this.src);}" onmousewheel="return imgzoom(this);" alt="Click here to open new window&#xD;&#xA;CTRL+Mouse wheel to zoom in/out" border="0" width="716" /><br /><br /><br /><br /><font color="Red">9、YAReG-1.0.zip </font>(也是使用rfstool功能，gui界面)<br /><font color="blue">下载地址</font>： http://yareg.akucom.de/download.cgi/YAReG-1.0.zip<br />
使用此软件需安装Microsoft .NET framework 1.1<br /><font color="blue">下载地址</font>： http://download.microsoft.com/download/7/b/9/7b90644d-1af0-42b9-b76d-a2770319a568/dotnetfx.exe<br /><br /><font color="Red">10、ReiserDriver Pre-release Version 2</font><br /><font color="blue">下载地址</font>： http://switch.dl.sourceforge.net/sourceforge/rfsd/ReiserDriver.pre-release.v2.zip<br /><br /><br />
  上面列出的工具只是比较常见的，还有不少WINDOWS下可访问LINUX分区的工具，这得益于微软的<br />
IFS Kit（The primary goal of the Microsoft Windows Installable File
System (IFS) Kit is to provide all of the materials necessary to
design, build, and debug file systems and file system filter drivers
for Windows 2000 and later operating systems.）想看了解更多不妨到这里去看看：<br />
http://www.microsoft.com/taiwan/whdc/devtools/ifskit/default.mspx<p></p><img src ="http://www.cnitblog.com/textbox/aggbug/62610.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-16 00:11 <a href="http://www.cnitblog.com/textbox/archive/2009/11/16/62610.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>今天终于装好了双系统winxp+fedora9</title><link>http://www.cnitblog.com/textbox/archive/2009/11/15/62604.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Sun, 15 Nov 2009 03:40:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/15/62604.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62604.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/15/62604.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62604.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62604.html</trackback:ping><description><![CDATA[
		<br />经过这几天的反复重装终于把双系统和开机背景给搞进去了。<br />说句实在话，一开始真是往往然，按照网上的教程弄搞的我的爱机反复被我折腾，老婆都很大意见，害的她的菜收不了呵呵。现在我要把我的安装流程和遇到的一些坎写下来不然过几天我就给忘了。<br /><br />我的目的是使用grub 实现引导双系统 winxp 和 fedora 9 。<br /><br />我的电脑是 sumsung x10 的本本（已经是老掉牙的本本了）磁盘分了3个区 c d e (e盘是fat32的 用于放fc9的iso文件和引导安装的文件 initrd.img 和 vmlinuz 　，其他分区是ntfs的）还有8g未分区的空间用于装fc9 打算到了安装fc9的过程中去安装。首先要把准备工作做好。<br /><br />准备工具 <br />1.WinXP 安装启动盘<br />2.WinGrub Windows版的GRUB<br />3.fc9.iso fc9的iso格式的安装文件<br />4.Xnview xpm图片转换工具 用于生产引导画面<br /><br />以上东西准备好了就可以开工了。<br />步骤如下<br />1.首先安装 WinXP 到c盘 <br />2.然后利用WinXP里面的磁盘工具进行分区格式化出 e 盘记住要格式成 fat32格式的。<br />3.安装 WinGrub 查看e盘的标识 (hd0,5) d盘(hd0,4) c盘(hd0,0) 然后安装grub到MBR中（我没选xp boot.ini 配置来引导，其实选也可以）<br />4.配置C:\Grub\MENU.LST的内容<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);"><br />timeout </span><span style="color: rgb(0, 0, 0);">20</span><span style="color: rgb(0, 0, 0);"><br /><br />title Windows at (hd0,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br />rootnoverify (hd0,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br />chainloader </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"><br /><br />title fc9 install</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">repare<br />root (hd0,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">)<br />kernel (hd0,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">vmlinuz<br />initrd (hd0,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">initrd.img</span></div><br />保存后就可以了。 设置完以后确认c盘根目录下有 GRLDR 文件 这个是grub的运行文件，如果缺少它等下重新启动的时候会出现 GRLDR is miss 的错误。开始我遇到这个错误的时候就抓头了。怎么办啊。。。<br />后来发现这个错误很容易取消的（根本不用重新装xp )。确认启动盘GRLDR 文件的存在，然后重新启动就会进入到grub的启动菜单了。<br />下面就开始安装 fc9<br />选择 第二个菜单fc9 install/repare <br />设置了一些东西之后就会出现安装界面了<br />这里需要注意的是安装时候的分区和bootload的安装方法<br />分区 100m的 swp 交换分区.<br />其余的使用extr3格式安装fc文件挂在"/"下 ，booltload mbr 安装到 (hda) <br />安装完后就可以重新启动.（记住把bios内的光盘启动给取消改成硬盘启动不然有可能会出现 GRLDR is miss 感觉这点grub这点好傻瓜）进入fc9以后就可以修改/boot/grub/grub.conf 的内容<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">timeout </span><span style="color: rgb(0, 0, 0);">20</span><span style="color: rgb(0, 0, 0);"><br /><br />title Windows at (hd0,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br />rootnoverify (hd0,</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">)<br />chainloader </span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">1</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 0);">title fedora 9</span><span style="color: rgb(0, 0, 0);"><br />root (hd0,</span><span style="color: rgb(0, 0, 0);">7</span><span style="color: rgb(0, 0, 0);">)<br />kernel </span><span style="color: rgb(0, 0, 0);"></span><span style="color: rgb(0, 0, 0);">boot/</span><span style="color: rgb(0, 0, 0);">vmlinuz（<font color="#008000">后面还有一大串东西 省略了。默认已经有的无需修改</font>）<br />initrd boot</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">initrd</span><span style="color: rgb(0, 0, 0);">（<font color="#006400">后面还有一大串东西 省略了。默认已经有的无需修改</font>）</span><span style="color: rgb(0, 0, 0);">.img</span><br /><span style="color: rgb(0, 0, 0);"><br />title fc9 install</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">repare<br />root (hd0,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">)<br />kernel (hd0,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">vmlinuz<br />initrd (hd0,</span><span style="color: rgb(0, 0, 0);">5</span><span style="color: rgb(0, 0, 0);">)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">initrd.img</span></div><br />保存后重新启动电脑就可以看到对应的菜单了。然后进入windows 把grub卸载就可以了，应xnview 找一张你喜欢的图片用xnview 修改成640*480大小颜色是16色的图片让那后保存成xpm格式。然后会到fedora下/boot/grub/把原来的 splash.xpm.gz 改名。把你要换的图片拷贝到该目录然后改成splash.xpm 名字压缩成gz 格式重新启动电脑就完事了。还有一个问题就是fc9的上网上不了，网上搜索了一短时间发现没人可以解决。奇怪？<br />后来发现是fc9的UI 的bug ，图标是叉叉，只要能设置好网关 ip，并且能ping 通就能上网了。不够自带的firefox浏览器性能上真是不能苟同<br />要用linux 还是用高版本的吧。要不是开发用我才不想用fc9呢<br /><img src ="http://www.cnitblog.com/textbox/aggbug/62604.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-15 11:40 <a href="http://www.cnitblog.com/textbox/archive/2009/11/15/62604.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>grub initrd vmlinuxz kernel system.map</title><link>http://www.cnitblog.com/textbox/archive/2009/11/14/62598.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Sat, 14 Nov 2009 09:34:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/14/62598.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62598.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/14/62598.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62598.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62598.html</trackback:ping><description><![CDATA[
		<br />
		<b>1.grub</b> 系统引导工具，有linux ,windows版本  用于一台电脑安装多种操作系统，它提供给各个系统引导也就是说做一个多系统启动的菜单。<br /><b><br />2.initrd</b><br /><font size="3">initrd 映像中包含了支持 Linux 系统两阶段引导过程所需要的必要可执行程式和系统文件。</font><br /><br />initrd是“initial
ramdisk”的简写。initrd一般被用来临时的引导硬件到实际内核vmlinuz能够接管并继续引导的状态。图中的initrd-
2.4.7-10.img主要是用于加载ext3等文件系统及scsi设备的驱动。比如，使用的是scsi硬盘，而内核vmlinuz中并没有这个
scsi硬件的驱动，那么在装入scsi模块之前，内核不能加载根文件系统，但scsi模块存储在根文件系统的/lib/modules下。为了解决这个
问题，可以引导一个能够读实际内核的initrd内核并用initrd修正scsi引导问题。initrd-2.4.7-10.img是用gzip压缩的
文件，下面来看一看这个文件的内容，操作步骤如下图所示： <br /><br />从图中linuxrc这个脚本的内容可以看到，initrd实现加载一些模块和安装文件系统等。 <br />initrd映象文件是使用mkinitrd创建的。mkinitrd实用程序能够创建initrd映象文件。这个命令是RedHat专有的。其它Linux发行版或许有相应的命令。这是个很方便的实用程序。具体情况请看帮助：man mkinitrd <br /><br /><b>3.vmlinuz </b><br /><br />vmlinuz是可引导的、压缩的内核。“vm”代表“Virtual Memory”。Linux
支持虚拟内存，不像老的操作系统比如DOS有640KB内存的限制。Linux能够使用硬盘空间作为虚拟内存，因此得名“vm”。vmlinuz是可执行
的Linux内核，它位于/boot/vmlinuz，它一般是一个软链接，比如图中是vmlinuz-2.4.7-10的软链接。 <br />vmlinuz的建立有两种方式。一是编译内核时通过“make zImage”创建，然后通过： <br />“cp
/usr/src/linux-2.4/arch/i386/linux/boot/zImage
/boot/vmlinuz”产生。zImage适用于小内核的情况，它的存在是为了向后的兼容性。二是内核编译时通过命令make
bzImage创建，然后通过：“cp /usr/src/linux-2.4/arch/i386/linux/boot/bzImage
/boot/vmlinuz”产生。bzImage是压缩的内核映像，需要注意，bzImage不是用bzip2压缩的，bzImage中的bz容易引起
误解，bz表示“big zImage”。 bzImage中的b是“big”意思。 <br />zImage（vmlinuz）和bzImage（vmlinuz）都是用gzip压缩的。它们不仅是一个压缩文件，而且在这两个文件的开头部分内嵌有gzip解压缩代码。所以你不能用gunzip 或 gzip –dc解包vmlinuz。 <br />内
核文件中包含一个微型的gzip用于解压缩内核并引导它。两者的不同之处在于，老的zImage解压缩内核到低端内存（第一个640K），bzImage
解压缩内核到高端内存（1M以上）。如果内核比较小，那么可以采用zImage
或bzImage之一，两种方式引导的系统运行时是相同的。大的内核采用bzImage，不能采用zImage。 <br />vmlinux是未压缩的内核，vmlinuz是vmlinux的压缩文件。 <br /><br /><br /><b>4.kernel </b><br /><br /><br /><b>5.System.map</b><font size="3">内核符号映射表，顾名思义就是将内核中的符号（也就是内核中的函数）和它的地址能联系起来的一个列表 <br />下面是一个system.map一部分，每次编译内核都会产生一个新的system.map<br /></font><font size="3">c0100000 A _text<br />
c0100000 t startup_32<br />
c01000a5 t checkCPUtype<br />
c0100133 t is486<br />
c0100142 t is386<br />
c010018c t L6<br />
c010018e t ready<br />
c010018f t check_x87<br />
c01001b6 t setup_idt<br />
c01001d3 t rp_sidt<br />
c01001e0 T stack_start<br />
c01001e8 t int_msg<br />
c01001fc t ignore_int<br />
c010021e T idt_descr<br />
c0100224 T cpu_gdt_descr<br />
c0101000 T swapper_pg_dir<br />
c0102000 T pg0<br />
c0103000 T pg1<br />
c0104000 T empty_zero_page<br />
c0105000 T _stext</font><br /><br /><font size="3"><br /></font><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62598.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-14 17:34 <a href="http://www.cnitblog.com/textbox/archive/2009/11/14/62598.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>如何才能保持专注</title><link>http://www.cnitblog.com/textbox/archive/2009/11/11/62527.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 11 Nov 2009 08:07:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/11/62527.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62527.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/11/62527.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62527.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62527.html</trackback:ping><description><![CDATA[   其实心里很想做一些东西，内心老是在提醒自己。但是总是被一些无关紧要的事情给分散注意力。一天时间莫名奇妙的过去了到了下班那一刻感觉在浪费时间。上网瞎逛，看美女图片，看新闻，看股市，qq农场，论坛，吃东西，身体不舒服，心静不下来，发呆，跟同事聊天 等等以上的任何一件事都可以打发掉一天的时间的几分之几。 我应该改变一下以前不写东西的习惯。这一个月来写了很多东西。<br /><br />     如何才能保证专注的心去做一件事呢，这让我想起了武侠小说里面的闭关修炼方法，也许只有这个办法才能保证一个人在专注一件事情。现实是不容许我这样做的，我只能做是尽量减少各种干扰。 把游戏删除了，把网页给屏蔽 等等 想尽一些方法来提醒我不应该做一些事。到最后必须要学会放弃。<br />    要学linux 就要装一非虚拟机的Linux ，决定了开始绸缪如何装双系统。把游戏，聊天，等等干扰的东西尽量放到一个比较麻烦的地方让自己都觉得麻烦就起到一种提醒作用和阻吓的作用,等我装完了就把过程写上来。win xp + fedora 9 双系统（先有win xp 系统） 无fedora 光碟。<br /><br />     后来发现装好了还是被很多琐碎的事情给耗掉了好多时间。。。。。。。。。。。。。真的要闭关修炼？<br /><img src ="http://www.cnitblog.com/textbox/aggbug/62527.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-11 16:07 <a href="http://www.cnitblog.com/textbox/archive/2009/11/11/62527.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>几天前在fedora 9 上编译《设备驱动第三版》的例子出错了一个system call 错误</title><link>http://www.cnitblog.com/textbox/archive/2009/11/03/62372.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 03 Nov 2009 04:01:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/03/62372.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62372.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/03/62372.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62372.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62372.html</trackback:ping><description><![CDATA[
		<b>错误 ：</b>
		<br />setlevel.c :30 :error: expected declaration sepecifiers of '...' before 'syslog'<br />
setlevel.c :30 :error: expected declaration sepecifiers of '...' before 'type'<br />
setlevel.c :30 :error: expected declaration sepecifiers of '...' before 'bufp'<br />


setlevel.c :30 :error: expected declaration sepecifiers of '...' before 'len'<br /><br />

错误发生在<br />一个函数声明那里<br /><br />_systecall3(int,syslog,int,type,char*,bufp,int,len);<br /><br />看不出那里出错。 上goole了一下。发现这是内核版本的问题。systecall3 是在2.6.11以前 的版本才有定义，之後版本就取消了。我使用的是2.6.25.14 为了编译它们需要加上定义才可以<br /><br /><br />什么是System Call 呢？？疑问出来了。<br /><br />以下是网络上一个个解释：<br /><font color="#ff0000"> <font size="2"><b> 所有的操作系统在其内核里都有一些内建的函数，这些函数可以用来完成一些系统级别的<span href="http://www.motobbs.com/tag.php?name=%B9%A6%C4%DC" onclick="tagshow(event)" class="t_tag">功能</span>。Linux系统使用的这样的函数叫做“系统调用”，英文systemcall</b><br /><b>系统支持的system call 文件位于 /usr/include/bits/syscall.h<span href="http://www.motobbs.com/tag.php?name=%CE%C4%BC%FE" onclick="tagshow(event)" class="t_tag"></span> 内<br /><br />每个系统调用都有一个定义好的数字，这些数字是用来构造这些系统调用的。内核通过0x80中断来管理这些系统调用。这些系统调用的对应的数字和一些参数都在调用的时候送到某些寄存器里面。</b><b><span style="font-size: 14px; line-height: 18px;">并且%eax寄存器全面检查系统调用表 如<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">sc()<br />{  </span><span style="color: rgb(0, 128, 0);"></span><span style="color: rgb(0, 128, 0);"><br /></span><span style="color: rgb(0, 0, 0);">　 __asm__(<br />　　　 </span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">movl $165,%eax</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);">　　　　</span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> $</span><span style="color: rgb(0, 0, 0);">0x80</span><span style="color: rgb(0, 0, 0);">"<br /></span><span style="color: rgb(0, 0, 0);">            );</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);">} </span></div> 以上是呼叫165这个 System Call<br /><font color="#000000">系统调用的数字实际上是一个序列号，表示其在系统的一个数组sys_call_table[165]中的地址。<br />下图是网络上找来的</font></span></b></font></font><font color="#000000"><br /><img src="file:///C:/DOCUME%7E1/admin/LOCALS%7E1/Temp/moz-screenshot.png" alt="" /><img src="file:///C:/DOCUME%7E1/admin/LOCALS%7E1/Temp/moz-screenshot-1.png" alt="" /></font><br /><img src="file:///C:/Documents%20and%20Settings/admin/Desktop/1206971856.jpg" alt="" /><img src="http://www.cnitblog.com/images/cnitblog_com/textbox/8457/r_1206971856.jpg" /><br /><br /><b><br />下图是根据calltables数组会叫对应eax寄存器的值为序号的system call</b><br /> <img src="http://www.cnitblog.com/images/cnitblog_com/textbox/8457/r_1206971942.jpg" /><br />下面是entry_32.s内的 system call 的汇编源码<br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">    # system call handler stub<br />ENTRY(system_call)<br />    RING0_INT_FRAME            # can</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">t unwind into user space anyway</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);">    pushl </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax            <font color="#008000"># save orig_eax 保存eax 入栈</font><br />    CFI_ADJUST_CFA_OFFSET </span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);"><br />    SAVE_ALL           <font color="#008000">//保存所有寄存器，所有入栈</font><br />    GET_THREAD_INFO(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">ebp)             # system call tracing </span><span style="color: rgb(0, 0, 255);">in</span><span style="color: rgb(0, 0, 0);"> operation </span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);"> emulation 获取进程的信息 PCB (task_struct)<br />    </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> Note, _TIF_SECCOMP is bit number 8, and so it needs testw and not testb </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    testw $(_TIF_SYSCALL_EMU</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);">_TIF_SYSCALL_TRACE</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);">_TIF_SECCOMP</span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);">_TIF_SYSCALL_AUDIT),TI_flags(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">ebp)<br />    jnz syscall_trace_entry<br />    cmpl $(nr_syscalls), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax<br />    jae syscall_badsys<br />syscall_call:<br />    call </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">sys_call_table(,</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax,</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">)<br />    movl </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax,PT_EAX(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp)        # store the </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> value<br />syscall_exit:<br />    LOCKDEP_SYS_EXIT<br />    DISABLE_INTERRUPTS(CLBR_ANY)    # make sure we don</span><span style="color: rgb(0, 0, 0);">'</span><span style="color: rgb(0, 0, 0);">t miss an interrupt</span><span style="color: rgb(0, 0, 0);"><br /></span><span style="color: rgb(0, 0, 0);">                    # setting need_resched or sigpending<br />                    # between sampling and the iret<br />    TRACE_IRQS_OFF<br />    testl $TF_MASK,PT_EFLAGS(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp)    # If tracing </span><span style="color: rgb(0, 0, 255);">set</span><span style="color: rgb(0, 0, 0);"> singlestep flag on exit<br />    jz no_singlestep<br />    orl $_TIF_SINGLESTEP,TI_flags(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">ebp)<br />no_singlestep:<br />    movl TI_flags(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">ebp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">ecx<br />    testw $_TIF_ALLWORK_MASK, </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">cx    # current</span><span style="color: rgb(0, 0, 0);">-&gt;</span><span style="color: rgb(0, 0, 0);">work<br />    jne syscall_exit_work<br /><br />restore_all:<br />    movl PT_EFLAGS(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax    # mix EFLAGS, SS and CS<br />    # Warning: PT_OLDSS(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp) contains the wrong</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">random values </span><span style="color: rgb(0, 0, 255);">if</span><span style="color: rgb(0, 0, 0);"> we<br />    # are returning to the kernel.<br />    # See comments </span><span style="color: rgb(0, 0, 255);">in</span><span style="color: rgb(0, 0, 0);"> process.c:copy_thread() </span><span style="color: rgb(0, 0, 255);">for</span><span style="color: rgb(0, 0, 0);"> details.<br />    movb PT_OLDSS(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">ah<br />    movb PT_CS(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">al<br />    andl $(VM_MASK </span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);"> (SEGMENT_TI_MASK </span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);"> SEGMENT_RPL_MASK), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax<br />    cmpl $((SEGMENT_LDT </span><span style="color: rgb(0, 0, 0);">&lt;&lt;</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);">) </span><span style="color: rgb(0, 0, 0);">|</span><span style="color: rgb(0, 0, 0);"> USER_RPL), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax<br />    CFI_REMEMBER_STATE<br />    je ldt_ss            # returning to user</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">space with LDT SS<br />restore_nocheck:<br />    TRACE_IRQS_IRET<br />restore_nocheck_notrace:<br />    RESTORE_REGS<br />    addl $</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp            # skip orig_eax</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">error_code<br />    CFI_ADJUST_CFA_OFFSET </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);"><br />irq_return:<br />    INTERRUPT_RETURN<br />.section .fixup,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">ax</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br />iret_exc:<br />    pushl $</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">            # no error code<br />    pushl $do_iret_error<br />    jmp error_code<br />.previous<br />.section __ex_table,</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">a</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);"><br />    .align </span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);"><br />    .</span><span style="color: rgb(0, 0, 255);">long</span><span style="color: rgb(0, 0, 0);"> irq_return,iret_exc<br />.previous<br /><br />    CFI_RESTORE_STATE<br />ldt_ss:<br />    larl PT_OLDSS(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax<br />    jnz restore_nocheck<br />    testl $</span><span style="color: rgb(0, 0, 0);">0x00400000</span><span style="color: rgb(0, 0, 0);">, </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax        # returning to 32bit stack</span><span style="color: rgb(0, 0, 0);">?</span><span style="color: rgb(0, 0, 0);"><br />    jnz restore_nocheck        # allright, normal </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"><br /><br />#ifdef CONFIG_PARAVIRT<br />    </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"><br />     * The kernel can't run on a non-flat stack if paravirt mode<br />     * is active.  Rather than try to fixup the high bits of<br />     * ESP, bypass this code entirely.  This may break DOSemu<br />     * and/or Wine support in a paravirt VM, although the option<br />     * is still available to implement the setting of the high<br />     * 16-bits in the INTERRUPT_RETURN paravirt-op.<br />     </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    cmpl $</span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">, pv_info</span><span style="color: rgb(0, 0, 0);">+</span><span style="color: rgb(0, 0, 0);">PARAVIRT_enabled<br />    jne restore_nocheck<br /></span><span style="color: rgb(0, 0, 255);">#endif</span><span style="color: rgb(0, 0, 0);"><br /><br />    </span><span style="color: rgb(0, 128, 0);">/*</span><span style="color: rgb(0, 128, 0);"> If returning to userspace with 16bit stack,<br />     * try to fix the higher word of ESP, as the CPU<br />     * won't restore it.<br />     * This is an "official" bug of all the x86-compatible<br />     * CPUs, which we can try to work around to make<br />     * dosemu and wine happy. </span><span style="color: rgb(0, 128, 0);">*/</span><span style="color: rgb(0, 0, 0);"><br />    movl PT_OLDESP(</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax<br />    movl </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp, </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">edx<br />    call patch_espfix_desc<br />    pushl $__ESPFIX_SS<br />    CFI_ADJUST_CFA_OFFSET </span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);"><br />    pushl </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">eax<br />    CFI_ADJUST_CFA_OFFSET </span><span style="color: rgb(0, 0, 0);">4</span><span style="color: rgb(0, 0, 0);"><br />    DISABLE_INTERRUPTS(CLBR_EAX)<br />    TRACE_IRQS_OFF<br />    lss (</span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp), </span><span style="color: rgb(0, 0, 0);">%</span><span style="color: rgb(0, 0, 0);">esp<br />    CFI_ADJUST_CFA_OFFSET </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">8</span><span style="color: rgb(0, 0, 0);"><br />    jmp restore_nocheck<br />    CFI_ENDPROC<br />ENDPROC(system_call)</span></div><br /><br /><font color="#ff0000"><font size="2"><b><span style="font-size: 14px; line-height: 18px;"><br /><br /></span></b></font></font><span style="font-size: 14px; line-height: 18px;"></span><img src ="http://www.cnitblog.com/textbox/aggbug/62372.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-03 12:01 <a href="http://www.cnitblog.com/textbox/archive/2009/11/03/62372.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Fedora 中的 make 与 gmake 命令区别</title><link>http://www.cnitblog.com/textbox/archive/2009/11/01/62334.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Sun, 01 Nov 2009 11:52:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/11/01/62334.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62334.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/11/01/62334.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62334.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62334.html</trackback:ping><description><![CDATA[
		<br />刚刚编译模块时候是使用 make ；而在编译fedora 执行文件时候是使用gmake，它们有区别吗？<br />看到make 的输出是使用 CC 编译器，gmake是使用gcc编译器。网上google后发现其实在fedora中的make的CC编译器其实就是gcc （使用命令 $ls -l /usr/bin/cc 可以看出cc是指向gcc的)，<font color="#ff0000"><b>使用CC是为了兼容老的c程序才保留下来的</b></font>。所以在fedora中使用 gmake 和 make 使用的编译器都是gcc 。<br /><br /><b>注释</b>：老的unix系统的CC程序叫做C Compiler ；GCC这个名字按GNU的说法叫做Gnu Compiler Collection 包含很多编译器(C, C , Objective-C, Ada, Fortran,and <span class="Apple-converted-space"></span><a style="margin: 0px; padding: 0px 10px 0px 0px; background-position: 100% 0%; background-image: url(http://www.chinaitzhe.com/img/desatured.gif); color: rgb(0, 109, 163); background-repeat: no-repeat; text-decoration: underline;" href="http://dev.chinaitzhe.com/java/" target="_blank">Java</a>)<br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62334.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-11-01 19:52 <a href="http://www.cnitblog.com/textbox/archive/2009/11/01/62334.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>makefile 中的for 目录递归编译</title><link>http://www.cnitblog.com/textbox/archive/2009/10/30/62270.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Fri, 30 Oct 2009 07:16:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/30/62270.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62270.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/30/62270.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62270.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62270.html</trackback:ping><description><![CDATA[
		<br />目录P下存在 A,B,C,D,E 目录，它们目录都存放有对应makefile 为了一个make命令编译它们<br />在目录Px下加一个makefile文件。内容如下：<br /><br />SUBDIRS=A B C D E<br /><br />all:subdirs<br /><br />subdirs:<br />
    for n in $(SUBDIRS);do $(MAKE) -C $$n || exit 1 ;done<br /><br />clean:<br />
    for n in $(SUBDIRS);do $(MAKE) -C $$n clean;done<br /><br /><br /><br /><br />备注： make 的-C 选项是制定makefile的文件目录，如果在A,B,C,D,E 目录 内也加入这文件就可以达到目录递归编译效果，适用用于比较大工程存在比较多的模块，每个模块之间又有多级目录的情况。<br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62270.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-30 15:16 <a href="http://www.cnitblog.com/textbox/archive/2009/10/30/62270.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>GNU Makefile 总结</title><link>http://www.cnitblog.com/textbox/archive/2009/10/21/62036.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 21 Oct 2009 02:30:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/21/62036.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62036.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/21/62036.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62036.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62036.html</trackback:ping><description><![CDATA[
		<br />
		<b>makefile 主要包含以下几点</b>
		<br /> <span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"><b>显式规则 </b>：</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">描述了在何种情况下如何更新一个或者多个被称为目标的文件（</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">的目标文件）。书写</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">时需要明确地给出目标文件、目标的依赖文件列表以及更新目标文件所需要的命令（有些规则没有命令，这样的规则只是纯粹的描述了文件之间的依赖关系）。</span><br /><b><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span> 
<span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">
隐含规则</span></b>：<span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">它是</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">根据一类目标文件（典型的是根据文件名的后缀）而自动推导出来的规则。</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">根据目标文件的名，自动产生目标的依赖文件并使用默认的命令来对目标进行更新（建立一个规则）。</span><font color="#ff0000"><b>简单的说就是  a.c 推出 a.o</b>  或  <b>a.o 推出 a.c </b>  </font><br />  <b><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span></b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"><b>变量定义</b>：</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">使用一个字符或字符串代表一段文本串，当定义了一个变量以后，</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">后续在需要使用此文本串的地方，通过引用这个变量来实现对文本串的使用。第一章的例子中，我们就定义了一个变量“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">objects</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”来表示一个</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">.o</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">文件列表。</span><br /><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">  <b>Makefile</b></span><b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">指示符</span></b>：<span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">指示符指明在</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">程序读取</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">文件过程中所要执行的一个动作。其中包括：</span><p class="MsoNormal" style="text-align: justify; text-indent: -21pt; line-height: 150%; margin-left: 72pt;"> <span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"><span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"></span></span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">读取一个文件，读取给定文件名的文件，将其内容作为</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">文件的一部分。</span></p><p class="MsoNormal" style="text-align: justify; text-indent: -21pt; line-height: 150%; margin-left: 72pt;"><span style="font-size: 12pt; line-height: 150%; font-family: Wingdings;" lang="EN-US"></span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">决定（通常是根据一个变量的得值）处理或者忽略</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">中的某一特定部分。</span></p><p class="MsoNormal" style="text-align: justify; text-indent: -21pt; line-height: 150%; margin-left: 72pt;"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">定义一个多行变量。</span></p><br />  <b>Makefile注释内容</b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">：</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">中“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”字符后的内容被作为是注释内容（和</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">shell</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">脚本一样）处理。如果此行的第一个非空字符为“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”，那么此行为注释行。注释行的结尾如果存在反斜线（</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">\</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">），那么下一行也被作为注释行。一般在书写</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">时推荐将注释作为一个独立的行，而不要和</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">的有效行放在一行中书写。当在</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">中需要使用字符“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”时，可以使用反斜线加“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”（</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">\#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">）来实现（对特殊字符“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”的转义），其表示将“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">#</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”作为一字符而不是注释的开始标志。</span><br /><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"><br /><font color="#ff0000"><b>备注：</b></font>以tab开头的行是以shell脚本执行。<br /><br /><b>makefile文件名查找顺序 ：</b></span><b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">“</span></b><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">GNUmakefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”。 </span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">当</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">文件的命名不是这三个任何一个时，</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">需要通过</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">的“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">-f</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”或者“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">--file</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”选项来指定</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">读取的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">文件</span><br /><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">.<br /><b>include 作用</b></span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">：在一个</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">A中包含其它的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefileB</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">文件</span>，这样就可以使用在<span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">A中就可以使用</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">makefileB</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">中的变量和规则</span><br />  <span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">include</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"> 指示符告诉</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">暂停读取当前的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">，而转去读取“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">include</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”指定的一个或者多个文件，完成以后再继续当前</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">的读取</span><br /><br /><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">格式：include foo 
a.mk b.mk c.mk </span></i></b><br />适用场合：<br /><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">1.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">        </span></span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">
有多个不同的程序，由不同目录下的几个独立的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">来描述其重建规则。它们需要使用一组通用的变量定义或者模式规则。通用的做法是将这些共同使用的变量或者模式规则定义在一个文件中（没有具体的文件命名限制），在需要使用的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">中使用指示符“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">include</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”来包含此文件。</span><br /><br /><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">2.<span style="font-family: &quot;Times New Roman&quot;; font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">        </span></span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">
当根据源文件自动产生依赖文件时；我们可以将自动产生的依赖关系保存在另外一个文件中，主</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">使用指示符“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">include</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”包含这些文件。这样的做法比直接在主</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">中追加依赖文件的方法要明智的多。其它版本的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">已经使用这种方式来处理。</span><br /><br /><br /><b><font color="#ff0000"><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">注意</span></font><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US"><font color="#ff0000"></font>-include 
FILENAMES...</span></i></b> 与<b><i><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US"> include 
FILENAMES... </span></i></b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span>之间 的区别。 出现错误时候<b><font color="#ff0000">退出</font></b>与<b><font color="#ff0000">继续</font></b>的区别<br /><br /><b>条件分支宏</b><br /><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">ifdef</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">ifeq</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">ifndef</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”和“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">ifneq</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">” </span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">条件分支的展开是“立即”的</span><h2><a name="_gnu_make_3.4"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">环境变量</span><span style="font-size: 14pt;"><font size="2"></font><b><span lang="EN-US"><font size="2">MAKEFILES </font><br /></span></b></span></a></h2><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">变量“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">MAKEFILES</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”主要用在“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”的递归调用过程中的的通信<br /><b><font color="#ff0000">注意</font></b>：</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">“</span><b><i><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">MAKEFILES</span></i></b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”定义的包含文件是否存在不会导致</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">错误</span><h2><font size="3"><a name="_gnu_make_3.5"><span style="font-size: 14pt; font-family: 楷体_GB2312;"></span></a></font></h2><h2><a name="_gnu_make_3.4"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">环境变量</span><span style="font-size: 14pt;"><b><span lang="EN-US"><font size="2">MAKEFILE_LIST </font><br /></span></b></span></a></h2><h2><a name="_gnu_make_3.5"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span></a></h2><h2><a name="_gnu_make_3.5"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span></a><font size="3"><a name="_gnu_make_3.5"></a></font><a name="_gnu_make_3.5"><span style="font-size: 14pt;"><b><b><span lang="EN-US"></span></b></b></span></a></h2><h2><a name="_gnu_make_3.5"></a><font size="3"><a name="_gnu_make_3.5"><font size="2"><span style="font-size: 14pt;"><b><span lang="EN-US"></span></b></span></font></a></font></h2><font color="#0000ff"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US"> MAKEFILES ,include </span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;"></span></font><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">解析执行之前</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">读取的文件名将会被自动依次追加到变量“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">MAKEFILE_LIST</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”的环境变量中。</span><br /><br /><b>其他环境变量</b><br /><br />GNU make 还支持一些特殊变量。它们一般都是只读的。 如（<span style="font-size: 12pt; font-family: 楷体_GB2312;"></span><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">.VARIABLES  环境变量  </span><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">makefile</span><span style="font-size: 12pt; font-family: 楷体_GB2312;">文件中所定义的所有全局变量列表</span><span style="font-size: 12pt; font-family: 楷体_GB2312;">）</span><br /><br /><b>宏变量 ：<br /><br />$*<br />$@ </b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">代表规则的目标</span><br /><b>$?<br />$&lt; </b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">代表规则中通过目录搜索得到的依赖文件列表的第一个依赖文件</span><br /><b>$^ </b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">代表所有通过目录搜索(<b>VPATH ;GPATH; vpath</b>)得到的依赖文件的完整路径名</span><br /><b><br />动态相关函数：<br />$$@<br /></b><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br /><br /><br /><br />objects := $(patsubst 
%.c,%.o,$(wildcard *.c))   </span></i></b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">将目录列表中所有文件名的后缀</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.c</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">替换为</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.o</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">。这样我们就可以得到在当前目录可生成的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.o</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">文件列表</span><br /><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US"></span></i></b><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">foo : 
$(objects)</span></i></b><br /><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">    cc -o foo 
$(objects)</span></i></b><b><br /></b><br /><br /><b>规则：</b><br /><br />如：<br /><p class="MsoNormal" style="text-indent: 41.2pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">foo.o[目标文件集合] : foo.c 
defs.h  [依赖文件集合]      # module for twiddling the frobs</span></i></b></p><p class="MsoNormal" style="text-indent: 41.2pt; margin-left: 30.9pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">cc -c -g foo.c [命令 ; 此行需要以tab键开头] <br /></span></i></b></p><b>格式：</b><br />    目标集合：依赖集合<br />        命令集合<br /><br /> 规则重载（ <span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">对于“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">GUNmakefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">”中没有此目标的规则 就会执行重载规则 ，如 执行 make 'ABCDEFG' 由于没有制定 </span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312;">ABCDEFG 规则 所以执行重载规则里面的命令）<br /></span><p class="MsoNormal" style="text-indent: 48.2pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">%: force</span></i></b></p><p class="MsoNormal" style="text-indent: 48.2pt; margin-left: 29.95pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">@$(MAKE) -f 
Makefile $@</span></i></b></p><p class="MsoNormal" style="text-indent: 48.2pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">force: ;</span></i></b></p><br /><br /><b>文件名通配符</b>:<br /><br />*<br />?<br />[...]<br /><br /><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;"><font color="#ff0000">注意</font>：主要用于文件名通配变量定义中使用的通配符不会被统配处理</span>（只会当成字符串处理，不会展开）<br /><br /><b>目录搜索机制</b><br /><br />是通过<b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">"VPATH</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”;“</span></b><b><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">vpath</span></b><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;"><b>”;"</b><b>GPATH"</b>指定的来指定规则中的依赖文件</span><br /><br /><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">通过变量“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">VPATH</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”可以指定依赖文件的搜索路径，当规则的依赖文件在当前目录不存在时，<br /></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">会在此变量所指定的目录下去寻找这些依赖文件</span><br /><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">VPATH = src:../headers</span></i></b><font size="2"><a name="_gnu_make_4.5.2"><span style="font-family: 楷体_GB2312;"><br /><b><br /><font size="3">选择性搜索（关键字</font></b></span><b><font size="3"><span lang="EN-US">vpath</span><span style="font-family: 楷体_GB2312;">）</span></font></b></a></font><b><font size="3"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">它可以为不同类型的文件（由文件名区分）指定不同的搜索目录<br /></span></font></b><b><i><span style="font-size: 12pt; line-height: 150%; font-family: Arial;" lang="EN-US">vpath %.h ../headers</span></i></b><br />   以上意思是<span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">中需要的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.h</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">文件；如果不能在当前目录下找到，则到目录“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">../headers</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”下寻找；</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;"></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">%.h</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”表示所有以“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.h</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”结尾的文件</span><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br />       vpath %.c 
foo<br />       vpath % 
blish<br />       vpath %.c 
bar</span></i></b><br /><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US"></span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">表示对所有的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.c</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">文件，</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">依次查找目录：“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">foo</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”、</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">blish</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">bar</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”</span><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br />       vpath %.c 
foo</span><span style="font-size: 12pt; font-family: 楷体_GB2312;">：</span><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">bar</span></i></b><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US"><br />       vpath % 
blish</span></i></b><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US"></span><br /><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">对于所有的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.c</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">文件</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">make</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">将依次查找目录：“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">foo</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">bar</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”、“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">blish</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”</span><br /><br /><b>Makefile伪目标</b><b>，强制目标，空目标，特殊目标，多目标，多规则目标<br /><br /><br /></b><h2><font size="3">静态模式规则 <br /></font></h2><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">静态模式规则对一个较大工程的管理非常有用。它可以对整个工程的同一类文件的重建规则进行一次定义，而实现对整个工程中此类文件指定相同的重建规则。</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">可以用来描述整个工程中所有的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.o</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">文件的依赖规则和编译命令。通常的做法是将生成同一类目标的模式定义在一个</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">make.rules</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">的文件中。在工程各个模块的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">Makefile</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">中包含此文件。</span><br /><b>格式</b>：<br /><p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">TARGETS ...: 
TARGET-PATTERN: PREREQ-PATTERNS ...</span></i></b></p><p class="MsoNormal" style="text-indent: 41.2pt; margin-left: 30.9pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">COMMANDS</span></i></b> </p><i><b></b></i><p class="MsoNormal" style="text-align: justify; line-height: 150%;">例如：</p><p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">files = foo.elc 
bar.o lose.o</span></i></b></p><p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">$(filter %.o,$(files)): 
%.o: %.c</span></i></b></p><p class="MsoNormal" style="text-indent: 41.2pt; margin-left: 30.9pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">$(CC) -c $(CFLAGS) 
$&lt; -o $@</span></i></b></p><p class="MsoNormal" style="text-indent: 13.85pt; margin-left: 29.95pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">$(filter %.elc,$(files)): 
%.elc: %.el</span></i></b></p><p class="MsoNormal" style="text-indent: 41.2pt; margin-left: 30.9pt;"><b><i><span style="font-size: 12pt; font-family: Arial;" lang="EN-US">emacs -f 
batch-byte-compile $&lt;</span></i></b></p><p class="MsoNormal" style="text-align: justify; line-height: 150%;"> 
<span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">它根据相应的</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">.c</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">文件来编译生成“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">foo.o</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”和“</span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US">bar.o</span><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;">”文件：</span></p><p class="MsoNormal" style="text-align: justify; line-height: 150%;"><span style="font-size: 12pt; line-height: 150%; font-family: 楷体_GB2312; color: black;"><br /></span><span style="font-size: 12pt; line-height: 150%; font-family: Arial; color: black;" lang="EN-US"></span></p><h2><a name="_gnu_make_4.13"><b><span style="font-size: 14pt;" lang="EN-US"></span></b><span style="font-size: 14pt; font-family: 楷体_GB2312;">双冒号规则</span></a></h2><b><br /></b><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62036.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-21 10:30 <a href="http://www.cnitblog.com/textbox/archive/2009/10/21/62036.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>linux 驱动模块的开发程序流程</title><link>http://www.cnitblog.com/textbox/archive/2009/10/20/62016.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 20 Oct 2009 04:27:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/20/62016.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/62016.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/20/62016.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/62016.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/62016.html</trackback:ping><description><![CDATA[
		<br />char devices<br /><br />1.注册设备号（MKDEV ,MAJOR,alloc_chrdev_region , register_chrdev_region)<br />2.分配设备 file_operations 结构体变量空间(cdev_alloc)<br />3.关联 file_operations 结构体变量 与设备号(cdev_add)<br />4.实现  file_operations 结构体变量 内的 接口函数。<br />5.关联 module_init 和 module_exit<br /><br /><br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/62016.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-20 12:27 <a href="http://www.cnitblog.com/textbox/archive/2009/10/20/62016.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>gcc 编译成执行文件的流程</title><link>http://www.cnitblog.com/textbox/archive/2009/10/17/61975.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Sat, 17 Oct 2009 05:44:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/17/61975.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61975.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/17/61975.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61975.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61975.html</trackback:ping><description><![CDATA[
		<font size="4" color="#000000" face="Arial">
				<strong>
						<br />gcc的编译流程分为四个步骤，分别为：<br />
预处理（Pre-Processing）<br />编译（Compiling）<br />汇编（Assembling）<br />
链接（Linking</strong>）<br /><br /><br />1）</font>
		<font face="Arial">
		</font>
		<font size="4" color="#000000" face="Arial">
				<strong>预处理： （-E 只预处理 ） </strong>
		</font>
		<font size="4" color="#000000" face="Arial">gcc –S hello.i –o hello.s</font>
		<font face="Arial">
				<br />
		</font>
		<font size="4" color="#000000" face="Arial">
				<strong>     把对应的 *.c 文件内 include 的头文件全部加入到一个 *.i的预处理源码文件<br /><br />2） 编译： （-S 只编译不汇编）<br />    语法检查，词法分析<br /><br />3） 汇编：  </strong>
		</font>
		<font size="4" color="#000000" face="Arial">gcc –c hello.s –o hello.o</font>
		<font face="Arial">
				<br />
		</font>
		<font size="4" color="#000000" face="Arial">
				<strong>    把代码转化成汇编代码<br /><br /><b>4） 连接： </b></strong>
		</font>
		<font face="Arial">
				<b>
						<font size="4" color="#000000">gcc hello.o –o hello</font>
						<br />
				</b>
				<b>   <font size="4">把目标文件连接成执行文件（连接函数库）</font></b>
				<br />   <br /></font>
		<font size="4" color="#000000" face="Arial">
				<strong>   静态连接： 把使用到的外部函数以代码的形式嵌入到执行文件中 （增加执行文件的体积，运行无需函数库文件）<br />   动态连接： 只是保存外部函数的一些call信息，用于程序运行时候会叫外部函数。 <br />（体积比静态要小，运行时候需要函数库文件支持）<br />   <br /></strong>
		</font>
<img src ="http://www.cnitblog.com/textbox/aggbug/61975.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-17 13:44 <a href="http://www.cnitblog.com/textbox/archive/2009/10/17/61975.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>fedora9 下的 简单 hellworld模块  并加入到slickedit 14.0.2 for linux</title><link>http://www.cnitblog.com/textbox/archive/2009/10/13/61785.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 13 Oct 2009 01:52:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/13/61785.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61785.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/13/61785.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61785.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61785.html</trackback:ping><description><![CDATA[1.在编译安装内核模块（驱动）之前先确认时候有安装kernel-devel<br /><br />输入： ls -d lib/modules/$(uname -r)/build<br /><br />如果有目录存在说明有安装，否则没安装<br /><br />下载相应内核的kernel-devel ,版本可是使用命令 uname -r 查看<br /><br />安装kernel-devel执行命令：<br /><br />rpm -ivh kernel-devel-$(uname -r).rpm<br /><br />安装完成　<br />以下是一个hello内核模块简单例子<br /><br />hello.c <br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">module.h</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">kernel.h</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br />#include </span><span style="color: rgb(0, 0, 0);">&lt;</span><span style="color: rgb(0, 0, 0);">linux</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">init.h</span><span style="color: rgb(0, 0, 0);">&gt;</span><span style="color: rgb(0, 0, 0);"><br /><br /></span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">int</span><span style="color: rgb(0, 0, 0);"> hello_init(</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">)<br />{<br />    printk(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">hello world</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />    </span><span style="color: rgb(0, 0, 255);">return</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 0);">0</span><span style="color: rgb(0, 0, 0);">;<br />}<br /></span><span style="color: rgb(0, 0, 255);">static</span><span style="color: rgb(0, 0, 0);"> </span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);"> hello_exit(</span><span style="color: rgb(0, 0, 255);">void</span><span style="color: rgb(0, 0, 0);">)<br />{<br />    printk(</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">good byte</span><span style="color: rgb(0, 0, 0);">"</span><span style="color: rgb(0, 0, 0);">);<br />}<br />module_init(hello_init);<br />module_exit(hello_exit);<br /></span></div><br />Makefile 内容如下<br /><br /><div style="border: 1px solid rgb(204, 204, 204); padding: 4px 5px 4px 4px; background-color: rgb(238, 238, 238); font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: rgb(0, 0, 0);">obj</span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">m:</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">hello.o<br /><br />KDIR :</span><span style="color: rgb(0, 0, 0);">=/</span><span style="color: rgb(0, 0, 0);">lib</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">modules</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">$(shell uname </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">r)</span><span style="color: rgb(0, 0, 0);">/</span><span style="color: rgb(0, 0, 0);">build<br />PWD  :</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">$(shell pwd)<br /><br />defalut :<br />$(MAKE) </span><span style="color: rgb(0, 0, 0);">-</span><span style="color: rgb(0, 0, 0);">C $(KDIR) M</span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(0, 0, 0);">$(PWD) modules<br /></span></div><br />执行make编译命令<br /><pre># make -C /lib/modules/$(uname -r)/build M=$(pwd) modules //编译<br /># make -C /lib/modules/$(uname -r)/build M=$(pwd) clean   //清除<br /># make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install //安装  <br /><br /><br />加入到slickedit ide 中<br />首先建立一个新GNU C/C++工程 取名 hello<br /><br />在Source file 内加入 hello.c<br /><br />在Other files 内加入 MakeFile<br /><br />右键点工程选择 project Properties...<br /><br />选择 Tools 那页<br />点 Build <br />在Command Line: 输入 ：make -C /lib/modules/$(uname -r)/build M=$(pwd) modules <br /><br />设置tag文件 tools -&gt; Tag Files<br /><br /><img src="file:///C:/DOCUME%7E1/admin/LOCALS%7E1/Temp/moz-screenshot.jpg" alt="" />点Add Tree 把 /usr/src/kernels/2.6.25.-14.fc9/include 加入 tag<br />这样在写驱动模块的时候就就会有丰富的提示信息了。可以加快输入速度和减少错误发生<br /><img src="http://www.cnitblog.com/images/cnitblog_com/textbox/8457/r_121323.bmp" height="335" width="706" /><br /><br /><br /><br />然后点工程build 就可以完成编译了。<br /><br /># insmod  hello.ko 加载模块<br /># lsmod 显示已经加载的模块<br /># rmmod hello 卸载模块<br /><br />由于优先级别的问题。在图形shell中是看不到模块的<span style="font-family: 微软雅黑;">printk</span>输出的，在text模式下是可以看到。<br />可以使用命令 dmesg 来查看输出信息 或者修改shell的优先级别<br /><font color="#ff0000">当日志级别小于console_loglevel时</font>，消息才能显示出来。<br />可以通过以下命令查看和修改优先级别<br />cat /proc/sys/kernel/printk<br />6   4  1   7<br /><br />第一个是控制台日志级别；第二个是默认的消息日志级别；第三个是最低的控制台日志级别；第四个是默认的控制台日志级别<br /><br />修改级别。<br /># echo 8 &gt; /proc/sys/kernel/printk<br />不知为什么我改完以后还是输出不了信息 ???<font color="#990000">(谁能告诉我这个是什么问题?)</font><br /><br />goole 对于fedora 9 还有一种方法让printk输出console <br /><br /><br /><br />执行<br />#gedit /etc/rsyslog.<span class="hilite3">conf <br /></span><font color="#339900">// 不同的Linux发行版使用不同<span class="hilite2">syslog</span>程序来记录系统日志。<br />// 的Debain 4.0/Ubuntu8.04（桌面版）默认使用的是sysklogd，配置文件为/etc/<span class="hilite2">syslog</span>.<span class="hilite3">conf</span>。<br />// <span class="hilite1">Fedora9</span>默认使用rsyslogd，配置文件为/etc/rsyslog.<span class="hilite3">conf</span>。<br />// opensuse11使用<span class="hilite2">syslog</span>-ng，配置文件为/etc/<span class="hilite2">syslog</span></font><span class="hilite3"><br /></span>#kern.*                                                 /dev/console<br /><font color="#009900">//把kern.*前的注视去掉。这样printk的信息就可以直接显示到终端了！</font><br />保存就好了<br /><br /><br /></pre><br /><br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/61785.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-13 09:52 <a href="http://www.cnitblog.com/textbox/archive/2009/10/13/61785.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>今天安装了slickedit 14.0.2 感觉不错。</title><link>http://www.cnitblog.com/textbox/archive/2009/10/13/61782.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 13 Oct 2009 01:30:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/13/61782.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61782.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/13/61782.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61782.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61782.html</trackback:ping><description><![CDATA[
		<br />1.官方下载for linux 的试用版本 <br />    http://www.slickedit.com<br />2.msdb下载for linux 的破解版vs<br />3.在fedora 9下安装。然后用破解版vs 覆盖原文件既可<br /><img src ="http://www.cnitblog.com/textbox/aggbug/61782.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-13 09:30 <a href="http://www.cnitblog.com/textbox/archive/2009/10/13/61782.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>perl 与 python 的决择</title><link>http://www.cnitblog.com/textbox/archive/2009/10/12/61769.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Mon, 12 Oct 2009 01:45:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/12/61769.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61769.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/12/61769.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61769.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61769.html</trackback:ping><description><![CDATA[看了网上的言论真是向左向右。<br />perl 复杂 python 简单 都能实现复杂功能。<br />vmware tools 的安装文件是perl的(听说老外很多使用perl)。goole使用python ..<br />一个个信息让我回想到了当年的vc++和delphi 之间较量，拜托还为这烦，成熟点好不。<br />决定学perl 了。当然我选择了delphi到现在delphi都快倒闭我都没后悔过。<br />因为它现在用vc /c 感觉也是小菜。<br /><img src ="http://www.cnitblog.com/textbox/aggbug/61769.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-12 09:45 <a href="http://www.cnitblog.com/textbox/archive/2009/10/12/61769.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>奇怪的问题，公司电脑可以yum install ibus\* 家里的本本fc9竟然不能安装</title><link>http://www.cnitblog.com/textbox/archive/2009/10/07/61714.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 07 Oct 2009 15:09:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/07/61714.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61714.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/07/61714.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61714.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61714.html</trackback:ping><description><![CDATA[[root@localhost yum.repos.d]# yum install ibus\*<br />Loaded plugins: refresh-packagekit<br />Setting up Install Process<br />Parsing package install arguments<br />No package ibus* available.<br />Nothing to do<br /><br /><br />以上是问题提示。想必是yum.repos.d目录内的软件仓库文件问题。无法找到对应软件<br />哎。后来重公司拷贝了那几个repo文件到家里的本本。<br />运行 yum install ibus\* <br />。。。。。。。<br />。。。。。。<br />Transaction Summary<br />=============================================================================<br />Install     23 Package(s)         <br />Update       1 Package(s)         <br />Remove       0 Package(s)  <br /><br />Total size: 56 M<br />Is this ok [y/N]:  y<br /><br /><br />Downloading Packages:<br />.......<br />.......<br /><br />下载完后又出一下问题（公司的电脑没有这个问题，抓狂，难道是公司的fc9和家的fc9不一样？？公司的和家里是分开下载的。提示的英文的意思是HdrFromFdno 没有V3 DSA signature&lt;缺少什么鬼签名的key&gt;<br /> 没办法。。。去baidu 找到两个结果可是都不是fc9的，试过没有用。<br />后来找到GPG加密的介绍：<br /><br />http://www.cnblogs.com/mopmoq/archive/2009/06/17/1504999.html<br /><br />一个yum还弄出那么多的东西出来。加密都弄出来。（怕怕）看了一下上面的连接大概介绍<br />了解了一下原理和用途。（數字簽名主要用途 是鑒定傳輸的內容或文件是否真的来自發出者和保證發出內容的完整性和验证是否被非法修改過的內容或文件)<br />pgp 生成一对密匙<br />1. 公匙(可發布到對方，用于对方验证你发出的数据是否来自你和完整性）<br />2. 密匙(自己保留，用于解密对方发送过来的用你的公匙加密的数据）<br /><br />数字签名..<br />   为证明一则讯息确实是宣称发出讯息的人所发，发明了数字签名的概念。正如其名称显示，发出讯息者数字化地在讯息上签名。别人可以通过这个签名检验这个讯息的真实性，同时信息或数据可以被确认是来自正当合法的来源，而被认为属实。<br />
一个数字签名是通过密钥和讯息本身而得来。讯息可以通过发出讯息者的公钥来验证。这样，不仅可以验证讯息是正确的发出讯息者所发，而且内容也得到验证。这样，得到讯息者可以确认：讯息来自该发出讯息者，而且在传递过程中其内容没有改变。  （以上是抄上面连接的）<br /><br />现在知道什么是数字签名了。<br />那为什么要yum要签名呢？ 什么文件数字签名？而由于我没公匙，无法验证？那又如何获取公匙呢？在那里获取呢？<br />一堆的问号在脑袋里打转转。。。<br /><br /><br /><br />warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 6df2196f<br />提示HdrFromFdno没有公匙。 key id 6df2196f <br /><br />GPG key retrieval failed 失败，<br /><br />看了一下yum 的源库配置文件 repo 文件里面有写gpgkey的位置<br /><br />fedora.repo<br /> gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch<br /><br />fedora-rawhide.repo<br />  gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test-$basearch file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch<br /><br />fedora-updates.repo<br />

 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch<br /><br />
fedora-updates-newkey.repo<br />


 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9-$basearch<br />

 
<br />fedora-updates-testing.repo<br />



 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$basearch<br />


 
<br />
fedora-updates-testing-newkey.repo<br />



 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-test-8-and-9-$basearch<br />


 
<br /><br /><br /><br /><br />最后去goole 找到很多，不过都是英文的。看起来头都大。）<br />warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID 6df2196f<br /><br /><br />GPG key retrieval failed: [Errno 5] OSError: [Errno 2] No such file or directory: '/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-8-and-9-i386'<br /><br /><br />       <br /><br /><br /><br /> linux 真是折腾人啊。问题一个一个的出来。安装一个输入法都是波折重重。。<br />不过没有问题是学不到东西。 不知道什么时候可以弄好这个问题<br /> <br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/61714.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-07 23:09 <a href="http://www.cnitblog.com/textbox/archive/2009/10/07/61714.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>fedora9 的ibus输入法安装。</title><link>http://www.cnitblog.com/textbox/archive/2009/10/07/61709.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Wed, 07 Oct 2009 09:25:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/07/61709.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61709.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/07/61709.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61709.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61709.html</trackback:ping><description><![CDATA[其实很简单就是千万不要太相信非官方的网页的提示。呵呵<br /><br />整整弄了一个多下午才弄出来是什么问题。<br />网上的大鸟给误导了说什么运行 yum install ibus-pinyin 就完成。<br />其实不是。就算你成功安装也是无法激活的。可能这是有于是fedora9的原因。<br />执行这命令只能下载2个包。<br />后来看了ibus  about 窗口的 http://code.google.com/p/ibus/wiki/ReadMe <br />后发现是要执行 yum install ibus\*<br />发现要下载22个包。。其中包括了qt等等，可想而知该版本需要依赖多少东西。终于可以用了。<br />不过第一次用就以为遇到bug了，按了shift键是中英文切换，我按了shift，ibus无任何提示是输出英文，就算按切换的键也再切换回来也没有用。害我还以为是bug呢。。。。。。其实不是。这个随笔就是用ibus写出来的。不过字体要比windows下看要漂亮多了 呵呵<br /><br />郁闷的是我家里的本本怎么都装不上ibus <br /><img src ="http://www.cnitblog.com/textbox/aggbug/61709.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-07 17:25 <a href="http://www.cnitblog.com/textbox/archive/2009/10/07/61709.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>fedora 9 添加新字体</title><link>http://www.cnitblog.com/textbox/archive/2009/10/06/61695.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 06 Oct 2009 06:43:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/06/61695.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61695.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/06/61695.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61695.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61695.html</trackback:ping><description><![CDATA[1. 在字体文件所在目录生成fonts.scale  和  fonts.dir可以执行 ：<br />mkfontscale<br /><br />mkfontdir<br /><br />2.把所在目录连接到/usr/share/fonts（跟拷贝差不多）<br /><br /><br />3. 最后执行如下命令：<br />fc-cache -fv<img src ="http://www.cnitblog.com/textbox/aggbug/61695.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-06 14:43 <a href="http://www.cnitblog.com/textbox/archive/2009/10/06/61695.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>slickedit11 显示中文 build乱码 </title><link>http://www.cnitblog.com/textbox/archive/2009/10/06/61694.html</link><dc:creator>零度</dc:creator><author>零度</author><pubDate>Tue, 06 Oct 2009 06:41:00 GMT</pubDate><guid>http://www.cnitblog.com/textbox/archive/2009/10/06/61694.html</guid><wfw:comment>http://www.cnitblog.com/textbox/comments/61694.html</wfw:comment><comments>http://www.cnitblog.com/textbox/archive/2009/10/06/61694.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cnitblog.com/textbox/comments/commentRss/61694.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/textbox/services/trackbacks/61694.html</trackback:ping><description><![CDATA[
		<br />1.显示中文<br /><br /> 1）.Tools-&gt;File Options-Load 下的Encoding 选择 Chinese Simplified (GB-2312)<br />  2)  .Tools-&gt;Font 下选择一个支持中文的字体(我选wenQuanYi Bitmap Song )  上面的combox 选择Unicode Source Windows<br /><br />2 build窗口乱码<br />  1）.建立 .tcshrc文件  命令： gedit .tcshrc  （由于slickedit11的build窗口是使用tcsh shell）<br /><br />  2）.加入下两句设置默认语言<br />     exprot LANG="en_US"<br />     exprot LC_ALL="en_US"<br /><br />以上问题解决<br /><br /><br /><br /><img src ="http://www.cnitblog.com/textbox/aggbug/61694.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/textbox/" target="_blank">零度</a> 2009-10-06 14:41 <a href="http://www.cnitblog.com/textbox/archive/2009/10/06/61694.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>