2010年10月22日星期五

MTD夹心UBI

"This is a small driver which implements fake MTD devices on top of UBI volumes. This sounds strange, but it is in fact quite useful to make MTD-oriented software (including all the legacy software) work on top of UBI."

作者留下了关于gluebi.c的设计目的,可以看出UBI的下层是MTD,结果上层还是MTD。这种肉夹馍的结构,只是上层的MTD是一个虚拟层,用于兼容以前的驱动

2010年10月21日星期四

Linux MTD nand read page抽象方法

Nand_read_page_hwecc()是抽象了硬件以后的接口,也是NAND flash一个最为基本平常的操作page read。和我见过的所有的其他的平台完全不一样,Linux MTD将硬件的NAND controller抽象成了,hwctl() 紧接着read_buf()这样的操作序列。可以看出hwctl负责下命令,包括read ,program ,erase等等。

2010年10月20日星期三

phone modem RT OS can disable time slice to improve performance

ThreadX具有时间片功能,但是这样的实时操作系统往往用在一下小型的系统上,比如phone modem里。在这样的应用中,由于内部的中断非常频繁,所以往往会disable time slice,来减小上下文切换开销,而达到高效的效果。

2010年9月17日星期五

flight term

distance measuring equipment (DME)
VHF omnidirectional range (VOR)
non-directional beacons (NDBs)

2010年8月12日星期四

DMA flow controller can solve unknown packet length problem

The peripheral that controls the length of the packet is known as the flow controller. The
flow controller is usually the DMAC, where the packet length is programmed by
software before the DMA channel is enabled. If the packet length is unknown when the
DMA channel is enabled, you can use either the source or destination peripherals as the
flow controller.

2010年8月4日星期三

git no branch


兄弟,那个git no branch ,网上查到了
终于救回来了,
有个命令git help里看不到的 叫reflog
Git reflog 可以看到no branch 上 提交的tag list
然后找到 最后一个tag , git checkout xxxx 就可以了

2010年5月31日星期一

UART RX的一个细节

当UART内部支持FIFO,那么一般情况,RX interrupt的触发条件就是RX FIFO接收到的数据,超过了level trigger。但是如果只有这一种触发条件是不够的,因为如果对方发送了很少的数据,比如一个字节,但是没有超过level trigger,那么逻辑上讲就不会触发RX interrupt,也就是上层软件意识不到有数据来临,但事实是对方已经发了东西,所以是就一个条件触发RX interrupt不够的。
基于以上的原因,在UART的hardware设计时,往往会加入一些条件:如果RX FIFO中不是空,但是在很短的时间内,还没有超过level trigger,此时就认为是一种timeout,同时也会触发RX interrupt,这样就解决了上面逻辑上和事实上不符合的问题

2010年5月21日星期五

cygwin in Win7 Command Prompt

The message I get when trying to run gcc in Win7 cmd.exe is: "Access is denied."
This is a known limitation of the symbolic links in Cygwin 1.7. The solution is to invoke the command('gcc-3.exe' or 'gcc-4.exe')  directly

2010年3月29日星期一

Linux中断和异常的处理交错的核心原则

在Linux中,中断和异常的处理是可以交错执行的。中断可以打断其他中断的处理,同时也可以打断异常的处理。

2010年3月25日星期四

Android目录结构

到目前为止,Android的代码结构是我5年以来见到的最漂亮的。专门有个build的目录,是它的build system。其他的目录主要依靠Android.mk来控制,这个文件的语法简单,结构清晰。根目录下的Makefile激发整个build system的编译过程。

而且代码直接包括tool chain,几乎无须另外安装什么东西(关于这点也许是优点,也许是缺点)。

2010年3月24日星期三

Linux tool chain

CodeSourcery is the best choice of Linux tool chain. When you consider which tool chain you will use to compiler Linux kernel, as well as Linux applications, do not hesitate, CodeSourcery product is your first choice. And the source code of their tool chain you can obtain freely.

