IPOD 修好了,开始折腾e680i

周一硬盘送到了,不过感觉不是特好,里面还有嘎达的生音。Anyway,装上去之后,使劲一扣,就好了。然后用最新的IPOD updater 2006-1-3,更新一下它的firmware。 Rockbox看起来不错,不过界面还是不如苹果做得好,而且似乎比较费电,暂时不用他了。不过用rockbox可以不用itunes upload歌曲,直接可以播放文件系统里面的mp3,比较好。我试了用floola来给ipod加歌曲,有两个问题:一个是新装的ipod不能用,必须要用itunes加至少一首歌。这是因为这个软件没法自己创建ipod的数据库,必须itunes来做这件事。第二就是很多中文tag显示的不对,显然是使用的iso-8859-1的编码。嗯。。还需要改进。对了,canvendish,这个软件是有linux版本的。 关于IPOD的firmware,其实就是装在那块硬盘上的了。如果你用windows的磁盘管理器去看ipod的磁盘,就会发现在你放歌曲的盘之外还有一个小分区,里面装的就是ipod的系统软件了。Rockbox就是修改这个分区的MBR,放了一个rockbox bootloader来实现双启动的。嗯,bootloader,很熟悉吧。。。rockbox本身是直接放在FAT32分区里面的。如果要装ipod linux,他没法装在FAT32上,必须要再弄一个ext3的FS,看起来比较麻烦。。。 IPOD就折腾到这里吧。前两天跟老婆换了她的e680i,忍不住又hack了一下,主要是默认的AMCSL字体很难看,记得以前我把simsun.ttf放进去的时候还是很不错的。在网上看了一些帖子,发现那些人还是很有想法的。他们的hacking基本是这样的: 修改rootfs,在/etc/rc.d/rc2.d里面加两个启动脚本,S70和S75,link到/diska/和/mmc/mmca1下,这样,只要在userfs或者mmc卡上写上两个脚本,这两个脚本就可以执行了,这样就可以做很多的事情。 rootfs的修改方法大概是,把刷机过程中的smg文件,用linux mount一下,然后cp出来,修改内容,再用mkcramfs作出来,就可以了,同理可以搞任何一个分区。 这样一来,要替换字体就比较容易了,只要在启动脚本里面把ttf文件,甚至包括fontdef.cfg,用mount –bind替换掉原来的文件就可以了。当然,如果ttf文件放在userfs上,那么机器就不能使用大容量磁盘模式,只能使用usbnet模式,好在这个模式下可以使用smb通过网上邻居来访问,不错。变通的方法就是启动的时候把这个文件cp到/tmp下去,也就是内存里。当然这样ttf文件不能太大。 还有人修改/usr/language里面的内容,就可以直接替换现有的theme了。。我用了一个apple的theme,感觉不错。 又拿起pst,又见MontaVista,颇有点怀念呢。记得我第一次去moto,就看见老姚在烧板子,我就傻乎乎在那看着……

四月 4, 2007 · Shawn Ma

Rockbox rocks!

今天装了一个rockbox,在被分成两半的ipod上。 What could I say? FANTASTIC!!! Rockbox是ipod上播放软件的替代品。其实他不光可以装在ipod上,还可以装在很多其他播放器上,比如iriver的。 他比ipod自带的多很多功能, 比如: 支持很多的播放文件格式:mp3, ac3, aac/mp4, mpc, ogg/vorbis, wav, aiff, flac, alac, wavpack. 支持均衡器(Equalizer),还有crossfeed——这是干嘛的? 更精确的音量控制。 可以使用主题(theme) 支持ReplayGain 可以看jpeg图片和文本文件。。。 可以玩doom。。。 支持unicode。。 据说On-The-Go的功能也增强了 还有很多plugin。。 en, in summary, it is an interesting toy for ipod.

三月 31, 2007 · Shawn Ma

拆了IPOD

