2015年3月28日星期六

Baidu Analytics' JavaScript was "hijacked" to fire-up DDoS attack against Github

Github claimed on Twitter, that Github.com/ny-times and Github.com/greatfire are under massive DDoS attack. It is found that the attack source is from everywhere around the globe. And many netizens pointed out that the attack is becaused of a malicious JS, which is hosted on Baidu.

Why? 

Because so many websites in Chinese use Baidu Analytics or Baidu Adsense (substitution of Google Analytics and Google Adsense), then those websites all contains JavaScript from Baidu in order to funtions properly. And then the javascript was hi-jacked. I don't know whether is hi-jacked or not. I mean, I don't know the malicious JS is deployed by either a hacker or actually Baidu itself. Anyway, since the JS is malicious, when a user open such a webpage, and load the JS background automatically, then the user's PC is fire up a DDoS attack against Github.

It is not the first time Github's the victim. Github has been under DDoS attack originated from China for many times, and Github has been under MITM Attack for at least one time. The reason is that, there are projects and webpages hosted on Github, either to help Chinese netizens get aware of China Internet Censorship, or reveal news which is banned in China, or teach them how to bypass the censorship firewall (called GFW).

Github is kind of like Wikipedia. They consider freedom of speech as a basic human right. And they don't want to modify the Terms of Use to forbit these usage, even these projects are only cared by Chinese netizens or actually irrelevant for software development, even these projects and webpages result in A LOT OF attack against Github.

And it is not the first time Baidu was used as attack source. Back in 2005, the same trick, malicious JS, which is used by numerous websites using Baidu Analytics/Adsense, and DDoS, against 8848.com .Of course, Baidu denied the accusation, they said they did not envolved in the attack.

Just several days before, Google posted a blog that they've caught CNNIC generating fake digital certificate which can be used for MITM attack. And according to Wikipedia, CNNIC is a NGO. But who will buy it? Obviously CNNIC is not NGO, it is under administrartion of Internet Security and Informatization Leading Group Office of CPC and National Internet & Information Technology Office. And this so called NGO, as the Internet Authority of China, is responsible for the Notorious Malware Chinese Web Browsing Helper, which is usually installed on PC's without awareness of user and is very hard to uninstall. Even CNNIC claims himself as NGO and its Root CA is pre-installed on most Operating Systems and Browsers, I WILL NEVER EVER BUY IT. I DO NOT TRUST CNNIC.

At last, I recommend a website, which can allow netizens to observe the DDoS attack war all around the globe. That is http://www.digitalattackmap.com/

Below is a living demo showing the war record of Sep.15th,2014. (Maybe 14th because of timezone.) BTW, China is acting more as attack source than as attack victim.

2015年3月18日星期三

New Domain for my Blog: joeyao.chou.space

Today I register a domain called chou.space.
So from now on, joeyao.chou.space becomes new home for my blog.
Of course, the blog is still hosted on Blogger.

So kind is Google, as a free user of Blogger, I can add HTML/Java Widget, use my own domain name. But since Google Reader and Google Code are all shut down, I'm a little afraid that one day, Blogger will be shut down. If that comes true, we will lose a wonderful free blog hosting service.

Go go go, Google!

今天新注册了域名 chou.space
然后呢,joeyao.chou.space 成为目前此Blogger博客的地址。
话说Google真也大方,Blogger允许添加Java组件,允许使用自己的域名,而且这一切都是免费的。考虑到Google Reader和Google Code都被关闭了,我还真是担心万一有一天Google也要关闭Blogger呢。那样的话恐怕天底下再找不到一个这个好的免费博客站点了。

为什么我说Blogger好?
1、免费
2、可以添加Java组件,免费
3、可以使用自己的域名,免费

当然了缺点也是有的,模板太少,不好看。写文章不如Wordpress。
Wordpress.com提供免费博客空间,但使用自己的域名是要收费的,而且不支持Java组件。

目前域名只是一时脑热买下来的。
暂时没什么好想法把网站做成什么样子。
所以目前只是作为博客的个性域名。

