本博客倡导开放源代码,在此公布之程序源代码如无特别声明均采用GNU通用公共 许可证(GPL)

乐在其中

分享学习Linux的乐趣

  IT博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  23 随笔 :: 0 文章 :: 401 评论 :: 0 Trackbacks
共3页: 1 2 3 
re: Buildroot - 让交叉编译更轻松 gouzhuang 2010-04-29 08:33
@焦路
>请问固件开发可不可以用c++
当然可以,只是c++编译出来的执行文件稍大一点,依赖更多的动态库。
>lz使用什么ide?
目前主要是一些修修补补,没有用ide。
re: Buildroot - 让交叉编译更轻松 gouzhuang 2010-04-29 08:28
@aaron
>http://buildroot.net/downloads/sources/ 这里uClibc0.9.28没有了,只有uClibc0.9.28.3
这里还有 http://www.uclibc.org/downloads/old-releases/
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-28 23:59
@laowantong
>strange, where did it got WPA key? I have not set up yet. only ifconfig set IP, that is all, why does it work????
其实你的无线网卡没有正常工作。你的telnet是通过有线网连接过去的。因为你的无线网卡和有线网卡的IP以及你的Ubuntu机器在同一子网内,播放机的有线网卡一样会响应访问无线IP的请求。

ifconfig的输出可以看出wlan0没有RUNNING状态。iwlist hang也说明无线网卡不正常。

加载r8187l模块后立即运行dmesg看看有什么日志信息。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-28 11:52
@老顽童
>汗, 我当成一个文件了, 奇怪,刷机没出问题:-)
你运气好:),重要的是packages/vmlinux.develop.avhdd.mars.nand.bin。根目录下的vmlinux似乎没什么用,不知为什么要放在那儿,难道只是为了符号表?。我的播放机上根本没这个文件。

待会看看你的符号表。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-28 10:43
@老顽童
>如果, sata_mars驱动不支持IDE转接, 是不是说不可能用内接的IDE盘了?还是因为厂家把IDE部分给精减掉了?
我看了一下内核源码,在ide模块初始化代码的开始处有如下代码:
if(is_mars_cpu())
{
printk (KERN_INFO "Mars no support IDE\n");
return 0;
}
看来是ide模块自己拒绝初始化,跟sata_mars无关。

>ubuntu上不能看MIPS的符号表, 只好回家再看了.
我在ubuntu上可以看呀!你确定看的是vmlinux文件而不是vmlinux.bin文件吗?

>rtl8187l 上面的灯亮了,wlan0也出来了,看来硬件驱动部分是工作了,只是我需要配置下WAP,什么的, 还不太懂怎么搞, 需要学学. 用dvdplayer界面上的无线网络配置, 它说找不到SSID.不知道怎么回事. 如果就是相当于做: iwlist wlan0 scan, 找不到SSID,是哪里的问题呢?
先不管dvdplayer,手工执行ifconfig wlan0 up; iwlist wlan0 scan看有什么结果。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-27 23:43
@老顽童
>Mars no support IDE
似乎sata_mars驱动不支持IDE转接

>about rtl8187l, 好象是工作了,
要确认是否工作很简单:扫描一下网络,如果能发现无线网络就说明驱动工作正常。用这个命令:iwlist wlan0 scan
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-27 23:37
@老顽童
>不过video, avi文件好象有点问题:"启动代码未知"错误
mkv又可以play
能说详细点吗?

