2010年3月29日星期一
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是多么的重要呀!连大小写都是要区分的。
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抢先看
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
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
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++实现,源代码约八万行.
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
中有定义.当你打开这个文件时,你就知道答案啦!
./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()函数
setprop ctl.start xxx
的命令来完成.他的具体实现请参考Android/system/core/init/init.c的
service_start()函数
2008年12月31日星期三
2008年11月13日星期四
2008年11月11日星期二
USB Host Class Client Driver Registry Setting
在Windows Mobile上,当HUB感受到有新设备插入时,Host Controller的Driver会试图枚举注册表。例如
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4099\Default\8\Mass_Storage_Class]
他们的含义如下
HKEY_LOCAL_MACHINE
Drivers
USB
LoadClients
VendorId_ProductId_ReleaseNumber
DeviceClass_DeviceSubClass_DeviceProtocol
Interface_Class_InterfaceSubClass_InterfaceProtocol
Client_Class
如上所示,如果没有特别定义,就用Default,每一个Key包含3个类别,可以制定任意几个
[HKEY_LOCAL_MACHINE\Drivers\USB\LoadClients\4817_4099\Default\8\Mass_Storage_Class]
他们的含义如下
HKEY_LOCAL_MACHINE
Drivers
USB
LoadClients
VendorId_ProductId_ReleaseNumber
DeviceClass_DeviceSubClass_DeviceProtocol
Interface_Class_InterfaceSubClass_InterfaceProtocol
Client_Class
如上所示,如果没有特别定义,就用Default,每一个Key包含3个类别,可以制定任意几个
2008年11月9日星期日
2008年10月31日星期五
Mobile: USB Host interface
正在写mobile上的USB Host Client Driver,今天终于知道了USBD.dll输出的函数如何使用啦!
USB毕竟只有一条通路,软件上在如何多线程,最终数据还是会以序列发送或者接收。
microsoft的函数很稳定,你可以大胆相信他们可以帮你做完你想做的事情,太多的超时处理只会是你陷入困境
USB毕竟只有一条通路,软件上在如何多线程,最终数据还是会以序列发送或者接收。
microsoft的函数很稳定,你可以大胆相信他们可以帮你做完你想做的事情,太多的超时处理只会是你陷入困境
2008年10月7日星期二
OHCI规定寄存器组和共享内存
2008年10月6日星期一
USB host初识
今天想了解一下USB host的驱动架构,嵌入式领域OHCI还是很常用的。
针对OHCI我今天才知道,它已经定义了内部寄存器组,包括每个bit的定义都有统一标准。
如果某个SOC说它支持OHCI,那么代码几乎不需要改,拿一个OHCI的代码就可以跑,只要提供寄存器组的首地址,那么其中每一个寄存器就确定了。另外就是中断号对应不一样。
不过虽然移植可能不难,但是搞清楚整个数据流程还是有必要的。
针对OHCI我今天才知道,它已经定义了内部寄存器组,包括每个bit的定义都有统一标准。
如果某个SOC说它支持OHCI,那么代码几乎不需要改,拿一个OHCI的代码就可以跑,只要提供寄存器组的首地址,那么其中每一个寄存器就确定了。另外就是中断号对应不一样。
不过虽然移植可能不难,但是搞清楚整个数据流程还是有必要的。
Linux on SAMSUNG s3c2443
我移植linux kernel 2.6.26.2到三星s3c2443处理器上,当我一直完,linux kernel已经更新到2.6.26.5了。不过其间的修改没有影响到s3c244x处理器系列。
总的来说,kernel2.6.26.2对s3c2443的支持非常的不好,它的许多代码只是移植了s3c2410的内核代码,因此在体系结构方面只是一个框架。根本不能用。
s3c2443的更好的官方支持要等2.6.28系列内核了,就目前kernel 2.6.27-rc一直在紧急的修补当中,不过我发现没有多少kernel修改者提交针对s3c2443的补丁,可能是市面上拿到s3c2443 CPU的人比较少?!
当然kernel 2.6.26.2经过修改已经可以启动,下面是我的boot log:
#Uncompressing Linux................................................................................................ done, booting the kernel.
Linux version 2.6.26.2 (cpuwolf@MyLin.localdomain) (gcc version 3.4.4) #36 Mon Sep 1 23:24:45 CST 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2443
Warning: bad configuration page, trying to continue
Ignoring unrecognised tag 0x00000000
Memory policy: ECC disabled, Data cache writeback
CPU S3C2443 (id 0x32443001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C2443: mpll on 800.000 MHz, cpu 400.000 MHz, mem 133.333 MHz, pclk 66.666 MHz
Warning: USB host bus not at 48MHz
S3C2443: epll on 96.000 MHz, usb-bus 96.000 MHz
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttySAC2,115200n8 console=tty0
irq: clearing pending ext status 00007200
irq: clearing subpending status 000000c0
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00000009, tcnt d902, tcfg 0000020e,00000002, usec 0000170a
Console: colour dummy device 80x30
console [tty0] enabled
console [ttySAC2] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61708KB available (2744K code, 277K data, 116K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 192 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2443: Initialising architecture
S3C2443: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 88
DMA channel 1 at c4800100, irq 89
DMA channel 2 at c4800200, irq 90
DMA channel 3 at c4800300, irq 91
DMA channel 4 at c4800400, irq 92
DMA channel 5 at c4800500, irq 93
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: cannot get irq 32 - err -22
s3c2410-lcd: probe of s3c2410-lcd failed with error -16
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.30
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2412-nand s3c2410-nand: Tacls=3, 22ns Twrph0=7 52ns, Twrph1=3 22ns
s3c2412-nand s3c2410-nand: System booted from NAND
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd5 (Samsung NAND 2GiB 3,3V 8-bit)
s3c2410_nand_update_chip: chip c3da52bc: 11
Scanning device for bad blocks
Bad eraseblock 0 at 0x00000000
Bad eraseblock 1 at 0x00040000
Bad eraseblock 2 at 0x00080000
Bad eraseblock 3 at 0x000c0000
Bad eraseblock 4 at 0x00100000
Bad eraseblock 5 at 0x00140000
Bad eraseblock 6 at 0x00180000
Bad eraseblock 7 at 0x001c0000
Bad eraseblock 8 at 0x00200000
Bad eraseblock 9 at 0x00240000
Bad eraseblock 10 at 0x00280000
Bad eraseblock 11 at 0x002c0000
Bad eraseblock 12 at 0x00300000
Bad eraseblock 13 at 0x00340000
Bad eraseblock 14 at 0x00380000
总的来说,kernel2.6.26.2对s3c2443的支持非常的不好,它的许多代码只是移植了s3c2410的内核代码,因此在体系结构方面只是一个框架。根本不能用。
s3c2443的更好的官方支持要等2.6.28系列内核了,就目前kernel 2.6.27-rc一直在紧急的修补当中,不过我发现没有多少kernel修改者提交针对s3c2443的补丁,可能是市面上拿到s3c2443 CPU的人比较少?!
当然kernel 2.6.26.2经过修改已经可以启动,下面是我的boot log:
#Uncompressing Linux................................................................................................ done, booting the kernel.
Linux version 2.6.26.2 (cpuwolf@MyLin.localdomain) (gcc version 3.4.4) #36 Mon Sep 1 23:24:45 CST 2008
CPU: ARM920T [41129200] revision 0 (ARMv4T), cr=c0007177
Machine: SMDK2443
Warning: bad configuration page, trying to continue
Ignoring unrecognised tag 0x00000000
Memory policy: ECC disabled, Data cache writeback
CPU S3C2443 (id 0x32443001)
S3C24XX Clocks, (c) 2004 Simtec Electronics
S3C2443: mpll on 800.000 MHz, cpu 400.000 MHz, mem 133.333 MHz, pclk 66.666 MHz
Warning: USB host bus not at 48MHz
S3C2443: epll on 96.000 MHz, usb-bus 96.000 MHz
CPU0: D VIVT write-back cache
CPU0: I cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
CPU0: D cache: 16384 bytes, associativity 64, 32 byte lines, 8 sets
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256
Kernel command line: console=ttySAC2,115200n8 console=tty0
irq: clearing pending ext status 00007200
irq: clearing subpending status 000000c0
PID hash table entries: 256 (order: 8, 1024 bytes)
timer tcon=00000009, tcnt d902, tcfg 0000020e,00000002, usec 0000170a
Console: colour dummy device 80x30
console [tty0] enabled
console [ttySAC2] enabled
Dentry cache hash table entries: 8192 (order: 3, 32768 bytes)
Inode-cache hash table entries: 4096 (order: 2, 16384 bytes)
Memory: 64MB = 64MB total
Memory: 61708KB available (2744K code, 277K data, 116K init)
Mount-cache hash table entries: 512
CPU: Testing write buffer coherency: ok
net_namespace: 192 bytes
NET: Registered protocol family 16
S3C2410 Power Management, (c) 2004 Simtec Electronics
S3C2443: Initialising architecture
S3C2443: IRQ Support
S3C24XX DMA Driver, (c) 2003-2004,2006 Simtec Electronics
DMA channel 0 at c4800000, irq 88
DMA channel 1 at c4800100, irq 89
DMA channel 2 at c4800200, irq 90
DMA channel 3 at c4800300, irq 91
DMA channel 4 at c4800400, irq 92
DMA channel 5 at c4800500, irq 93
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
NET: Registered protocol family 2
IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
TCP established hash table entries: 2048 (order: 2, 16384 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
TCP reno registered
NET: Registered protocol family 1
NetWinder Floating Point Emulator V0.97 (double precision)
JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
msgmni has been set to 120
io scheduler noop registered
io scheduler anticipatory registered (default)
io scheduler deadline registered
io scheduler cfq registered
s3c2410-lcd s3c2410-lcd: cannot get irq 32 - err -22
s3c2410-lcd: probe of s3c2410-lcd failed with error -16
Serial: 8250/16550 driver $Revision: 1.90 $ 4 ports, IRQ sharing enabled
s3c2440-uart.0: s3c2410_serial0 at MMIO 0x50000000 (irq = 70) is a S3C2440
s3c2440-uart.1: s3c2410_serial1 at MMIO 0x50004000 (irq = 73) is a S3C2440
s3c2440-uart.2: s3c2410_serial2 at MMIO 0x50008000 (irq = 76) is a S3C2440
brd: module loaded
loop: module loaded
dm9000 Ethernet Driver, V1.30
S3C24XX NAND Driver, (c) 2004 Simtec Electronics
s3c2412-nand s3c2410-nand: Tacls=3, 22ns Twrph0=7 52ns, Twrph1=3 22ns
s3c2412-nand s3c2410-nand: System booted from NAND
NAND device: Manufacturer ID: 0xec, Chip ID: 0xd5 (Samsung NAND 2GiB 3,3V 8-bit)
s3c2410_nand_update_chip: chip c3da52bc: 11
Scanning device for bad blocks
Bad eraseblock 0 at 0x00000000
Bad eraseblock 1 at 0x00040000
Bad eraseblock 2 at 0x00080000
Bad eraseblock 3 at 0x000c0000
Bad eraseblock 4 at 0x00100000
Bad eraseblock 5 at 0x00140000
Bad eraseblock 6 at 0x00180000
Bad eraseblock 7 at 0x001c0000
Bad eraseblock 8 at 0x00200000
Bad eraseblock 9 at 0x00240000
Bad eraseblock 10 at 0x00280000
Bad eraseblock 11 at 0x002c0000
Bad eraseblock 12 at 0x00300000
Bad eraseblock 13 at 0x00340000
Bad eraseblock 14 at 0x00380000
订阅:
博文 (Atom)
。