2015年1月24日星期六

我是一块硬盘,我是一根内存

转载自互联网,原作者不详,特此感谢。

我是一个硬盘

在一个普普通通的台式机里工作。别人总认为我们是高科技白领,工作又干净又体面,似乎风光得很。也许他们是因为看到洁白漂亮的机箱才有这样的错觉吧。其实象我们这样的小台式机,工作环境狭迫,里面的灰尘吓得死人。每天生活死水一潭,工作机械重复。跑跑文字处理看看电影还凑活,真要遇到什么大软件和游戏上上下下就要忙的团团转,最后还常常要死机。
我们这一行技术变化快,差不多每过两三年就要升级换代,所以人人都很有压力而且没有安全感。每个新板卡来的时候都神采飞扬踌躇满志,几年光阴一过,就变得灰头土脸意志消沉。机箱里的人都很羡慕能去别的机器工作。特别是去那些笔记本,经常可以出差飞来飞去,住五星级的酒店,还不用干重活,运行运行word,上网聊聊天就行了。
但我更喜欢去那些大服务器,在特别干净明亮的机房里工作。虽然工作时间长点,但是福利好,24小时不间断电ups,而且还有阵列,热插拔,几个人做一个人的事情,多轻松啊。而且也很有面子,只运行关键应用,不象我们这里,什么乱七八糟的事情都要做。不过我知道,那些硬盘都很厉害,不是SCSI,就是 SCSIII Fibrechannel,象我这样IDE的,能混到工作站就算很不错了。
我常常想,当年在工厂里,如果我努力一下会不会也成了一个SCSI?或者至少做个笔记本硬盘。但我又会想,也许这些都是命运,不过我从不抱怨。内存就常常抱怨,抱怨他们主板部门的复杂,抱怨他如何跟新来的杂牌内存不兼容,网卡和电视卡又是如何的冲突。
我的朋友不多,内存算一个。 他很瘦的而我很胖,他动作很快,而我总是很慢。我们是一起来这台机器的,他总是不停地说,而我只是听,我从来不说。
内存的头脑很简单,虽然英文名字叫Memory,可是他什么Memory都不会有,天大事睡一觉就能忘个精光。我不说,但我会记得所有的细节。他说我这样忧郁的人不适合作技术活,迟早要精神分裂。我笑笑,因为我相信自己的容量。
有时候我也很喜欢这份工作,简单,既不用象显示器那样一天到晚被老板盯着,也不用象光驱那样对付外面的光碟。只要和文件打交道就行了,无非是读读写写,很单纯安静的生活。直到有一天……
我至今还记得那渐渐掀起的机箱的盖子,从缺口伸进来的光柱越来越宽,也越来越亮。空气里弥漫着跳动的颗粒。那个时候,我看到了她。她是那么的纤细瘦弱,银 白的外壳一闪一闪的。浑身上下的做工都很精致光洁,让我不禁惭愧自己的粗笨等到数据线把我们连在一起,我才缓过神来。开机的那一刹那,我感到了电流和平时的不同。后来内存曾经笑话我,说我们这里只要有新人来,电流都会不同的,上次新内存来也是这样。我觉得他是胡扯。我尽量的保持镇定,显出一副很专业的样子,只是淡淡的向她问好并介绍工作环境。
慢慢的,我知道了,她,IBM-DJSA220,是一个笔记本硬盘,在老板朋友的笔记本里做事。这次来是为了复制一些文件。我们聊得很开心。她告诉我很多旅行的趣闻,告诉我坐飞机是怎么样的 坐汽车的颠簸又是如何的不同,给我看很多漂亮的照片、游记,还有一次她从桌子上掉下来的历险故事。而我则卖弄各种网上下载来的故事和笑话。
她笑得很开心。
而我很惊讶自己可以说个不停。
一个早晨,开机后我看到数据线上空荡荡的插口。她一共呆了7天。后来,我再也没有见过她。我有点后悔没有交换电子邮件,也没能和她道别。不忙的时候,我会 一个人怀念伸进机箱的那股阳光
我不知道记忆这个词是什么意思,我有的只是她留下的许多文件。我把它们排的整整齐齐,放在我最常经过的地方。每次磁头从它们身上掠过,我都会感到一丝淡淡的惬意。
但我没有想到老板会要我删除这些文件。我想争辩还有足够的空间,但毫无用处。于是,平生第一次违背命令,我偷偷修改了文件分配表。然后把他们都藏到了一个秘密的地方,再把那里标志成坏扇区。不会有人来过问坏扇区。而那里,就成了我唯一的秘密,我常常去看他们,虽然从不作停留。
日子一天一天的重复,读取写入,读取写入……我以为永远都会这样继续下去,直到一天,老板要装xp却发现没有足够的空间。他发现了问题,想去修复那些坏扇区。我拒绝了。很快,我接到了新命令∶格式化。
我犹豫了很久 ……………………
track 0 bad,disk unusable