如果怀疑跟内核有关可以进行以下两项检查:
1. 比较一下我编译的模块是否比原厂固件少了某些模块。
2. 比较一下我编译的内核与原厂内核的符号表,看有多大差异。符号表可以用命令"nm vmlinux"获得。
@www
请看博文更新
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-27 11:38
@laowantong
>oops,new kernel not work for me:-(
Sorry, 是我没搞清你的播放机的固件结构。我的机子是基于NOR Flash的,你的应该是NAND Flash的,两者固件的结构略有不同。

我看了一下海信MP801(基于NAND)的固件,认为应该这样更新内核,请与你的固件进行对照,如有不符请先不要更新,有把握再做。

1. 固件包内package2目录下有个文件叫vmlinux.develop.avhdd.mars.nand.bin,这个文件要用http://www.cnitblog.com/Files/gouzhuang/vmlinux.bin.lzma.zip 来替代(解压后得到vmlinux.bin,然后改名为vmlinux.develop.avhdd.mars.nand.bin)

2. package2目录下有个yaffs2_1.img文件,这个是根文件系统映像,解开后用 http://www.cnitblog.com/Files/gouzhuang/vmlinux.lzma.zip (需要解压) 替换下面的vmlinux文件再重新打包

3. 重新打包固件,再用它刷机

注意:以上步骤我没有条件验证,最好先咨询一下有同型号刷机经验者。
@iamcatcher
smartctl我没用过。你在台式机上试过吗?
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-25 10:01
到目前为止,insmod报出的错误代码有:2,8,17
查了一下内核头文件,这些错误代码有如下定义:
#define ENOENT 2 /* No such file or directory */
...
#define ENOEXEC 8 /* Exec format error */
...
#define EEXIST 17 /* File exists */

不过对于老顽童先遇到8,后遇到2仍有些不解。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-25 09:31
@ccc
>insmod: cannot insert `/lib/modules/2.6.12.6-VENUS/kernel/drivers/usb/host/ohci-hcd.ko': Success (17): Success
应该是这个模块已经加载了,不能重复加载,用lsmod看一下有没有。
@老顽童
USB TV tuner我不了解,但我觉得支持它有些困难。只要有源码,安装驱动应该不是问题,困难在于上层应用如何将电视画面输出到屏幕上,这需要了解播放机的视频输出接口。

usb camera应该不成问题,我听说有人给他的NAS接上摄像头,可以在办公室监控家里。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-23 14:57
@老顽童
>难道不需要r8187l 驱动?
我认为是r8187对你的网卡支持有问题。你可以手工选择驱动:
rmmod r8187以及ieee80211_*
modprobe r8187l

>要是能够redirect TV/HDMI output到远方的Xwindow上,岂不美妙?
据我所知这是不可能的。播放机的图形界面根本不是基于Xwindow的。音/视频的解码和输出是由专用的解码芯片完成的。播放程序DvdPlayer是通过RPC与解码芯片进行通讯的。这是我目前掌握的情况。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-23 10:08
@老顽童
>怎么看idVendor and idProduct of your usb card?
台式机linux上用lsusb命令看

我给你的busybox就是把我自己用的改用static link重新编译的,不支持 --install功能,你需要自己建symbolic link。busybox --help 可以列出编入的所有命令。

我没用任何的log,也不打算用。/tmp用的是ramfs,/tmp下文件越多,可用内存就越少。想看系统日志可以用dmesg命令,它是把最近的内核日志显示出来。建议你进行调试时停掉DvdPlayer,它产生太多的日志,很快就让内核日志缓冲区溢出,早一点的日志信息就看不到了。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 16:30
@laowantong
>my machine is 1283(M890), maybe diff from 1073?
don't worry, they use the same kernel source. in fact my player reports board-id 1283.

here goes the kernel and modules:
http://www.cnitblog.com/Files/gouzhuang/vmlinux.bin.lzma.zip
http://www.cnitblog.com/Files/gouzhuang/modules.tar.zip

in case you want to know the kernel config, here it is:
http://www.cnitblog.com/Files/gouzhuang/kernel-config.zip
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 15:56
@laowantong
>do you think these files need to modify, when you add ide and r8187l modules?
insmod does not rely on any of these files. As far as I know, modprobe requires an up-to-date modules.dep, and it may use modules.symbol and modules.alias
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 15:28
@laowantong
>when I plug in WG111v2 USB card, system insert module r8187, that is for WG111v3 card.
r8187 and r8187l has overlapped device support.

driver idVendor idProduct
-------------------------
r8187 0x0bda 0x8187
r8187 0x0bda 0x8189
r8187 0x0846 0x6100
r8187 0x0846 0x6a00
r8187 0x050d 0x705e
r8187l 0x1b75 0x8187
r8187l 0x0bda 0x8187
r8187l 0x0846 0x6100
r8187l 0x0846 0x6a00

what is the idVendor and idProduct of your usb card?
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 15:09
@laowantong
try use this busybox, it may give more meaningful error message

http://www.cnitblog.com/Files/gouzhuang/busybox.zip

this is a static linked busybox 1.15.3, run this command

busybox insmod <path_to_module>

let see what it says
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 12:39
@everpunk
>然后执行/tmp/usbmounts/sda1 # cp myhotplug to /dev/root/usr/local/etc
应该是 cp myhotplug /usr/local/etc

然后 chmod +x /usr/local/etc/myhotplug

然后 echo /usr/local/etc/myhotplug > /proc/sys/kernel/hotplug
这个命令的意思是把字符串"/usr/loca/etc/myhotplug"写到/proc/sys/kernel/hotplug文件里。

建议你先找一本Linux入门的书看看。

re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 12:30
@laowantong
>only 1 file in rtl8187l ? maybe some depmod?
是的, 内嵌了ieee80211, 所以不依赖任何外部模块

>how to write the entry in modules.dep?
是depmod产生的:
编译完内核并将模块安装到某个指定目录后,在内核源码目录执行
depmod -ae -F System.map -b 模块安装目录 -r 2.6.12.6-VENUS
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 09:35
@laowantong
按原厂配置编译好了,rtl8187l也一并编译了。试试吧,再不行就只有更新内核了。

http://www.cnitblog.com/Files/gouzhuang/ide-modules.tar.zip

http://www.cnitblog.com/Files/gouzhuang/rtl8187l-modules.tar.zip
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-22 08:31
@laowantong(老顽童?)
>insmod: cannot insert `/lib/modules/2.6.12.6-VENUS/kernel/drivers/ide/ide-disk.ko': Success (8): Success
看来还是兼容性问题。如果你愿意尝试,我可以提供编译好的内核及模块,这个需要重刷固件。

等等,有可能是我关闭了内核debug,导致与你的内核不兼容。我会用最接近原厂的配置(华硕的配置)重编一次。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 16:04
@everpunk
>明白这个意思了,那是在PC上建个TXT文件?编码另存成unicode还是什么?再登录到播放器的telnet复制到目标位置就行了吧?
没错。如果文件内容全是英文,无须另存为unicode。

>可是输入后显示~ # /opt/etc/init.d
>-sh: /opt/etc/init.d: Permission denied
?? /opt/etc/init.d是个目录,不能执行!应该输入/opt/etc/init.d/S50transmission
系统是不会自动执行/opt/etc/init.d下的脚本的。你的/opt是在某个脚本里mount的吧?应该在那个脚本中调用/opt/etc/init.d下的脚本。 可以加入下面的代码来实现:
# Start all init scripts in /opt/etc/init.d
for i in /opt/etc/init.d/S??* ;do
if [ -x $i ] ; then
$i start&
fi
done
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 14:43
@everpunk
>郁闷了,移动硬盘是EXT3格式的,这可怎么办啊?
你总该有个U盘吧,把它格式化成fat32。如果实在想要在windows上访问ext3,可以用ext2fsd http://www.ext2fsd.com/
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 13:53
@everpunk
>怎么把这些命令加成脚本又存到目标位置呢?
在PC上编辑并保存文件,然后ftp传送到播放机或通过U盘转过去。
如果你的播放机的根目录是可写的,直接复制到目标目录就可以了。如果根是只读的,你可以把它放在/usr/local/etc下面。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 11:52
@老顽童
>奇怪, 用了insmod ./ide-core.ko也不行
这个我也觉得奇怪。你能把错误信息帖出来吗?

>我觉得普通LINUX,不需要这些设定, 有新硬件, kernel会自动加载模块的,这1283怎么不行呢?
嵌入式系统做了大量裁剪,易用性方面比不上台式系统。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 09:22
@老顽童
关于帮你编译RTL8187L驱动,最好能确定我的编译环境与你的内核兼容,否则编出来也不能用。所以要先确认IDE模块不能加载的原因。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 09:17
@everpunk
我给的这段是shell脚本,不是在命令行上直接输入的。把脚本存到一个文件里,比如/sbin/myhotplug。

然后修改属性使其可执行:
chmod +x /sbin/myhotplug

修改系统默认的hotplug程序:
echo /sbin/myhotplug > /proc/sys/kernel/hotplug
注意这只在本次启动有效,系统重启后默认hotplug程序又会恢复原来的。要想在系统启动时自动修改,需要将上面的命令加到系统初始化脚本里(如果不熟悉linux系统最好不要轻易修改,否则可能造成系统无法启动)。

另外,这个脚本的目的不是让盘符不变,它使我们在盘符变化的情况下仍然可以正确的挂载/opt
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-21 08:32
@老顽童
modprobe依赖于modules.dep, insmod则需要输入模块的完整路径。如果insmod报"Invalid Format"之类的错误,说明模块与现有内核不兼容,需要用与内核兼容的配置来编译模块。

如果你遇到的不是兼容性问题,可以在modules.dep中加入下面几行:
kernel/drivers/ide/ide-cd.ko: kernel/drivers/ide/ide-core.ko
kernel/drivers/ide/ide-generic.ko: kernel/drivers/ide/ide-core.ko
kernel/drivers/ide/ide-disk.ko: kernel/drivers/ide/ide-core.ko
kernel/drivers/ide/ide-core.ko:

支持IDE硬盘以及SATA-IDE转接需要加载ide-disk和ide-generic
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-19 13:21
@老顽童
我编译好了内核IDE驱动模块,你可以试试。有可能我的内核编译配置与你的不兼容,模块无法加载,不过试试也没关系。

下载连接:http://www.cnitblog.com/Files/gouzhuang/ide.tar.zip
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-19 13:04
@老顽童
看了一下华硕的内核源码配置,IDE支持是关闭的,相信你的播放机也是一样的。要支持IDE和IDE-SATA转接,至少需要打开下面三个内核配置参数:
CONFIG_IDE
CONFIG_BLK_DEV_IDE
CONFIG_BLK_DEV_IDE_SATA_BRIDGE

你需要重新编译你的内核,或者把上述IDE支持编译成模块。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-18 23:37
@老顽童
>>内置盘还是不行, 设备没有识别出来
前面你提到内置盘ext2可以挂载,现在又说不行,是我理解错了吗?

另外,关于设备号变化的问题其实很好解决,让内核使用下面这个简单的hotplug脚本(echo 脚本路径 > /proc/sys/kernel/hotplug)。如果usb硬盘的根目录下有名为.optware的文件,则将其bind到/opt

#!/bin/sh

# call /sbin/hotplug first
/sbin/hotplug $1

if [ "$SUBSYSTEM.$ACTION" = "block.add" ] ; then
dev=`basename $DEVPATH`
case "$dev" in
sd[a-z][0-9]*)
if [ -e /tmp/usbmounts/$dev/.optware ] ; then
mount --bind /tmp/usbmounts/$dev /opt
fi
;;
esac
fi
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-16 17:11
@老顽童
看一下你的/etc/fstab里面有没有内置盘的配置
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-16 13:53
@老顽童
USB设备都是通过hotplug程序来mount的,根据hotplug程序的源码来看,它是按下面的顺序尝试挂载的:
1. ufsd 非公开源码的ntfs支持
2. ntfs
3. vfat
4. ext3

