<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Challenge everything!</title>
	<atom:link href="http://blogs.gnome.org/raywang/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/raywang</link>
	<description>Ray Wang&#039;s notes</description>
	<lastBuildDate>Tue, 29 Sep 2009 02:17:12 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by/3.0/</creativeCommons:license>		<item>
		<title>Linux&#8217;s Magic key (转)</title>
		<link>http://blogs.gnome.org/raywang/2009/08/11/linuxs-magic-key-%e8%bd%ac/</link>
		<comments>http://blogs.gnome.org/raywang/2009/08/11/linuxs-magic-key-%e8%bd%ac/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 04:10:54 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/raywang/?p=30018</guid>
		<description><![CDATA[转自 http://li2z.cn/2009/08/10/linux_magic-key/
自从我换成了开源的A卡驱动以后，我的电脑就时不时地崩溃。现象是：突然之间，整个画面就冻结了，鼠标也不能动了，几乎所有的按键也都失效了，ctrl+alt+F1 和 ctrl+alt+backspace 都无效。这种情况一般发生在有不规则形状的窗口出现的时候，比如gnome-osd的透明文字，但也不是很一定的，发生的概率也不高，一般几天才会有一次。我想，要彻底解决的话，也只能等待驱动的改进了。
不过，每次崩溃都强行按电源的话，还是有点心痛的。幸好办法还是有的，因为驱动程序其实也只是一个程序而已，这时候即使驱动死掉了，鼠标键盘不能动，linux内核还是在正常运行的（按理如果我开了sshd的话，其他机器还是能ssh上来的）。而且，内核还是能处理一些键盘事件的，比如本文要说的：Magic System Request Key
以下按键，一般情况下不建议使用，除非是ctrl+alt+F1都失效了，才用。
使用Magic SysRq key的前提是CONFIG_MAGIC_SYSRQ这个内核选项被打开，并且没有在/proc/sys/kernel/sysrq里禁用掉，也就是 cat 这个文件的时候，出来的是 1 （或其他某些非0值）。其实这两个条件，在一般的linux发行版里都是满足的。下面就来介绍一下几个键的具体作用，其中SysRq指的是右上角的 “Print Screen”键。

    ALT-SysRq-b 立即重启系统，不卸载分区和同步文件。
    ALT-SysRq-c 调用kexec内核函数来重启，可以生成个crashdump。
    ALT-SysRq-d 显示所有的“锁”，如果开了X的话，估计基本看不到。
    ALT-SysRq-e 给除了init以外的所有进程发送SIGTERM信号，可以试图正常结束所有进程。
    ALT-SysRq-f 调用oom_kill函数来干掉占用了很大内存的进程。
    ALT-SysRq-g 内核调试相关的（好像新内核已经没了？）。
    ALT-SysRq-h 显示其他key的帮助，同样，如果开了X的话，估计基本看不到。
    ALT-SysRq-i [...]]]></description>
			<content:encoded><![CDATA[<p>转自 http://li2z.cn/2009/08/10/linux_magic-key/</p>
<p>自从我换成了开源的A卡驱动以后，我的电脑就时不时地崩溃。现象是：突然之间，整个画面就冻结了，鼠标也不能动了，几乎所有的按键也都失效了，ctrl+alt+F1 和 ctrl+alt+backspace 都无效。这种情况一般发生在有不规则形状的窗口出现的时候，比如gnome-osd的透明文字，但也不是很一定的，发生的概率也不高，一般几天才会有一次。我想，要彻底解决的话，也只能等待驱动的改进了。<br />
不过，每次崩溃都强行按电源的话，还是有点心痛的。幸好办法还是有的，因为驱动程序其实也只是一个程序而已，这时候即使驱动死掉了，鼠标键盘不能动，linux内核还是在正常运行的（按理如果我开了sshd的话，其他机器还是能ssh上来的）。而且，内核还是能处理一些键盘事件的，比如本文要说的：Magic System Request Key<br />
以下按键，一般情况下不建议使用，除非是ctrl+alt+F1都失效了，才用。<br />
使用Magic SysRq key的前提是CONFIG_MAGIC_SYSRQ这个内核选项被打开，并且没有在/proc/sys/kernel/sysrq里禁用掉，也就是 cat 这个文件的时候，出来的是 1 （或其他某些非0值）。其实这两个条件，在一般的linux发行版里都是满足的。下面就来介绍一下几个键的具体作用，其中SysRq指的是右上角的 “Print Screen”键。</p>
<blockquote><p>
    ALT-SysRq-b 立即重启系统，不卸载分区和同步文件。<br />
    ALT-SysRq-c 调用kexec内核函数来重启，可以生成个crashdump。<br />
    ALT-SysRq-d 显示所有的“锁”，如果开了X的话，估计基本看不到。<br />
    ALT-SysRq-e 给除了init以外的所有进程发送SIGTERM信号，可以试图正常结束所有进程。<br />
    ALT-SysRq-f 调用oom_kill函数来干掉占用了很大内存的进程。<br />
    ALT-SysRq-g 内核调试相关的（好像新内核已经没了？）。<br />
    ALT-SysRq-h 显示其他key的帮助，同样，如果开了X的话，估计基本看不到。<br />
    ALT-SysRq-i 给除了init以外的所有进程发送SIGKILL信号。<br />
    ALT-SysRq-k 结束当前虚拟终端的所有进程。<br />
    ALT-SysRq-l 显示所有活动CPU的栈跟踪信息。<br />
    ALT-SysRq-m 显示内存状态。<br />
    ALT-SysRq-n<br />
    ALT-SysRq-o 可能的话，关机。<br />
    ALT-SysRq-p 显示当前的寄存器状态和标志位。<br />
    ALT-SysRq-r 关闭键盘的raw模式。<br />
    ALT-SysRq-s 同步内存里的数据到硬盘。<br />
    ALT-SysRq-t 显示当前的任务信息。<br />
    ALT-SysRq-u 以只读模式重新挂载所有分区。<br />
    ALT-SysRq-v<br />
    ALT-SysRq-w 显示不可中断的任务<br />
    ALT-SysRq-x<br />
    ALT-SysRq-z<br />
    ALT-SysRq-数字键 调整日志输出级别
</p></blockquote>
<p>    另外，除了物理的按键以外，其实还可以把某个键的值用root权限写到 /proc/sysrq-trigger 文件里（这个文件是个只写不读的怪文件，哈哈），比如</p>
<p>    echo t > /proc/sysrq-trigger</p>
<p>    ，来触发Magic SysRq key。 </p>
<p>以上内容可以在内核源码的 Documentation/sysrq.txt 里找到英文原文，但是即便是这个官方文档，也似乎不是每个按键都有效的，可能是某些只有在特定的硬件条件下才有效，又或者文档没更新？<br />
在万一遇到程序崩溃的时候，你可能需要按的键是： ALT-SysRq-r e i s u b 来安全地重启机器~</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/08/11/linuxs-magic-key-%e8%bd%ac/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Mono UIA Packages Preview</title>
		<link>http://blogs.gnome.org/raywang/2009/07/30/mono-uia-packages-preview/</link>
		<comments>http://blogs.gnome.org/raywang/2009/07/30/mono-uia-packages-preview/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 02:28:46 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[mono]]></category>
		<category><![CDATA[uia]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/raywang/?p=30013</guid>
		<description><![CDATA[Recently, I was working on pushing Mono UIA stuff into debian/ubuntu, but being accepted is a really long way to go. The packages need to be reviewed by Debian Mono Group hackers, and they were mostly working on geting Mono 2.4.2 uploaded, UIA stuff are not in a high priority. 
For those who wants to [...]]]></description>
			<content:encoded><![CDATA[<p>Recently, I was working on pushing <a href="http://www.mono-project.com/Accessibility">Mono UIA</a> stuff into debian/ubuntu, but being accepted is a really long way to go. The packages need to be reviewed by Debian Mono Group hackers, and they were mostly working on geting Mono 2.4.2 uploaded, UIA stuff are not in a high priority. </p>
<p>For those who wants to use Winforms apps on GNU/Linux, you can get packages as deb or rpm without compiling by yourself. Currently we have <a href="http://www.mono-project.com/Accessibility:_Release_Notes_1.0">1.0 release</a>. You can get:</p>
<p>RPM:</p>
<blockquote><p>http://download.opensuse.org/repositories/Mono://UIA/MonoOpenSUSE_11.1/ (for openSUSE 11.1)</p></blockquote>
<p>you will need to install <strong>mono-uia, mono-winfxcore, uiaatkbridge, uiautomationwinforms</strong> in order. </p>
<p>DEB:</p>
<blockquote><p>https://edge.launchpad.net/~raywang/+archive/uia2atk</p></blockquote>
<p>you have to add my PPA to your /etc/apt/sources.list, import key and get refreshed, and install <del datetime="2009-09-29T02:00:58+00:00">libmono-uia3.0-cil, libmono-winfxcore3.0-cil, libmono-uiaatkbridge1.0, libmono-uiautomationwinforms1.0-cil</del> <strong>libmono-uia3.0-cil, libmono-windowsbase3.0-cil, libmono-uia-atkbridge1.0-cil, libmono-uia-winforms1.0-cil</strong> in order.</p>
<p>Feel free to contact me if there are problems/questions/concerns etc</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/07/30/mono-uia-packages-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>用Google App Engine做个人代理服务器（Linux版）</title>
		<link>http://blogs.gnome.org/raywang/2009/06/18/%e7%94%a8google-app-engine%e5%81%9a%e4%b8%aa%e4%ba%ba%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88linux%e7%89%88%ef%bc%89/</link>
		<comments>http://blogs.gnome.org/raywang/2009/06/18/%e7%94%a8google-app-engine%e5%81%9a%e4%b8%aa%e4%ba%ba%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88linux%e7%89%88%ef%bc%89/#comments</comments>
		<pubDate>Thu, 18 Jun 2009 03:19:55 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/raywang/2009/06/18/%e7%94%a8google-app-engine%e5%81%9a%e4%b8%aa%e4%ba%ba%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88linux%e7%89%88%ef%bc%89/</guid>
		<description><![CDATA[摘自：http://groups.google.com/group/gappproxy/browse_thread/thread/3d0ad3dd6331311
博文的链接地址是：http://hi.baidu.com/bdhoffmann/blog/item/
db383603b37756703812bbc8.html
～～～～～
      身处教育网，找代理上网总是一件烦人甚至恼人的事情。某次和同学闲聊，他推荐了Gappproxy给我使用，我用了一下，感觉还可以。现将
自己使用的一些心得记录如下，希望能让广大Linuxer受益。（windows下使用的详细教程请参看http://skydao.com/
post/google- app-engine-to-do-with-personal-proxy-server-second-
edition/）
      使用的过程主要分为两个部分。第一部分是上传一个文件到google appengine（GAE）,第二部分是建立本地和GAE的连
接。
1：上传
1.1 创建一个google appengine帐号
     点击链接 （http://appengine.google.com/）申请注册一个google appengine帐号，注册需要一个
gmail邮箱，另外在注册的过程中需要填入手机号码进行验证。
1.2 安装python
     我的系统是Ubuntu8.04，所以只要apt-get install python就可以了
1.3 下载并安装google appengine软件包
     点击链接（http://code.google.com/appengine/downloads.html），下载Linux平台的
Google App Engine SDK，并进行解压。我的解压路径是桌面上的GAE目录。
1.4 下载并解压fetchserver源码包。
     点击链接（http://code.google.com/p/gappproxy/downloads/list），下载里面的
fetchserver- 1.0.0beta.tar.gz。这个是GAppProxy服务端源码包，用于架设自己的fetchServer。要将这
个包进行解压。然后将解压后的文件（fetchServer）夹放入Google App Engine SDK的安装目录。
1.5 编辑fetchServer目录下的app.yaml文件。
   [...]]]></description>
			<content:encoded><![CDATA[<p>摘自：http://groups.google.com/group/gappproxy/browse_thread/thread/3d0ad3dd6331311</p>
<p>博文的链接地址是：http://hi.baidu.com/bdhoffmann/blog/item/<br />
db383603b37756703812bbc8.html<br />
～～～～～<br />
      身处教育网，找代理上网总是一件烦人甚至恼人的事情。某次和同学闲聊，他推荐了Gappproxy给我使用，我用了一下，感觉还可以。现将<br />
自己使用的一些心得记录如下，希望能让广大Linuxer受益。（windows下使用的详细教程请参看http://skydao.com/<br />
post/google- app-engine-to-do-with-personal-proxy-server-second-<br />
edition/）</p>
<p>      使用的过程主要分为两个部分。第一部分是上传一个文件到google appengine（GAE）,第二部分是建立本地和GAE的连<br />
接。</p>
<p>1：上传<br />
1.1 创建一个google appengine帐号<br />
     点击链接 （http://appengine.google.com/）申请注册一个google appengine帐号，注册需要一个<br />
gmail邮箱，另外在注册的过程中需要填入手机号码进行验证。</p>
<p>1.2 安装python<br />
     我的系统是Ubuntu8.04，所以只要apt-get install python就可以了</p>
<p>1.3 下载并安装google appengine软件包<br />
     点击链接（http://code.google.com/appengine/downloads.html），下载Linux平台的<br />
Google App Engine SDK，并进行解压。我的解压路径是桌面上的GAE目录。</p>
<p>1.4 下载并解压fetchserver源码包。<br />
     点击链接（http://code.google.com/p/gappproxy/downloads/list），下载里面的<br />
fetchserver- 1.0.0beta.tar.gz。这个是GAppProxy服务端源码包，用于架设自己的fetchServer。要将这<br />
个包进行解压。然后将解压后的文件（fetchServer）夹放入Google App Engine SDK的安装目录。</p>
<p>1.5 编辑fetchServer目录下的app.yaml文件。<br />
     用nano或者其他方式编辑这个文件，主要编辑的参数是第一行application.<br />
～～～～～～～～～～～～～～～～～～～～<br />
application: aaaaaa(比如我的比如你的AppEngine地址是aaaaaaaaa.appspot.com，那就是<br />
application帐号就是aaaaaa）)<br />
～～～～～～～～～～～～～～～～～～～～<br />
     编辑结束后，保存并关闭这个文件。</p>
<p>1.6 上传<br />
    进入Google App Engine SDK目录。然后运行命令：appcfg.py update fetchserver。程序会要求<br />
你填入你的gmail和gmail的密码。<br />
～～～～～～<br />
hoffmann@ubuntu:~/Desktop/GAE$ python appcfg.py update fetchServer/<br />
Scanning files on local disk.<br />
Initiating update.<br />
Email: aaa&#8230;@gmail.com<br />
Password for aaa&#8230;@gmail.com:<br />
Cloning 1 application file.<br />
Deploying new version.<br />
Checking if new version is ready to serve.<br />
Closing update: new version is ready to start serving.<br />
～～～～～～<br />
OK ，上传部分完毕。</p>
<p>2：连接<br />
2.1：下载客户端<br />
    点击链接（http://code.google.com/p/gappproxy/downloads/list），下载<br />
gappproxy- 1.0.0beta.tar.gz ，这个是GAppProxy源码包，内含客户端所有源码，并将这个文件进行解压。我还是解压<br />
在桌面上，文件夹的名字是gappproxy。</p>
<p>2.2 更改配置文件<br />
    进入gappproxy目录，用nano或者其他的文件编辑器编辑proxy.conf文件。在fetchserver一栏里面填写自己的<br />
apengine地址。并去掉一行开头的井号（这个是注释用的）<br />
～～～～～～～～～～～～～～～～～<br />
GAppProxy configuration</p>
<p># local_proxy<br />
#local_proxy = host:port<br />
#<br />
# If local proxy needs authentication:<br />
#local_proxy = user:passwd@host:port</p>
<p>fetch server<br />
#fetch_server = http://127.0.0.1:8080/fetch.py<br />
fetch_server = http://aaaaaa.appspot.com/fetch.py ###填写自己注册的appengine地<br />
址。<br />
#fetch_server = http://fetchserver-nolog.appspot.com/fetch.py<br />
～～～～～～～～～～～～～～～～～～～～<br />
     然后保存并关闭。</p>
<p>2.3 运行代理服务<br />
    直接在终端里面运行 python proxy.py.如果看到HTTP Enabled : YES的字样，恭喜你，代理已经成功开启了。你<br />
所要做的就是将这个终端一直开着，就可以上网了。代理的地址是127.0.0.1:8000.这个可以在浏览器里面设置的。<br />
～～～～～～～～～～～～～～～<br />
hoffmann@ubuntu:~/Desktop/gappproxy$ python proxy.py<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
HTTP Enabled : YES<br />
HTTPS Enabled: NO<br />
Local Proxy :<br />
Fetch Server : http://aaaaaa.appspot.com/fetch.py<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
~~~~~~~~~~~~~~~~~~</p>
<p>注：<br />
1:感谢博客天空岛里面的文章（http://skydao.com/post/google-app-engine-to-do-with-<br />
personal-proxy-server-second-edition/）以及group上面WCM的指点。</p>
<p>2:虽然在主页上提到gappproxy仅支持标准80端口的HTTP协议和443端口的HTTPS协议,其他端口均不支持.但是我在实际应用的过程<br />
中，上微软的live.com，总是上不去。＝。＝</p>
<p>3:现在google appengine开始收费了，标准为：每额外一小时CPU处理时间收费10美分；输入应用的数据每1GB收费10美分，输出的<br />
数据收费12美分；每一 GB数据存储一个月收费15美分。所以强烈推荐大家自己在google appenging上自己搭建服务器。因为，免费的流<br />
量对于个人来说是够用的，但是如果大家都用软件作者的服务器（客户端conf文件里面默认的那个），那么作者估计会花费大笔的银子的。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/06/18/%e7%94%a8google-app-engine%e5%81%9a%e4%b8%aa%e4%ba%ba%e4%bb%a3%e7%90%86%e6%9c%8d%e5%8a%a1%e5%99%a8%ef%bc%88linux%e7%89%88%ef%bc%89/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Say Hi to GNOME World</title>
		<link>http://blogs.gnome.org/raywang/2009/04/20/say-hi-to-gnome-world/</link>
		<comments>http://blogs.gnome.org/raywang/2009/04/20/say-hi-to-gnome-world/#comments</comments>
		<pubDate>Mon, 20 Apr 2009 07:32:57 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/raywang/?p=30006</guid>
		<description><![CDATA[Hi everybody,
I&#8217;m new here, I will start my new blog from today, and I&#8217;d like to write my posts about GNOME,  and of course I&#8217;ll try to write in English. see you then.  
]]></description>
			<content:encoded><![CDATA[<p>Hi everybody,</p>
<p>I&#8217;m new here, I will start my new blog from today, and I&#8217;d like to write my posts about GNOME,  and of course I&#8217;ll try to write in English. see you then. <img src='http://blogs.gnome.org/raywang/wp-content/mu-plugins/tango-smilies/tango/face-smile.png' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/04/20/say-hi-to-gnome-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>i18n 和 l10n 区别</title>
		<link>http://blogs.gnome.org/raywang/2009/04/07/i18n-%e5%92%8c-l10n-%e5%8c%ba%e5%88%ab/</link>
		<comments>http://blogs.gnome.org/raywang/2009/04/07/i18n-%e5%92%8c-l10n-%e5%8c%ba%e5%88%ab/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 07:32:01 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[i18n]]></category>
		<category><![CDATA[l10n]]></category>

		<guid isPermaLink="false">http://raywang.yo2.cn/?p=30005</guid>
		<description><![CDATA[
Internationalization = I18n
Changing a program to support for multiple languages and cultural habits.

Character handling (unicode&#8230;)
Locale awareness (date formats, currencies, numbers, time zones, etc.)

Localizability
Isolate localizable items (messages, pictures, etc.)
Implement infrastructure necessary for localizing above items.




The programmer’s work.

Localization = L10n

Translate localizable items (messages, pictures, etc.) for one language.


Providing an internationalized package the necessary bits to support one’s [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><strong>Internationalization = I18n</strong><br />
Changing a program to support for multiple languages and cultural habits.</p>
<ul>
<li>Character handling (unicode&#8230;)</li>
<li>Locale awareness (date formats, currencies, numbers, time zones, etc.)
<ul>
<li>Localizability</li>
<li>Isolate localizable items (messages, pictures, etc.)</li>
<li>Implement infrastructure necessary for localizing above items.</li>
</ul>
</li>
</ul>
</li>
<p><span style="color: #ff0000">The programmer’s work.</span></ul>
<ul>
<li><strong>Localization = L10n</strong>
<ul>
<li>Translate localizable items (messages, pictures, etc.) for one language.</li>
</ul>
</li>
<p>Providing an internationalized package the necessary bits to support one’s native language and cultural habits.</p>
<p><span style="color: #ff0000">The translator’s work. </span></ul>
<p>Gettext = complete toolset for translating messages output by programs.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/04/07/i18n-%e5%92%8c-l10n-%e5%8c%ba%e5%88%ab/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Linux System Programming 学习笔记</title>
		<link>http://blogs.gnome.org/raywang/2009/03/20/linux-system-programming-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0/</link>
		<comments>http://blogs.gnome.org/raywang/2009/03/20/linux-system-programming-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0/#comments</comments>
		<pubDate>Fri, 20 Mar 2009 06:13:43 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>
		<category><![CDATA[lsp]]></category>

		<guid isPermaLink="false">http://raywang.yo2.cn/?p=28024</guid>
		<description><![CDATA[the sector is the smallest addressable unit on a block deviice.
the block is the smallest addressable unit on a file system.
the page size is the smallest unit addressable by the memory management unit.

sector = 512 bytes
block = sector * 2(power 0, 1, 4) = 512 bytes, 1 KB, 4 KB
sector &#60;= block &#60;= page size
process

&#124;------ [...]]]></description>
			<content:encoded><![CDATA[<p><code>the <strong>sector</strong> is the smallest addressable unit on a block deviice.<br />
the <strong>block</strong> is the smallest addressable unit on a file system.<br />
the <strong>page size</strong> is the smallest unit addressable by the memory management unit.</code></p>
<p><code><br />
<strong>sector</strong> = 512 bytes<br />
<strong>block</strong> = sector * 2(power 0, 1, 4) = 512 bytes, 1 KB, 4 KB<br />
sector &lt;= block &lt;= page size</code></p>
<p><strong>process</strong><br />
<code><br />
|------ data<br />
|------ resources<br />
|------ state<br />
|------ virtualized computer</code></p>
<p><strong>ELF section</strong><br />
<code><br />
text section: executable code, readonly data<br />
data section: C variables with values, readable and writable<br />
bss section: uninitialized global data</code></p>
<p><code><br />
<strong>real uid</strong> is always that of the user who started the process.<br />
<strong>effective uid</strong> may change under various rules to allow a process to execute with the rights of different users.<br />
<strong>saved uid</strong> stores the original effective uid, its value is used in deciding what effective uid values the user may switch to.<br />
<strong>filesystem uid</strong> which is usually equal to the effective uid, is used for verifying file system access.<br />
</code><br />
<code><strong><br />
real gid<br />
effective gid<br />
save gid<br />
filesystem gid</strong></code></p>
<p><strong>IPC</strong> mechanism supported by Linux:<br />
<code><br />
pipes<br />
named pipes<br />
semaphores<br />
message queues<br />
shared memory<br />
futexes<br />
</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/03/20/linux-system-programming-%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>srandom 与 random</title>
		<link>http://blogs.gnome.org/raywang/2009/02/19/srandom-%e4%b8%8e-random/</link>
		<comments>http://blogs.gnome.org/raywang/2009/02/19/srandom-%e4%b8%8e-random/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 03:38:19 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[c]]></category>

		<guid isPermaLink="false">http://raywang.yo2.cn/articles/srandom-%e4%b8%8e-random.html</guid>
		<description><![CDATA[今天看了看这两个函数的manpage，srandom 的作用是为random 做个种子，默认random生成的数是以srandom(1)为种子的。所以，虽然random 生成的数好像没什么规律，但每次生成的数都是一样的。如果想要改变这个所谓的“随机数”，就要再说srandom生成一个新的种子，比如srandom(2)，不过这样做太麻烦了，先拿srandom(time(0))充个数吧。
#include &#60;stdlib.h&#62;
#include &#60;stdio.h&#62;
int main()
{
srandom(time(NULL));
printf(&#8221;the number is %ld\n&#8221;, random());
}
]]></description>
			<content:encoded><![CDATA[<p>今天看了看这两个函数的manpage，srandom 的作用是为random 做个种子，默认random生成的数是以srandom(1)为种子的。所以，虽然random 生成的数好像没什么规律，但每次生成的数都是一样的。如果想要改变这个所谓的“随机数”，就要再说srandom生成一个新的种子，比如srandom(2)，不过这样做太麻烦了，先拿srandom(time(0))充个数吧。</p>
<p>#include &lt;stdlib.h&gt;<br />
#include &lt;stdio.h&gt;</p>
<p>int main()<br />
{<br />
srandom(time(NULL));<br />
printf(&#8221;the number is %ld\n&#8221;, random());<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/02/19/srandom-%e4%b8%8e-random/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>把baidu 的博客搬到这来了</title>
		<link>http://blogs.gnome.org/raywang/2009/02/13/%e6%8a%8abaidu-%e7%9a%84%e5%8d%9a%e5%ae%a2%e6%90%ac%e5%88%b0%e8%bf%99%e6%9d%a5%e4%ba%86/</link>
		<comments>http://blogs.gnome.org/raywang/2009/02/13/%e6%8a%8abaidu-%e7%9a%84%e5%8d%9a%e5%ae%a2%e6%90%ac%e5%88%b0%e8%bf%99%e6%9d%a5%e4%ba%86/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 08:29:28 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://raywang.yo2.cn/articles/%e6%8a%8abaidu-%e7%9a%84%e5%8d%9a%e5%ae%a2%e6%90%ac%e5%88%b0%e8%bf%99%e6%9d%a5%e4%ba%86.html</guid>
		<description><![CDATA[baidu 实在是太烂了， 所以决定搬到这来，关键也是看了initialtive 的推荐。
不过这里的访问速度实在是不敢恭维&#8230;
]]></description>
			<content:encoded><![CDATA[<p>baidu 实在是太烂了， 所以决定搬到这来，关键也是看了initialtive 的推荐。</p>
<p>不过这里的访问速度实在是不敢恭维&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/02/13/%e6%8a%8abaidu-%e7%9a%84%e5%8d%9a%e5%ae%a2%e6%90%ac%e5%88%b0%e8%bf%99%e6%9d%a5%e4%ba%86/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>厘清了xorg里的一些概念</title>
		<link>http://blogs.gnome.org/raywang/2009/02/11/%e5%8e%98%e6%b8%85%e4%ba%86xorg%e9%87%8c%e7%9a%84%e4%b8%80%e4%ba%9b%e6%a6%82%e5%bf%b5/</link>
		<comments>http://blogs.gnome.org/raywang/2009/02/11/%e5%8e%98%e6%b8%85%e4%ba%86xorg%e9%87%8c%e7%9a%84%e4%b8%80%e4%ba%9b%e6%a6%82%e5%bf%b5/#comments</comments>
		<pubDate>Wed, 11 Feb 2009 11:30:36 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[X.org]]></category>

		<guid isPermaLink="false">http://raywang.yo2.cn/articles/%e5%8e%98%e6%b8%85%e4%ba%86xorg%e9%87%8c%e7%9a%84%e4%b8%80%e4%ba%9b%e6%a6%82%e5%bf%b5.html</guid>
		<description><![CDATA[摘自：http://portis21.spaces.live.com/blog/cns!5F0852C73A746A31!532.entry?wa=wsignin1.0&#38;sa=932181685
今天看到一篇不错的英文文章，解释了xorg实现里的一些概念，也解决了我的一些疑惑。概括并解释一下。
期待已久的DRI2被排除出了Xorg 7.4版本了，为什么呢？ 是为了给GEM取代TTM让路，而DRI2的实现目前依赖于TTM。
目 前的Xserver渲染架构严重落后于时代，自Xfree时代遗留的问题在Xorg里也未得到足够的重视，所以现在到了革新的时候。2D加速，3D加速等 都依赖于一个好的内存和执行管理器，这也是最难的部分。目前的xorg驱动都实现了各自的存储管理，提供DRI1接口，并负责modesetting。
Memory manger位于内核中，并为用户空间的程序提供一套操作API。由各个不同的显卡硬件抽象出相同的操作，大家共享这部分代码，剩下的与具体硬件相关的部 分由各个显卡分别实现。老的TTM管理器API复杂，而且不适合现代显卡架构，于是Intel提出了GEM来取代之，目前GEM里只包含Intel自己的 硬件相关部分，ATI驱动的一个分支也实现了对GEM的支持。GEM目前已经进入2.6.28版本的内核。
Kernel mode setting：内核也做一部分modesetting的工作，比如系统引导的时候显示的信息，这些都是内核提前做了mode setting，而我们在进入X前，加载xorg驱动模块的时候，xorg驱动再做一次modesetting，重置显示设定，所以会有屏幕闪烁的情况出 现。现在的kernel mode setting就是要把这部分功能移到内核里，完全由内核做mode setting。Fedora 9/10已经实现了这个功能，所以从启动内核到进入X不会有闪烁，一切都很平滑，并且可以做很多eye candy的东西。目前KMS还未进入内核，最早也要等到2.6.29版本了。
DRI2是下一代的Direct Rendering Infrastructure，具有重定向(redirect) direct rendering功能。在当前，一个程序如果使用了OpenGL窗口，显示内容是直接写到framebuffer里的。这会跟使用了composite 功能的窗口管理器WM冲突，这是为什么Google Earth在compiz下支离破碎的原因。而通过DRI2，OpenGL窗口内容先被重定向的offscreen memory里，然后由WM负责输出，就不再会有冲突。而DRI2是基于老的TTM设计的，需要针对GEM作修改。
2D加速方面，EXA 将要取代老的XAA，但EXA也只是xorg server全面转向OpenGL前的一个临时解决方案。XAA不对大量常用2D操作作加速，并且对XRender的加速也支持不够。Intel又提出了 UXA来取代EXA，当前UXA提供和EXA同样的API，但是利用了新的GEM管理器。
Redhat的一个大牛不满X架构的严重老化，另起炉灶设计一个全新的X server，代号Wayland，目前还不实用，拭目以待吧。
针 对GEM修改后的DRI2预计会伴随Xserver 1.6于09年初发布，同时还将释出RandR 1.3。而Xorg 7.5预计09年四月发布，届时将会伴随Xserver 1.7。至于kernel mode setting，Ubuntu开发者将于下月召开的会议上讨论是否用Fedora的Plymouth替换Usplash，如果在9.04版里引入 Plymouth，我们就能用上KMS。Mesa 7.2不支持GEM，git版本的似乎也不行，估计要到7.3/7.4才会支持。
]]></description>
			<content:encoded><![CDATA[<p>摘自：http://portis21.spaces.live.com/blog/cns!5F0852C73A746A31!532.entry?wa=wsignin1.0&amp;sa=932181685</p>
<p>今天看到一篇不错的英文文章，解释了xorg实现里的一些概念，也解决了我的一些疑惑。概括并解释一下。</p>
<p>期待已久的DRI2被排除出了Xorg 7.4版本了，为什么呢？ 是为了给GEM取代TTM让路，而DRI2的实现目前依赖于TTM。</p>
<p>目 前的Xserver渲染架构严重落后于时代，自Xfree时代遗留的问题在Xorg里也未得到足够的重视，所以现在到了革新的时候。2D加速，3D加速等 都依赖于一个好的内存和执行管理器，这也是最难的部分。目前的xorg驱动都实现了各自的存储管理，提供DRI1接口，并负责modesetting。</p>
<p>Memory manger位于内核中，并为用户空间的程序提供一套操作API。由各个不同的显卡硬件抽象出相同的操作，大家共享这部分代码，剩下的与具体硬件相关的部 分由各个显卡分别实现。老的TTM管理器API复杂，而且不适合现代显卡架构，于是Intel提出了GEM来取代之，目前GEM里只包含Intel自己的 硬件相关部分，ATI驱动的一个分支也实现了对GEM的支持。GEM目前已经进入2.6.28版本的内核。</p>
<p>Kernel mode setting：内核也做一部分modesetting的工作，比如系统引导的时候显示的信息，这些都是内核提前做了mode setting，而我们在进入X前，加载xorg驱动模块的时候，xorg驱动再做一次modesetting，重置显示设定，所以会有屏幕闪烁的情况出 现。现在的kernel mode setting就是要把这部分功能移到内核里，完全由内核做mode setting。Fedora 9/10已经实现了这个功能，所以从启动内核到进入X不会有闪烁，一切都很平滑，并且可以做很多eye candy的东西。目前KMS还未进入内核，最早也要等到2.6.29版本了。</p>
<p>DRI2是下一代的Direct Rendering Infrastructure，具有重定向(redirect) direct rendering功能。在当前，一个程序如果使用了OpenGL窗口，显示内容是直接写到framebuffer里的。这会跟使用了composite 功能的窗口管理器WM冲突，这是为什么Google Earth在compiz下支离破碎的原因。而通过DRI2，OpenGL窗口内容先被重定向的offscreen memory里，然后由WM负责输出，就不再会有冲突。而DRI2是基于老的TTM设计的，需要针对GEM作修改。</p>
<p>2D加速方面，EXA 将要取代老的XAA，但EXA也只是xorg server全面转向OpenGL前的一个临时解决方案。XAA不对大量常用2D操作作加速，并且对XRender的加速也支持不够。Intel又提出了 UXA来取代EXA，当前UXA提供和EXA同样的API，但是利用了新的GEM管理器。</p>
<p>Redhat的一个大牛不满X架构的严重老化，另起炉灶设计一个全新的X server，代号Wayland，目前还不实用，拭目以待吧。</p>
<p>针 对GEM修改后的DRI2预计会伴随Xserver 1.6于09年初发布，同时还将释出RandR 1.3。而Xorg 7.5预计09年四月发布，届时将会伴随Xserver 1.7。至于kernel mode setting，Ubuntu开发者将于下月召开的会议上讨论是否用Fedora的Plymouth替换Usplash，如果在9.04版里引入 Plymouth，我们就能用上KMS。Mesa 7.2不支持GEM，git版本的似乎也不行，估计要到7.3/7.4才会支持。</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/02/11/%e5%8e%98%e6%b8%85%e4%ba%86xorg%e9%87%8c%e7%9a%84%e4%b8%80%e4%ba%9b%e6%a6%82%e5%bf%b5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>看图学VCS</title>
		<link>http://blogs.gnome.org/raywang/2009/01/04/%e7%9c%8b%e5%9b%be%e5%ad%a6vcs/</link>
		<comments>http://blogs.gnome.org/raywang/2009/01/04/%e7%9c%8b%e5%9b%be%e5%ad%a6vcs/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 10:37:00 +0000</pubDate>
		<dc:creator>raywang</dc:creator>
				<category><![CDATA[GNU/Linux]]></category>

		<guid isPermaLink="false">http://raywang.yo2.cn/articles/%e7%9c%8b%e5%9b%be%e5%ad%a6vcs.html</guid>
		<description><![CDATA[&#60;br&#62;]]></description>
			<content:encoded><![CDATA[<p>http://www.ruanyifeng.com/blog/2008/12/a_visual_guide_to_version_control.html</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/raywang/2009/01/04/%e7%9c%8b%e5%9b%be%e5%ad%a6vcs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