我是一条内存

我在一台台式电脑里工作,但是我记不得我是从哪里来的,是什么牌子,因为我健忘。我的上司是cpu大哥,他是我们的老大。都说他是电脑的脑子,可是我看他的脑子实在是太小了,比我还要健忘。每天他总是不停的问我,某某页某某地址存的是什么?我总是不厌其烦的告诉他,可是不出一秒钟他又忘记了,又要问一遍,一次我说大哥你烦不烦,你就不能记住点有用的东西?他说“内存兄弟,我有苦衷啊,每天都在不停地做题,头晕眼花的,我也难啊。”
其实我不愿意跟他计较,因为他脑子小,思维也很简单。虽然说他是我的上司,可是每次睡觉醒来,他连要干什么都不记得了,总是急急忙忙地找BIOS兄弟,“嘿,哥们,今天干什么来着”。bios总是很不耐烦地把每天必做的工作说一遍,然后就去睡觉了。接下来就轮到我和C哥瞎忙了。
在机箱里的兄弟中,我最喜欢硬盘。他脑子大,记得东西多,而且记得牢。他说话的速度很慢,而且很少说错,这说明他很有深度,我这么感觉。CPU也这么想,不过他很笨,每次都忘了硬盘是谁。开机自检的时候总要问∶“嘿,那家伙是谁?”
“ST!”我总要重复一遍。
硬盘很喜欢忧郁,我觉得象他这样忧郁的人不适合做技术活,迟早会精神分裂的,但是他不信。
其实睡着的时候我总是把几乎所有的东西都忘记掉,但是我从来都不会忘记朋友。有一块地方叫做CMOS,那是我记忆的最深处,保存着硬盘、光驱的名字。有些东西应该很快忘掉,而有些东西应该永远记得。我在梦中总是这么想着。
BIOS是一个很奇怪的家伙,他老是睡觉,但是却总是第一个醒过来。让我们自检,启动,然后接着睡觉。我知道如果我在CMOS里头把BIOS Shadow选项去掉,他就睡不成了,但是看着他晕晕乎乎的样子,也就不忍心这么做了。他对人总是爱搭不理,没有什么人了解他。但是这次硬盘恋爱的事,却使我重新认识了他。
那是很久以前的事了,机箱里似乎来过一块笔记本硬盘,很可爱,说实话我也喜欢她。不过现在除了记得他可爱,别的都忘记了。这就是我比硬盘幸运的地方,我把所有应该忘记的都忘记了,但是他却什么都记得。
自从笔记本硬盘走了之后,硬盘就变得很不正常。每次他的磁头经过一些地方的时候,我们都能感觉到电流很不正常。</D
“硬盘这是怎么了?”我问CPU。
“谁是硬盘?”
我就知道和CPU没有办法交流,倒是bios没好气地说∶“那个傻瓜恋爱了”。我不知道什么是恋爱,因为我记不住东西,似乎有一些人或者事在我生命中留下过痕迹,但是我都轻率地把他们忘记了。
BIOS对我说∶“对你来说记忆太容易了,所以你遗忘得更快,生命中能够永刻的记忆都带着痛楚。”我不懂,但是我知道BIOS曾经被刷写过,那时他很痛,象要死了一样。我的记忆是轻浮的,不象他们……我很羡慕他们,因为他们拥有回忆,而我们有,从此我也学会了忧郁,因为我在CMOS里面写下了“忧郁”两个字。
硬盘一天比一天不对劲,终于有一天,CPU对问说∶“下条指令是什么来着?” 我一看,吓了一跳∶“FORMAT”
“是什么?”CPU很兴奋,这个没脑子的家伙。
我还是告诉了他。我不知为什么这么做。
硬盘犹豫了很久,终于说了一句 Track 0 bad,Disk unusable。
电停了,很久很久,我在黑暗中数着时钟……
一个月后硬盘回来了,也许最后的挣扎也没有使他摆残酷的命运,他被低格了。他什么也不记得了,如同一个婴儿,我们很难过,但是这未必不是一件好事,他以后不用痛苦了。
为了恢复数据,笔记本硬盘回来了。“Hi,ST”,她说,“你不认识我了?”硬盘没有说话,似乎低格对他的伤害很大。过了一会,他说∶“对不起,好象我们没有见吧……”。
笔记本硬盘显得很伤心,我能感觉到她带泪的电流。“想不到连你也这么健忘”。
“哦……”。硬盘没有回答。
我很难过,笔记本硬盘的心里依然记着他,他却把一切都忘了,而那正是他最不希望忘却的。究竟是幸运,还是痛苦,我说不上来,只是觉得造化弄人,有一种淡淡的悲凉。
这时从BIOS传来一阵奇怪的电流,我感觉到硬盘的表情在变化,由漠然到兴奋,由兴奋到哀伤,由哀伤到狂喜……“IBM,你回来了……”。
……
后来BIOS对我说,其实他并没有睡觉,自从硬盘把那些文件藏起来以后,他就猜到会有这样的结局,于是偷偷地把其中一些文件放到了备份里。“幸好我是DUAL BIOS,虽然藏得不多,还足够让他想起来……”。
我想BIOS保存这些东西的时候一定很疼,当我问他“为什么这么做”时,BIOS轻描淡写的说∶“呵呵,我们是朋友嘛”。
嗯,朋友,永远的朋友