两年前买的一个ipod,四代,20G的。前几天老婆用来备份几个文件,结果,拷不出来了!研究后发现,是硬盘坏了。保修期已过,这个玩意就没啥用了,打算再买一个nano之类的。 昨天试图把它废物利用一下,因为原来放歌曲的地方应该还是好的,于是去当了一个itunes 7.1,发现苹果的软件特别的无耻,装itunes一定要装quicktime,然后这两个软件就跟大管家一样,自动关联了很多后缀,启动了一对服务,quicktime还autorun,itunes还要管理你的music,我靠,不可忍。去网上search一下,发现有一些替代品,比如floola。同时发现,网上有人自己修ipod,无非是换硬盘、电池之类的。于是我想把我这个也休一下好了,现在小硬盘还是很便宜的嘛!于是去找了一个如何拆ipod的video,并把我的ipod给拆了。 我没有那个录像上说的工具,只好使用小改锥。而且把表面划伤了一点点……sorry ipod,以后给你买个漂亮的衣裳。 ipod其实就是上下两面直接扣在一起的,撬开就是这样: 里面那个蓝色包着的,就是硬盘了!硬盘头上那条黄色的,就是接硬盘的数据线,下面屁股上黑色那个,只是一块海绵。 我把硬盘翻了过来。 反面有一块蓝色海绵垫着的,底下那块镜子似的是电池。别的,就是电路板了。。。 把海绵用刀子挂下来,他是用不干胶粘上去的。 看,这就是硬盘了,TOSHIBA MK2004GAL。 拆了硬盘的ipod,STILL KICKING! 盒子的两部分有一个小导线连着的,很容易扒开,于是,尘归尘,土归土(啊,这个照的很不好,懒得再拍了) 最后,我研究了一下硬盘,发现它是1.8寸的MicroDrive的硬盘,你看,他的接口,其实是跟CF卡是一样的: 我没有CF卡做比较,因为在相机里……,不过我的确试图把CF卡插到ipod里面去,发现不行,虽然针数是一样的,但是那个接口上还有一个突起,导致CF卡插不进去。 然后就是试图去找一个这个硬盘了,首先他不是我最开始想象的笔记本硬盘那样的,比那个要小!试着找了找看是不是有其他的牌子或者新款的硬盘,比如容量大一些的,结果如下: MK2004GAL是东芝很久以前出的20G硬盘,GAL系列可以放在ipod里,另外的GAH系列是两碟的,厚一些,就放不了了,GAL系列新款的有MK2006GAL, MK 3006GAL, MK3008GAL, MK4007GAL, MK4009GAL。其中30xx是30G的,40xx是40G的。另外还有一家也生产,不过接口一样,大小不一样。。最后去淘宝找了找,居然还是卖MK2004GAL最多。。。最后买了一个,350¥,现在就等这个新硬盘到货了。。。

三月 31, 2007 · Shawn Ma

我讨厌XML