2010年3月18日星期四

荣幸

如果现在还能看到这篇文章的,那么要不是翻墙出境,要不就是搜索引擎的cache。我感到非常荣幸!很久没来这里,这里是我最喜欢的博客服务,可是被国人给封闭了。现在天天都可以到这里来了,因为到了一家新公司。
以后希望能每天到这里写点东西。

2009年5月27日星期三

2009年5月22日星期五

repo upload: Permission denied (publickey)

Upload project scripts/:
branch ed-patchset ( 1 commit, Fri May 22 18:56:58 2009 +0800):
4dd9c101 remove unecessary script file *~
to 10.83.35.33:808 (y/n)? y
Permission denied (publickey).
fatal: The remote end hung up unexpectedly

--------------------------------------------
[FAILED] scripts/ ed-patchset (Upload failed)

得到上面的错误。但是如果我测试和gerrit的链接
ssh -p 29418 v.w@10.83.35.33
可以发现ssh的key是工作正常的,可以链接到server.

同时
git push ssh://v.w@10.83.35.33:29418/kernel HEAD:refs/for/master
push也是OK

但就是repo upload不可以。想了很久,最后发现
git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com
这两个命令我把名字和邮件的头字母写成了大写造成的,我该成小写后,repo upload终于可以工作啦!!

因此,上面的git config --global对于使用repo是多么的重要呀!连大小写都是要区分的。

2009年5月10日星期日

Android1.5抢先看

Google刚发布了Android1.5,同时发布的还有1.5 SDK
Android1.5已经增加了很多新的特征。
  • 只要长按输入框,就会出现复制和输入法切换菜单。已经具备复制和剪切的功能
  • 内置了google拼音输入法。
  • 支持多国语言,并且无需重启,语言任意切换

2009年4月8日星期三

LVM故障排除

今天Linux一启动,发现如下错误,系统halt.
Couldn't find device with uuid 'EgMxmG-QFR0-eS7r-R38U-1z5w-yoHl-3J4cFo'.
Couldn't find all physical volumes for volume group VolGroup00.
Volume gourp "VolGroup00" not found
吓了我一身冷汗,结果就用下面的命令解除了问题
vgreduce --removemissing VolGroup00

2009年4月7日星期二

Android OpenGL hardware acceleration

Android OpenGL有软件模拟模式, 也就是所有的运算由CPU进行.相关的代码汇集在
libagl.so
中.
如果你想用hardware加速,那么必须实现
libhgl.so
或者
libhgld.so
,并且打开Android属性集
debug.egl.hw

debug.egl.profiler

2009年4月3日星期五

Android SGL是什么?

Android 使用SGL处理2D图形.但是SGL到底是什么?

SGL(Skia Graphics Library)一个向量图形引擎,能在低端设备比如手机、电视及其它手持设备之上,呈现高品质的2D图形.

Skia实际是美国Skia公司,2005年十一月被Google收购,该公司的业务是向量绘图软件.

自2005年Skia被Google收购后,一直相当神秘低调,直到2007年初,Skia GL相关的源代码才被揭露,作为Google Android平台的图形引擎,稍候的Google Chrome浏览器也采用Skia引擎。而Android与Chrome的代码中都有一份[skia]的拷贝.

Skia用C++实现,源代码约八万行.

2009年4月1日星期三

Android system.img的疑惑

Android系统自己的文件,最后build出来,权限,ownership都是正确的.可是自己加进去的文件权限总是不是自己的预期.这是为什么呢?
./external/yaffs2/yaffs2/utils/的源代码会生成mkyaffsimage的可执行文件.这个代码是Android改写过的,所有的疑问都在fs_config()函数.这个函数在
./system/core/include/private/android_filesystem_config.h
中有定义.当你打开这个文件时,你就知道答案啦!

2009年3月26日星期四

Android service

Android service 的启动可以用
setprop ctl.start xxx
的命令来完成.他的具体实现请参考Android/system/core/init/init.c的
service_start()函数