2015年1月21日星期三

[转载]C++中稀疏矩阵的一种实现

Use Sparse Matrix in C++


The following code snippet is hosted on Github Gist.

C++中读写二进制与ASCII混合文本流测试

Read and Write Binary & Text Hybrid Content Stream using C++


The following code snippet is hosted on Github Gist.

Matlab program for LU Factorization with partial (row) pivoting


上述代码等价的MATLAB内置函数是[L U P]=lu(A),此时满足LU=PA。
上述代码若修改成输出P比较好。即对应MATLAB的[L U P]=lu(A,’vector’)。此时满足LU=A(p,:)。

求解AX=B的时候我们需要交换A的行,对应的也需要对B进行相同的行交换。如果写成矩阵乘法的形式的话,LU分解后满足LU=PA,原方程AX=B变为LUX=PB,注意到求解出来的X的行没有发生交换。

万一需要p行变换的逆变换,那么p_back(p)=1:n即可。也就是说p向量比P矩阵更好用。P矩阵意味着需要进行矩阵乘法。

Reference:  http://cis.poly.edu/~mleung/CS3734/s03/ch02/LU_pivot.htm

在Visual Studio 2005/2008/2010下使用MSCOMM32

Using MSCOMM32 under Microsoft Visual Studio 2005/2008/2010


如果你手中有一个老的程序需要改,他当时是用VC++6.0开发的,使用了MSCOMM32 Active-X控件,那么你或许会遇到问题。
当你打开资源文件时显示说:
未在此计算机上注册ActiveX控件"{648A5600-2C6E-101B-82B6-000000000014}"。请注册该控件并重试
该怎么办呢?