XML现在被越来越广泛的应用了,不过我觉得它已经变了,本来它是为了简单,容易读懂而设计的,但是现在,它彻底变成了只有机器才能读懂的东西。可恶的是,我的工作中还是要经常读XML文档,有时候甚至要读XML Schema来确定一个文档的合法性-_-。号称最好的XML SPY,也就那么回事,编辑起来一点都不方便。 一个例子就是XACML。这个东西是BEA和EnTrust,Sun等公司合伙搞出来的一个OASIS标准,用来表述授权的策略。我们公司以前的一个产品,也有一种自己发明的授权策略表述语言。如果要表示这么一个策略: 当用户user_1访问resource_1的时候,具有role_1的角色 用我们以前的表述语言,大概这么写: grant( user_1, resource_1, role_1 ) 如果用XACML来表述,就得象下面这样。实在是,让人无法恭维。呵呵,大概就是为了软件公司能赚钱吧。。。 <Policy xmlns=”urn:oasis:names:tc:xacml:2.0:policy:schema:os“ PolicyId=”urn:bea:xacml:2.0:entitlement:role:permitRole“ RuleCombiningAlgId=”urn:oasis:names:tc:xacml:1.0:rule-combining-algorithm:first-applicable“> <Target> <div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">Resources</span></span><span><span style="color: #0000ff;">></span></span> </div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">Resource</span></span><span><span style="color: #0000ff;">></span></span> </div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>ResourceMatch</span><span> MatchId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:function:string-equal</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span> </div> <div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>AttributeValue</span><span> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#string</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span><span><strong><span style="background-color: #ffff00;">resource_1</span></strong></span><span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">AttributeValue</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">ResourceAttributeDesignator</span></span> <span><span style="color: #990000;">AttributeId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:2.0:resource:resource-ancestor-or-self</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#string</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> MustBePresent</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>true</strong><span style="color: #0000ff;"><span>&#8220;</span><span> /></span></span> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">ResourceMatch</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>ResourceMatch</span><span> MatchId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:function:string-equal</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span> </div> <div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>AttributeValue</span><span> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#string</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span><span><strong><span style="background-color: #ffff00;">role_1</span></strong></span><span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">AttributeValue</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">ResourceAttributeDesignator</span></span> <span><span style="color: #990000;">AttributeId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:2.0:subject:role</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#string</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> MustBePresent</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>true</strong><span style="color: #0000ff;"><span>&#8220;</span><span> /></span></span> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">ResourceMatch</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Resource</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Resources</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">Actions</span></span><span><span style="color: #0000ff;">></span></span> </div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">Action</span></span><span><span style="color: #0000ff;">></span></span> </div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>ActionMatch</span><span> MatchId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:function:anyURI-equal</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span> </div> <div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>AttributeValue</span><span> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#anyURI</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span><span><strong>urn:oasis:names:tc:xacml:2.0:actions:enableRole</strong></span><span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">AttributeValue</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">ActionAttributeDesignator</span></span> <span><span style="color: #990000;">AttributeId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:action:action-id</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#anyURI</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> MustBePresent</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>true</strong><span style="color: #0000ff;"><span>&#8220;</span><span> /></span></span> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">ActionMatch</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Action</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Actions</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Target</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>Rule</span><span> RuleId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>primary-rule</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> Effect</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>Permit</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span> </div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">Condition</span></span><span><span style="color: #0000ff;">></span></span> </div> <div> <div> <div> <a href="http://themouse.spaces.live.com/mmm2006-11-30_19.10/#"><strong><span style="font-family: Courier New; color: #ff0000;">&#8211;</span></strong></a> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>Apply</span><span> FunctionId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:function:string-is-in</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span> </div> <div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span style="color: #990000;"><span>AttributeValue</span><span> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#string</strong><span style="color: #0000ff;"><span>&#8220;</span><span>></span></span><span><strong><span style="background-color: #ffff00;">user_1</span></strong></span><span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">AttributeValue</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">SubjectAttributeDesignator</span></span> <span><span style="color: #990000;">AttributeId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:subject:subject-id</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> DataType</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>http://www.w3.org/2001/XMLSchema#string</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> SubjectCategory</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>urn:oasis:names:tc:xacml:1.0:subject-category:access-subject</strong><span style="color: #0000ff;"><span>&#8220;</span><span> /></span></span> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Apply</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Condition</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Rule</span></span><span><span style="color: #0000ff;">></span></span> </div> </div> </div> <div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"><</span></span><span><span style="color: #990000;">Rule</span></span> <span><span style="color: #990000;">RuleId</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>deny-rule</strong><span><span style="color: #0000ff;">&#8220;</span></span><span><span style="color: #990000;"> Effect</span></span><span><span style="color: #0000ff;">=&#8221;</span></span><strong>Deny</strong><span style="color: #0000ff;"><span>&#8220;</span><span> /></span></span> </div> </div> <div> <span><strong><span style="font-family: Courier New; color: #ff0000;"> </span></strong></span> <span><span style="color: #0000ff;"></</span></span><span><span style="color: #990000;">Policy</span></span><span><span style="color: #0000ff;">></span></span> </div>

十二月 15, 2006 · Shawn Ma