而且在尝试ext3时还专门跳过SATA硬盘,不太明白是什么原因。不过我看到的源码也许与你的系统上的不同。

我猜测你的播放机不是通过hotplug来挂载内置盘的,很可能是通过系统初始化脚本来完成的。海信的播放机没有内置盘,因此我无法验证这一点。
re: 编译内核(Compile the Kernel) gouzhuang 2010-04-15 16:00
@老顽童
ext2的支持根本没有编入内核。我认为系统是有意不支持ext2的,因为ext2文件系统不是日志文件系统(Journaling file system: http://en.wikipedia.org/wiki/Journaling_file_system)。如果ext2文件系统非正常卸载,比如直接拔出usb设备或者直接关闭播放机电源等等,则再次mount时必需要经过fsck才行,而且数据也有可能损坏。日志文件系统就不存在这个问题,ext3文件系统就是这样的文件系统,因此是支持的。建议你使用ext3。
如何创建ext3文件系统?下面两个命令都可以:
1. mke2fs -j /dev/sda1
2. mkfs.ext3 /dev/sda1
用你的设备名替换上面的/dev/sda1
@老顽童
编译内核时可以加入键盘鼠标支持。问题是在播放机上用键盘鼠标可以做什么呢?
re: 升级BusyBox gouzhuang 2010-03-18 11:38
@atwo
ipkg 安装的busybox应该是optware,optware都是动态连接/opt/lib下的库。自己编译的busybox是连接/lib下的库。
关于交叉编译工具的制作,我会在后续的博文中发表。
共3页: 1 2 3