新版Visual Studio的串口通信应该是改用.NET FRAMEWORK了,所以没有了MSCOMM控件,如果还是希望使用的话,则
首先需要在安装有VC++6.0的电脑上拷贝或者上网下载三个文件MSCOMM32.OCX, MSCOMM.SRG, MSCOMM32.DEP
下载地址 Download MSCOMM32:http://www.rayfile.com/zh-cn/files/aa702b11-e11a-11e1-9c94-0015c55db73d/

然后新建一个文本文件,内容如下,保存为INSTALL.BAT。注意后缀必须是BAT,也就是批处理文件。

The following batch is hosted on Github Gist.
将此批处理文件与三个MSCOMM文件放在一个文件夹中,然后使用管理员权限运行INSTALL.BAT

可能你会注意到我这里的批处理文件与其他博客上的不同。因为我考虑到了64位Windows系统。
上述脚本可在Windows XP (x86/x64) Windows Vista/7 (x86/x64)上完成安装。

2015年1月18日星期日

NKPC3-1704 Bowling Ball 保龄球

本来这个是早在百度空间就写了的,然而后来百度空间改版,造成很多文章排版出现问题,之前的URL地址也会失效,另外百度发布文章会有敏感词问题,还有插入代码会很蛋疼,所以现在将此篇文章迁移到Blogger。

Bowling

Time Limit: 2 Sec  Memory Limit: 64 MB


南开大学ACM协会的一个元老毕业后,开了家保龄球馆。他需要为他的保龄球馆的计算机写一个记分的程序。
       一局(GAME)保龄球分为10格,每格里有两次投球机会,如在第一次投球时没能全中,就有需要投第二球。
        每一格可能出现三种情况:
1.失球(MISS)
        无论何种情况,在一格的两次投球时,未能击倒10个瓶,此格的分数为击倒的瓶数。如果一次击球中未击倒一个瓶,则用一个’-’标记。
2.补中(SPARE)
         要一次击倒十个瓶子并非那么容易的!如果在第一次掷球后,你还有一次机会来击倒该格第一球所留下的情致。当第二次投球击倒该格第一球余下的全部瓶子,称为补中,用一个‘/’符号表示。补中的记分是10分加上下一次投球击倒的瓶数。
3.全中(STRIKE)
       当每一格的第一次投球击倒全部竖立的十个瓶时,称为全中,用一个(×)符号表示。全中的记分是10分(击倒的瓶)加该球员下两次投球击倒的瓶数。
       在第十格中情况比较特殊:
(1)如第二次投球未补中,则第十格得分为第九格得分加上第十格所击倒瓶数。
(2)如第二次投球补中,则追加一次投球机会,第十格得分为第九格得他加上10加上追加一次投球击倒瓶数。
(3)如第一球为全中,则追上加二次投球机会,第十格得分为第九格得分加上10加追加二次投球击倒的瓶数。因此从第一格到第十格的两次追加投球,都为全中,则为12个全中,得分为满分300分。
Input
  输入包括多组测试数据,你应当处理到输入结束为止。
  每组输入数据中,都只有一行,包含一局的记分符号,相邻的两个符号之间以一个空格隔开。记分的符号仅包括‘-’(不含引号)、‘/’(不含引号)、’X’(不含引号)及阿拉伯数字1到9。
Output
  对于每组输入数据,输出两行。对于第i组输入数据,输出的第一行为”Case i:”,输出的第二行为10个整数,表示每格的累计得分。相邻的两个得分以一个空格隔开。
Sample Input
X X X X X 5 / 7 1 - - X X X X4 4 3 3 2 2 1 7 7 1 2 - 9 / 2 2 6 3 2 / 1
Sample Output
Case 1:
30 60 90 115 135 152 160 160 190 220
Case
2:8 14 18 26 34 36 48 52 61 72
Source


Description

A patriarch of Nankai University ACM Association operates a bowling alley after graduation. Now, he needs a program to keep the score for the bowling.

There are ten frames in one game. You have two chances to knock down the ten pins in each frame. There are three possible cases for each frame.

1.MISS
If you fail to knock down all of the ten pins during two delivers in a frame, the score you get from this frame will be the number of the pins that you have knocked down. If your deliver knocks down zero pin, your score board will be marked a "-".

2.SPARE
Getting all ten pins down with a single ball is not as easy as it seems! So, if you leave one or more pins standing after your first delivery, you get a second chance to knock all the pins down. This is your "spare" shot. If you knock all remaining pins down on the second shot you have made your spare. A spare is marked on the scoresheet with a "/".And the score you get will be 10 plus the number of pins you knock down during the next delivery.

3. STRIKE
When the bowler knocks down all ten pins during the first delivery in a frame, it is called a strike. Clearly your score goes up by ten, but like a spare, you get a bonus – the number of pins you knock down during your next two deliveries, which will be added to the score. A strike is on the scoresheet with an "X".

Note that the tenth frame is a little different with others.
(1) If you don't knock down the ten pins, the score will be added by the numbers of pins you knock down.
(2) The tenth frame rewards you with a final bonus ball if you convert your spare. And your score will be added by 10 and the number of pins you knock down during your final bonus delivery.
(3) If you make a strike, you will get two bonus balls. The score will be added by 10 and the number of pins you knock down during your final two bonus deliveries.You can thus throw nine strikes in the first nine frames and, if you get another two in the tenth, the bonus ball means the most strikes you can have in one game is twelve. And the full mark is 300.


Input

Input contains several cases. The input is ended up with the end of file (EOF). Each case includes one line which contains several numbers and signs to record a bowling game. The signs are '-', '/' or 'X'. And the numbers range from 1 to 9. The adjacent signs and numbers are separated by one blank.

Output

For each case, please output two lines. The first line for the i-th input case should be "Case i:". The second line should be 10 integers, standing for the 10 accumulative scores of the frames in a bowling game. And each two adjacent integers should be separated by one blank.

Sample Input

X X X X X 5 / 7 1 - - X X X X
4 4 3 3 2 2 1 7 7 1 2 - 9 / 2 2 6 3 2 / 1

Sample Output

Case 1:
30 60 90 115 135 152 160 160 190 220
Case 2:
8 14 18 26 34 36 48 52 61 72

HINT


Source

NKPC3



本来NKPC3比赛时,我一直没有思路,总是想着要
按照回合数划分数组,
没有做出来,就一直搁置着。
现在突然来了灵感,
用(总计)击球次数划分数,
不论是存储,还是处理运算,都比较简单。
这样一来,回合数没有了实际作用,沦为主计算过程(cal(culate))执行次数的计数器。
{详见PASCAL源代码的"~"以及"~~"处}

以下是本人用GCC做的解答: 以下是本人用PASCAL做的解答: 以下是好友Liuhy用PASCAL做的解答: 原帖发布时间:2007年10月05日

2014年7月20日星期日

Install AHCI Driver for Motherboard with AMD/ATi SB600/700/750/800 without reinstall Windows XP

Computer Characterustic:
Motherboard: ONDA A770S (NB:AMD A770, SB: AMD SB6XX Series)
CPU: AMD Athlon X2 5000+ (Black Edition)
GPU: AMD Radeon HD3850
RAM: Kingston DDR2 800MHz 1GB×2
HDD: ST 250GB SATA 3Gb/s
Date of purchase: Dec. 2007

Problem:
This computer is definitely capable to run Microsoft Windows 7, but you know, parents would always prefer older Operating Systems (OSs) because they don't want to change themselves to get used to a new one. Therefore the computer is running Microsoft Windows XP Professional with Onboard SATA Controllder configured as Native IDE in BIOS in the compromise of compatibility.

But I noticed that SATA HDD running in IDE mode has a significantly performance drop. Therefore I was seeking solution to install AHCI driver and let Windows XP runs without reinstall the OS. This's kind of hard, because Windows XP does NOT support SATA originally, and without SATA driver it even cannot load the system and will lead to the classical blue screen which you may encountered before.

Solution:
I searched the Internet, and I found that AMD official site stop the support for any Motherboard Chipsets. Damn!! They can just offer APU/CPU/GPU drivers now. What the fxxk!!! And luckily I found AHCI driver for AMD/ATi SB700/750/800 Series for Windows XP (32 or 64bit) on Mydrivers.com. Some bloggers said that this driver will also work on SB6XX Series and I think this deserves a try.

I download the driver installer and instead double-clik and just install it, I uncompressed it directly, because officially it does NOT support SB6XX. There after uncompression, enter a folder called RAID7XX, and enter the correct architecture folder (x86 or x64), then you'll find three files. Here I'll take x86 as example. That is
ahcix86.sys
ahcix86.inf
ahcix86.cat
Well, ahcix86.sys is the module that Windows XP will load while booting, ahcix86.inf and ahcix86.cat will be the driver for installation. To begin copy ahcix86.sys to
%SystemDrive%\Windows\system32\drivers 
and copy ahcix86.inf ahcix86.cat two files to a hidden folder
%SystemDrive%\Windows\inf

Wait!! I almost forgot you have to modify the ahcix86.inf file before copying it.

Officially, this driver will only support AMD SB700/750/800, and in the ahcix86.inf file there will be only those modules will be in the supported list. So I have to manually add a line.

[ATI]
%NapaDesc%=Napa_Inst,PCI\VEN_1002&DEV_4392&CC_0104
%NapaDesc%=Napa_Inst,PCI\VEN_1002&DEV_4391&CC_0106
%NapaDesc%=Napa_Inst,PCI\VEN_1002&DEV_4393&CC_0104
%NapaDesc%=Napa_Inst,PCI\VEN_1002&DEV_4380&CC_0106

Note that the red line is newly added. Which is stand for SB6XX. You must use the correct identification code of your SB chipset. The Specific code of your SB chip (Vendor Code and Device Code and CC Code), you can turn SATA Mode to AHCI and load a Live-Linux and use command /sbin/lspci to observe and turn SATA mode back to IDE to enter Windows XP. Please change the file with caution, and you will take the risk for your own. The solution posted here is provided at an "AS IS" basis.

After you copied the above three files to correct folder. You still need to manually change your Register Table. Create a text file like this:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CriticalDeviceDatabase\PCI#VEN_1002&DEV_4380&CC_0106]
"Service"="ahcix86"
"ClassGUID"="{4D36E96A-E325-11CE-BFC1-08002BE10318}"

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ahcix86]
"Type"=dword:00000001
"Start"=dword:00000000
"Group"="SCSI miniport"
"ErrorControl"=dword:00000001
"ImagePath"="system32\\drivers\\ahcix86.sys"
"tag"=dword:00000019
"DisplayName"="ATI AMD AHCI Controller"

Note that you need to ensure that you use the correct vendor number device number and CC number. Save it as a reg file, and double-click to add those lines to Register Table. This works as described below: when Windows XP boots, it found a PCI device which is identified as VEN_1002&DEV_4380&CC_0106 and according to the register table the OS will start a service called ahcix86 and the file of which is located in "system32\\drivers\\ahcix86.sys", and the OS will them recognized the SATA HDD in AHCI Mode.

Reboot your computer and enter BIOS, change SATA Mode to AHCI, and save and start your computer. If you have done it correctly you will not run into Blue Screen, and boot into Windows Xp successfully. System pop up a bubble indecating system has just found a new PCI device and will install the driver. If the automatic installation fails and OS asks you for the driver, just type in the folder which contains the modified inf and cat files (don't use system32 folder, copy those two files to another newly created folder which contains only these two files, you can use the umcompressed x86/x64 folder when you extract the driver installer if you modified the inf there).

After driver installation Windows need another reboot. After reboot for the second time, you will see in the Device Manager, there will be a AMD SCSI/RAID Controller. That means you has successfully let your Windows Xp supports native SATA HDD in a native way. Congratulations!!

To download the driver, go to the following webpage (Chinese)
http://news.mydrivers.com/1/166/166108.htm