From adam8157在gmail.com Sat May 1 00:08:42 2010 From: adam8157在gmail.com (Adam Lee) Date: Sat, 1 May 2010 00:08:42 +0800 Subject: =?utf-8?B?d2ViY2FjaGXns7vnu5/vvIzmr5Q=?= =?utf-8?B?5aaCc3F1aWTlgZrnmoTkvJrkuK3mr5LlkJc=?= In-Reply-To: References: Message-ID: <20100430160842.GA1936@debian> 这个倒不是中毒, 可能有响应错误, 或者因为IO的问题, 导致cache出错. 基本上, 这个缓存不要存太久, 可以计划任务抛弃过久的缓存. On Fri, Apr 30, 2010 at 11:55:17PM +0800, lu wrote: > webcache系统,比如squid做的会中毒吗? > 我听说webcache跑久了会中毒,这是怎么回事啊?望高手解答! > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From dean.sinaean在gmail.com Tue May 4 09:21:48 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Mon, 3 May 2010 21:21:48 -0400 Subject: =?GB2312?B?tK6/2mNhdCC2q873vfjIpb/J0tTV/bOjsvrJ+tDFusWjrLWr?= =?GB2312?B?seCzzMqxb3BlbiBmYWlsLsfztO/Iy73i0smhow==?= Message-ID: 如题,我cat 一个mp3进去,能从示波器上看到信号,但是 open("/dev/ttySAC1",O_RDWR),返回-1。这是为什么呢~ From crquan在gmail.com Tue May 4 09:28:33 2010 From: crquan在gmail.com (Cheng Renquan) Date: Tue, 4 May 2010 09:28:33 +0800 Subject: =?UTF-8?B?UmU6IOS4suWPo2NhdCDkuJzopb/ov5vljrvlj6/ku6XmraPluLjkuqfnlJ/kv6Hlj7c=?= =?UTF-8?B?77yM5L2G57yW56iL5pe2b3BlbiBmYWlsLuaxgui+vuS6uuino+eWkeOAgg==?= In-Reply-To: References: Message-ID: Open 返回 -1 时,先检查 errno 值看看 -- sent from Android/Linux On 04-May-2010 9:22 AM, "Dean Sinaean" wrote: 如题,我cat 一个mp3进去,能从示波器上看到信号,但是 open("/dev/ttySAC1",O_RDWR),返回-1。这是为什么呢~ _______________________________________________ Linux 内核开发中文邮件列表 Linux-kernel在zh-kernel.org http://zh-kernel.org/mailman/listinfo/linux-kernel Linux 内核开发中文社区: http://zh-kernel.org From dean.sinaean在gmail.com Tue May 4 09:36:45 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Mon, 3 May 2010 21:36:45 -0400 Subject: =?GB2312?B?UmU6ILSuv9pjYXQgtqvO9734yKW/ydLU1f2zo7L6yfrQxbrF?= =?GB2312?B?o6y1q7Hgs8zKsW9wZW4gZmFpbC7H87TvyMu94tLJoaM=?= In-Reply-To: References: Message-ID: 谢谢,Cheng Renquan.我都不知道有这么个东西,没系统学习过linux,刚刚试了下,原来是改设备描述符时忘记加路径了。问题解决了。errno=2,表示No such file or directory 2010/5/3 Cheng Renquan > Open 返回 -1 时,先检查 errno 值看看 > > -- sent from Android/Linux > > On 04-May-2010 9:22 AM, "Dean Sinaean" wrote: > > 如题,我cat 一个mp3进去,能从示波器上看到信号,但是 > open("/dev/ttySAC1",O_RDWR),返回-1。这是为什么呢~ > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > > From dean.sinaean在gmail.com Tue May 4 11:07:32 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Mon, 3 May 2010 23:07:32 -0400 Subject: =?GB2312?B?tK6/2rXEtsG74dfoyPvC8KO/?= Message-ID: 我向另一块板子发送一个字节,然后那块板子会发来三个字节。 下面的代码中,我不断的发字节,然后读一字节。但是发现读不到,发送也不发了。 代码如下,得到的结果是只显示一个one char written. 帮我看看是怎么回事吧,谢谢了。 #include #include #include "fcntl.h" #include #include #include /*标准输入输出定义*/ #include /*标准函数库定义*/ #include /*Unix 标准函数定义*/ #include #include #include /*文件控制定义*/ #include /*PPSIX 终端控制定义*/ #include /*错误号定义*/ main() { int fd; int i; struct termios Opt; int nByte; char *ap="s"; char *buffer; //while(1) //{ printf("HERE"); // } fd=open("/dev/ttySAC1",O_RDWR );//| O_NOCTTY | O_NDELAY); if(fd==-1) { printf("open error"); printf("errno:%d\n",errno); } printf("OPEN TTY"); tcgetattr(fd, &Opt); cfsetispeed(&Opt,B115200); /*设置为115200Bps*/ cfsetospeed(&Opt,B115200); tcsetattr(fd,0,&Opt); printf("BAUDRATE SET"); while(1) { write(fd, ap ,1); printf("one char written\n"); // while(1) //{ // nByte=read(fd,buffer,1); // if(nByte==-1) // break; nByte=read(fd,buffer,1); if(nByte<0) { printf("read err,errno:%d",errno); } printf("read:%c",buffer);//[0],buffer[1],buffer[2]); } } From zoleooo在hotmail.com Tue May 4 14:57:28 2010 From: zoleooo在hotmail.com (zhangleo) Date: Tue, 4 May 2010 06:57:28 +0000 Subject: =?gb2312?B?UkU6IMfrzspzb2Nr?= =?gb2312?B?ZXQgcmF3ILGozsTI5w==?= =?gb2312?B?us7WuLaovdO/2reiy80=?= In-Reply-To: <20100430123946.GA8146@localhost.localdomain> References: , <20100430123946.GA8146@localhost.localdomain> Message-ID: ������������޸ģ������endto�󣬷�����Ĵ�send failed: Operation not permitted �����ôԭ�����root > Date: Fri, 30 Apr 2010 20:39:46 +0800 > From: kernel.zeng在gmail.com > To: zoleooo在hotmail.com > CC: linux-kernel在zh-kernel.org > Subject: Re: ��socket raw ����������ӿڷ�� > > setsockopt(SO_BINDTODEVICE) > > SO_BINDTODEVICE > Bind this socket to a particular device like ��eth0��, as specified in the passed interface > name. If the name is an empty string or the option length is zero, the socket device bind- > ing is removed. The passed option is a variable-length null-terminated interface name > string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > ets received from that particular interface are processed by the socket. Note that this > only works for some socket types, particularly AF_INET sockets. It is not supported for > packet sockets (use normal bind(8) there). > > On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > Date: Fri, 30 Apr 2010 09:44:40 +0000 > > From: zhangleo > > To: linux-kernel在zh-kernel.org > > Subject: ��socket raw ����������ӿڷ�� > > > > > > ������p��� SOCK_RAW��ʽ������8���ӿڣ����ʱ�ָ��ijһ��ڷ������ϣ��������ӿڷ���� > > �ʵ�ô�� ��β�� > _________________________________________________________________ > > һ��Ƭ��԰רD�DWindows Live�Ƭ�Ŀɰ��Ƶ�� > > http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > _______________________________________________ > > Linux ��˿����������� > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux ��˿��������� http://zh-kernel.org _________________________________________________________________ SkyDrive�����ᣬ����������������ʱ������� http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From zoleooo在hotmail.com Tue May 4 15:00:41 2010 From: zoleooo在hotmail.com (zhangleo) Date: Tue, 4 May 2010 07:00:41 +0000 Subject: =?gb2312?B?UkU6ILSuv9q1xLbBu+HX6A==?= =?gb2312?B?yPvC8KO/?= In-Reply-To: References: Message-ID: 会,可以设置为非阻塞,或设定一段timeout > Date: Mon, 3 May 2010 23:07:32 -0400 > Subject: 串口的读会阻塞吗? > From: dean.sinaean在gmail.com > To: linux-kernel在zh-kernel.org > > 我向另一块板子发送一个字节,然后那块板子会发来三个字节。 > 下面的代码中,我不断的发字节,然后读一字节。但是发现读不到,发送也不发了。 > 代码如下,得到的结果是只显示一个one char written. 帮我看看是怎么回事吧,谢谢了。 > #include > #include > #include "fcntl.h" > #include > #include > #include /*标准输入输出定义*/ > #include /*标准函数库定义*/ > #include /*Unix 标准函数定义*/ > #include > #include > #include /*文件控制定义*/ > #include /*PPSIX 终端控制定义*/ > #include /*错误号定义*/ > > main() > { > int fd; > int i; > struct termios Opt; > int nByte; > char *ap="s"; > char *buffer; > //while(1) > //{ > printf("HERE"); > // } > fd=open("/dev/ttySAC1",O_RDWR );//| O_NOCTTY | O_NDELAY); > if(fd==-1) > { > printf("open error"); > printf("errno:%d\n",errno); > } > printf("OPEN TTY"); > tcgetattr(fd, &Opt); > cfsetispeed(&Opt,B115200); /*设置为115200Bps*/ > cfsetospeed(&Opt,B115200); > tcsetattr(fd,0,&Opt); > printf("BAUDRATE SET"); > while(1) > { > write(fd, ap ,1); > printf("one char written\n"); > > > > // while(1) > //{ > // nByte=read(fd,buffer,1); > // if(nByte==-1) > // break; > nByte=read(fd,buffer,1); > if(nByte<0) > { > printf("read err,errno:%d",errno); > } > printf("read:%c",buffer);//[0],buffer[1],buffer[2]); > } > > } > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org _________________________________________________________________ 一张照片的自白――Windows Live照片的可爱视频介绍 http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry From zoleooo在hotmail.com Tue May 4 15:31:48 2010 From: zoleooo在hotmail.com (zhangleo) Date: Tue, 4 May 2010 07:31:48 +0000 Subject: =?gb2312?B?UkU6ILSuv9q1xLbBu+HX6A==?= =?gb2312?B?yPvC8KO/?= In-Reply-To: References: , , Message-ID: 建议你在read之前增加一定的延时,非阻塞如果没有读到数据直接返回,有可能数据到了,但read操作早已结束 建议最好用select方式实现非阻塞io处理 Date: Tue, 4 May 2010 03:28:41 -0400 Subject: Re: 串口的读会阻塞吗? From: dean.sinaean在gmail.com To: zoleooo在hotmail.com CC: linux-kernel在zh-kernel.org 嗯,我设了非阻塞,结果返回错误 码11,解为资源暂时无法获得。这是怎么回事呢?我用示波器检测到另外一块板传回的信号了啊。 2010/5/4 zhangleo 会,可以设置为非阻塞,或设定一段timeout > Date: Mon, 3 May 2010 23:07:32 -0400 > Subject: 串口的读会阻塞吗? > From: dean.sinaean在gmail.com > To: linux-kernel在zh-kernel.org > > 我向另一块板子发送一个字节,然后那块板子会发来三个字节。 > 下面的代码中,我不断的发字节,然后读一字节。但是发现读不到,发送也不发了。 > 代码如下,得到的结果是只显示一个one char written. 帮我看看是怎么回事吧,谢谢了。 > #include > #include > #include "fcntl.h" > #include > #include > #include /*标准输入输出定义*/ > #include /*标准函数库定义*/ > #include /*Unix 标准函数定义*/ > #include > #include > #include /*文件控制定义*/ > #include /*PPSIX 终端控制定义*/ > #include /*错误号定义*/ > > main() > { > int fd; > int i; > struct termios Opt; > int nByte; > char *ap="s"; > char *buffer; > //while(1) > //{ > printf("HERE"); > // } > fd=open("/dev/ttySAC1",O_RDWR );//| O_NOCTTY | O_NDELAY); > if(fd==-1) > { > printf("open error"); > printf("errno:%d\n",errno); > } > printf("OPEN TTY"); > tcgetattr(fd, &Opt); > cfsetispeed(&Opt,B115200); /*设置为115200Bps*/ > cfsetospeed(&Opt,B115200); > tcsetattr(fd,0,&Opt); > printf("BAUDRATE SET"); > while(1) > { > write(fd, ap ,1); > printf("one char written\n"); > > > > // while(1) > //{ > // nByte=read(fd,buffer,1); > // if(nByte==-1) > // break; > nByte=read(fd,buffer,1); > if(nByte<0) > { > printf("read err,errno:%d",errno); > } > printf("read:%c",buffer);//[0],buffer[1],buffer[2]); > } > > } > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org 使用Messenger保护盾2.0,支持多账号登录! 现在就下载! _________________________________________________________________ 想知道明天天气如何?必应告诉你! http://cn.bing.com/search?q=%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5&form=MICHJ2 From kernel.zeng在gmail.com Tue May 4 15:38:41 2010 From: kernel.zeng在gmail.com (Wheelz) Date: Tue, 4 May 2010 15:38:41 +0800 Subject: =?utf-8?B?6K+36Zeuc29ja2V0IHJhdyDmiqU=?= =?utf-8?B?5paH5aaC5L2V5oyH5a6a5o6l5Y+j5Y+R6YCB?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> Message-ID: <20100504073841.GA9120@localhost.localdomain> 应该是你构造的包不对吧。 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > Date: Tue, 4 May 2010 06:57:28 +0000 > From: zhangleo > To: kernel.zeng在gmail.com > CC: linux-kernel在zh-kernel.org > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > 这个会是什么原因,我是root > > > Date: Fri, 30 Apr 2010 20:39:46 +0800 > > From: kernel.zeng在gmail.com > > To: zoleooo在hotmail.com > > CC: linux-kernel在zh-kernel.org > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > setsockopt(SO_BINDTODEVICE) > > > > SO_BINDTODEVICE > > Bind this socket to a particular device like “eth0”, as specified in the passed interface > > name. If the name is an empty string or the option length is zero, the socket device bind- > > ing is removed. The passed option is a variable-length null-terminated interface name > > string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > ets received from that particular interface are processed by the socket. Note that this > > only works for some socket types, particularly AF_INET sockets. It is not supported for > > packet sockets (use normal bind(8) there). > > > > On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > > Date: Fri, 30 Apr 2010 09:44:40 +0000 > > > From: zhangleo > > > To: linux-kernel在zh-kernel.org > > > Subject: 请问socket raw 报文如何指定接口发送 > > > > > > > > > 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > > 能实现么, 如何操作 > > > _________________________________________________________________ > > > 一张照片的自白――Windows Live照片的可爱视频介绍 > > > http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > _________________________________________________________________ > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From been2100在163.com Tue May 4 15:32:06 2010 From: been2100在163.com (=?utf-8?B?5LuY54eV5paM?=) Date: Tue, 4 May 2010 15:32:06 +0800 (CST) Subject: =?utf-8?Q?Re:Re:_Re:_=E5=88=B0=E5=BA=95=E4=BB=80=E4=B9=88=E6=98=AFsocket?= In-Reply-To: References: <4BCD9C79.0752B0.22752@ustc.edu> <92C3774BE7204FADB4B4480851AA9831@lzheng> Message-ID: <1244089.c255.128623a9752.Coremail.been2100@163.com> 我也正在学习unix网络编程,有好的方法吗? 有点浮躁和急进了...

在2010-04-23 11:52:16,"xiaobo zhou" 写道: >在ISO的七层协议里,是没有socket的。 >但是,socket是实际存在着,它是应用层和传输层的接口。 >如果应用程序需要利用存在的协议进行传输,就需要socket操作。 >类似的比如写一个文件,就需要fopen()等一系列接口函数调用。 >而socket的参数,都是需要协议支持,这些协议可以是标准也可以是自己实现。 > > >2010/4/21 Lv Zheng > >> 不同意理解内核协议栈只需要理解socket layer,其实socket >>> layer只是一个调用接口,是通过函数注册和函数钩子的形式,直接调用传输层函数的。你增加传输层实现,只需要往socket >>> layer注册一下,就可以调用你的传输 层。 >>> >> >> Linux的socket >> layer已经抽象了协议栈类型。如SOCK_DGRAM/SOCK_STREAM/SOCK_SEQPACKET各自所需的通用层都在socket的数据结构和API中实现。 >> SS_CONNECTING / SS_CONNECTED / SS_DISCONNECTING用来标志连接型协议栈的状态。 >> >> 如果socket用户不被允许获取连接期间的报文,则有塞子:lock_sock/release_sock用来塞住receive_queue,导致报文在backlog中处理。 >> 这是协议特性决定的,了解协议特性才能选择所需的socket type,才能知道要不要有backlog处理。 >> >> sk_wmem_alloc/sk_sndbuf管理报文发送API。/sk_rmem_alloc/sk_rcvbuf管理报文发送API。 >> 不同的协议栈根据其协议栈特性不同所调用的socket报文API有很大区别。 >> >> 主要的特性就是:socket用户何时可以读取报文,何时可以发送报文(即满足什么条件select会返回可读可写),这是协议特性决定。在协议栈中所使用何种报文处理API主要取决于:是否入需要进入接收发送队列,是否永远允许用户可写,是否需要管理队列大小等。 >> >> 任何协议栈如果要提供socket就要管理socket,可是管理节点的API也需要协议栈调用socket层的而不是协议栈自己实现。所有被协议栈管理的套接口用sk_node连接。协议栈只需要提供hash表头就可以使用socket >> layer的API增删查属于自己的套接 口。 >> >> 还有很多:比如说地址族绑定(sockaddr和SOCK_ZAPPED),linger,分片实现等。这些都实现在socket >> layer里,实际上却是协议栈特性决定的。 >> >> 我认为已经有协议栈实现经验的开发者看了协议描述文档后可以很容易读懂内核的协议栈流程实现。难点在于读的时候相信很多人都有疑问:为什么在这里调用这个API而不调用另一个API?为啥这里是alloc_skb,那里是sock_alloc_send_skb,而有时候却调用sk_wmalloc?为什么这个协议族data_ready/write_space这样实现,而另一个那样实现?为什么这个协议要用cmsg >> API而那个不用到?为什么这里是skb_clone而调用同样的 函数另一个地方就要skb_copy? >> >> 这只有把socket >> layer的实现用设计者的眼光去分析之后才能找到答案。得到答案后再去读内核的任何一个协议栈都跟读流程代码一样不再有任何障碍。关键还有不再有低级的Bug。 >> >> 我看的是VxWorks 协议栈源代码,他是源于BSD的,LINUX的也类似。 >>> >> >> 我听说VxWorks上作协议栈分片实现不怎么好,是不是它的socket层抽象的东西太少了?我没有读过VxWorks协议栈。 >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org >> >_______________________________________________ >Linux 内核开发中文邮件列表 >Linux-kernel在zh-kernel.org >http://zh-kernel.org/mailman/listinfo/linux-kernel >Linux 内核开发中文社区: http://zh-kernel.org From orphen.leiliu在gmail.com Tue May 4 15:54:36 2010 From: orphen.leiliu在gmail.com (Liu Lei) Date: Tue, 4 May 2010 15:54:36 +0800 Subject: =?GB2312?Q?Re:_=C7=EB=CE=CAsocket_raw_=B1=A8=CE=C4=C8=E7=BA=CE?= =?GB2312?Q?=D6=B8=B6=A8=BD=D3=BF=DA=B7=A2=CB=CD?= In-Reply-To: <20100504073841.GA9120@localhost.localdomain> References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain> Message-ID: <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> 您好: 应该没有使用root执行吧? Operation not permitted是说权限不允许。 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 在 2010-5-4,下午3:38, Wheelz 写道: > 应该是你构造的包不对吧。 > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: >> Date: Tue, 4 May 2010 06:57:28 +0000 >> From: zhangleo >> To: kernel.zeng在gmail.com >> CC: linux-kernel在zh-kernel.org >> Subject: RE: 请问socket raw 报文如何指定接口发送 >> >> >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted >> >> 这个会是什么原因,我是root >> >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 >>> From: kernel.zeng在gmail.com >>> To: zoleooo在hotmail.com >>> CC: linux-kernel在zh-kernel.org >>> Subject: Re: 请问socket raw 报文如何指定接口发送 >>> >>> setsockopt(SO_BINDTODEVICE) >>> >>> SO_BINDTODEVICE >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface >>> name. If the name is an empty string or the option length is zero, the socket device bind- >>> ing is removed. The passed option is a variable-length null-terminated interface name >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- >>> ets received from that particular interface are processed by the socket. Note that this >>> only works for some socket types, particularly AF_INET sockets. It is not supported for >>> packet sockets (use normal bind(8) there). >>> >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 >>>> From: zhangleo >>>> To: linux-kernel在zh-kernel.org >>>> Subject: 请问socket raw 报文如何指定接口发送 >>>> >>>> >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 >>>> 能实现么, 如何操作 >>>> _________________________________________________________________ >>>> 一张照片的自白――Windows Live照片的可爱视频介绍 >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry >>>> _______________________________________________ >>>> Linux 内核开发中文邮件列表 >>>> Linux-kernel在zh-kernel.org >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>> Linux 内核开发中文社区: http://zh-kernel.org >> >> _________________________________________________________________ >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org 致 礼! ──────────────────────────── Liu Lei From dean.sinaean在gmail.com Tue May 4 15:28:41 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Tue, 4 May 2010 03:28:41 -0400 Subject: =?GB2312?B?UmU6ILSuv9q1xLbBu+HX6Mj7wvCjvw==?= In-Reply-To: References: Message-ID: 嗯,我设了非阻塞,结果返回错误 码11,解为资源暂时无法获得。这是怎么回事呢?我用示波器检测到另外一块板传回的信号了啊。 2010/5/4 zhangleo > 会,可以设置为非阻塞,或设定一段timeout > > > Date: Mon, 3 May 2010 23:07:32 -0400 > > Subject: 串口的读会阻塞吗? > > From: dean.sinaean在gmail.com > > > To: linux-kernel在zh-kernel.org > > > > 我向另一块板子发送一个字节,然后那块板子会发来三个字节。 > > 下面的代码中,我不断的发字节,然后读一字节。但是发现读不到,发送也不发了。 > > 代码如下,得到的结果是只显示一个one char written. 帮我看看是怎么回事吧,谢谢了。 > > #include > > #include > > #include "fcntl.h" > > #include > > #include > > #include /*标准输入输出定义*/ > > #include /*标准函数库定义*/ > > #include /*Unix 标准函数定义*/ > > #include > > #include > > #include /*文件控制定义*/ > > #include /*PPSIX 终端控制定义*/ > > #include /*错误号定义*/ > > > > main() > > { > > int fd; > > int i; > > struct termios Opt; > > int nByte; > > char *ap="s"; > > char *buffer; > > //while(1) > > //{ > > printf("HERE"); > > // } > > fd=open("/dev/ttySAC1",O_RDWR );//| O_NOCTTY | O_NDELAY); > > if(fd==-1) > > { > > printf("open error"); > > printf("errno:%d\n",errno); > > } > > printf("OPEN TTY"); > > tcgetattr(fd, &Opt); > > cfsetispeed(&Opt,B115200); /*设置为115200Bps*/ > > cfsetospeed(&Opt,B115200); > > tcsetattr(fd,0,&Opt); > > printf("BAUDRATE SET"); > > while(1) > > { > > write(fd, ap ,1); > > printf("one char written\n"); > > > > > > > > // while(1) > > //{ > > // nByte=read(fd,buffer,1); > > // if(nByte==-1) > > // break; > > nByte=read(fd,buffer,1); > > if(nByte<0) > > { > > printf("read err,errno:%d",errno); > > } > > printf("read:%c",buffer);//[0],buffer[1],buffer[2]); > > } > > > > } > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > ------------------------------ > 使用Messenger保护盾2.0,支持多账号登录! 现在就下载! > From zoleooo在hotmail.com Tue May 4 16:19:12 2010 From: zoleooo在hotmail.com (zhangleo) Date: Tue, 4 May 2010 08:19:12 +0000 Subject: =?gb2312?B?UkU6IMfrzspzb2Nr?= =?gb2312?B?ZXQgcmF3ILGozsTI5w==?= =?gb2312?B?us7WuLaovdO/2reiy80=?= In-Reply-To: <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain>, <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> Message-ID: 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > Subject: Re: 请问socket raw 报文如何指定接口发送 > From: orphen.leiliu在gmail.com > Date: Tue, 4 May 2010 15:54:36 +0800 > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > To: kernel.zeng在gmail.com > > 您好: > > 应该没有使用root执行吧? > Operation not permitted是说权限不允许。 > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > 应该是你构造的包不对吧。 > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > >> Date: Tue, 4 May 2010 06:57:28 +0000 > >> From: zhangleo > >> To: kernel.zeng在gmail.com > >> CC: linux-kernel在zh-kernel.org > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > >> > >> > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > >> > >> 这个会是什么原因,我是root > >> > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > >>> From: kernel.zeng在gmail.com > >>> To: zoleooo在hotmail.com > >>> CC: linux-kernel在zh-kernel.org > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > >>> > >>> setsockopt(SO_BINDTODEVICE) > >>> > >>> SO_BINDTODEVICE > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > >>> ing is removed. The passed option is a variable-length null-terminated interface name > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > >>> ets received from that particular interface are processed by the socket. Note that this > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > >>> packet sockets (use normal bind(8) there). > >>> > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > >>>> From: zhangleo > >>>> To: linux-kernel在zh-kernel.org > >>>> Subject: 请问socket raw 报文如何指定接口发送 > >>>> > >>>> > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > >>>> 能实现么, 如何操作 > >>>> _________________________________________________________________ > >>>> 一张照片的自白――Windows Live照片的可爱视频介绍 > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > >>>> _______________________________________________ > >>>> Linux 内核开发中文邮件列表 > >>>> Linux-kernel在zh-kernel.org > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > >>>> Linux 内核开发中文社区: http://zh-kernel.org > >> > >> _________________________________________________________________ > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > 致 > 礼! > > ──────────────────────────── > Liu Lei > > > > > _________________________________________________________________ SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From orphen.leiliu在gmail.com Tue May 4 16:24:41 2010 From: orphen.leiliu在gmail.com (Liu Lei) Date: Tue, 4 May 2010 16:24:41 +0800 Subject: =?GB2312?Q?Re:_=C7=EB=CE=CAsocket_raw_=B1=A8=CE=C4=C8=E7=BA=CE?= =?GB2312?Q?=D6=B8=B6=A8=BD=D3=BF=DA=B7=A2=CB=CD?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain>, <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> Message-ID: 您好: 莫非,您是不是bind到了一个错误的/不存在的接口? 在 2010-5-4,下午4:19, zhangleo 写道: > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > From: orphen.leiliu在gmail.com > > Date: Tue, 4 May 2010 15:54:36 +0800 > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > To: kernel.zeng在gmail.com > > > > 您好: > > > > 应该没有使用root执行吧? > > Operation not permitted是说权限不允许。 > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > 应该是你构造的包不对吧。 > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > >> From: zhangleo > > >> To: kernel.zeng在gmail.com > > >> CC: linux-kernel在zh-kernel.org > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > >> > > >> > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > >> > > >> 这个会是什么原因,我是root > > >> > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > >>> From: kernel.zeng在gmail.com > > >>> To: zoleooo在hotmail.com > > >>> CC: linux-kernel在zh-kernel.org > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > >>> > > >>> setsockopt(SO_BINDTODEVICE) > > >>> > > >>> SO_BINDTODEVICE > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > >>> ets received from that particular interface are processed by the socket. Note that this > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > >>> packet sockets (use normal bind(8) there). > > >>> > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > >>>> From: zhangleo > > >>>> To: linux-kernel在zh-kernel.org > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > >>>> > > >>>> > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > >>>> 能实现么, 如何操作 > > >>>> _________________________________________________________________ > > >>>> 一张照片的自白——Windows Live照片的可爱视频介绍 > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > >>>> _______________________________________________ > > >>>> Linux 内核开发中文邮件列表 > > >>>> Linux-kernel在zh-kernel.org > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > >> > > >> _________________________________________________________________ > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > 致 > > 礼! > > > > ──────────────────────────── > > Liu Lei > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! 致 礼! ──────────────────────────── Liu Lei From kernel.zeng在gmail.com Tue May 4 16:50:14 2010 From: kernel.zeng在gmail.com (Wheelz) Date: Tue, 4 May 2010 16:50:14 +0800 Subject: =?utf-8?B?6K+36Zeuc29ja2V0IHJhdyDmiqU=?= =?utf-8?B?5paH5aaC5L2V5oyH5a6a5o6l5Y+j5Y+R6YCB?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain> <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> Message-ID: <20100504084454.GA10975@localhost.localdomain> 从我这里的Fedora 12来说,如果我把packet全部清0的话,会有Operation not permitted 原因是selinux会尝试分析这个报文,发现有问题,于是sendto就返回了EPERM On Tue, May 04, 2010 at 08:19:12AM +0000, zhangleo wrote: > Date: Tue, 4 May 2010 08:19:12 +0000 > From: zhangleo > To: orphen.leiliu在gmail.com, kernel.zeng在gmail.com > CC: linux-kernel在zh-kernel.org > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > From: orphen.leiliu在gmail.com > > Date: Tue, 4 May 2010 15:54:36 +0800 > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > To: kernel.zeng在gmail.com > > > > 您好: > > > > 应该没有使用root执行吧? > > Operation not permitted是说权限不允许。 > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > 应该是你构造的包不对吧。 > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > >> From: zhangleo > > >> To: kernel.zeng在gmail.com > > >> CC: linux-kernel在zh-kernel.org > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > >> > > >> > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > >> > > >> 这个会是什么原因,我是root > > >> > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > >>> From: kernel.zeng在gmail.com > > >>> To: zoleooo在hotmail.com > > >>> CC: linux-kernel在zh-kernel.org > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > >>> > > >>> setsockopt(SO_BINDTODEVICE) > > >>> > > >>> SO_BINDTODEVICE > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > >>> ets received from that particular interface are processed by the socket. Note that this > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > >>> packet sockets (use normal bind(8) there). > > >>> > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > >>>> From: zhangleo > > >>>> To: linux-kernel在zh-kernel.org > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > >>>> > > >>>> > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > >>>> 能实现么, 如何操作 > > >>>> _________________________________________________________________ > > >>>> 一张照片的自白——Windows Live照片的可爱视频介绍 > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > >>>> _______________________________________________ > > >>>> Linux 内核开发中文邮件列表 > > >>>> Linux-kernel在zh-kernel.org > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > >> > > >> _________________________________________________________________ > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > 致 > > 礼! > > > > ──────────────────────────── > > Liu Lei > > > > > > > > > > > > _________________________________________________________________ > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From zoleooo在hotmail.com Tue May 4 16:58:22 2010 From: zoleooo在hotmail.com (zhangleo) Date: Tue, 4 May 2010 08:58:22 +0000 Subject: =?gb2312?B?UkU6IMfrzspzb2Nr?= =?gb2312?B?ZXQgcmF3ILGozsTI5w==?= =?gb2312?B?us7WuLaovdO/2reiy80=?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain>, <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> , Message-ID: i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "dhcp_renew.h" static unsigned short inline checksum(unsigned short *buffer,int size){ unsigned long cksum = 0; while(size>1){ cksum += *buffer++; size -= sizeof(unsigned short); } if(size){ cksum += *(unsigned char *)buffer; } cksum = (cksum >> 16) + (cksum & 0xffff); cksum += (cksum >> 16); return((unsigned short )(~cksum)); } static unsigned int inline udp_checksum(unsigned long saddr, unsigned long daddr, unsigned short *buffer, int size) { unsigned long sum = 0; char *buf; struct fake_header *fh; int fh_len = sizeof(struct fake_header); buf = (char *)malloc(fh_len+size); fh = (struct fake_header *)buf; memcpy(buf+fh_len,buffer,size); fh->saddr = saddr; fh->daddr = daddr; fh->mbz = 0; fh->proto = IPPROTO_UDP; fh->header_len = htons(sizeof(struct udphdr)); sum = checksum((unsigned short*)buf,fh_len+size); free(buf); return(sum); } unsigned int inline ip_checksum(unsigned short *buffer,int size){ return(checksum(buffer,size*4)); } int main(void) { int s; char datagram[4096]; struct dhcp_packet *dp; struct sockaddr_in sin; char *dev = "eth1"; s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); if(s < 0) return -1; memset (datagram, 0, 4096); /* zero out the buffer */ /* ip header */ struct iphdr *iph = (struct iphdr *) datagram; /* udp header */ struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); sin.sin_family = AF_INET; sin.sin_port = htons(S_PORT); sin.sin_addr.s_addr = inet_addr (S_ADDR); /* fill in the IP Header */ iph->ihl = 5; iph->version = 4; iph->tos = 0; iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; iph->id = 0x1234; iph->frag_off = 0; iph->ttl = 64; iph->protocol = IPPROTO_UDP; iph->saddr = inet_addr(S_ADDR); iph->daddr = inet_addr(D_ADDR); iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); /* fill in the udp header */ udph->source = htons (S_PORT); udph->dest = htons (D_PORT); udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); dp->op = BOOTREPLY; /* dhcp offer message */ dp->htype = HTYPE_ETHER; /* ethernet */ dp->hlen = 6; dp->hops = 0; dp->xid = 0; dp->secs = 0; dp->flags = BOOTP_BROADCAST; /* other just fill in zero */ bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); #if 1 if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ printf("bind to interface %s \n failed", dev); return -1; } #endif { int one = 1; const int *val = &one; if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) printf ("line %d setsockopt failed!\n", __LINE__); } if(sendto(s, datagram, iph->tot_len, 0, (struct sockaddr *)&sin, sizeof(struct sockaddr_in)) < 0){ printf("send failed: %s\n", strerror(errno)); }else{ printf(" %d ok\n", iph->tot_len); } close(s); return 0; } Subject: Re: 请问socket raw 报文如何指定接口发送 From: orphen.leiliu在gmail.com Date: Tue, 4 May 2010 16:24:41 +0800 CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org To: zoleooo在hotmail.com 您好: 莫非,您是不是bind到了一个错误的/不存在的接口? 在 2010-5-4,下午4:19, zhangleo 写道: 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > Subject: Re: 请问socket raw 报文如何指定接口发送 > From: orphen.leiliu在gmail.com > Date: Tue, 4 May 2010 15:54:36 +0800 > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > To: kernel.zeng在gmail.com > > 您好: > > 应该没有使用root执行吧? > Operation not permitted是说权限不允许。 > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > 应该是你构造的包不对吧。 > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > >> Date: Tue, 4 May 2010 06:57:28 +0000 > >> From: zhangleo > >> To: kernel.zeng在gmail.com > >> CC: linux-kernel在zh-kernel.org > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > >> > >> > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > >> > >> 这个会是什么原因,我是root > >> > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > >>> From: kernel.zeng在gmail.com > >>> To: zoleooo在hotmail.com > >>> CC: linux-kernel在zh-kernel.org > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > >>> > >>> setsockopt(SO_BINDTODEVICE) > >>> > >>> SO_BINDTODEVICE > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > >>> ing is removed. The passed option is a variable-length null-terminated interface name > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > >>> ets received from that particular interface are processed by the socket. Note that this > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > >>> packet sockets (use normal bind(8) there). > >>> > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > >>>> From: zhangleo > >>>> To: linux-kernel在zh-kernel.org > >>>> Subject: 请问socket raw 报文如何指定接口发送 > >>>> > >>>> > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > >>>> 能实现么, 如何操作 > >>>> _________________________________________________________________ > >>>> 一张照片的自白――Windows Live照片的可爱视频介绍 > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > >>>> _______________________________________________ > >>>> Linux 内核开发中文邮件列表 > >>>> Linux-kernel在zh-kernel.org > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > >>>> Linux 内核开发中文社区: http://zh-kernel.org > >> > >> _________________________________________________________________ > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > 致 > 礼! > > ──────────────────────────── > Liu Lei > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! 致 礼! ──────────────────────────── Liu Lei _________________________________________________________________ SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From orphen.leiliu在gmail.com Tue May 4 17:13:53 2010 From: orphen.leiliu在gmail.com (Liu Lei) Date: Tue, 4 May 2010 17:13:53 +0800 Subject: =?GB2312?Q?Re:_=C7=EB=CE=CAsocket_raw_=B1=A8=CE=C4=C8=E7=BA=CE?= =?GB2312?Q?=D6=B8=B6=A8=BD=D3=BF=DA=B7=A2=CB=CD?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain>, <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> , Message-ID: <8BF66A34-BFD4-43DC-BE92-677DE0D9B20F@gmail.com> 您好: 我觉得您这里有一个错误。 首先,您bind了s和sin。 然后您又使用sendto发送到sin。 那么这个sin到底是本地还是对端呢? 如果要使用sendto的话,需要设定一个对端的sockaddr。 在 2010-5-4,下午4:58, zhangleo 写道: > i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include "dhcp_renew.h" > static unsigned short inline checksum(unsigned short *buffer,int size){ > unsigned long cksum = 0; > while(size>1){ > cksum += *buffer++; > size -= sizeof(unsigned short); > } > if(size){ > cksum += *(unsigned char *)buffer; > } > cksum = (cksum >> 16) + (cksum & 0xffff); > cksum += (cksum >> 16); > return((unsigned short )(~cksum)); > } > static unsigned int inline udp_checksum(unsigned long saddr, > unsigned long daddr, > unsigned short *buffer, > int size) > { > unsigned long sum = 0; > char *buf; > struct fake_header *fh; > int fh_len = sizeof(struct fake_header); > buf = (char *)malloc(fh_len+size); > fh = (struct fake_header *)buf; > memcpy(buf+fh_len,buffer,size); > fh->saddr = saddr; > fh->daddr = daddr; > fh->mbz = 0; > fh->proto = IPPROTO_UDP; > fh->header_len = htons(sizeof(struct udphdr)); > sum = checksum((unsigned short*)buf,fh_len+size); > free(buf); > return(sum); > } > unsigned int inline ip_checksum(unsigned short *buffer,int size){ > return(checksum(buffer,size*4)); > } > > int main(void) > { > int s; > char datagram[4096]; > struct dhcp_packet *dp; > struct sockaddr_in sin; > char *dev = "eth1"; > s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); > if(s < 0) > return -1; > memset (datagram, 0, 4096); /* zero out the buffer */ > /* ip header */ > struct iphdr *iph = (struct iphdr *) datagram; > /* udp header */ > struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); > sin.sin_family = AF_INET; > sin.sin_port = htons(S_PORT); > sin.sin_addr.s_addr = inet_addr (S_ADDR); > /* fill in the IP Header */ > iph->ihl = 5; > iph->version = 4; > iph->tos = 0; > iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; > iph->id = 0x1234; > iph->frag_off = 0; > iph->ttl = 64; > iph->protocol = IPPROTO_UDP; > iph->saddr = inet_addr(S_ADDR); > iph->daddr = inet_addr(D_ADDR); > iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); > /* fill in the udp header */ > udph->source = htons (S_PORT); > udph->dest = htons (D_PORT); > udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); > udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); > > dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); > dp->op = BOOTREPLY; /* dhcp offer message */ > dp->htype = HTYPE_ETHER; /* ethernet */ > dp->hlen = 6; > dp->hops = 0; > dp->xid = 0; > dp->secs = 0; > dp->flags = BOOTP_BROADCAST; > /* other just fill in zero */ > bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); > #if 1 > if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ > printf("bind to interface %s \n failed", dev); > return -1; > } > #endif > { > int one = 1; > const int *val = &one; > if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) > printf ("line %d setsockopt failed!\n", __LINE__); > } > > if(sendto(s, > datagram, > iph->tot_len, > 0, > (struct sockaddr *)&sin, > sizeof(struct sockaddr_in)) < 0){ > printf("send failed: %s\n", strerror(errno)); > }else{ > printf(" %d ok\n", iph->tot_len); > } > close(s); > return 0; > } > > Subject: Re: 请问socket raw 报文如何指定接口发送 > From: orphen.leiliu在gmail.com > Date: Tue, 4 May 2010 16:24:41 +0800 > CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org > To: zoleooo在hotmail.com > > 您好: > > 莫非,您是不是bind到了一个错误的/不存在的接口? > > 在 2010-5-4,下午4:19, zhangleo 写道: > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > From: orphen.leiliu在gmail.com > > Date: Tue, 4 May 2010 15:54:36 +0800 > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > To: kernel.zeng在gmail.com > > > > 您好: > > > > 应该没有使用root执行吧? > > Operation not permitted是说权限不允许。 > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > 应该是你构造的包不对吧。 > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > >> From: zhangleo > > >> To: kernel.zeng在gmail.com > > >> CC: linux-kernel在zh-kernel.org > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > >> > > >> > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > >> > > >> 这个会是什么原因,我是root > > >> > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > >>> From: kernel.zeng在gmail.com > > >>> To: zoleooo在hotmail.com > > >>> CC: linux-kernel在zh-kernel.org > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > >>> > > >>> setsockopt(SO_BINDTODEVICE) > > >>> > > >>> SO_BINDTODEVICE > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > >>> ets received from that particular interface are processed by the socket. Note that this > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > >>> packet sockets (use normal bind(8) there). > > >>> > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > >>>> From: zhangleo > > >>>> To: linux-kernel在zh-kernel.org > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > >>>> > > >>>> > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > >>>> 能实现么, 如何操作 > > >>>> _________________________________________________________________ > > >>>> 一张照片的自白——Windows Live照片的可爱视频介绍 > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > >>>> _______________________________________________ > > >>>> Linux 内核开发中文邮件列表 > > >>>> Linux-kernel在zh-kernel.org > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > >> > > >> _________________________________________________________________ > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > 致 > > 礼! > > > > ──────────────────────────── > > Liu Lei > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! > > 致 > 礼! > > ──────────────────────────── > Liu Lei > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! 致 礼! ──────────────────────────── Liu Lei From kernel.zeng在gmail.com Tue May 4 17:30:26 2010 From: kernel.zeng在gmail.com (Wheelz) Date: Tue, 4 May 2010 17:30:26 +0800 Subject: =?utf-8?B?6K+36Zeuc29ja2V0IHJhdyDmiqU=?= =?utf-8?B?5paH5aaC5L2V5oyH5a6a5o6l5Y+j5Y+R6YCB?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain> <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> Message-ID: <20100504093026.GA2569@localhost.localdomain> 应该给一个可编译的版本。 On Tue, May 04, 2010 at 08:58:22AM +0000, zhangleo wrote: > Date: Tue, 4 May 2010 08:58:22 +0000 > From: zhangleo > To: orphen.leiliu在gmail.com > CC: kernel.zeng在gmail.com, linux-kernel在zh-kernel.org > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! > > > > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > #include > > #include "dhcp_renew.h" > > static unsigned short inline checksum(unsigned short *buffer,int size){ > > unsigned long cksum = 0; > > while(size>1){ > cksum += *buffer++; > size -= sizeof(unsigned short); > } > > if(size){ > cksum += *(unsigned char *)buffer; > } > > cksum = (cksum >> 16) + (cksum & 0xffff); > cksum += (cksum >> 16); > > return((unsigned short )(~cksum)); > } > > static unsigned int inline udp_checksum(unsigned long saddr, > unsigned long daddr, > unsigned short *buffer, > int size) > { > unsigned long sum = 0; > char *buf; > struct fake_header *fh; > int fh_len = sizeof(struct fake_header); > > buf = (char *)malloc(fh_len+size); > fh = (struct fake_header *)buf; > memcpy(buf+fh_len,buffer,size); > > fh->saddr = saddr; > fh->daddr = daddr; > fh->mbz = 0; > fh->proto = IPPROTO_UDP; > fh->header_len = htons(sizeof(struct udphdr)); > > sum = checksum((unsigned short*)buf,fh_len+size); > free(buf); > > return(sum); > } > > unsigned int inline ip_checksum(unsigned short *buffer,int size){ > return(checksum(buffer,size*4)); > } > > > int main(void) > { > int s; > char datagram[4096]; > struct dhcp_packet *dp; > struct sockaddr_in sin; > char *dev = "eth1"; > > s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); > > if(s < 0) > return -1; > > memset (datagram, 0, 4096); /* zero out the buffer */ > /* ip header */ > struct iphdr *iph = (struct iphdr *) datagram; > /* udp header */ > struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); > > sin.sin_family = AF_INET; > sin.sin_port = htons(S_PORT); > sin.sin_addr.s_addr = inet_addr (S_ADDR); > > /* fill in the IP Header */ > iph->ihl = 5; > iph->version = 4; > iph->tos = 0; > iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; > iph->id = 0x1234; > iph->frag_off = 0; > iph->ttl = 64; > iph->protocol = IPPROTO_UDP; > iph->saddr = inet_addr(S_ADDR); > iph->daddr = inet_addr(D_ADDR); > iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); > > /* fill in the udp header */ > udph->source = htons (S_PORT); > udph->dest = htons (D_PORT); > udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); > udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); > > > dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); > dp->op = BOOTREPLY; /* dhcp offer message */ > dp->htype = HTYPE_ETHER; /* ethernet */ > dp->hlen = 6; > dp->hops = 0; > dp->xid = 0; > dp->secs = 0; > dp->flags = BOOTP_BROADCAST; > /* other just fill in zero */ > > bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); > #if 1 > if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ > printf("bind to interface %s \n failed", dev); > return -1; > } > #endif > > { > int one = 1; > const int *val = &one; > if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) > printf ("line %d setsockopt failed!\n", __LINE__); > } > > > if(sendto(s, > datagram, > iph->tot_len, > 0, > (struct sockaddr *)&sin, > sizeof(struct sockaddr_in)) < 0){ > printf("send failed: %s\n", strerror(errno)); > }else{ > printf(" %d ok\n", iph->tot_len); > } > close(s); > return 0; > } > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > From: orphen.leiliu在gmail.com > Date: Tue, 4 May 2010 16:24:41 +0800 > CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org > To: zoleooo在hotmail.com > > 您好: > > > 莫非,您是不是bind到了一个错误的/不存在的接口? > > > > 在 2010-5-4,下午4:19, zhangleo 写道: > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > From: orphen.leiliu在gmail.com > > Date: Tue, 4 May 2010 15:54:36 +0800 > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > To: kernel.zeng在gmail.com > > > > 您好: > > > > 应该没有使用root执行吧? > > Operation not permitted是说权限不允许。 > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > 应该是你构造的包不对吧。 > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > >> From: zhangleo > > >> To: kernel.zeng在gmail.com > > >> CC: linux-kernel在zh-kernel.org > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > >> > > >> > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > >> > > >> 这个会是什么原因,我是root > > >> > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > >>> From: kernel.zeng在gmail.com > > >>> To: zoleooo在hotmail.com > > >>> CC: linux-kernel在zh-kernel.org > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > >>> > > >>> setsockopt(SO_BINDTODEVICE) > > >>> > > >>> SO_BINDTODEVICE > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > >>> ets received from that particular interface are processed by the socket. Note that this > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > >>> packet sockets (use normal bind(8) there). > > >>> > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > >>>> From: zhangleo > > >>>> To: linux-kernel在zh-kernel.org > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > >>>> > > >>>> > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > >>>> 能实现么, 如何操作 > > >>>> _________________________________________________________________ > > >>>> 一张照片的自白——Windows Live照片的可爱视频介绍 > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > >>>> _______________________________________________ > > >>>> Linux 内核开发中文邮件列表 > > >>>> Linux-kernel在zh-kernel.org > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > >> > > >> _________________________________________________________________ > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > 致 > > 礼! > > > > ──────────────────────────── > > Liu Lei > > > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! > > > > > > > 致 > 礼! > > > ──────────────────────────── Liu Lei > > > > > _________________________________________________________________ > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From zoleooo在hotmail.com Tue May 4 17:32:10 2010 From: zoleooo在hotmail.com (zhangleo) Date: Tue, 4 May 2010 09:32:10 +0000 Subject: =?gb2312?B?UkU6IMfrzspzb2Nr?= =?gb2312?B?ZXQgcmF3ILGozsTI5w==?= =?gb2312?B?us7WuLaovdO/2reiy80=?= In-Reply-To: <20100504093026.GA2569@localhost.localdomain> References: , <20100430123946.GA8146@localhost.localdomain>, , <20100504073841.GA9120@localhost.localdomain>, <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com>, , , , <20100504093026.GA2569@localhost.localdomain> Message-ID: sure, sendto的sin参数是无用的,因为raw方式发送,所以我重用了本地地址 #ifndef __DHCP_RENEW_H_ #define __DHCP_RENEW_H_ #define DHCP_UDP_OVERHEAD (20 + /* IP header */ \ 8) /* UDP header */ #define DHCP_SNAME_LEN 64 #define DHCP_FILE_LEN 128 #define DHCP_FIXED_NON_UDP 236 #define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD) /* Everything but options. */ #define BOOTP_MIN_LEN 300 #define DHCP_MTU_MAX 1500 #define DHCP_MTU_MIN 576 #define DHCP_MAX_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN) #define DHCP_MIN_OPTION_LEN (DHCP_MTU_MIN - DHCP_FIXED_LEN) struct dhcp_packet { u_int8_t op; /* 0: Message opcode/type */ u_int8_t htype; /* 1: Hardware addr type (net/if_types.h) */ u_int8_t hlen; /* 2: Hardware addr length */ u_int8_t hops; /* 3: Number of relay agent hops from client */ u_int32_t xid; /* 4: Transaction ID */ u_int16_t secs; /* 8: Seconds since client started looking */ u_int16_t flags; /* 10: Flag bits */ struct in_addr ciaddr; /* 12: Client IP address (if already in use) */ struct in_addr yiaddr; /* 16: Client IP address */ struct in_addr siaddr; /* 18: IP address of next server to talk to */ struct in_addr giaddr; /* 20: DHCP relay agent IP address */ unsigned char chaddr [16]; /* 24: Client hardware address */ char sname [DHCP_SNAME_LEN]; /* 40: Server name */ char file [DHCP_FILE_LEN]; /* 104: Boot filename */ unsigned char options [DHCP_MAX_OPTION_LEN]; /* 212: Optional parameters (actual length dependent on MTU). */ }; #define BOOTREQUEST 1 #define BOOTREPLY 2 /* Possible values for flags field... */ #define BOOTP_BROADCAST 32768L /* Possible values for hardware type (htype) field... */ #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ #define HTYPE_FDDI 8 /* FDDI... */ struct fake_header { unsigned long saddr; unsigned long daddr; char mbz; char proto; unsigned short header_len; }; #define S_PORT 67 #define D_PORT 68 #define S_ADDR "10.0.1.59" #define D_ADDR "10.0.1.255" #endif > Date: Tue, 4 May 2010 17:30:26 +0800 > From: kernel.zeng在gmail.com > To: zoleooo在hotmail.com > CC: orphen.leiliu在gmail.com; linux-kernel在zh-kernel.org > Subject: Re: 请问socket raw 报文如何指定接口发送 > > 应该给一个可编译的版本。 > > On Tue, May 04, 2010 at 08:58:22AM +0000, zhangleo wrote: > > Date: Tue, 4 May 2010 08:58:22 +0000 > > From: zhangleo > > To: orphen.leiliu在gmail.com > > CC: kernel.zeng在gmail.com, linux-kernel在zh-kernel.org > > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! > > > > > > > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > #include > > > > #include "dhcp_renew.h" > > > > static unsigned short inline checksum(unsigned short *buffer,int size){ > > > > unsigned long cksum = 0; > > > > while(size>1){ > > cksum += *buffer++; > > size -= sizeof(unsigned short); > > } > > > > if(size){ > > cksum += *(unsigned char *)buffer; > > } > > > > cksum = (cksum >> 16) + (cksum & 0xffff); > > cksum += (cksum >> 16); > > > > return((unsigned short )(~cksum)); > > } > > > > static unsigned int inline udp_checksum(unsigned long saddr, > > unsigned long daddr, > > unsigned short *buffer, > > int size) > > { > > unsigned long sum = 0; > > char *buf; > > struct fake_header *fh; > > int fh_len = sizeof(struct fake_header); > > > > buf = (char *)malloc(fh_len+size); > > fh = (struct fake_header *)buf; > > memcpy(buf+fh_len,buffer,size); > > > > fh->saddr = saddr; > > fh->daddr = daddr; > > fh->mbz = 0; > > fh->proto = IPPROTO_UDP; > > fh->header_len = htons(sizeof(struct udphdr)); > > > > sum = checksum((unsigned short*)buf,fh_len+size); > > free(buf); > > > > return(sum); > > } > > > > unsigned int inline ip_checksum(unsigned short *buffer,int size){ > > return(checksum(buffer,size*4)); > > } > > > > > > int main(void) > > { > > int s; > > char datagram[4096]; > > struct dhcp_packet *dp; > > struct sockaddr_in sin; > > char *dev = "eth1"; > > > > s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); > > > > if(s < 0) > > return -1; > > > > memset (datagram, 0, 4096); /* zero out the buffer */ > > /* ip header */ > > struct iphdr *iph = (struct iphdr *) datagram; > > /* udp header */ > > struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); > > > > sin.sin_family = AF_INET; > > sin.sin_port = htons(S_PORT); > > sin.sin_addr.s_addr = inet_addr (S_ADDR); > > > > /* fill in the IP Header */ > > iph->ihl = 5; > > iph->version = 4; > > iph->tos = 0; > > iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; > > iph->id = 0x1234; > > iph->frag_off = 0; > > iph->ttl = 64; > > iph->protocol = IPPROTO_UDP; > > iph->saddr = inet_addr(S_ADDR); > > iph->daddr = inet_addr(D_ADDR); > > iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); > > > > /* fill in the udp header */ > > udph->source = htons (S_PORT); > > udph->dest = htons (D_PORT); > > udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); > > udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); > > > > > > dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); > > dp->op = BOOTREPLY; /* dhcp offer message */ > > dp->htype = HTYPE_ETHER; /* ethernet */ > > dp->hlen = 6; > > dp->hops = 0; > > dp->xid = 0; > > dp->secs = 0; > > dp->flags = BOOTP_BROADCAST; > > /* other just fill in zero */ > > > > bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); > > #if 1 > > if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ > > printf("bind to interface %s \n failed", dev); > > return -1; > > } > > #endif > > > > { > > int one = 1; > > const int *val = &one; > > if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) > > printf ("line %d setsockopt failed!\n", __LINE__); > > } > > > > > > if(sendto(s, > > datagram, > > iph->tot_len, > > 0, > > (struct sockaddr *)&sin, > > sizeof(struct sockaddr_in)) < 0){ > > printf("send failed: %s\n", strerror(errno)); > > }else{ > > printf(" %d ok\n", iph->tot_len); > > } > > close(s); > > return 0; > > } > > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > From: orphen.leiliu在gmail.com > > Date: Tue, 4 May 2010 16:24:41 +0800 > > CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org > > To: zoleooo在hotmail.com > > > > 您好: > > > > > > 莫非,您是不是bind到了一个错误的/不存在的接口? > > > > > > > > 在 2010-5-4,下午4:19, zhangleo 写道: > > > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > From: orphen.leiliu在gmail.com > > > Date: Tue, 4 May 2010 15:54:36 +0800 > > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > > To: kernel.zeng在gmail.com > > > > > > 您好: > > > > > > 应该没有使用root执行吧? > > > Operation not permitted是说权限不允许。 > > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > > > 应该是你构造的包不对吧。 > > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > > >> From: zhangleo > > > >> To: kernel.zeng在gmail.com > > > >> CC: linux-kernel在zh-kernel.org > > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > > >> > > > >> > > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > > >> > > > >> 这个会是什么原因,我是root > > > >> > > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > > >>> From: kernel.zeng在gmail.com > > > >>> To: zoleooo在hotmail.com > > > >>> CC: linux-kernel在zh-kernel.org > > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > > >>> > > > >>> setsockopt(SO_BINDTODEVICE) > > > >>> > > > >>> SO_BINDTODEVICE > > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > > >>> ets received from that particular interface are processed by the socket. Note that this > > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > > >>> packet sockets (use normal bind(8) there). > > > >>> > > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > > >>>> From: zhangleo > > > >>>> To: linux-kernel在zh-kernel.org > > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > > >>>> > > > >>>> > > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > > >>>> 能实现么, 如何操作 > > > >>>> _________________________________________________________________ > > > >>>> 一张照片的自白――Windows Live照片的可爱视频介绍 > > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > > >>>> _______________________________________________ > > > >>>> Linux 内核开发中文邮件列表 > > > >>>> Linux-kernel在zh-kernel.org > > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > > >> > > > >> _________________________________________________________________ > > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > > _______________________________________________ > > > > Linux 内核开发中文邮件列表 > > > > Linux-kernel在zh-kernel.org > > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > 致 > > > 礼! > > > > > > ──────────────────────────── > > > Liu Lei > > > > > > > > > > > > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! > > > > > > > > > > > > > > 致 > > 礼! > > > > > > ──────────────────────────── Liu Lei > > > > > > > > > > _________________________________________________________________ > > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c _________________________________________________________________ SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From kernel.zeng在gmail.com Tue May 4 17:42:12 2010 From: kernel.zeng在gmail.com (Wheelz) Date: Tue, 4 May 2010 17:42:12 +0800 Subject: =?utf-8?B?6K+36Zeuc29ja2V0IHJhdyDmiqU=?= =?utf-8?B?5paH5aaC5L2V5oyH5a6a5o6l5Y+j5Y+R6YCB?= In-Reply-To: References: <20100430123946.GA8146@localhost.localdomain> <20100504073841.GA9120@localhost.localdomain> <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> <20100504093026.GA2569@localhost.localdomain> Message-ID: <20100504094212.GA2775@localhost.localdomain> 这个程序在我这里没问题,可以发送。 On Tue, May 04, 2010 at 09:32:10AM +0000, zhangleo wrote: > Date: Tue, 4 May 2010 09:32:10 +0000 > From: zhangleo > To: kernel.zeng在gmail.com > CC: orphen.leiliu在gmail.com, linux-kernel在zh-kernel.org > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > sure, sendto的sin参数是无用的,因为raw方式发送,所以我重用了本地地址 > > > > #ifndef __DHCP_RENEW_H_ > #define __DHCP_RENEW_H_ > > #define DHCP_UDP_OVERHEAD (20 + /* IP header */ \ > 8) /* UDP header */ > #define DHCP_SNAME_LEN 64 > #define DHCP_FILE_LEN 128 > #define DHCP_FIXED_NON_UDP 236 > #define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD) > /* Everything but options. */ > #define BOOTP_MIN_LEN 300 > > #define DHCP_MTU_MAX 1500 > #define DHCP_MTU_MIN 576 > > #define DHCP_MAX_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN) > #define DHCP_MIN_OPTION_LEN (DHCP_MTU_MIN - DHCP_FIXED_LEN) > > struct dhcp_packet { > u_int8_t op; /* 0: Message opcode/type */ > u_int8_t htype; /* 1: Hardware addr type (net/if_types.h) */ > u_int8_t hlen; /* 2: Hardware addr length */ > u_int8_t hops; /* 3: Number of relay agent hops from client */ > u_int32_t xid; /* 4: Transaction ID */ > u_int16_t secs; /* 8: Seconds since client started looking */ > u_int16_t flags; /* 10: Flag bits */ > struct in_addr ciaddr; /* 12: Client IP address (if already in use) */ > struct in_addr yiaddr; /* 16: Client IP address */ > struct in_addr siaddr; /* 18: IP address of next server to talk to */ > struct in_addr giaddr; /* 20: DHCP relay agent IP address */ > unsigned char chaddr [16]; /* 24: Client hardware address */ > char sname [DHCP_SNAME_LEN]; /* 40: Server name */ > char file [DHCP_FILE_LEN]; /* 104: Boot filename */ > unsigned char options [DHCP_MAX_OPTION_LEN]; > /* 212: Optional parameters > (actual length dependent on MTU). */ > }; > > #define BOOTREQUEST 1 > #define BOOTREPLY 2 > > /* Possible values for flags field... */ > #define BOOTP_BROADCAST 32768L > > /* Possible values for hardware type (htype) field... */ > #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ > #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ > #define HTYPE_FDDI 8 /* FDDI... */ > > struct fake_header { > unsigned long saddr; > unsigned long daddr; > char mbz; > char proto; > unsigned short header_len; > }; > > #define S_PORT 67 > #define D_PORT 68 > > #define S_ADDR "10.0.1.59" > #define D_ADDR "10.0.1.255" > > #endif > > > > Date: Tue, 4 May 2010 17:30:26 +0800 > > From: kernel.zeng在gmail.com > > To: zoleooo在hotmail.com > > CC: orphen.leiliu在gmail.com; linux-kernel在zh-kernel.org > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > 应该给一个可编译的版本。 > > > > On Tue, May 04, 2010 at 08:58:22AM +0000, zhangleo wrote: > > > Date: Tue, 4 May 2010 08:58:22 +0000 > > > From: zhangleo > > > To: orphen.leiliu在gmail.com > > > CC: kernel.zeng在gmail.com, linux-kernel在zh-kernel.org > > > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > > > > i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! > > > > > > > > > > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > #include > > > > > > #include "dhcp_renew.h" > > > > > > static unsigned short inline checksum(unsigned short *buffer,int size){ > > > > > > unsigned long cksum = 0; > > > > > > while(size>1){ > > > cksum += *buffer++; > > > size -= sizeof(unsigned short); > > > } > > > > > > if(size){ > > > cksum += *(unsigned char *)buffer; > > > } > > > > > > cksum = (cksum >> 16) + (cksum & 0xffff); > > > cksum += (cksum >> 16); > > > > > > return((unsigned short )(~cksum)); > > > } > > > > > > static unsigned int inline udp_checksum(unsigned long saddr, > > > unsigned long daddr, > > > unsigned short *buffer, > > > int size) > > > { > > > unsigned long sum = 0; > > > char *buf; > > > struct fake_header *fh; > > > int fh_len = sizeof(struct fake_header); > > > > > > buf = (char *)malloc(fh_len+size); > > > fh = (struct fake_header *)buf; > > > memcpy(buf+fh_len,buffer,size); > > > > > > fh->saddr = saddr; > > > fh->daddr = daddr; > > > fh->mbz = 0; > > > fh->proto = IPPROTO_UDP; > > > fh->header_len = htons(sizeof(struct udphdr)); > > > > > > sum = checksum((unsigned short*)buf,fh_len+size); > > > free(buf); > > > > > > return(sum); > > > } > > > > > > unsigned int inline ip_checksum(unsigned short *buffer,int size){ > > > return(checksum(buffer,size*4)); > > > } > > > > > > > > > int main(void) > > > { > > > int s; > > > char datagram[4096]; > > > struct dhcp_packet *dp; > > > struct sockaddr_in sin; > > > char *dev = "eth1"; > > > > > > s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); > > > > > > if(s < 0) > > > return -1; > > > > > > memset (datagram, 0, 4096); /* zero out the buffer */ > > > /* ip header */ > > > struct iphdr *iph = (struct iphdr *) datagram; > > > /* udp header */ > > > struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); > > > > > > sin.sin_family = AF_INET; > > > sin.sin_port = htons(S_PORT); > > > sin.sin_addr.s_addr = inet_addr (S_ADDR); > > > > > > /* fill in the IP Header */ > > > iph->ihl = 5; > > > iph->version = 4; > > > iph->tos = 0; > > > iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; > > > iph->id = 0x1234; > > > iph->frag_off = 0; > > > iph->ttl = 64; > > > iph->protocol = IPPROTO_UDP; > > > iph->saddr = inet_addr(S_ADDR); > > > iph->daddr = inet_addr(D_ADDR); > > > iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); > > > > > > /* fill in the udp header */ > > > udph->source = htons (S_PORT); > > > udph->dest = htons (D_PORT); > > > udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); > > > udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); > > > > > > > > > dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); > > > dp->op = BOOTREPLY; /* dhcp offer message */ > > > dp->htype = HTYPE_ETHER; /* ethernet */ > > > dp->hlen = 6; > > > dp->hops = 0; > > > dp->xid = 0; > > > dp->secs = 0; > > > dp->flags = BOOTP_BROADCAST; > > > /* other just fill in zero */ > > > > > > bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); > > > #if 1 > > > if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ > > > printf("bind to interface %s \n failed", dev); > > > return -1; > > > } > > > #endif > > > > > > { > > > int one = 1; > > > const int *val = &one; > > > if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) > > > printf ("line %d setsockopt failed!\n", __LINE__); > > > } > > > > > > > > > if(sendto(s, > > > datagram, > > > iph->tot_len, > > > 0, > > > (struct sockaddr *)&sin, > > > sizeof(struct sockaddr_in)) < 0){ > > > printf("send failed: %s\n", strerror(errno)); > > > }else{ > > > printf(" %d ok\n", iph->tot_len); > > > } > > > close(s); > > > return 0; > > > } > > > > > > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > From: orphen.leiliu在gmail.com > > > Date: Tue, 4 May 2010 16:24:41 +0800 > > > CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org > > > To: zoleooo在hotmail.com > > > > > > 您好: > > > > > > > > > 莫非,您是不是bind到了一个错误的/不存在的接口? > > > > > > > > > > > > 在 2010-5-4,下午4:19, zhangleo 写道: > > > > > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > From: orphen.leiliu在gmail.com > > > > Date: Tue, 4 May 2010 15:54:36 +0800 > > > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > > > To: kernel.zeng在gmail.com > > > > > > > > 您好: > > > > > > > > 应该没有使用root执行吧? > > > > Operation not permitted是说权限不允许。 > > > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > > > > > 应该是你构造的包不对吧。 > > > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > > > >> From: zhangleo > > > > >> To: kernel.zeng在gmail.com > > > > >> CC: linux-kernel在zh-kernel.org > > > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > >> > > > > >> > > > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > > > >> > > > > >> 这个会是什么原因,我是root > > > > >> > > > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > > > >>> From: kernel.zeng在gmail.com > > > > >>> To: zoleooo在hotmail.com > > > > >>> CC: linux-kernel在zh-kernel.org > > > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > >>> > > > > >>> setsockopt(SO_BINDTODEVICE) > > > > >>> > > > > >>> SO_BINDTODEVICE > > > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > > > >>> ets received from that particular interface are processed by the socket. Note that this > > > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > > > >>> packet sockets (use normal bind(8) there). > > > > >>> > > > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > > > >>>> From: zhangleo > > > > >>>> To: linux-kernel在zh-kernel.org > > > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > > > >>>> > > > > >>>> > > > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > > > >>>> 能实现么, 如何操作 > > > > >>>> _________________________________________________________________ > > > > >>>> 一张照片的自白——Windows Live照片的可爱视频介绍 > > > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > > > >>>> _______________________________________________ > > > > >>>> Linux 内核开发中文邮件列表 > > > > >>>> Linux-kernel在zh-kernel.org > > > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > > > >> > > > > >> _________________________________________________________________ > > > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > > > _______________________________________________ > > > > > Linux 内核开发中文邮件列表 > > > > > Linux-kernel在zh-kernel.org > > > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > > > 致 > > > > 礼! > > > > > > > > ──────────────────────────── > > > > Liu Lei > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! > > > > > > > > > > > > > > > > > > > > > 致 > > > 礼! > > > > > > > > > ──────────────────────────── Liu Lei > > > > > > > > > > > > > > > _________________________________________________________________ > > > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > _________________________________________________________________ > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From hellohello008在163.com Tue May 4 17:47:30 2010 From: hellohello008在163.com (hellohello) Date: Tue, 4 May 2010 17:47:30 +0800 Subject: =?gb2312?B?udjT2iAnbWFrZSBDT05GSUdfREVCVUdfU0VDVElPTl9NSVNNQVRDSD15IM7K?= =?gb2312?B?zOI=?= Message-ID: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> 您好! 我使用的freescale 的ltib环境, 开发板类型是mpc8272ads. build kernel时编译器告警需要我编译时用 'make CONFIG_DEBUG_SECTION_MISMATCH=y' 可是make menuconfig界面中没有该选项,在哪里打开呢? 谢谢帮助 致 礼! From xiyou.wangcong在gmail.com Tue May 4 18:11:35 2010 From: xiyou.wangcong在gmail.com (Amerigo Wang) Date: Tue, 4 May 2010 18:11:35 +0800 Subject: =?utf-8?B?5YWz5LqOICdtYWtlIENPTkZJR19E?= =?utf-8?B?RUJVR19TRUNUSU9OX01JU01BVENIPXkg6Zeu6aKY?= In-Reply-To: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> Message-ID: <20100504101135.GA6057@cr0.nay.redhat.com> On Tue, May 04, 2010 at 05:47:30PM +0800, hellohello wrote: > >您好! > 我使用的freescale 的ltib环境, 开发板类型是mpc8272ads. > >build kernel时编译器告警需要我编译时用 'make CONFIG_DEBUG_SECTION_MISMATCH=y' > >可是make menuconfig界面中没有该选项,在哪里打开呢? > 这个CONFIG依赖于UNDEFINED,所以不会通过make menuconfig显示出来, 除非有别的CONFIG去select它。你只能通过命令行传递进去。 From cyrusyzgtt在gmail.com Tue May 4 18:11:19 2010 From: cyrusyzgtt在gmail.com (CyrusYzGTt) Date: Tue, 04 May 2010 18:11:19 +0800 Subject: =?UTF-8?B?5YWz5LqOICdtYWtlIENPTkZJR19ERUJVR19TRUNUSU9OX01JU00=?= =?UTF-8?B?QVRDSD15IOmXrumimA==?= In-Reply-To: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> Message-ID: <4BDFF2C7.9090204@gmail.com> 用其他方法,我的內核編譯經驗,是Fedora的,不知道適用於你不? cp /boot/config-"uname -r" /usr/src/linux-2.6.33.3/.config cd /usr/src/linux-2.6.33.3/ vi .config添加或刪除 于 2010年05月04日 17:47, hellohello 写道: > 您好! > 我使用的freescale 的ltib环境, 开发板类型是mpc8272ads. > > build kernel时编译器告警需要我编译时用 'make CONFIG_DEBUG_SECTION_MISMATCH=y' > > 可是make menuconfig界面中没有该选项,在哪里打开呢? > > 谢谢帮助 > > > 致 > 礼! > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From hellohello008在163.com Tue May 4 19:10:43 2010 From: hellohello008在163.com (hellohello) Date: Tue, 4 May 2010 19:10:43 +0800 Subject: =?utf-8?Q?Re:_=E5=85=B3=E4=BA=8E_'make_CONFIG=5FDEBUG=5FSECTIO?= =?utf-8?Q?N=5FMISMATCH=3Dy_=E9=97=AE=E9=A2=98?= References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> Message-ID: <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> 谢谢,不过我修改了.config文件还是不行,自动被改恢复了。 我是在ltib的shell下执行 -c 选项进行配置和内核的编译的 LTIB> ./ltib -c 打印到下面menuconfig的时候,出现内核配置界面 + '[' -n y -o -n '' ']' + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig scripts/kconfig/mconf arch/powerpc/Kconfig 。。。内核配置界面 。。。 *** End of Linux kernel configuration. *** Execute 'make' to build the kernel or try 'make help'. 然后就是编译内核过程,接着打印如下: + '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' + cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev + '[' -n '' ']' + '[' '%{kernel_series}' = 2.4 ']' + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig CHK include/linux/version.h CHK include/linux/utsrelease.h CALL scripts/checksyscalls.sh CHK include/linux/compile.h CALL arch/powerpc/kernel/systbl_chk.sh GZIP kernel/config_data.gz IKCFG kernel/config_data.h CC kernel/configs.o LD kernel/built-in.o LD vmlinux.o MODPOST vmlinux.o WARNING: modpost: Found 1 section mismatch(es). To see full details build your kernel with: 'make CONFIG_DEBUG_SECTION_MISMATCH=y' 此处告警! 如果不使用./litb -c ,手动敲make ... menuconfig命令,如下所示,不会报错 LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig scripts/kconfig/mconf arch/powerpc/Kconfig 。。。出现内核配置界面。。。 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 make[1]: *** [arch/powerpc/kernel] Error 2 make: *** [uImage] Error 2 LTIB> 是不是与 ./ltib -c时在make ... uImage命令之前还执行的语句有关?如: + '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' + cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev + '[' -n '' ']' + '[' '%{kernel_series}' = 2.4 ']' + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig 但这部分用"+"号做前缀的打印语句我没看明白, 应该是某个脚本里的吧,也没找到地方。 因此,现在我有2个困惑了 1)形如“ + '[' -n '' ']' + '[' '%{kernel_series}' = 2.4 ']' ” 在make ... uImage语句之前的这些打印语句是哪里来的?他们表示什么意思?或者在哪里能找到与之相关的说明文件,我先自己看看. 2)如何将CONFIG_DEBUG_SECTION_MISMATCH=y 选项打开 谁能解惑,非常感谢 ----- Original Message ----- From: "CyrusYzGTt" To: Sent: Tuesday, May 04, 2010 6:11 PM Subject: Re: 关于 'make CONFIG_DEBUG_SECTION_MISMATCH=y 问题 > 用其他方法,我的內核編譯經驗,是Fedora的,不知道適用於你不? > cp /boot/config-"uname -r" /usr/src/linux-2.6.33.3/.config > cd /usr/src/linux-2.6.33.3/ > vi .config添加或刪除 > 于 2010年05月04日 17:47, hellohello 写道: >> 您好! >> 我使用的freescale 的ltib环境, 开发板类型是mpc8272ads. >> >> build kernel时编译器告警需要我编译时用 'make CONFIG_DEBUG_SECTION_MISMATCH=y' >> >> 可是make menuconfig界面中没有该选项,在哪里打开呢? >> >> 谢谢帮助 >> >> >> 致 >> 礼! >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From dean.sinaean在gmail.com Tue May 4 19:17:04 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Tue, 4 May 2010 07:17:04 -0400 Subject: =?GB2312?B?0ru49s/gtbHB7sjLt9G94rXEzsrM4qOsudjT2mxpbnV4z8I=?= =?GB2312?B?tcS0rr/aseCzzA==?= Message-ID: 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个毫无用处有变量声明才可以读到内容。 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读到。而且变量类型任意,char int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? #include #include #include "fcntl.h" #include #include #include /*标准输入输出定义*/ #include /*标准函数库定义*/ #include /*Unix 标准函数定义*/ #include #include #include /*文件控制定义*/ #include /*PPSIX 终端控制定义*/ #include /*错误号定义*/ main() { int fd; int i; struct termios Opt; int nByte; char *ap="s"; char *buffer; //while(1) //{ printf("HERE"); // } fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| O_NOCTTY | O_NDELAY); if(fd==-1) { printf("open error"); printf("errno:%d\n",errno); } printf("OPEN TTY"); tcgetattr(fd,&Opt); //初始化 tcflush(fd,TCIFLUSH); cfsetispeed(&Opt,B9600); //设置波特率 cfsetospeed(&Opt,B9600); Opt.c_cflag |= CS8; //设置数据位 Opt.c_cflag &= ~PARENB; Opt.c_oflag &= ~(OPOST); Opt.c_cflag &= ~CSTOPB; Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); Opt.c_cc[VMIN] = 0; Opt.c_cc[VTIME] = 0; if (tcsetattr(fd,TCSANOW,&Opt) != 0) //装载初始化参数 { perror("SetupSerial!\n"); close(fd); return -1; } printf("BAUDRATE SET"); while(1) { *char lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的那个usleep去替它,但不好用。 * //usleep(1000000); // sprintf(buf, "%c", i++); write(fd, ap, 1); //写串口 //printf("Open \n"); //为测试是不是运行到这里设的输出 //usleep(100000); //if(len > 0) // { read(fd, buffer, 3); //读串口数据 printf("buf %s\n", buffer); //输出读到的数据 // } usleep(100000); } // while(1) // { // write(fd, ap ,1); // printf("one char written\n"); // // for(i=0;i<100000;i++) // { // nByte=read(fd,buffer,1); // if (nByte>0) // break; //} // if(nByte<0) // { // printf("read err,errno:%d",errno); // printf("read:%s",buffer); // } // else // { // printf("read:%s",buffer);//[0],buffer[1],buffer[2]); // break; // } // usleep(100000); // } } From cyrusyzgtt在gmail.com Tue May 4 19:18:59 2010 From: cyrusyzgtt在gmail.com (CyrusYzGTt) Date: Tue, 04 May 2010 19:18:59 +0800 Subject: =?UTF-8?B?5YWz5LqOICdtYWtlIENPTkZJR19ERUJVR19TRUNUSU9OX01JU00=?= =?UTF-8?B?QVRDSD15IOmXrumimA==?= In-Reply-To: <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> Message-ID: <4BE002A3.4070904@gmail.com> 對不起,我忘了,另外,需要make oldconfig就行,不用 menuconfig 于 2010年05月04日 19:10, hellohello 写道: > 谢谢,不过我修改了.config文件还是不行,自动被改恢复了。 > > 我是在ltib的shell下执行 -c 选项进行配置和内核的编译的 > LTIB> ./ltib -c > > 打印到下面menuconfig的时候,出现内核配置界面 > + '[' -n y -o -n '' ']' > + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig > scripts/kconfig/mconf arch/powerpc/Kconfig > > 。。。内核配置界面 。。。 > > *** End of Linux kernel configuration. > *** Execute 'make' to build the kernel or try 'make help'. > > 然后就是编译内核过程,接着打印如下: > > + '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' > + cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev > + '[' -n '' ']' > + '[' '%{kernel_series}' = 2.4 ']' > + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage > scripts/kconfig/conf -s arch/powerpc/Kconfig > CHK include/linux/version.h > CHK include/linux/utsrelease.h > CALL scripts/checksyscalls.sh > CHK include/linux/compile.h > CALL arch/powerpc/kernel/systbl_chk.sh > GZIP kernel/config_data.gz > IKCFG kernel/config_data.h > CC kernel/configs.o > LD kernel/built-in.o > LD vmlinux.o > MODPOST vmlinux.o > WARNING: modpost: Found 1 section mismatch(es). > To see full details build your kernel with: > 'make CONFIG_DEBUG_SECTION_MISMATCH=y' > 此处告警! > > > > 如果不使用./litb -c ,手动敲make ... menuconfig命令,如下所示,不会报错 > LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig > scripts/kconfig/mconf arch/powerpc/Kconfig > 。。。出现内核配置界面。。。 > > 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: > LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig > /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file > make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 > make[1]: *** [arch/powerpc/kernel] Error 2 > make: *** [uImage] Error 2 > LTIB> > > > 是不是与 ./ltib -c时在make ... uImage命令之前还执行的语句有关?如: > + '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' > + cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev > + '[' -n '' ']' > + '[' '%{kernel_series}' = 2.4 ']' > + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage > scripts/kconfig/conf -s arch/powerpc/Kconfig > > 但这部分用"+"号做前缀的打印语句我没看明白, > 应该是某个脚本里的吧,也没找到地方。 > > > 因此,现在我有2个困惑了 > > 1)形如“ > + '[' -n '' ']' > + '[' '%{kernel_series}' = 2.4 ']' > ” 在make ... uImage语句之前的这些打印语句是哪里来的?他们表示什么意思?或者在哪里能找到与之相关的说明文件,我先自己看看. > > 2)如何将CONFIG_DEBUG_SECTION_MISMATCH=y 选项打开 > > > 谁能解惑,非常感谢 > > > > > ----- Original Message ----- > From: "CyrusYzGTt" > To: > Sent: Tuesday, May 04, 2010 6:11 PM > Subject: Re: 关于 'make CONFIG_DEBUG_SECTION_MISMATCH=y 问题 > > > >> 用其他方法,我的內核編譯經驗,是Fedora的,不知道適用於你不? >> cp /boot/config-"uname -r" /usr/src/linux-2.6.33.3/.config >> cd /usr/src/linux-2.6.33.3/ >> vi .config添加或刪除 >> 于 2010年05月04日 17:47, hellohello 写道: >> >>> 您好! >>> 我使用的freescale 的ltib环境, 开发板类型是mpc8272ads. >>> >>> build kernel时编译器告警需要我编译时用 'make CONFIG_DEBUG_SECTION_MISMATCH=y' >>> >>> 可是make menuconfig界面中没有该选项,在哪里打开呢? >>> >>> 谢谢帮助 >>> >>> >>> 致 >>> 礼! >>> _______________________________________________ >>> Linux 内核开发中文邮件列表 >>> Linux-kernel在zh-kernel.org >>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>> Linux 内核开发中文社区: http://zh-kernel.org >>> >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org From oldcode在gmail.com Tue May 4 20:48:58 2010 From: oldcode在gmail.com (Ender.Dai) Date: Tue, 4 May 2010 20:48:58 +0800 Subject: =?UTF-8?B?UmU6IOS4gOS4quebuOW9k+S7pOS6uui0ueino+eahOmXrumimO+8jOWFs+S6jmxpbnV4?= =?UTF-8?B?5LiL55qE5Liy5Y+j57yW56iL?= In-Reply-To: References: Message-ID: char *buffer; ...... read(fd, buffer, 3); //读串口数据 printf("buf %s\n", buffer); //输出读到的数据 buffer是野指针。加上你那个变量之后编译,整个程序的内存布局可能发生了一些变化,于是恰巧“正确”工作了。 2010/5/4 Dean Sinaean : > 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: > 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个毫无用处有变量声明才可以读到内容。 > 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读到。而且变量类型任意,char >  int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? > #include > #include > #include "fcntl.h" > #include > #include > #include          /*标准输入输出定义*/ > #include         /*标准函数库定义*/ > #include         /*Unix 标准函数定义*/ > #include     > #include     > #include          /*文件控制定义*/ > #include        /*PPSIX 终端控制定义*/ > #include          /*错误号定义*/ > > main() > { > int fd; >    int i; >    struct  termios Opt; >    int nByte; >    char *ap="s"; >    char *buffer; >    //while(1) >    //{ >     printf("HERE"); >    // } >    fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| > O_NOCTTY | O_NDELAY); >    if(fd==-1) >    { >     printf("open error"); >     printf("errno:%d\n",errno); >     } >    printf("OPEN TTY"); > tcgetattr(fd,&Opt);      //初始化 > tcflush(fd,TCIFLUSH); > cfsetispeed(&Opt,B9600);    //设置波特率 > cfsetospeed(&Opt,B9600); > > Opt.c_cflag |= CS8;                          //设置数据位 > Opt.c_cflag &= ~PARENB; > Opt.c_oflag &= ~(OPOST); > Opt.c_cflag &= ~CSTOPB; > Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); > Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); > > Opt.c_cc[VMIN] = 0; > Opt.c_cc[VTIME] = 0; > >   if (tcsetattr(fd,TCSANOW,&Opt) != 0)       //装载初始化参数 > { >   perror("SetupSerial!\n"); >   close(fd); >   return -1; > } >      printf("BAUDRATE SET"); > > while(1) > { > *char > lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的那个usleep去替它,但不好用。 > * >  //usleep(1000000); >       // sprintf(buf, "%c", i++); >  write(fd, ap, 1);        //写串口 > //printf("Open  \n");      //为测试是不是运行到这里设的输出 > //usleep(100000); > //if(len > 0) >  // { > read(fd, buffer, 3);      //读串口数据 >        printf("buf %s\n", buffer);    //输出读到的数据 >  // } >    usleep(100000); > } > > //      while(1) >  //    { >    //    write(fd, ap ,1); >      //   printf("one char written\n"); > // >  //      for(i=0;i<100000;i++) >    //    { >      //      nByte=read(fd,buffer,1); >        //    if (nByte>0) >          //  break; >        //} >          //  if(nByte<0) >            // { >             // printf("read err,errno:%d",errno); >             // printf("read:%s",buffer); >   //         } >     //       else >       //     { >         //   printf("read:%s",buffer);//[0],buffer[1],buffer[2]); >           // break; >            // } >             // usleep(100000); >    //  } > > } > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org -- Invent and fit; have fits and reinvent! We toast the Lisp programmer who pens his thoughts within nests of parentheses. From dean.sinaean在gmail.com Tue May 4 21:14:06 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Tue, 4 May 2010 09:14:06 -0400 Subject: =?GB2312?B?UmU6INK7uPbP4LWxwe7Iy7fRveK1xM7KzOKjrLnY09psaW51eA==?= =?GB2312?B?z8K1xLSuv9qx4LPM?= In-Reply-To: References: Message-ID: 野指针是什么意思?怎么改变才使程序正常工作,而不需要那个变量声明呢?谢谢。 2010/5/4 Ender.Dai > char *buffer; > ...... > read(fd, buffer, 3); //读串口数据 > printf("buf %s\n", buffer); //输出读到的数据 > > buffer是野指针。加上你那个变量之后编译,整个程序的内存布局可能发生了一些变化,于是恰巧“正确”工作了。 > > 2010/5/4 Dean Sinaean : > > 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: > > > 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个毫无用处有变量声明才可以读到内容。 > > 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读到。而且变量类型任意,char > > int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? > > #include > > #include > > #include "fcntl.h" > > #include > > #include > > #include /*标准输入输出定义*/ > > #include /*标准函数库定义*/ > > #include /*Unix 标准函数定义*/ > > #include > > #include > > #include /*文件控制定义*/ > > #include /*PPSIX 终端控制定义*/ > > #include /*错误号定义*/ > > > > main() > > { > > int fd; > > int i; > > struct termios Opt; > > int nByte; > > char *ap="s"; > > char *buffer; > > //while(1) > > //{ > > printf("HERE"); > > // } > > fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| > > O_NOCTTY | O_NDELAY); > > if(fd==-1) > > { > > printf("open error"); > > printf("errno:%d\n",errno); > > } > > printf("OPEN TTY"); > > tcgetattr(fd,&Opt); //初始化 > > tcflush(fd,TCIFLUSH); > > cfsetispeed(&Opt,B9600); //设置波特率 > > cfsetospeed(&Opt,B9600); > > > > Opt.c_cflag |= CS8; //设置数据位 > > Opt.c_cflag &= ~PARENB; > > Opt.c_oflag &= ~(OPOST); > > Opt.c_cflag &= ~CSTOPB; > > Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); > > Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); > > > > Opt.c_cc[VMIN] = 0; > > Opt.c_cc[VTIME] = 0; > > > > if (tcsetattr(fd,TCSANOW,&Opt) != 0) //装载初始化参数 > > { > > perror("SetupSerial!\n"); > > close(fd); > > return -1; > > } > > printf("BAUDRATE SET"); > > > > while(1) > > { > > *char > > > lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的那个usleep去替它,但不好用。 > > * > > //usleep(1000000); > > // sprintf(buf, "%c", i++); > > write(fd, ap, 1); //写串口 > > //printf("Open \n"); //为测试是不是运行到这里设的输出 > > //usleep(100000); > > //if(len > 0) > > // { > > read(fd, buffer, 3); //读串口数据 > > printf("buf %s\n", buffer); //输出读到的数据 > > // } > > usleep(100000); > > } > > > > // while(1) > > // { > > // write(fd, ap ,1); > > // printf("one char written\n"); > > // > > // for(i=0;i<100000;i++) > > // { > > // nByte=read(fd,buffer,1); > > // if (nByte>0) > > // break; > > //} > > // if(nByte<0) > > // { > > // printf("read err,errno:%d",errno); > > // printf("read:%s",buffer); > > // } > > // else > > // { > > // printf("read:%s",buffer);//[0],buffer[1],buffer[2]); > > // break; > > // } > > // usleep(100000); > > // } > > > > } > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > > -- > Invent and fit; have fits and reinvent! > We toast the Lisp programmer who pens his thoughts within nests of > parentheses. > From yujian.china在gmail.com Tue May 4 21:28:38 2010 From: yujian.china在gmail.com (=?utf-8?B?eXVqaWFu?=) Date: Tue, 4 May 2010 21:28:38 +0800 Subject: =?utf-8?B?UmU6IFJlOiDkuIDkuKrnm7jlvZPku6TkurrotLnop6PnmoTpl67popjvvIzlhbPkuo5saW51eOS4i+eahOS4suWPo+e8lueoiw==?= References: , , Message-ID: <201005042128281870125@gmail.com> 野指针 是指指针变量指向的内存已经被释放了 但是仍在使用该被指向的内存空间 2010-05-04 yujian 发件人: Dean Sinaean 发送时间: 2010-05-04 21:15:03 收件人: Ender.Dai 抄送: linux-kernel 主题: Re: 一个相当令人费解的问题,关于linux下的串口编程 野指针是什么意思?怎么改变才使程序正常工作,而不需要那个变量声明呢?谢谢。 2010/5/4 Ender.Dai > char *buffer; > ...... > read(fd, buffer, 3); //读串口数据 > printf("buf %s\n", buffer); //输出读到的数据 > > buffer是野指针。加上你那个变量之后编译,整个程序的内存布局可能发生了一些变化,于是恰巧“正确”工作了。 > > 2010/5/4 Dean Sinaean : > > 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: > > > 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个毫无用处有变量声明才可以读到内容。 > > 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读到。而且变量类型任意,char > > int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? > > #include > > #include > > #include "fcntl.h" > > #include > > #include > > #include /*标准输入输出定义*/ > > #include /*标准函数库定义*/ > > #include /*Unix 标准函数定义*/ > > #include > > #include > > #include /*文件控制定义*/ > > #include /*PPSIX 终端控制定义*/ > > #include /*错误号定义*/ > > > > main() > > { > > int fd; > > int i; > > struct termios Opt; > > int nByte; > > char *ap="s"; > > char *buffer; > > //while(1) > > //{ > > printf("HERE"); > > // } > > fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| > > O_NOCTTY | O_NDELAY); > > if(fd==-1) > > { > > printf("open error"); > > printf("errno:%d\n",errno); > > } > > printf("OPEN TTY"); > > tcgetattr(fd,&Opt); //初始化 > > tcflush(fd,TCIFLUSH); > > cfsetispeed(&Opt,B9600); //设置波特率 > > cfsetospeed(&Opt,B9600); > > > > Opt.c_cflag |= CS8; //设置数据位 > > Opt.c_cflag &= ~PARENB; > > Opt.c_oflag &= ~(OPOST); > > Opt.c_cflag &= ~CSTOPB; > > Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); > > Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); > > > > Opt.c_cc[VMIN] = 0; > > Opt.c_cc[VTIME] = 0; > > > > if (tcsetattr(fd,TCSANOW,&Opt) != 0) //装载初始化参数 > > { > > perror("SetupSerial!\n"); > > close(fd); > > return -1; > > } > > printf("BAUDRATE SET"); > > > > while(1) > > { > > *char > > > lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的那个usleep去替它,但不好用。 > > * > > //usleep(1000000); > > // sprintf(buf, "%c", i++); > > write(fd, ap, 1); //写串口 > > //printf("Open \n"); //为测试是不是运行到这里设的输出 > > //usleep(100000); > > //if(len > 0) > > // { > > read(fd, buffer, 3); //读串口数据 > > printf("buf %s\n", buffer); //输出读到的数据 > > // } > > usleep(100000); > > } > > > > // while(1) > > // { > > // write(fd, ap ,1); > > // printf("one char written\n"); > > // > > // for(i=0;i<100000;i++) > > // { > > // nByte=read(fd,buffer,1); > > // if (nByte>0) > > // break; > > //} > > // if(nByte<0) > > // { > > // printf("read err,errno:%d",errno); > > // printf("read:%s",buffer); > > // } > > // else > > // { > > // printf("read:%s",buffer);//[0],buffer[1],buffer[2]); > > // break; > > // } > > // usleep(100000); > > // } > > > > } > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > > -- > Invent and fit; have fits and reinvent! > We toast the Lisp programmer who pens his thoughts within nests of > parentheses. > _______________________________________________ Linux 内核开发中文邮件列表 Linux-kernel在zh-kernel.org http://zh-kernel.org/mailman/listinfo/linux-kernel Linux 内核开发中文社区: http://zh-kernel.org From higur在163.com Tue May 4 21:30:37 2010 From: higur在163.com (higur) Date: Tue, 4 May 2010 21:30:37 +0800 Subject: =?GB2312?B?1+mypb3TytXF5NbD?= Message-ID: Linux-kernel,你好 现象如下: 做了一个嵌入式平台的网络组播接收,但是收不到组播数据包。无奈,移植程序到同一个Lan里的一台linux平台的pc机,收到数据。 先在的问题是,在编译2.6.*操作系统的时候怎么配置组播?我配置了netoption->netparam->ip_multicast,ip_multicast_route. 在系统起来的时候也加了ifconfig eth0 multicast 还是收不到数据。大家有想法么?对了,我用的是kernel_sock 用户态的程序也是一样的。 higur,higur在163.com 2010-05-04 From kongjianjun在gmail.com Tue May 4 21:40:03 2010 From: kongjianjun在gmail.com (Amos Kong) Date: Tue, 4 May 2010 21:40:03 +0800 Subject: =?GB2312?B?UmU6INfpsqW908rVxeTWww==?= In-Reply-To: References: Message-ID: 2010/5/4 higur : > Linux-kernel,你好 > 现象如下: > 做了一个嵌入式平台的网络组播接收,但是收不到组播数据包。无奈,移植程序到同一个Lan里的一台linux平台的pc机,收到数据。 > 先在的问题是,在编译2.6.*操作系统的时候怎么配置组播?我配置了netoption->netparam->ip_multicast,ip_multicast_route. > 在系统起来的时候也加了ifconfig eth0 multicast > 还是收不到数据。大家有想法么?对了,我用的是kernel_sock > 用户态的程序也是一样的。 添加mac组播: if maddr add 02:00:5E:C0:01:64 dev eth0 添加IP组播: (http://lkml.org/lkml/2004/8/5/143) /* Purpose: Join a multicast group (for testing) */ /* Author: David Stevens , 2004 */ #include #include #include #include #include #include int main(int argc, char *argv[]) { struct ip_mreqn mreqn; int s; if (argc != 3) { fprintf(stderr, "usage: %s \n", argv[0]); exit(1); } s = socket(PF_INET, SOCK_DGRAM, 0); if (s < 0) { perror("socket"); exit(1); } memset(&mreqn, 0, sizeof(mreqn)); mreqn.imr_ifindex = if_nametoindex(argv[1]); if (!mreqn.imr_ifindex) { fprintf(stderr, "%s: \"%s\" invalid interface\n", argv[0], argv[1]); exit(1); } if (inet_pton(AF_INET, argv[2], &mreqn.imr_multiaddr) <= 0) { fprintf(stderr, "%s: \"%s\" invalid group address\n", argv[0], argv[2]); exit(1); } if (setsockopt(s, SOL_IP, IP_ADD_MEMBERSHIP, &mreqn,sizeof mreqn) < 0) { perror("IP_ADD_MEMBERSHIP"); exit(1); } printf("joined group %s on %s (pausing...)\n", argv[2], argv[1]); fflush(stdout); pause(); exit(0); } From xiyou.wangcong在gmail.com Tue May 4 22:19:53 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Tue, 4 May 2010 22:19:53 +0800 Subject: =?utf-8?B?5YWz5LqOICdtYWtlIENPTkZJR19E?= =?utf-8?B?RUJVR19TRUNUSU9OX01JU01BVENIPXkg6Zeu6aKY?= In-Reply-To: <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> Message-ID: <20100504141953.GA13311@hack> On Tue, May 04, 2010 at 07:10:43PM +0800, hellohello wrote: >谢谢,不过我修改了.config文件还是不行,自动被改恢复了。 > 当然不行,你看过.config文件么?前5行是: % head -5 .config # # Automatically generated make config: don't edit # Linux kernel version: 2.6.34-rc6 # Tue May 4 21:42:24 2010 # 第2行已经写得很清楚了吧? 你手工添加/删除CONFIG会破坏它们之间的依赖关系,如果你添加的不对, kconfig会直接忽略。 > >因此,现在我有2个困惑了 > >1)形如“ >+ '[' -n '' ']' >+ '[' '%{kernel_series}' = 2.4 ']' >” 在make ... uImage语句之前的这些打印语句是哪里来的?他们表示什么意思?或者在哪里能找到与之相关的说明文件,我先自己看看. 调试信息,应该是通过类似bash -x得到的。 > >2)如何将CONFIG_DEBUG_SECTION_MISMATCH=y 选项打开 > 你成功地忽视了我给你的前一个回复。 再说一遍,你只能通过命令行传递进去,因为它就是这么设计的。 -- Live like a child, think like the god. From gejunly在sina.com Wed May 5 01:15:04 2010 From: gejunly在sina.com (gejunly) Date: Wed, 5 May 2010 01:15:04 +0800 Subject: =?gb2312?B?yPXI9bXEzsrSu8/Co6y52NPaseDQtMTausvEo7/p?= Message-ID: <201005050115013312684@sina.com> 弱弱的问一下,我现在想在2.6.18内核编写内核模块,调用sys_open函数。编译通过但是insmod时报错。 急切等待解决方法。 同样也期待调用do_sys_open函数的方法。 小弟在这里多谢了。 2010-05-05 gejunly From dean.sinaean在gmail.com Wed May 5 08:30:54 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Tue, 4 May 2010 20:30:54 -0400 Subject: =?GB2312?B?UmU6IFJlOiDSu7j2z+C1scHuyMu30b3itcTOyszio6y52NPabGk=?= =?GB2312?B?bnV4z8K1xLSuv9qx4LPM?= In-Reply-To: <201005042128281870125@gmail.com> References: <201005042128281870125@gmail.com> Message-ID: 该怎么改进呢? 2010/5/4 yujian > 野指针 是指指针变量指向的内存已经被释放了 > 但是仍在使用该被指向的内存空间 > > > > 2010-05-04 > ------------------------------ > yujian > ------------------------------ > *发件人:* Dean Sinaean > *发送时间:* 2010-05-04 21:15:03 > *收件人:* Ender.Dai > *抄送:* linux-kernel > *主题:* Re: 一个相当令人费解的问题,关于linux下的串口编程 > 野指针是什么意思?怎么改变才使程序正常工作,而不需要那个变量声明呢?谢谢。 > 2010/5/4 Ender.Dai > > char *buffer; > > ...... > > read(fd, buffer, 3); //读串口数据 > > printf("buf %s\n", buffer); //输出读到的数据 > > > > buffer是野指针。加上你那个变量之后编译,整个程序的内存布局可能发生了一些变化,于是恰巧“正确”工作了。 > > > > 2010/5/4 Dean Sinaean : > > > 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: > > > > > > 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个毫无用处有变量声明才可以读到内容。 > > > 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读到。而且变量类型任意,char > > > int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? > > > #include > > > #include > > > #include "fcntl.h" > > > #include > > > #include > > > #include /*标准输入输出定义*/ > > > #include /*标准函数库定义*/ > > > #include /*Unix 标准函数定义*/ > > > #include > > > #include > > > #include /*文件控制定义*/ > > > #include /*PPSIX 终端控制定义*/ > > > #include /*错误号定义*/ > > > > > > main() > > > { > > > int fd; > > > int i; > > > struct termios Opt; > > > int nByte; > > > char *ap="s"; > > > char *buffer; > > > //while(1) > > > //{ > > > printf("HERE"); > > > // } > > > fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| > > > O_NOCTTY | O_NDELAY); > > > if(fd==-1) > > > { > > > printf("open error"); > > > printf("errno:%d\n",errno); > > > } > > > printf("OPEN TTY"); > > > tcgetattr(fd,&Opt); //初始化 > > > tcflush(fd,TCIFLUSH); > > > cfsetispeed(&Opt,B9600); //设置波特率 > > > cfsetospeed(&Opt,B9600); > > > > > > Opt.c_cflag |= CS8; //设置数据位 > > > Opt.c_cflag &= ~PARENB; > > > Opt.c_oflag &= ~(OPOST); > > > Opt.c_cflag &= ~CSTOPB; > > > Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); > > > Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); > > > > > > Opt.c_cc[VMIN] = 0; > > > Opt.c_cc[VTIME] = 0; > > > > > > if (tcsetattr(fd,TCSANOW,&Opt) != 0) //装载初始化参数 > > > { > > > perror("SetupSerial!\n"); > > > close(fd); > > > return -1; > > > } > > > printf("BAUDRATE SET"); > > > > > > while(1) > > > { > > > *char > > > > > > lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的那个usleep去替它,但不好用。 > > > * > > > //usleep(1000000); > > > // sprintf(buf, "%c", i++); > > > write(fd, ap, 1); //写串口 > > > //printf("Open \n"); //为测试是不是运行到这里设的输出 > > > //usleep(100000); > > > //if(len > 0) > > > // { > > > read(fd, buffer, 3); //读串口数据 > > > printf("buf %s\n", buffer); //输出读到的数据 > > > // } > > > usleep(100000); > > > } > > > > > > // while(1) > > > // { > > > // write(fd, ap ,1); > > > // printf("one char written\n"); > > > // > > > // for(i=0;i<100000;i++) > > > // { > > > // nByte=read(fd,buffer,1); > > > // if (nByte>0) > > > // break; > > > //} > > > // if(nByte<0) > > > // { > > > // printf("read err,errno:%d",errno); > > > // printf("read:%s",buffer); > > > // } > > > // else > > > // { > > > // printf("read:%s",buffer);//[0],buffer[1],buffer[2]); > > > // break; > > > // } > > > // usleep(100000); > > > // } > > > > > > } > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > > > -- > > Invent and fit; have fits and reinvent! > > We toast the Lisp programmer who pens his thoughts within nests of > > parentheses. > > > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From xiao.zhang在windriver.com Wed May 5 08:31:55 2010 From: xiao.zhang在windriver.com (ZhangXiao) Date: Wed, 05 May 2010 08:31:55 +0800 Subject: =?UTF-8?B?5LiA5Liq55u45b2T5Luk5Lq66LS56Kej55qE6Zeu6aKY77yM5YWz?= =?UTF-8?B?5LqObGludXjkuIvnmoTkuLLlj6PnvJbnqIs=?= In-Reply-To: References: Message-ID: <4BE0BC7B.1020409@windriver.com> How about using "objdump" to see what changes there. Or, just compile it with -o0 or -g. Thanks Xiao Dean Sinaean wrote: > 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: > 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个毫无用处有变量声明才可以读到内容。 > 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读到。而且变量类型任意,char > int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? > #include > #include > #include "fcntl.h" > #include > #include > #include /*标准输入输出定义*/ > #include /*标准函数库定义*/ > #include /*Unix 标准函数定义*/ > #include > #include > #include /*文件控制定义*/ > #include /*PPSIX 终端控制定义*/ > #include /*错误号定义*/ > > main() > { > int fd; > int i; > struct termios Opt; > int nByte; > char *ap="s"; > char *buffer; > //while(1) > //{ > printf("HERE"); > // } > fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| > O_NOCTTY | O_NDELAY); > if(fd==-1) > { > printf("open error"); > printf("errno:%d\n",errno); > } > printf("OPEN TTY"); > tcgetattr(fd,&Opt); //初始化 > tcflush(fd,TCIFLUSH); > cfsetispeed(&Opt,B9600); //设置波特率 > cfsetospeed(&Opt,B9600); > > Opt.c_cflag |= CS8; //设置数据位 > Opt.c_cflag &= ~PARENB; > Opt.c_oflag &= ~(OPOST); > Opt.c_cflag &= ~CSTOPB; > Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); > Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); > > Opt.c_cc[VMIN] = 0; > Opt.c_cc[VTIME] = 0; > > if (tcsetattr(fd,TCSANOW,&Opt) != 0) //装载初始化参数 > { > perror("SetupSerial!\n"); > close(fd); > return -1; > } > printf("BAUDRATE SET"); > > while(1) > { > *char > lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的那个usleep去替它,但不好用。 > * > //usleep(1000000); > // sprintf(buf, "%c", i++); > write(fd, ap, 1); //写串口 > //printf("Open \n"); //为测试是不是运行到这里设的输出 > //usleep(100000); > //if(len > 0) > // { > read(fd, buffer, 3); //读串口数据 > printf("buf %s\n", buffer); //输出读到的数据 > // } > usleep(100000); > } > > // while(1) > // { > // write(fd, ap ,1); > // printf("one char written\n"); > // > // for(i=0;i<100000;i++) > // { > // nByte=read(fd,buffer,1); > // if (nByte>0) > // break; > //} > // if(nByte<0) > // { > // printf("read err,errno:%d",errno); > // printf("read:%s",buffer); > // } > // else > // { > // printf("read:%s",buffer);//[0],buffer[1],buffer[2]); > // break; > // } > // usleep(100000); > // } > > } > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From xiao.zhang在windriver.com Wed May 5 08:42:35 2010 From: xiao.zhang在windriver.com (ZhangXiao) Date: Wed, 05 May 2010 08:42:35 +0800 Subject: =?UTF-8?B?5LiA5Liq55u45b2T5Luk5Lq66LS56Kej55qE6Zeu6aKY77yM5YWz?= =?UTF-8?B?5LqObGludXjkuIvnmoTkuLLlj6PnvJbnqIs=?= In-Reply-To: <4BE0BC7B.1020409@windriver.com> References: <4BE0BC7B.1020409@windriver.com> Message-ID: <4BE0BEFB.50703@windriver.com> ZhangXiao wrote: > How about using "objdump" to see what changes there. Or, just compile > it with -o0 or -g. > Sorry, not read your code carefully. Ender.Dai is right. :-) char buffer[xxx]; > Thanks > Xiao > > Dean Sinaean wrote: >> 今天一直在搞串口通信,也问了大家不少问题,得到了一些人的帮助,非常感 >> 谢大家。最终我的串口通信好用了,但是却引发了一个令我非常费解的问题: >> 在一个循环中,我不断地写串口,然后读串口,问题就在这个循环里,我直接 >> 写然后读,把读到的打印出来。这样不好用,读不到内容。非要循环中加一个 >> 毫无用处有变量声明才可以读到内容。 >> 请大家见下面代码中的红声部分。就是那句,去掉了就读不到了,加上就能读 >> 到。而且变量类型任意,char >> int都行。不是延时的问题,因为我尝试过在将这个声明替换成一个1s的延 >> 时,但是就是不好用。非要有这个声明才行。大家想想是怎么回事? >> #include >> #include >> #include "fcntl.h" >> #include >> #include >> #include /*标准输入输出定义*/ >> #include /*标准函数库定义*/ >> #include /*Unix 标准函数定义*/ >> #include >> #include >> #include /*文件控制定义*/ >> #include /*PPSIX 终端控制定义*/ >> #include /*错误号定义*/ >> >> main() >> { >> int fd; >> int i; >> struct termios Opt; >> int nByte; >> char *ap="s"; >> char *buffer; >> //while(1) >> //{ >> printf("HERE"); >> // } >> fd=open("/dev/ttySAC1",O_RDWR);//|O_NONBLOCK|O_NDELAY|O_NOCTTY );//| >> O_NOCTTY | O_NDELAY); >> if(fd==-1) >> { >> printf("open error"); >> printf("errno:%d\n",errno); >> } >> printf("OPEN TTY"); >> tcgetattr(fd,&Opt); //初始化 >> tcflush(fd,TCIFLUSH); >> cfsetispeed(&Opt,B9600); //设置波特率 >> cfsetospeed(&Opt,B9600); >> >> Opt.c_cflag |= CS8; //设置数据位 >> Opt.c_cflag &= ~PARENB; >> Opt.c_oflag &= ~(OPOST); >> Opt.c_cflag &= ~CSTOPB; >> Opt.c_lflag &= ~(ICANON|ISIG|ECHO|IEXTEN); >> Opt.c_iflag &= ~(INPCK|BRKINT|ICRNL|ISTRIP|IXON); >> >> Opt.c_cc[VMIN] = 0; >> Opt.c_cc[VTIME] = 0; >> >> if (tcsetattr(fd,TCSANOW,&Opt) != 0) //装载初始化参数 >> { >> perror("SetupSerial!\n"); >> close(fd); >> return -1; >> } >> printf("BAUDRATE SET"); >> >> while(1) >> { >> *char >> lendasdas;//就是这个变量声明,加它好用,不加不好用。这个变量毫无用 >> 处。变量类型换成别的也行,变量名也是随意取的,换别的也行。我用下面的 >> 那个usleep去替它,但不好用。 >> * >> //usleep(1000000); >> // sprintf(buf, "%c", i++); >> write(fd, ap, 1); //写串口 >> //printf("Open \n"); //为测试是不是运行到这里设的输出 >> //usleep(100000); >> //if(len > 0) >> // { >> read(fd, buffer, 3); //读串口数据 >> printf("buf %s\n", buffer); //输出读到的数据 >> // } >> usleep(100000); >> } >> >> // while(1) >> // { >> // write(fd, ap ,1); >> // printf("one char written\n"); >> // >> // for(i=0;i<100000;i++) >> // { >> // nByte=read(fd,buffer,1); >> // if (nByte>0) >> // break; >> //} >> // if(nByte<0) >> // { >> // printf("read err,errno:%d",errno); >> // printf("read:%s",buffer); >> // } >> // else >> // { >> // printf("read:%s",buffer);//[0],buffer[1],buffer[2]); >> // break; >> // } >> // usleep(100000); >> // } >> >> } >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > > From zoleooo在hotmail.com Wed May 5 09:58:41 2010 From: zoleooo在hotmail.com (zhangleo) Date: Wed, 5 May 2010 01:58:41 +0000 Subject: =?gb2312?B?UkU6IMfrzspzb2Nr?= =?gb2312?B?ZXQgcmF3ILGozsTI5w==?= =?gb2312?B?us7WuLaovdO/2reiy80=?= In-Reply-To: <20100504094212.GA2775@localhost.localdomain> References: , <20100430123946.GA8146@localhost.localdomain>, , <20100504073841.GA9120@localhost.localdomain>, <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com>, , , , <20100504093026.GA2569@localhost.localdomain>, , <20100504094212.GA2775@localhost.localdomain> Message-ID: 是嘛,能够指定接口,比如eth1发送么,最好用tcpdump看一下。 我刚刚调好,可以发送,但还是从lo接口发送的 > Date: Tue, 4 May 2010 17:42:12 +0800 > From: kernel.zeng在gmail.com > To: zoleooo在hotmail.com > CC: orphen.leiliu在gmail.com; linux-kernel在zh-kernel.org > Subject: Re: 请问socket raw 报文如何指定接口发送 > > 这个程序在我这里没问题,可以发送。 > > On Tue, May 04, 2010 at 09:32:10AM +0000, zhangleo wrote: > > Date: Tue, 4 May 2010 09:32:10 +0000 > > From: zhangleo > > To: kernel.zeng在gmail.com > > CC: orphen.leiliu在gmail.com, linux-kernel在zh-kernel.org > > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > sure, sendto的sin参数是无用的,因为raw方式发送,所以我重用了本地地址 > > > > > > > > #ifndef __DHCP_RENEW_H_ > > #define __DHCP_RENEW_H_ > > > > #define DHCP_UDP_OVERHEAD (20 + /* IP header */ \ > > 8) /* UDP header */ > > #define DHCP_SNAME_LEN 64 > > #define DHCP_FILE_LEN 128 > > #define DHCP_FIXED_NON_UDP 236 > > #define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD) > > /* Everything but options. */ > > #define BOOTP_MIN_LEN 300 > > > > #define DHCP_MTU_MAX 1500 > > #define DHCP_MTU_MIN 576 > > > > #define DHCP_MAX_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN) > > #define DHCP_MIN_OPTION_LEN (DHCP_MTU_MIN - DHCP_FIXED_LEN) > > > > struct dhcp_packet { > > u_int8_t op; /* 0: Message opcode/type */ > > u_int8_t htype; /* 1: Hardware addr type (net/if_types.h) */ > > u_int8_t hlen; /* 2: Hardware addr length */ > > u_int8_t hops; /* 3: Number of relay agent hops from client */ > > u_int32_t xid; /* 4: Transaction ID */ > > u_int16_t secs; /* 8: Seconds since client started looking */ > > u_int16_t flags; /* 10: Flag bits */ > > struct in_addr ciaddr; /* 12: Client IP address (if already in use) */ > > struct in_addr yiaddr; /* 16: Client IP address */ > > struct in_addr siaddr; /* 18: IP address of next server to talk to */ > > struct in_addr giaddr; /* 20: DHCP relay agent IP address */ > > unsigned char chaddr [16]; /* 24: Client hardware address */ > > char sname [DHCP_SNAME_LEN]; /* 40: Server name */ > > char file [DHCP_FILE_LEN]; /* 104: Boot filename */ > > unsigned char options [DHCP_MAX_OPTION_LEN]; > > /* 212: Optional parameters > > (actual length dependent on MTU). */ > > }; > > > > #define BOOTREQUEST 1 > > #define BOOTREPLY 2 > > > > /* Possible values for flags field... */ > > #define BOOTP_BROADCAST 32768L > > > > /* Possible values for hardware type (htype) field... */ > > #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ > > #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ > > #define HTYPE_FDDI 8 /* FDDI... */ > > > > struct fake_header { > > unsigned long saddr; > > unsigned long daddr; > > char mbz; > > char proto; > > unsigned short header_len; > > }; > > > > #define S_PORT 67 > > #define D_PORT 68 > > > > #define S_ADDR "10.0.1.59" > > #define D_ADDR "10.0.1.255" > > > > #endif > > > > > > > Date: Tue, 4 May 2010 17:30:26 +0800 > > > From: kernel.zeng在gmail.com > > > To: zoleooo在hotmail.com > > > CC: orphen.leiliu在gmail.com; linux-kernel在zh-kernel.org > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > > 应该给一个可编译的版本。 > > > > > > On Tue, May 04, 2010 at 08:58:22AM +0000, zhangleo wrote: > > > > Date: Tue, 4 May 2010 08:58:22 +0000 > > > > From: zhangleo > > > > To: orphen.leiliu在gmail.com > > > > CC: kernel.zeng在gmail.com, linux-kernel在zh-kernel.org > > > > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > > > > > > > i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! > > > > > > > > > > > > > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > #include > > > > > > > > #include "dhcp_renew.h" > > > > > > > > static unsigned short inline checksum(unsigned short *buffer,int size){ > > > > > > > > unsigned long cksum = 0; > > > > > > > > while(size>1){ > > > > cksum += *buffer++; > > > > size -= sizeof(unsigned short); > > > > } > > > > > > > > if(size){ > > > > cksum += *(unsigned char *)buffer; > > > > } > > > > > > > > cksum = (cksum >> 16) + (cksum & 0xffff); > > > > cksum += (cksum >> 16); > > > > > > > > return((unsigned short )(~cksum)); > > > > } > > > > > > > > static unsigned int inline udp_checksum(unsigned long saddr, > > > > unsigned long daddr, > > > > unsigned short *buffer, > > > > int size) > > > > { > > > > unsigned long sum = 0; > > > > char *buf; > > > > struct fake_header *fh; > > > > int fh_len = sizeof(struct fake_header); > > > > > > > > buf = (char *)malloc(fh_len+size); > > > > fh = (struct fake_header *)buf; > > > > memcpy(buf+fh_len,buffer,size); > > > > > > > > fh->saddr = saddr; > > > > fh->daddr = daddr; > > > > fh->mbz = 0; > > > > fh->proto = IPPROTO_UDP; > > > > fh->header_len = htons(sizeof(struct udphdr)); > > > > > > > > sum = checksum((unsigned short*)buf,fh_len+size); > > > > free(buf); > > > > > > > > return(sum); > > > > } > > > > > > > > unsigned int inline ip_checksum(unsigned short *buffer,int size){ > > > > return(checksum(buffer,size*4)); > > > > } > > > > > > > > > > > > int main(void) > > > > { > > > > int s; > > > > char datagram[4096]; > > > > struct dhcp_packet *dp; > > > > struct sockaddr_in sin; > > > > char *dev = "eth1"; > > > > > > > > s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); > > > > > > > > if(s < 0) > > > > return -1; > > > > > > > > memset (datagram, 0, 4096); /* zero out the buffer */ > > > > /* ip header */ > > > > struct iphdr *iph = (struct iphdr *) datagram; > > > > /* udp header */ > > > > struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); > > > > > > > > sin.sin_family = AF_INET; > > > > sin.sin_port = htons(S_PORT); > > > > sin.sin_addr.s_addr = inet_addr (S_ADDR); > > > > > > > > /* fill in the IP Header */ > > > > iph->ihl = 5; > > > > iph->version = 4; > > > > iph->tos = 0; > > > > iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; > > > > iph->id = 0x1234; > > > > iph->frag_off = 0; > > > > iph->ttl = 64; > > > > iph->protocol = IPPROTO_UDP; > > > > iph->saddr = inet_addr(S_ADDR); > > > > iph->daddr = inet_addr(D_ADDR); > > > > iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); > > > > > > > > /* fill in the udp header */ > > > > udph->source = htons (S_PORT); > > > > udph->dest = htons (D_PORT); > > > > udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); > > > > udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); > > > > > > > > > > > > dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); > > > > dp->op = BOOTREPLY; /* dhcp offer message */ > > > > dp->htype = HTYPE_ETHER; /* ethernet */ > > > > dp->hlen = 6; > > > > dp->hops = 0; > > > > dp->xid = 0; > > > > dp->secs = 0; > > > > dp->flags = BOOTP_BROADCAST; > > > > /* other just fill in zero */ > > > > > > > > bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); > > > > #if 1 > > > > if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ > > > > printf("bind to interface %s \n failed", dev); > > > > return -1; > > > > } > > > > #endif > > > > > > > > { > > > > int one = 1; > > > > const int *val = &one; > > > > if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) > > > > printf ("line %d setsockopt failed!\n", __LINE__); > > > > } > > > > > > > > > > > > if(sendto(s, > > > > datagram, > > > > iph->tot_len, > > > > 0, > > > > (struct sockaddr *)&sin, > > > > sizeof(struct sockaddr_in)) < 0){ > > > > printf("send failed: %s\n", strerror(errno)); > > > > }else{ > > > > printf(" %d ok\n", iph->tot_len); > > > > } > > > > close(s); > > > > return 0; > > > > } > > > > > > > > > > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > From: orphen.leiliu在gmail.com > > > > Date: Tue, 4 May 2010 16:24:41 +0800 > > > > CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org > > > > To: zoleooo在hotmail.com > > > > > > > > 您好: > > > > > > > > > > > > 莫非,您是不是bind到了一个错误的/不存在的接口? > > > > > > > > > > > > > > > > 在 2010-5-4,下午4:19, zhangleo 写道: > > > > > > > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > From: orphen.leiliu在gmail.com > > > > > Date: Tue, 4 May 2010 15:54:36 +0800 > > > > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > > > > To: kernel.zeng在gmail.com > > > > > > > > > > 您好: > > > > > > > > > > 应该没有使用root执行吧? > > > > > Operation not permitted是说权限不允许。 > > > > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > > > > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > > > > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > > > > > > > 应该是你构造的包不对吧。 > > > > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > > > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > > > > >> From: zhangleo > > > > > >> To: kernel.zeng在gmail.com > > > > > >> CC: linux-kernel在zh-kernel.org > > > > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > >> > > > > > >> > > > > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > > > > >> > > > > > >> 这个会是什么原因,我是root > > > > > >> > > > > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > > > > >>> From: kernel.zeng在gmail.com > > > > > >>> To: zoleooo在hotmail.com > > > > > >>> CC: linux-kernel在zh-kernel.org > > > > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > >>> > > > > > >>> setsockopt(SO_BINDTODEVICE) > > > > > >>> > > > > > >>> SO_BINDTODEVICE > > > > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > > > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > > > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > > > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > > > > >>> ets received from that particular interface are processed by the socket. Note that this > > > > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > > > > >>> packet sockets (use normal bind(8) there). > > > > > >>> > > > > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > > > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > > > > >>>> From: zhangleo > > > > > >>>> To: linux-kernel在zh-kernel.org > > > > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > > > > >>>> > > > > > >>>> > > > > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > > > > >>>> 能实现么, 如何操作 > > > > > >>>> _________________________________________________________________ > > > > > >>>> 一张照片的自白――Windows Live照片的可爱视频介绍 > > > > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > > > > >>>> _______________________________________________ > > > > > >>>> Linux 内核开发中文邮件列表 > > > > > >>>> Linux-kernel在zh-kernel.org > > > > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > > > > >> > > > > > >> _________________________________________________________________ > > > > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > > > > _______________________________________________ > > > > > > Linux 内核开发中文邮件列表 > > > > > > Linux-kernel在zh-kernel.org > > > > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > > > > > 致 > > > > > 礼! > > > > > > > > > > ──────────────────────────── > > > > > Liu Lei > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! > > > > > > > > > > > > > > > > > > > > > > > > > > > > 致 > > > > 礼! > > > > > > > > > > > > ──────────────────────────── Liu Lei > > > > > > > > > > > > > > > > > > > > _________________________________________________________________ > > > > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > > _________________________________________________________________ > > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c _________________________________________________________________ 约会说不清地方?来试试微软地图最新msn互动功能! http://ditu.live.com/?form=TL&swm=1 From hellohello008在163.com Wed May 5 10:54:21 2010 From: hellohello008在163.com (hellohello) Date: Wed, 5 May 2010 10:54:21 +0800 Subject: =?utf-8?Q?Re:_=E5=85=B3=E4=BA=8E_'make_CONFIG=5FDEBUG=5FSECTIO?= =?utf-8?Q?N=5FMISMATCH=3Dy_=E9=97=AE=E9=A2=98?= References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> <20100504141953.GA13311@hack> Message-ID: <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> 我当然想直接就通过命令行解决这个问题了, 但主要因为前面那我的第1个问题还没有搞定, 也就是手动敲写 make ... uImage命令,执行不下去。 我是在红帽子+x86的机子上使用ltib 交叉编译环境编译linux ppc的程序。 细节如下: > 如果不使用./ltib -c ,手动敲make ... menuconfig命令,如下所示,不会报错 > LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig > scripts/kconfig/mconf arch/powerpc/Kconfig > 。。。出现内核配置界面。。。 > > 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: > LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig > /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file > make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 > make[1]: *** [arch/powerpc/kernel] Error 2 > make: *** [uImage] Error 2 > LTIB> 查看./ltib -c正常编译过程的打印输出, 怀疑问题与在make ... uImage命令之前还执行的这4行语句有关,如下: + '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' + cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev + '[' -n '' ']' + '[' '%{kernel_series}' = 2.4 ']' + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig 但我没找到这四行语句来自哪个脚本,不知道'[' '%{kernel_series}' = 2.4 ']'是其什么作用,所以没法进展下去了。 ----- Original Message ----- From: "Américo Wang" To: "hellohello" Cc: "CyrusYzGTt" ; Sent: Tuesday, May 04, 2010 10:19 PM Subject: Re: 关于 'make CONFIG_DEBUG_SECTION_MISMATCH=y 问题 > On Tue, May 04, 2010 at 07:10:43PM +0800, hellohello wrote: >>谢谢,不过我修改了.config文件还是不行,自动被改恢复了。 >> > > 当然不行,你看过.config文件么?前5行是: > > % head -5 .config > # > # Automatically generated make config: don't edit > # Linux kernel version: 2.6.34-rc6 > # Tue May 4 21:42:24 2010 > # > > 第2行已经写得很清楚了吧? > > 你手工添加/删除CONFIG会破坏它们之间的依赖关系,如果你添加的不对, > kconfig会直接忽略。 > > > >> >>因此,现在我有2个困惑了 >> >>1)形如“ >>+ '[' -n '' ']' >>+ '[' '%{kernel_series}' = 2.4 ']' >>” 在make ... uImage语句之前的这些打印语句是哪里来的?他们表示什么意思?或者在哪里能找到与之相关的说明文件,我先自己看看. > > > 调试信息,应该是通过类似bash -x得到的。 > >> >>2)如何将CONFIG_DEBUG_SECTION_MISMATCH=y 选项打开 >> > > 你成功地忽视了我给你的前一个回复。 > 再说一遍,你只能通过命令行传递进去,因为它就是这么设计的。 > > -- > Live like a child, think like the god. > > From kernel.zeng在gmail.com Wed May 5 10:58:54 2010 From: kernel.zeng在gmail.com (Wheelz) Date: Wed, 5 May 2010 10:58:54 +0800 Subject: =?utf-8?B?6K+36Zeuc29ja2V0IHJhdyDmiqU=?= =?utf-8?B?5paH5aaC5L2V5oyH5a6a5o6l5Y+j5Y+R6YCB?= In-Reply-To: References: <20100504073841.GA9120@localhost.localdomain> <43DF099F-967C-413E-B450-3E09273B89ED@gmail.com> <20100504093026.GA2569@localhost.localdomain> <20100504094212.GA2775@localhost.localdomain> Message-ID: <20100505025854.GA4600@localhost.localdomain> 你这个程序有几个问题: 1)sendto()的时候,指定了destination的地址等于S_ADDR, 这是导致你的程序从lo接口发送的原因,因为S_ADDR是你自己。 raw socket发送的时候,是根据这个参数来路由的。 2)D_ADDR是一个子网广播地址,对于一个dgram socket来说, 如果想发送广播包,需要先调用setsockopt(SO_BROADCAST) On Wed, May 05, 2010 at 01:58:41AM +0000, zhangleo wrote: > Date: Wed, 5 May 2010 01:58:41 +0000 > From: zhangleo > To: kernel.zeng在gmail.com > CC: orphen.leiliu在gmail.com, linux-kernel在zh-kernel.org > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > 是嘛,能够指定接口,比如eth1发送么,最好用tcpdump看一下。 > > 我刚刚调好,可以发送,但还是从lo接口发送的 > > > Date: Tue, 4 May 2010 17:42:12 +0800 > > From: kernel.zeng在gmail.com > > To: zoleooo在hotmail.com > > CC: orphen.leiliu在gmail.com; linux-kernel在zh-kernel.org > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > 这个程序在我这里没问题,可以发送。 > > > > On Tue, May 04, 2010 at 09:32:10AM +0000, zhangleo wrote: > > > Date: Tue, 4 May 2010 09:32:10 +0000 > > > From: zhangleo > > > To: kernel.zeng在gmail.com > > > CC: orphen.leiliu在gmail.com, linux-kernel在zh-kernel.org > > > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > > > > sure, sendto的sin参数是无用的,因为raw方式发送,所以我重用了本地地址 > > > > > > > > > > > > #ifndef __DHCP_RENEW_H_ > > > #define __DHCP_RENEW_H_ > > > > > > #define DHCP_UDP_OVERHEAD (20 + /* IP header */ \ > > > 8) /* UDP header */ > > > #define DHCP_SNAME_LEN 64 > > > #define DHCP_FILE_LEN 128 > > > #define DHCP_FIXED_NON_UDP 236 > > > #define DHCP_FIXED_LEN (DHCP_FIXED_NON_UDP + DHCP_UDP_OVERHEAD) > > > /* Everything but options. */ > > > #define BOOTP_MIN_LEN 300 > > > > > > #define DHCP_MTU_MAX 1500 > > > #define DHCP_MTU_MIN 576 > > > > > > #define DHCP_MAX_OPTION_LEN (DHCP_MTU_MAX - DHCP_FIXED_LEN) > > > #define DHCP_MIN_OPTION_LEN (DHCP_MTU_MIN - DHCP_FIXED_LEN) > > > > > > struct dhcp_packet { > > > u_int8_t op; /* 0: Message opcode/type */ > > > u_int8_t htype; /* 1: Hardware addr type (net/if_types.h) */ > > > u_int8_t hlen; /* 2: Hardware addr length */ > > > u_int8_t hops; /* 3: Number of relay agent hops from client */ > > > u_int32_t xid; /* 4: Transaction ID */ > > > u_int16_t secs; /* 8: Seconds since client started looking */ > > > u_int16_t flags; /* 10: Flag bits */ > > > struct in_addr ciaddr; /* 12: Client IP address (if already in use) */ > > > struct in_addr yiaddr; /* 16: Client IP address */ > > > struct in_addr siaddr; /* 18: IP address of next server to talk to */ > > > struct in_addr giaddr; /* 20: DHCP relay agent IP address */ > > > unsigned char chaddr [16]; /* 24: Client hardware address */ > > > char sname [DHCP_SNAME_LEN]; /* 40: Server name */ > > > char file [DHCP_FILE_LEN]; /* 104: Boot filename */ > > > unsigned char options [DHCP_MAX_OPTION_LEN]; > > > /* 212: Optional parameters > > > (actual length dependent on MTU). */ > > > }; > > > > > > #define BOOTREQUEST 1 > > > #define BOOTREPLY 2 > > > > > > /* Possible values for flags field... */ > > > #define BOOTP_BROADCAST 32768L > > > > > > /* Possible values for hardware type (htype) field... */ > > > #define HTYPE_ETHER 1 /* Ethernet 10Mbps */ > > > #define HTYPE_IEEE802 6 /* IEEE 802.2 Token Ring... */ > > > #define HTYPE_FDDI 8 /* FDDI... */ > > > > > > struct fake_header { > > > unsigned long saddr; > > > unsigned long daddr; > > > char mbz; > > > char proto; > > > unsigned short header_len; > > > }; > > > > > > #define S_PORT 67 > > > #define D_PORT 68 > > > > > > #define S_ADDR "10.0.1.59" > > > #define D_ADDR "10.0.1.255" > > > > > > #endif > > > > > > > > > > Date: Tue, 4 May 2010 17:30:26 +0800 > > > > From: kernel.zeng在gmail.com > > > > To: zoleooo在hotmail.com > > > > CC: orphen.leiliu在gmail.com; linux-kernel在zh-kernel.org > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > > > > 应该给一个可编译的版本。 > > > > > > > > On Tue, May 04, 2010 at 08:58:22AM +0000, zhangleo wrote: > > > > > Date: Tue, 4 May 2010 08:58:22 +0000 > > > > > From: zhangleo > > > > > To: orphen.leiliu在gmail.com > > > > > CC: kernel.zeng在gmail.com, linux-kernel在zh-kernel.org > > > > > Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > > > > > > > > > > i attach the source code below, so wierd that i can't find what's the problems in it. anyone if have time please get help, thx! > > > > > > > > > > > > > > > > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > #include > > > > > > > > > > #include "dhcp_renew.h" > > > > > > > > > > static unsigned short inline checksum(unsigned short *buffer,int size){ > > > > > > > > > > unsigned long cksum = 0; > > > > > > > > > > while(size>1){ > > > > > cksum += *buffer++; > > > > > size -= sizeof(unsigned short); > > > > > } > > > > > > > > > > if(size){ > > > > > cksum += *(unsigned char *)buffer; > > > > > } > > > > > > > > > > cksum = (cksum >> 16) + (cksum & 0xffff); > > > > > cksum += (cksum >> 16); > > > > > > > > > > return((unsigned short )(~cksum)); > > > > > } > > > > > > > > > > static unsigned int inline udp_checksum(unsigned long saddr, > > > > > unsigned long daddr, > > > > > unsigned short *buffer, > > > > > int size) > > > > > { > > > > > unsigned long sum = 0; > > > > > char *buf; > > > > > struct fake_header *fh; > > > > > int fh_len = sizeof(struct fake_header); > > > > > > > > > > buf = (char *)malloc(fh_len+size); > > > > > fh = (struct fake_header *)buf; > > > > > memcpy(buf+fh_len,buffer,size); > > > > > > > > > > fh->saddr = saddr; > > > > > fh->daddr = daddr; > > > > > fh->mbz = 0; > > > > > fh->proto = IPPROTO_UDP; > > > > > fh->header_len = htons(sizeof(struct udphdr)); > > > > > > > > > > sum = checksum((unsigned short*)buf,fh_len+size); > > > > > free(buf); > > > > > > > > > > return(sum); > > > > > } > > > > > > > > > > unsigned int inline ip_checksum(unsigned short *buffer,int size){ > > > > > return(checksum(buffer,size*4)); > > > > > } > > > > > > > > > > > > > > > int main(void) > > > > > { > > > > > int s; > > > > > char datagram[4096]; > > > > > struct dhcp_packet *dp; > > > > > struct sockaddr_in sin; > > > > > char *dev = "eth1"; > > > > > > > > > > s = socket(AF_INET, SOCK_RAW, IPPROTO_UDP); > > > > > > > > > > if(s < 0) > > > > > return -1; > > > > > > > > > > memset (datagram, 0, 4096); /* zero out the buffer */ > > > > > /* ip header */ > > > > > struct iphdr *iph = (struct iphdr *) datagram; > > > > > /* udp header */ > > > > > struct udphdr *udph = (struct udphdr *) (datagram + sizeof (struct iphdr)); > > > > > > > > > > sin.sin_family = AF_INET; > > > > > sin.sin_port = htons(S_PORT); > > > > > sin.sin_addr.s_addr = inet_addr (S_ADDR); > > > > > > > > > > /* fill in the IP Header */ > > > > > iph->ihl = 5; > > > > > iph->version = 4; > > > > > iph->tos = 0; > > > > > iph->tot_len = sizeof(struct iphdr) + sizeof(struct udphdr) + BOOTP_MIN_LEN; > > > > > iph->id = 0x1234; > > > > > iph->frag_off = 0; > > > > > iph->ttl = 64; > > > > > iph->protocol = IPPROTO_UDP; > > > > > iph->saddr = inet_addr(S_ADDR); > > > > > iph->daddr = inet_addr(D_ADDR); > > > > > iph->check = ip_checksum ((unsigned short *) datagram, iph->ihl); > > > > > > > > > > /* fill in the udp header */ > > > > > udph->source = htons (S_PORT); > > > > > udph->dest = htons (D_PORT); > > > > > udph->len = BOOTP_MIN_LEN+sizeof(struct udphdr); > > > > > udph->check = udp_checksum( iph->saddr, iph->daddr, (unsigned short*)udph, 0); > > > > > > > > > > > > > > > dp = (struct dhcp_packet *)(datagram + sizeof(struct iphdr) + sizeof(struct udphdr)); > > > > > dp->op = BOOTREPLY; /* dhcp offer message */ > > > > > dp->htype = HTYPE_ETHER; /* ethernet */ > > > > > dp->hlen = 6; > > > > > dp->hops = 0; > > > > > dp->xid = 0; > > > > > dp->secs = 0; > > > > > dp->flags = BOOTP_BROADCAST; > > > > > /* other just fill in zero */ > > > > > > > > > > bind(s, (struct sockaddr*)&sin, sizeof(struct sockaddr_in)); > > > > > #if 1 > > > > > if(setsockopt(s, SOL_SOCKET, SO_BINDTODEVICE, dev, sizeof(dev)) < 0){ > > > > > printf("bind to interface %s \n failed", dev); > > > > > return -1; > > > > > } > > > > > #endif > > > > > > > > > > { > > > > > int one = 1; > > > > > const int *val = &one; > > > > > if (setsockopt (s, IPPROTO_IP, IP_HDRINCL, val, sizeof (one)) < 0) > > > > > printf ("line %d setsockopt failed!\n", __LINE__); > > > > > } > > > > > > > > > > > > > > > if(sendto(s, > > > > > datagram, > > > > > iph->tot_len, > > > > > 0, > > > > > (struct sockaddr *)&sin, > > > > > sizeof(struct sockaddr_in)) < 0){ > > > > > printf("send failed: %s\n", strerror(errno)); > > > > > }else{ > > > > > printf(" %d ok\n", iph->tot_len); > > > > > } > > > > > close(s); > > > > > return 0; > > > > > } > > > > > > > > > > > > > > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > From: orphen.leiliu在gmail.com > > > > > Date: Tue, 4 May 2010 16:24:41 +0800 > > > > > CC: kernel.zeng在gmail.com; linux-kernel在zh-kernel.org > > > > > To: zoleooo在hotmail.com > > > > > > > > > > 您好: > > > > > > > > > > > > > > > 莫非,您是不是bind到了一个错误的/不存在的接口? > > > > > > > > > > > > > > > > > > > > 在 2010-5-4,下午4:19, zhangleo 写道: > > > > > > > > > > 是啊,RAW可以发送任何格式的报文,但我的确是root,weird > > > > > > > > > > > Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > > From: orphen.leiliu在gmail.com > > > > > > Date: Tue, 4 May 2010 15:54:36 +0800 > > > > > > CC: zoleooo在hotmail.com; linux-kernel在zh-kernel.org > > > > > > To: kernel.zeng在gmail.com > > > > > > > > > > > > 您好: > > > > > > > > > > > > 应该没有使用root执行吧? > > > > > > Operation not permitted是说权限不允许。 > > > > > > 我认为这种绑定到具体接口的底层设定操作应该是需要root权限的。 > > > > > > > > > > > > 我曾经写的一个使用SOCK_RAW, IPPROTO_RAW程序无论写什么报头都可以发送,错误的也可以。 > > > > > > > > > > > > 在 2010-5-4,下午3:38, Wheelz 写道: > > > > > > > > > > > > > 应该是你构造的包不对吧。 > > > > > > > 比如,用IPPROTO_RAW的话,你自己必须构造正确的ip header。 > > > > > > > > > > > > > > On Tue, May 04, 2010 at 06:57:28AM +0000, zhangleo wrote: > > > > > > >> Date: Tue, 4 May 2010 06:57:28 +0000 > > > > > > >> From: zhangleo > > > > > > >> To: kernel.zeng在gmail.com > > > > > > >> CC: linux-kernel在zh-kernel.org > > > > > > >> Subject: RE: 请问socket raw 报文如何指定接口发送 > > > > > > >> > > > > > > >> > > > > > > >> 我按照这个方式增加了修改,但在调用sendto后,返回这样的错误send failed: Operation not permitted > > > > > > >> > > > > > > >> 这个会是什么原因,我是root > > > > > > >> > > > > > > >>> Date: Fri, 30 Apr 2010 20:39:46 +0800 > > > > > > >>> From: kernel.zeng在gmail.com > > > > > > >>> To: zoleooo在hotmail.com > > > > > > >>> CC: linux-kernel在zh-kernel.org > > > > > > >>> Subject: Re: 请问socket raw 报文如何指定接口发送 > > > > > > >>> > > > > > > >>> setsockopt(SO_BINDTODEVICE) > > > > > > >>> > > > > > > >>> SO_BINDTODEVICE > > > > > > >>> Bind this socket to a particular device like “eth0”, as specified in the passed interface > > > > > > >>> name. If the name is an empty string or the option length is zero, the socket device bind- > > > > > > >>> ing is removed. The passed option is a variable-length null-terminated interface name > > > > > > >>> string with the maximum size of IFNAMSIZ. If a socket is bound to an interface, only pack- > > > > > > >>> ets received from that particular interface are processed by the socket. Note that this > > > > > > >>> only works for some socket types, particularly AF_INET sockets. It is not supported for > > > > > > >>> packet sockets (use normal bind(8) there). > > > > > > >>> > > > > > > >>> On Fri, Apr 30, 2010 at 09:44:40AM +0000, zhangleo wrote: > > > > > > >>>> Date: Fri, 30 Apr 2010 09:44:40 +0000 > > > > > > >>>> From: zhangleo > > > > > > >>>> To: linux-kernel在zh-kernel.org > > > > > > >>>> Subject: 请问socket raw 报文如何指定接口发送 > > > > > > >>>> > > > > > > >>>> > > > > > > >>>> 自己组的ip报文 SOCK_RAW方式,设备有8个eth接口,发送时想指定某一个接口发送,不希望根据路由表查找接口发送。 > > > > > > >>>> 能实现么, 如何操作 > > > > > > >>>> _________________________________________________________________ > > > > > > >>>> 一张照片的自白——Windows Live照片的可爱视频介绍 > > > > > > >>>> http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > > > > > > >>>> _______________________________________________ > > > > > > >>>> Linux 内核开发中文邮件列表 > > > > > > >>>> Linux-kernel在zh-kernel.org > > > > > > >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > > > >>>> Linux 内核开发中文社区: http://zh-kernel.org > > > > > > >> > > > > > > >> _________________________________________________________________ > > > > > > >> SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > > > > >> http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > > > > > _______________________________________________ > > > > > > > Linux 内核开发中文邮件列表 > > > > > > > Linux-kernel在zh-kernel.org > > > > > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > > > > > > > 致 > > > > > > 礼! > > > > > > > > > > > > ──────────────────────────── > > > > > > Liu Lei > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 聊天+搜索+邮箱 想要轻松出游,手机MSN帮你搞定! 立刻下载! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 致 > > > > > 礼! > > > > > > > > > > > > > > > ──────────────────────────── Liu Lei > > > > > > > > > > > > > > > > > > > > > > > > > _________________________________________________________________ > > > > > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > > > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > > > > > _________________________________________________________________ > > > SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! > > > http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c > > _________________________________________________________________ > 约会说不清地方?来试试微软地图最新msn互动功能! > http://ditu.live.com/?form=TL&swm=1 From xiyou.wangcong在gmail.com Wed May 5 12:34:39 2010 From: xiyou.wangcong在gmail.com (Amerigo Wang) Date: Wed, 5 May 2010 12:34:39 +0800 Subject: =?utf-8?B?5YWz5LqOICdtYWtlIENPTkZJR19E?= =?utf-8?B?RUJVR19TRUNUSU9OX01JU01BVENIPXkg6Zeu6aKY?= In-Reply-To: <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> <20100504141953.GA13311@hack> <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> Message-ID: <20100505043439.GA4294@cr0.nay.redhat.com> On Wed, May 05, 2010 at 10:54:21AM +0800, hellohello wrote: > >> 如果不使用./ltib -c ,手动敲make ... menuconfig命令,如下所示,不会报错 >> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig >> scripts/kconfig/mconf arch/powerpc/Kconfig >> 。。。出现内核配置界面。。。 >> >> 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: >> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig >> /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file >> make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 >> make[1]: *** [arch/powerpc/kernel] Error 2 >> make: *** [uImage] Error 2 >> LTIB> 我没做过嵌入式,这看起来像是你的编译环境有问题,试试下面的命令输出什么: file scripts/basic/fixdep 或者运行一下make ..... mrproper之后再运行make ..... uImage。 > > >查看./ltib -c正常编译过程的打印输出, >怀疑问题与在make ... uImage命令之前还执行的这4行语句有关,如下: >+ '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' >+ cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev >+ '[' -n '' ']' >+ '[' '%{kernel_series}' = 2.4 ']' >+ make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage >scripts/kconfig/conf -s arch/powerpc/Kconfig > > >但我没找到这四行语句来自哪个脚本,不知道'[' '%{kernel_series}' = 2.4 ']'是其什么作用,所以没法进展下去了。 > 你可以看看是不是ltib的调试信息,我没使用过,不知道。 From hellohello008在163.com Wed May 5 13:56:53 2010 From: hellohello008在163.com (hellohello) Date: Wed, 5 May 2010 13:56:53 +0800 Subject: =?utf-8?Q?Re:_=E5=85=B3=E4=BA=8E_'make_CONFIG=5FDEBUG=5FSECTIO?= =?utf-8?Q?N=5FMISMATCH=3Dy_=E9=97=AE=E9=A2=98?= References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> <20100504141953.GA13311@hack> <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> <20100505043439.GA4294@cr0.nay.redhat.com> Message-ID: <01a201caec17$c3a035a0$9c1cbcc0@sfdomain.com> LTIB> file scripts/basic/fixdep scripts/basic/fixdep: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped 从上面看fixdep是host X86上的程序,这里为何会报错“/bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file”? ----- Original Message ----- From: "Amerigo Wang" To: "hellohello" Cc: "Américo Wang" ; "CyrusYzGTt" ; Sent: Wednesday, May 05, 2010 12:34 PM Subject: Re: 关于 'make CONFIG_DEBUG_SECTION_MISMATCH=y 问题 > On Wed, May 05, 2010 at 10:54:21AM +0800, hellohello wrote: >> >>> 如果不使用./ltib -c ,手动敲make ... menuconfig命令,如下所示,不会报错 >>> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig >>> scripts/kconfig/mconf arch/powerpc/Kconfig >>> 。。。出现内核配置界面。。。 >>> >>> 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: >>> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig >>> /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file >>> make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 >>> make[1]: *** [arch/powerpc/kernel] Error 2 >>> make: *** [uImage] Error 2 >>> LTIB> > > 我没做过嵌入式,这看起来像是你的编译环境有问题,试试下面的命令输出什么: > > file scripts/basic/fixdep > > 或者运行一下make ..... mrproper之后再运行make ..... uImage。 > >> >> >>查看./ltib -c正常编译过程的打印输出, >>怀疑问题与在make ... uImage命令之前还执行的这4行语句有关,如下: >>+ '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' >>+ cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev >>+ '[' -n '' ']' >>+ '[' '%{kernel_series}' = 2.4 ']' >>+ make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage >>scripts/kconfig/conf -s arch/powerpc/Kconfig >> >> >>但我没找到这四行语句来自哪个脚本,不知道'[' '%{kernel_series}' = 2.4 ']'是其什么作用,所以没法进展下去了。 >> > > 你可以看看是不是ltib的调试信息,我没使用过,不知道。 From cyrusyzgtt在gmail.com Wed May 5 14:35:45 2010 From: cyrusyzgtt在gmail.com (CyrusYzGTt) Date: Wed, 05 May 2010 14:35:45 +0800 Subject: =?UTF-8?B?5YWz5LqOICdtYWtlIENPTkZJR19ERUJVR19TRUNUSU9OX01JU00=?= =?UTF-8?B?QVRDSD15IOmXrumimA==?= In-Reply-To: <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> <20100504141953.GA13311@hack> <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> Message-ID: <4BE111C1.20603@gmail.com> 看看合适不,这是一般我使用的编译步骤,适合2.6的 make oldconfig make bzImage ~VuL4"N^`    >[Rs{(:_A   make modules #hkwHs3\    sQ@&~'O^   make modules_install P PyOzW�C    (G>aeL 2   make install LX^[W;*`] 于 2010年05月05日 10:54, hellohello 写道: > 我当然想直接就通过命令行解决这个问题了, > 但主要因为前面那我的第1个问题还没有搞定, > 也就是手动敲写 make ... uImage命令,执行不下去。 > 我是在红帽子+x86的机子上使用ltib 交叉编译环境编译linux ppc的程序。 > > > 细节如下: > > >> 如果不使用./ltib -c ,手动敲make ... menuconfig命令,如下所示,不会报错 >> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig >> scripts/kconfig/mconf arch/powerpc/Kconfig >> 。。。出现内核配置界面。。。 >> >> 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: >> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig >> /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file >> make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 >> make[1]: *** [arch/powerpc/kernel] Error 2 >> make: *** [uImage] Error 2 >> LTIB> >> > > 查看./ltib -c正常编译过程的打印输出, > 怀疑问题与在make ... uImage命令之前还执行的这4行语句有关,如下: > + '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' > + cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev > + '[' -n '' ']' > + '[' '%{kernel_series}' = 2.4 ']' > + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage > scripts/kconfig/conf -s arch/powerpc/Kconfig > > > 但我没找到这四行语句来自哪个脚本,不知道'[' '%{kernel_series}' = 2.4 ']'是其什么作用,所以没法进展下去了。 > > > > > ----- Original Message ----- > From: "Américo Wang" > To: "hellohello" > Cc: "CyrusYzGTt" ; > Sent: Tuesday, May 04, 2010 10:19 PM > Subject: Re: 关于 'make CONFIG_DEBUG_SECTION_MISMATCH=y 问题 > > > >> On Tue, May 04, 2010 at 07:10:43PM +0800, hellohello wrote: >> >>> 谢谢,不过我修改了.config文件还是不行,自动被改恢复了。 >>> >>> >> 当然不行,你看过.config文件么?前5行是: >> >> % head -5 .config >> # >> # Automatically generated make config: don't edit >> # Linux kernel version: 2.6.34-rc6 >> # Tue May 4 21:42:24 2010 >> # >> >> 第2行已经写得很清楚了吧? >> >> 你手工添加/删除CONFIG会破坏它们之间的依赖关系,如果你添加的不对, >> kconfig会直接忽略。 >> >> >> >> >>> 因此,现在我有2个困惑了 >>> >>> 1)形如“ >>> + '[' -n '' ']' >>> + '[' '%{kernel_series}' = 2.4 ']' >>> ” 在make ... uImage语句之前的这些打印语句是哪里来的?他们表示什么意思?或者在哪里能找到与之相关的说明文件,我先自己看看. >>> >> >> 调试信息,应该是通过类似bash -x得到的。 >> >> >>> 2)如何将CONFIG_DEBUG_SECTION_MISMATCH=y 选项打开 >>> >>> >> 你成功地忽视了我给你的前一个回复。 >> 再说一遍,你只能通过命令行传递进去,因为它就是这么设计的。 >> >> -- >> Live like a child, think like the god. >> >> > > From nylzhaowei在gmail.com Wed May 5 15:02:15 2010 From: nylzhaowei在gmail.com (Godbach) Date: Wed, 5 May 2010 15:02:15 +0800 Subject: =?GB2312?B?UmU6IMj1yPW1xM7K0rvPwqOsudjT2rHg0LTE2rrLxKO/6Q==?= In-Reply-To: <201005050115013312684@sina.com> References: <201005050115013312684@sina.com> Message-ID: 在 2010年5月5日 上午1:15,gejunly 写道: > > 弱弱的问一下,我现在想在2.6.18内核编写内核模块,调用sys_open函数。编译通过但是insmod时报错。 > 急切等待解决方法。 > 同样也期待调用do_sys_open函数的方法。 > 小弟在这里多谢了。 看一下这个函数是否EXPORT出来给其他模块调用了。另外,报错的信息请贴出来。把错误描述具体一点,有利于别人帮你定位问题。 From haygto在gmail.com Thu May 6 09:49:18 2010 From: haygto在gmail.com (SaintEvil) Date: Thu, 6 May 2010 09:49:18 +0800 Subject: =?GB2312?B?c2S/qMf9tq/Oyszi?= Message-ID: 在utu2440上移植SD卡驱动,用的内核是2.6.26.下载如下地址的s3c_mci.patch http://svnweb.openmoko.org/*checkout*/branches/src/target/kernel/2.6.24.x/patches/s3c_mci.patch?rev=4096 打上补丁,配置内核,添加 &s3c_device_sdi, gpio_detect = S3C2410_GPG8 等,编译下载内核到开发板,插上SD卡毫无反应。 后改用30版本内核,把上面添加的两条一样进行添加,编译内核下载到开发板,可以顺利读出SD卡内容。这说明硬件是没问题的 现在急需在26内核下正确驱动SD卡,感觉应该是patch的问题。 那位有这方面经验的大侠指教一下。 在线等,谢谢! From solyn123在gmail.com Thu May 6 11:38:33 2010 From: solyn123在gmail.com (=?GB2312?B?wdbWvsa9?=) Date: Thu, 6 May 2010 11:38:33 +0800 Subject: =?GB2312?B?dS1ib290MS4xLjKw5rG+yse38dans9ZkdGK1xLLOyv20q7Xdt70=?= =?GB2312?B?yr0=?= Message-ID: 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 编译好的内核下到内存中就死掉了,没有任何打印信息。 我感觉是我的dtb文件有点问题, 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 From wangbj在gmail.com Thu May 6 12:36:14 2010 From: wangbj在gmail.com (Baojun Wang) Date: Thu, 6 May 2010 12:36:14 +0800 Subject: =?UTF-8?B?UmU6IHUtYm9vdDEuMS4y54mI5pys5piv5ZCm5pSv5oyBZHRi55qE5Y+C5pWw5Lyg6YCS?= =?UTF-8?B?5pa55byP?= In-Reply-To: References: Message-ID: you could check the u-boot change log, it sounds like the fdt/dtb support came from 1.3.X for old u-boot, you can use the cuImage. 2010/5/6 林志平 : > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > 我感觉是我的dtb文件有点问题, > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From zhigang.gong在gmail.com Thu May 6 14:29:08 2010 From: zhigang.gong在gmail.com (zhigang gong) Date: Thu, 6 May 2010 14:29:08 +0800 Subject: =?GB2312?B?UmU6IMfrzspzb2NrZXQgcmF3ILGozsTI57rO1ri2qL3Tv9q3osvN?= In-Reply-To: References: Message-ID: man 7 raw, ���Կ���������� If IP_HDRINCL is specified and the IP header has a non-zero destination address then the destination address of the socket is used to route the packet. When MSG_DONTROUTE is specified, the destination address should refer to a local interface, otherwise a routing table lookup is done anyway but gatewayed routes are ignored. �����������route�ķ�ʽ��һ����MSG_DONTROUTE���������P���Ӧ��DZ���an�ĵ����kernel IP layer �����route table lookup,ֻ����� hop�·�������� �ڶ���û���MSG_DONTROUTE, ���P��ĵ��������Ϊ������������route table lookup�ģ������·��Ҳ�ᷢ���·���� �ɼ������l �����ayer 3��������ģ��·�����ȷ����ĸ�erface�����ݳ�� ���Ļ�������ѡ���һ������8����p��������·����Ҫȥ����ĵ���������뷨������Ӧ��nterface. �һ���packet socket Ȼ��d��ij��erface��� man 7 packet ��Կ�����ڡ������Բο�libpcap����iface_bind() ��ocket��ָ���Ķ˿ڣ� pcap_inject_linux() �Ӱ󶨵Ķ˿ڷ��������Ļ�����ernet headerҲ�Ҫ����׼����ˡ� 2010/4/30 zhangleo > > ������p��� SOCK_RAW��ʽ������8���ӿڣ����ʱ�ָ��ijһ��ڷ������ϣ��������ӿڷ���� > �ʵ�ô�� ��β��_________________________________________________________________ > һ��Ƭ��԰רD�DWindows Live�Ƭ�Ŀɰ��Ƶ�� > http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > _______________________________________________ > Linux ��˿����������� Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux ��˿��������� http://zh-kernel.org From hellohello008在163.com Thu May 6 14:48:59 2010 From: hellohello008在163.com (hellohello) Date: Thu, 6 May 2010 14:48:59 +0800 Subject: =?utf-8?B?UmU6IHUtYm9vdDEuMS4y54mI5pys5piv5ZCm5pSv5oyBZHRi55qE5Y+C?= =?utf-8?B?5pWw5Lyg6YCS5pa55byP?= References: Message-ID: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 以前没搞过linux,现在发现开头很费劲, 我用的是freescale的 MPC8272ADS_20080623-ltib.iso 里面带的是u-boot-1.3.2,支持dtb。 不过我也遇到uboot控制权刚转移到内核就死机的问题 ## Transferring control to Linux (at address 00000000) ... . ----- Original Message ----- From: "林志平" To: "linux-kernel" Sent: Thursday, May 06, 2010 11:38 AM Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > 我感觉是我的dtb文件有点问题, > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From vividfe在gmail.com Thu May 6 15:09:12 2010 From: vividfe在gmail.com (vital) Date: Thu, 6 May 2010 15:09:12 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> Message-ID: 在 2010年5月6日 下午2:48,hellohello 写道: > > 我也是在mpc8247上移植 Linux Kernel is 2.6.25 > 以前没搞过linux,现在发现开头很费劲, > 我用的是freescale的 MPC8272ADS_20080623-ltib.iso > 里面带的是u-boot-1.3.2,支持dtb。 > 不过我也遇到uboot控制权刚转移到内核就死机的问题 > ## Transferring control to Linux (at address 00000000) ... 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) 3> cuImage确实可以尝试 4> 可以在 u-boot里dump __log_buf看看死在哪? 5> 可以自己写个simple uart打印一下信息定位问题 请依次排查。 Cheers Bruce > > > > > . > > ----- Original Message ----- > From: "林志平" > To: "linux-kernel" > Sent: Thursday, May 06, 2010 11:38 AM > Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >> 我感觉是我的dtb文件有点问题, >> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From vividfe在gmail.com Thu May 6 15:15:56 2010 From: vividfe在gmail.com (vital) Date: Thu, 6 May 2010 15:15:56 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 在 2010年5月6日 上午11:38,林志平 写道: > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > 我感觉是我的dtb文件有点问题, > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 支不支持,u-boot会显示出来。 即使支持,比较新的kernel中dts格式,注意是格式,已经不匹配原有的u-boot。所以都需要更新。 调试方法可以参考我在另一封邮件提到的。 Bruce > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From zoleooo在hotmail.com Thu May 6 15:33:18 2010 From: zoleooo在hotmail.com (zhangleo) Date: Thu, 6 May 2010 07:33:18 +0000 Subject: =?gb2312?B?UkU6IMfrzspzb2Nr?= =?gb2312?B?ZXQgcmF3ILGozsTI5w==?= =?gb2312?B?us7WuLaovdO/2reiy80=?= In-Reply-To: References: , Message-ID: ����ظ���ʵ����Ǵ��hcp server�� ���er�����client�����p�����������������㲥һ��p offer�Ϣʹclient�����dhcp discovery�����㲥�������ˣ��ͻ��˸�����ģ���dhcp��pЭ����ʱ��ent�˻�û�bind����Ķ˿ڡ� ����������������ģ� Date: Thu, 6 May 2010 14:29:08 +0800 Subject: Re: ��socket raw ����������ӿڷ�� From: zhigang.gong在gmail.com To: zoleooo在hotmail.com CC: linux-kernel在zh-kernel.org man 7 raw, ���Կ���������� If IP_HDRINCL is specified and the IP header has a non-zero destination address then the destination address of the socket is used to route the packet. When MSG_DONTROUTE is specified, the destination address should refer to a local interface, otherwise a routing table lookup is done anyway but gatewayed routes are ignored. �����������route�ķ�ʽ��һ����MSG_DONTROUTE���������P���Ӧ��DZ���an�ĵ����kernel IP layer �����route table lookup,ֻ����� hop�·�������� �ڶ���û���MSG_DONTROUTE, ���P��ĵ��������Ϊ������������route table lookup�ģ������·��Ҳ�ᷢ���·���� �ɼ������l �����ayer 3��������ģ��·�����ȷ����ĸ�erface�����ݳ�� ���Ļ�������ѡ���һ������8����p��������·����Ҫȥ����ĵ���������뷨������Ӧ��nterface. �һ���packet socket Ȼ��d��ij��erface��� man 7 packet ��Կ�����ڡ������Բο�libpcap����iface_bind() ��ocket��ָ���Ķ˿ڣ� pcap_inject_linux() �Ӱ󶨵Ķ˿ڷ��������Ļ�����ernet headerҲ�Ҫ����׼����ˡ� 2010/4/30 zhangleo ������p��� SOCK_RAW��ʽ������8���ӿڣ����ʱ�ָ��ijһ��ڷ������ϣ��������ӿڷ���� �ʵ�ô�� ��β��_______________________________________________________________ һ��Ƭ��԰רD�DWindows Live�Ƭ�Ŀɰ��Ƶ�� http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry _______________________________________________ Linux ��˿�����������inux-kernel在zh-kernel.org http://zh-kernel.org/mailman/listinfo/linux-kernel Linux ��˿��������� http://zh-kernel.org _________________________________________________________________ �֪������Σ��������� http://cn.bing.com/search?q=%E5%A4%A9%E6%B0%94%E9%A2%84%E6%8A%A5&form=MICHJ2 From hellohello008在163.com Thu May 6 15:41:41 2010 From: hellohello008在163.com (hellohello) Date: Thu, 6 May 2010 15:41:41 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> Message-ID: <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> From: "vital" > 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? > 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) 下面是u-boot里tftp内核到内存的运行过程: => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' => run ftp1 Trying FCC1 ETHERNET fcc_rbase 07ffb210 NetRxPackets 07ffbe4c fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 Using FCC1 ETHERNET device TFTP from server 192.168.1.66; our IP address is 192.168.1.1 Filename '/tftpboot/uImage'. Load address: 0x1000000 Loading: ################################################################# ################################ done Bytes transferred = 1419267 (15a803 hex) Trying FCC1 ETHERNET fcc_rbase 07ffb210 NetRxPackets 07ffbe4c fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 Using FCC1 ETHERNET device TFTP from server 192.168.1.66; our IP address is 192.168.1.1 Filename '/tftpboot/rootfs.ext2.gz.uboot'. Load address: 0x2000000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ############################ done Bytes transferred = 4220072 (4064a8 hex) Trying FCC1 ETHERNET fcc_rbase 07ffb210 NetRxPackets 07ffbe4c fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 Using FCC1 ETHERNET device TFTP from server 192.168.1.66; our IP address is 192.168.1.1 Filename '/tftpboot/mpc8272ads.dtb'. Load address: 0x400000 Loading: # done Bytes transferred = 12288 (3000 hex) ## Booting image at 01000000 ... Image Name: Linux-2.6.25 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size: 1419203 Bytes = 1.4 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK ## Current stack ends at 0x07BC4BF0 => set upper limit to 0x00800000 ## cmdline at 0x007FFF00 ... 0x007FFF38 bd address = 0x07BC4FAC memstart = 0x00000000 memsize = 0x08000000 flashstart = 0xFFF00000 flashsize = 0x00080000 flashoffset = 0x00033000 sramstart = 0x00000000 sramsize = 0x00000000 immr_base = 0xF0000000 bootflags = 0xF0010000 vco = 400 MHz sccfreq = 100 MHz brgfreq = 25 MHz intfreq = 400 MHz cpmfreq = 200 MHz busfreq = 100 MHz ethaddr = 08:00:C0:A8:01:01 eth1addr = 04:00:00:00:00:0B IP addr = 192.168.1.1 baudrate = 9600 bps Not skipping initrd ## Loading RAMDisk Image at 02000000 ... Image Name: uboot ext2 ramdisk rootfs Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size: 4220008 Bytes = 4 MB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK Booting using the fdt at 0x400000 ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) Loading Ramdisk to 077bd000, end 07bc3468 ... OK Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b Updating property 'timebase-frequency' = 01 7d 78 40 Updating property 'bus-frequency' = 05 f5 e1 00 Updating property 'clock-frequency' = 17 d7 84 00 Updating property 'bus-frequency' = 05 f5 e1 00 Updating property 'current-speed' = 00 00 25 80 Updating property 'clock-frequency' = 01 7d 78 40 ## Transferring control to Linux (at address 00000000) ... 这里就死掉了 > 5> 可以自己写个simple uart打印一下信息定位问题 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 还要做地址偏移,正在查这些资料。 另外,下面是我用的dts文件 / { model = "MPC8272ADS"; compatible = "fsl,mpc8272ads"; #address-cells = <1>; #size-cells = <1>; cpus { #address-cells = <1>; #size-cells = <0>; PowerPC,8272在0 { device_type = "cpu"; reg = <0>; d-cache-line-size = ; i-cache-line-size = ; d-cache-size = ; i-cache-size = ; timebase-frequency = <0>; bus-frequency = <0>; clock-frequency = <0>; }; }; memory { device_type = "memory"; reg = <0 0>; }; soc在f0000000 { #address-cells = <1>; #size-cells = <1>; device_type = "soc"; compatible = "fsl,mpc8272", "fsl,pq2-soc"; ranges = <00000000 f0000000 00053000>; // Temporary -- will go away once kernel uses ranges for get_immrbase(). reg = ; cpm在119c0 { #address-cells = <1>; #size-cells = <1>; compatible = "fsl,mpc8272-cpm", "fsl,cpm2"; reg = <119c0 30>; ranges; muram在0 { #address-cells = <1>; #size-cells = <1>; ranges = <0 0 10000>; data在0 { compatible = "fsl,cpm-muram-data"; reg = <0 2000 9800 800>; }; }; brg在119f0 { compatible = "fsl,mpc8272-brg", "fsl,cpm2-brg", "fsl,cpm-brg"; reg = <119f0 10 115f0 10>; }; serial在11a82 { device_type = "serial"; compatible = "fsl,mpc8272-smc-uart", "fsl,cpm2-smc-uart"; reg = <11a82 10 87fc 1>; interrupts = <4 8>; interrupt-parent = <&PIC>; fsl,cpm-brg = <7>; fsl,cpm-command = <1d000000>; }; } } ... ... chosen { linux,stdout-path = "/soc/cpm/serial在11a82"; }; ----- Original Message ----- From: "vital" To: "hellohello" Cc: "林志平" ; "linux-kernel" Sent: Thursday, May 06, 2010 3:09 PM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >在 2010年5月6日 下午2:48,hellohello 写道: >> >> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >> 以前没搞过linux,现在发现开头很费劲, >> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >> 里面带的是u-boot-1.3.2,支持dtb。 >> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >> ## Transferring control to Linux (at address 00000000) ... > > 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? > 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) > 3> cuImage确实可以尝试 > 4> 可以在 u-boot里dump __log_buf看看死在哪? > 5> 可以自己写个simple uart打印一下信息定位问题 > > 请依次排查。 > > Cheers > Bruce > >> >> >> >> >> . >> >> ----- Original Message ----- >> From: "林志平" >> To: "linux-kernel" >> Sent: Thursday, May 06, 2010 11:38 AM >> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>> 我感觉是我的dtb文件有点问题, >>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>> _______________________________________________ >>> Linux 内核开发中文邮件列表 >>> Linux-kernel在zh-kernel.org >>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>> Linux 内核开发中文社区: http://zh-kernel.org >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > From vividfe在gmail.com Thu May 6 16:43:08 2010 From: vividfe在gmail.com (vital) Date: Thu, 6 May 2010 16:43:08 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> Message-ID: 在 2010年5月6日 下午3:41,hellohello 写道: > From: "vital" >> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) > 下面是u-boot里tftp内核到内存的运行过程: > > => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 > => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' > => run ftp1 [snip] > ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) > Loading Ramdisk to 077bd000, end 07bc3468 ... OK > Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 > Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 > Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b > Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b > Updating property 'timebase-frequency' = 01 7d 78 40 > Updating property 'bus-frequency' = 05 f5 e1 00 > Updating property 'clock-frequency' = 17 d7 84 00 > Updating property 'bus-frequency' = 05 f5 e1 00 > Updating property 'current-speed' = 00 00 25 80 > Updating property 'clock-frequency' = 01 7d 78 40 > ## Transferring control to Linux (at address 00000000) ... > 这里就死掉了 假设你已经起来了kernel。 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 > > > >> 5> 可以自己写个simple uart打印一下信息定位问题 > 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 > 还要做地址偏移,正在查这些资料。 u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 > > > > [snip] > serial在11a82 { > device_type = "serial"; > compatible = "fsl,mpc8272-smc-uart", > "fsl,cpm2-smc-uart"; 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? Bruce > reg = <11a82 10 87fc 1>; > interrupts = <4 8>; > interrupt-parent = <&PIC>; > fsl,cpm-brg = <7>; > fsl,cpm-command = <1d000000>; > }; > } > } > ... > ... > chosen { > linux,stdout-path = "/soc/cpm/serial在11a82"; > }; > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > Sent: Thursday, May 06, 2010 3:09 PM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月6日 下午2:48,hellohello 写道: >>> >>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>> 以前没搞过linux,现在发现开头很费劲, >>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>> 里面带的是u-boot-1.3.2,支持dtb。 >>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>> ## Transferring control to Linux (at address 00000000) ... >> >> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >> 3> cuImage确实可以尝试 >> 4> 可以在 u-boot里dump __log_buf看看死在哪? >> 5> 可以自己写个simple uart打印一下信息定位问题 >> >> 请依次排查。 >> >> Cheers >> Bruce >> >>> >>> >>> >>> >>> . >>> >>> ----- Original Message ----- >>> From: "林志平" >>> To: "linux-kernel" >>> Sent: Thursday, May 06, 2010 11:38 AM >>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>> 我感觉是我的dtb文件有点问题, >>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>> _______________________________________________ >>>> Linux 内核开发中文邮件列表 >>>> Linux-kernel在zh-kernel.org >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>> Linux 内核开发中文社区: http://zh-kernel.org >>> _______________________________________________ >>> Linux 内核开发中文邮件列表 >>> Linux-kernel在zh-kernel.org >>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>> Linux 内核开发中文社区: http://zh-kernel.org >> From wangbj在gmail.com Thu May 6 17:06:44 2010 From: wangbj在gmail.com (Baojun Wang) Date: Thu, 6 May 2010 17:06:44 +0800 Subject: =?UTF-8?B?UmU6IHUtYm9vdDEuMS4y54mI5pys5piv5ZCm5pSv5oyBZHRi55qE5Y+C5pWw5Lyg6YCS?= =?UTF-8?B?5pa55byP?= In-Reply-To: <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> Message-ID: MPC82xx 启动的时候应该是MMU off的,这时候应该使用的是物理地址 你以前VA-PA一一对应,使用的是MPC85XX? 2010/5/6 hellohello : > From: "vital" >> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) > 下面是u-boot里tftp内核到内存的运行过程: > > => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 > => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot;  tftp 400000 /tftpboot/mpc8272ads.dtb;  bootm 1000000  2000000 400000' > => run ftp1 > Trying FCC1 ETHERNET > fcc_rbase 07ffb210 NetRxPackets 07ffbe4c > fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 > Using FCC1 ETHERNET device > TFTP from server 192.168.1.66; our IP address is 192.168.1.1 > Filename '/tftpboot/uImage'. > Load address: 0x1000000 > Loading: ################################################################# >         ################################ > done > Bytes transferred = 1419267 (15a803 hex) > Trying FCC1 ETHERNET > fcc_rbase 07ffb210 NetRxPackets 07ffbe4c > fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 > Using FCC1 ETHERNET device > TFTP from server 192.168.1.66; our IP address is 192.168.1.1 > Filename '/tftpboot/rootfs.ext2.gz.uboot'. > Load address: 0x2000000 > Loading: ################################################################# >         ################################################################# >         ################################################################# >         ################################################################# >         ############################ > done > Bytes transferred = 4220072 (4064a8 hex) > Trying FCC1 ETHERNET > fcc_rbase 07ffb210 NetRxPackets 07ffbe4c > fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 > Using FCC1 ETHERNET device > TFTP from server 192.168.1.66; our IP address is 192.168.1.1 > Filename '/tftpboot/mpc8272ads.dtb'. > Load address: 0x400000 > Loading: # > done > Bytes transferred = 12288 (3000 hex) > ## Booting image at 01000000 ... >   Image Name:   Linux-2.6.25 >   Image Type:   PowerPC Linux Kernel Image (gzip compressed) >   Data Size:    1419203 Bytes =  1.4 MB >   Load Address: 00000000 >   Entry Point:  00000000 >   Verifying Checksum ... OK >   Uncompressing Kernel Image ... OK > ## Current stack ends at 0x07BC4BF0 => set upper limit to 0x00800000 > ## cmdline at 0x007FFF00 ... 0x007FFF38 > bd address  = 0x07BC4FAC > memstart    = 0x00000000 > memsize     = 0x08000000 > flashstart  = 0xFFF00000 > flashsize   = 0x00080000 > flashoffset = 0x00033000 > sramstart   = 0x00000000 > sramsize    = 0x00000000 > immr_base   = 0xF0000000 > bootflags   = 0xF0010000 > vco         =    400 MHz > sccfreq     =    100 MHz > brgfreq     =     25 MHz > intfreq     =    400 MHz > cpmfreq     =    200 MHz > busfreq     =    100 MHz > ethaddr     = 08:00:C0:A8:01:01 > eth1addr    = 04:00:00:00:00:0B > IP addr     = 192.168.1.1 > baudrate    =   9600 bps > Not skipping initrd > ## Loading RAMDisk Image at 02000000 ... >   Image Name:   uboot ext2 ramdisk rootfs >   Image Type:   PowerPC Linux RAMDisk Image (gzip compressed) >   Data Size:    4220008 Bytes =  4 MB >   Load Address: 00000000 >   Entry Point:  00000000 >   Verifying Checksum ... OK >   Booting using the fdt at 0x400000 > ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >   Loading Ramdisk to 077bd000, end 07bc3468 ... OK > Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' =  08 00 c0 a8 01 01 > Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' =  08 00 c0 a8 01 01 > Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' =  04 00 00 00 00 0b > Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' =  04 00 00 00 00 0b > Updating property 'timebase-frequency' =  01 7d 78 40 > Updating property 'bus-frequency' =  05 f5 e1 00 > Updating property 'clock-frequency' =  17 d7 84 00 > Updating property 'bus-frequency' =  05 f5 e1 00 > Updating property 'current-speed' =  00 00 25 80 > Updating property 'clock-frequency' =  01 7d 78 40 > ## Transferring control to Linux (at address 00000000) ... > 这里就死掉了 > > > >> 5> 可以自己写个simple uart打印一下信息定位问题 >   想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >   还要做地址偏移,正在查这些资料。 > > > > > 另外,下面是我用的dts文件 > / { >  model = "MPC8272ADS"; >  compatible = "fsl,mpc8272ads"; >  #address-cells = <1>; >  #size-cells = <1>; > >  cpus { >  #address-cells = <1>; >  #size-cells = <0>; > >  PowerPC,8272在0 { >   device_type = "cpu"; >   reg = <0>; >   d-cache-line-size = ; >   i-cache-line-size = ; >   d-cache-size = ; >   i-cache-size = ; >   timebase-frequency = <0>; >   bus-frequency = <0>; >   clock-frequency = <0>; >  }; >  }; > >  memory { >  device_type = "memory"; >  reg = <0 0>; >  }; > > soc在f0000000 { >  #address-cells = <1>; >  #size-cells = <1>; >  device_type = "soc"; >  compatible = "fsl,mpc8272", "fsl,pq2-soc"; >  ranges = <00000000 f0000000 00053000>; > >  // Temporary -- will go away once kernel uses ranges for get_immrbase(). >  reg = ; > >  cpm在119c0 { >   #address-cells = <1>; >   #size-cells = <1>; >   compatible = "fsl,mpc8272-cpm", "fsl,cpm2"; >   reg = <119c0 30>; >   ranges; > >   muram在0 { >    #address-cells = <1>; >    #size-cells = <1>; >    ranges = <0 0 10000>; > >    data在0 { >     compatible = "fsl,cpm-muram-data"; >     reg = <0 2000 9800 800>; >    }; >   }; > >   brg在119f0 { >    compatible = "fsl,mpc8272-brg", >                 "fsl,cpm2-brg", >                 "fsl,cpm-brg"; >    reg = <119f0 10 115f0 10>; >   }; >   serial在11a82 { >    device_type = "serial"; >    compatible = "fsl,mpc8272-smc-uart", >                 "fsl,cpm2-smc-uart"; >    reg = <11a82 10 87fc 1>; >    interrupts = <4 8>; >    interrupt-parent = <&PIC>; >    fsl,cpm-brg = <7>; >    fsl,cpm-command = <1d000000>; >   }; >  } > } > ... > ... > chosen { >  linux,stdout-path = "/soc/cpm/serial在11a82"; >  }; > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > Sent: Thursday, May 06, 2010 3:09 PM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月6日 下午2:48,hellohello 写道: >>> >>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>> 以前没搞过linux,现在发现开头很费劲, >>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>> 里面带的是u-boot-1.3.2,支持dtb。 >>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>> ## Transferring control to Linux (at address 00000000) ... >> >> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >> 3> cuImage确实可以尝试 >> 4> 可以在 u-boot里dump __log_buf看看死在哪? >> 5> 可以自己写个simple uart打印一下信息定位问题 >> >> 请依次排查。 >> >> Cheers >> Bruce >> >>> >>> >>> >>> >>> . >>> >>> ----- Original Message ----- >>> From: "林志平" >>> To: "linux-kernel" >>> Sent: Thursday, May 06, 2010 11:38 AM >>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>> 我感觉是我的dtb文件有点问题, >>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>> _______________________________________________ >>>> Linux 内核开发中文邮件列表 >>>> Linux-kernel在zh-kernel.org >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>> Linux 内核开发中文社区: http://zh-kernel.org >>> _______________________________________________ >>> Linux 内核开发中文邮件列表 >>> Linux-kernel在zh-kernel.org >>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>> Linux 内核开发中文社区: http://zh-kernel.org >> > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From hellohello008在163.com Thu May 6 17:13:47 2010 From: hellohello008在163.com (hellohello) Date: Thu, 6 May 2010 17:13:47 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> Message-ID: <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> 谢谢回复 ----- Original Message ----- From: "vital" To: "hellohello" > [snip] > >> serial在11a82 { >> device_type = "serial"; >> compatible = "fsl,mpc8272-smc-uart", >> "fsl,cpm2-smc-uart"; > > 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? > > Bruce -----8272ads板子是使用scc1做的调试口,我的板子是smc1做的, 因此我对应修改了寄存器地址,中断号,cpm的命令,波特率brg号 ,当时,还有个有疑问的地方就是你刚提到的, compatible = "fsl,mpc8272-scc-uart", "fsl,cpm2-scc-uart"; 由于我不清楚这里是如何和驱动代码对应上的,在linux目录下搜不着 类似cpm2-scc-的代码,于是就简单的将scc字段改成了smc字段, 是不是就是这里的问题阿? 下面是修改前后的对比 /*****hello serial在11a00 { device_type = "serial"; compatible = "fsl,mpc8272-scc-uart", "fsl,cpm2-scc-uart"; reg = <11a00 20 8000 100>; interrupts = <28 8>; interrupt-parent = <&PIC>; fsl,cpm-brg = <1>; fsl,cpm-command = <00800000>; };*/ serial在11a82 { device_type = "serial"; compatible = "fsl,mpc8272-smc-uart", "fsl,cpm2-smc-uart"; reg = <11a82 10 87fc 1>; interrupts = <4 8>; interrupt-parent = <&PIC>; fsl,cpm-brg = <7>; fsl,cpm-command = <1d000000>; }; ----- Original Message ----- From: "vital" To: "hellohello" Cc: "林志平" ; "linux-kernel" Sent: Thursday, May 06, 2010 4:43 PM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >在 2010年5月6日 下午3:41,hellohello 写道: >> From: "vital" >>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >> 下面是u-boot里tftp内核到内存的运行过程: >> >> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >> => run ftp1 > > [snip] > >> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >> Updating property 'timebase-frequency' = 01 7d 78 40 >> Updating property 'bus-frequency' = 05 f5 e1 00 >> Updating property 'clock-frequency' = 17 d7 84 00 >> Updating property 'bus-frequency' = 05 f5 e1 00 >> Updating property 'current-speed' = 00 00 25 80 >> Updating property 'clock-frequency' = 01 7d 78 40 >> ## Transferring control to Linux (at address 00000000) ... >> 这里就死掉了 > > 假设你已经起来了kernel。 > 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 > >> >> >> >>> 5> 可以自己写个simple uart打印一下信息定位问题 >> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >> 还要做地址偏移,正在查这些资料。 > > u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 > >> >> >> >> > [snip] > >> serial在11a82 { >> device_type = "serial"; >> compatible = "fsl,mpc8272-smc-uart", >> "fsl,cpm2-smc-uart"; > > 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? > > Bruce > > >> reg = <11a82 10 87fc 1>; >> interrupts = <4 8>; >> interrupt-parent = <&PIC>; >> fsl,cpm-brg = <7>; >> fsl,cpm-command = <1d000000>; >> }; >> } >> } >> ... >> ... >> chosen { >> linux,stdout-path = "/soc/cpm/serial在11a82"; >> }; >> >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >> Cc: "林志平" ; "linux-kernel" >> Sent: Thursday, May 06, 2010 3:09 PM >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>>在 2010年5月6日 下午2:48,hellohello 写道: >>>> >>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>> 以前没搞过linux,现在发现开头很费劲, >>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>> ## Transferring control to Linux (at address 00000000) ... >>> >>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>> 3> cuImage确实可以尝试 >>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>> 5> 可以自己写个simple uart打印一下信息定位问题 >>> >>> 请依次排查。 >>> >>> Cheers >>> Bruce >>> >>>> >>>> >>>> >>>> >>>> . >>>> >>>> ----- Original Message ----- >>>> From: "林志平" >>>> To: "linux-kernel" >>>> Sent: Thursday, May 06, 2010 11:38 AM >>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>> >>>> >>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>> 我感觉是我的dtb文件有点问题, >>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>> _______________________________________________ >>>>> Linux 内核开发中文邮件列表 >>>>> Linux-kernel在zh-kernel.org >>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>> _______________________________________________ >>>> Linux 内核开发中文邮件列表 >>>> Linux-kernel在zh-kernel.org >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>> Linux 内核开发中文社区: http://zh-kernel.org >>> > From hellohello008在163.com Thu May 6 17:23:49 2010 From: hellohello008在163.com (hellohello) Date: Thu, 6 May 2010 17:23:49 +0800 Subject: =?utf-8?B?UmU6IHUtYm9vdDEuMS4y54mI5pys5piv5ZCm5pSv5oyBZHRi55qE5Y+C?= =?utf-8?B?5pWw5Lyg6YCS5pa55byP?= References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> Message-ID: <041501caecfd$d656e360$9c1cbcc0@sfdomain.com> 不是,是8247, uboot里还是MMUoff的,可以点灯,调好了串口, 我是看介绍linux的书上写的内核映射到3Gb空间,以为在 ## Transferring control to Linux (at address 00000000) ... 之后,应该是内核跑起来了,如果调试,点灯程序要改,正在查 ----- Original Message ----- From: "Baojun Wang" To: "hellohello" Cc: "linux-kernel" Sent: Thursday, May 06, 2010 5:06 PM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > MPC82xx 启动的时候应该是MMU off的,这时候应该使用的是物理地址 > 你以前VA-PA一一对应,使用的是MPC85XX? > > 2010/5/6 hellohello : >> From: "vital" >>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >> 下面是u-boot里tftp内核到内存的运行过程: >> >> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >> => run ftp1 >> Trying FCC1 ETHERNET >> fcc_rbase 07ffb210 NetRxPackets 07ffbe4c >> fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 >> Using FCC1 ETHERNET device >> TFTP from server 192.168.1.66; our IP address is 192.168.1.1 >> Filename '/tftpboot/uImage'. >> Load address: 0x1000000 >> Loading: ################################################################# >> ################################ >> done >> Bytes transferred = 1419267 (15a803 hex) >> Trying FCC1 ETHERNET >> fcc_rbase 07ffb210 NetRxPackets 07ffbe4c >> fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 >> Using FCC1 ETHERNET device >> TFTP from server 192.168.1.66; our IP address is 192.168.1.1 >> Filename '/tftpboot/rootfs.ext2.gz.uboot'. >> Load address: 0x2000000 >> Loading: ################################################################# >> ################################################################# >> ################################################################# >> ################################################################# >> ############################ >> done >> Bytes transferred = 4220072 (4064a8 hex) >> Trying FCC1 ETHERNET >> fcc_rbase 07ffb210 NetRxPackets 07ffbe4c >> fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 >> Using FCC1 ETHERNET device >> TFTP from server 192.168.1.66; our IP address is 192.168.1.1 >> Filename '/tftpboot/mpc8272ads.dtb'. >> Load address: 0x400000 >> Loading: # >> done >> Bytes transferred = 12288 (3000 hex) >> ## Booting image at 01000000 ... >> Image Name: Linux-2.6.25 >> Image Type: PowerPC Linux Kernel Image (gzip compressed) >> Data Size: 1419203 Bytes = 1.4 MB >> Load Address: 00000000 >> Entry Point: 00000000 >> Verifying Checksum ... OK >> Uncompressing Kernel Image ... OK >> ## Current stack ends at 0x07BC4BF0 => set upper limit to 0x00800000 >> ## cmdline at 0x007FFF00 ... 0x007FFF38 >> bd address = 0x07BC4FAC >> memstart = 0x00000000 >> memsize = 0x08000000 >> flashstart = 0xFFF00000 >> flashsize = 0x00080000 >> flashoffset = 0x00033000 >> sramstart = 0x00000000 >> sramsize = 0x00000000 >> immr_base = 0xF0000000 >> bootflags = 0xF0010000 >> vco = 400 MHz >> sccfreq = 100 MHz >> brgfreq = 25 MHz >> intfreq = 400 MHz >> cpmfreq = 200 MHz >> busfreq = 100 MHz >> ethaddr = 08:00:C0:A8:01:01 >> eth1addr = 04:00:00:00:00:0B >> IP addr = 192.168.1.1 >> baudrate = 9600 bps >> Not skipping initrd >> ## Loading RAMDisk Image at 02000000 ... >> Image Name: uboot ext2 ramdisk rootfs >> Image Type: PowerPC Linux RAMDisk Image (gzip compressed) >> Data Size: 4220008 Bytes = 4 MB >> Load Address: 00000000 >> Entry Point: 00000000 >> Verifying Checksum ... OK >> Booting using the fdt at 0x400000 >> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >> Updating property 'timebase-frequency' = 01 7d 78 40 >> Updating property 'bus-frequency' = 05 f5 e1 00 >> Updating property 'clock-frequency' = 17 d7 84 00 >> Updating property 'bus-frequency' = 05 f5 e1 00 >> Updating property 'current-speed' = 00 00 25 80 >> Updating property 'clock-frequency' = 01 7d 78 40 >> ## Transferring control to Linux (at address 00000000) ... >> 这里就死掉了 >> >> >> >>> 5> 可以自己写个simple uart打印一下信息定位问题 >> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >> 还要做地址偏移,正在查这些资料。 >> >> >> >> >> 另外,下面是我用的dts文件 >> / { >> model = "MPC8272ADS"; >> compatible = "fsl,mpc8272ads"; >> #address-cells = <1>; >> #size-cells = <1>; >> >> cpus { >> #address-cells = <1>; >> #size-cells = <0>; >> >> PowerPC,8272在0 { >> device_type = "cpu"; >> reg = <0>; >> d-cache-line-size = ; >> i-cache-line-size = ; >> d-cache-size = ; >> i-cache-size = ; >> timebase-frequency = <0>; >> bus-frequency = <0>; >> clock-frequency = <0>; >> }; >> }; >> >> memory { >> device_type = "memory"; >> reg = <0 0>; >> }; >> >> soc在f0000000 { >> #address-cells = <1>; >> #size-cells = <1>; >> device_type = "soc"; >> compatible = "fsl,mpc8272", "fsl,pq2-soc"; >> ranges = <00000000 f0000000 00053000>; >> >> // Temporary -- will go away once kernel uses ranges for get_immrbase(). >> reg = ; >> >> cpm在119c0 { >> #address-cells = <1>; >> #size-cells = <1>; >> compatible = "fsl,mpc8272-cpm", "fsl,cpm2"; >> reg = <119c0 30>; >> ranges; >> >> muram在0 { >> #address-cells = <1>; >> #size-cells = <1>; >> ranges = <0 0 10000>; >> >> data在0 { >> compatible = "fsl,cpm-muram-data"; >> reg = <0 2000 9800 800>; >> }; >> }; >> >> brg在119f0 { >> compatible = "fsl,mpc8272-brg", >> "fsl,cpm2-brg", >> "fsl,cpm-brg"; >> reg = <119f0 10 115f0 10>; >> }; >> serial在11a82 { >> device_type = "serial"; >> compatible = "fsl,mpc8272-smc-uart", >> "fsl,cpm2-smc-uart"; >> reg = <11a82 10 87fc 1>; >> interrupts = <4 8>; >> interrupt-parent = <&PIC>; >> fsl,cpm-brg = <7>; >> fsl,cpm-command = <1d000000>; >> }; >> } >> } >> ... >> ... >> chosen { >> linux,stdout-path = "/soc/cpm/serial在11a82"; >> }; >> >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >> Cc: "林志平" ; "linux-kernel" >> Sent: Thursday, May 06, 2010 3:09 PM >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>>在 2010年5月6日 下午2:48,hellohello 写道: >>>> >>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>> 以前没搞过linux,现在发现开头很费劲, >>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>> ## Transferring control to Linux (at address 00000000) ... >>> >>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>> 3> cuImage确实可以尝试 >>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>> 5> 可以自己写个simple uart打印一下信息定位问题 >>> >>> 请依次排查。 >>> >>> Cheers >>> Bruce >>> >>>> >>>> >>>> >>>> >>>> . >>>> >>>> ----- Original Message ----- >>>> From: "林志平" >>>> To: "linux-kernel" >>>> Sent: Thursday, May 06, 2010 11:38 AM >>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>> >>>> >>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>> 我感觉是我的dtb文件有点问题, >>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>> _______________________________________________ >>>>> Linux 内核开发中文邮件列表 >>>>> Linux-kernel在zh-kernel.org >>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>> _______________________________________________ >>>> Linux 内核开发中文邮件列表 >>>> Linux-kernel在zh-kernel.org >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>> Linux 内核开发中文社区: http://zh-kernel.org >>> >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > From hellohello008在163.com Thu May 6 17:35:06 2010 From: hellohello008在163.com (hellohello) Date: Thu, 6 May 2010 17:35:06 +0800 Subject: =?utf-8?Q?Re:_=E5=85=B3=E4=BA=8E_'make_CONFIG=5FDEBUG=5FSECTIO?= =?utf-8?Q?N=5FMISMATCH=3Dy_=E9=97=AE=E9=A2=98?= References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> <20100504141953.GA13311@hack> <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> <20100505043439.GA4294@cr0.nay.redhat.com> Message-ID: <043701caecff$69f15640$9c1cbcc0@sfdomain.com> 谢谢两位的支持。 虽然没明白为何会报错“/bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file” 但我最后花了一个小时将ltib在redhat上重新装了一次, 从头到尾按顺序一步步又做了一遍, LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' make CONFIG_DEBUG_SECTION_MISMATCH=y uImage 能够进行下去,应该是“Américo Wang”说的编译环境问题。 接着编译器给出了 WARNING: vmlinux.o(.text+0x159450): Section mismatch in reference from the function move_device_tree ...... 的信息 google了一下,找到了patch方法, -static void move_device_tree(void) +static void __init move_device_tree(void) 现在总算先解决 了CONFIG_DEBUG_SECTION_MISMATCH问题。 ----- Original Message ----- From: "Amerigo Wang" To: "hellohello" Cc: "Américo Wang" ; "CyrusYzGTt" ; Sent: Wednesday, May 05, 2010 12:34 PM Subject: Re: 关于 'make CONFIG_DEBUG_SECTION_MISMATCH=y 问题 > On Wed, May 05, 2010 at 10:54:21AM +0800, hellohello wrote: >> >>> 如果不使用./ltib -c ,手动敲make ... menuconfig命令,如下所示,不会报错 >>> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig >>> scripts/kconfig/mconf arch/powerpc/Kconfig >>> 。。。出现内核配置界面。。。 >>> >>> 然而, 如果编译内核,我接着手动敲写下面的 make ... uImage命令,就会报错: >>> LTIB> make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage scripts/kconfig/conf -s arch/powerpc/Kconfig >>> /bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file >>> make[2]: *** [arch/powerpc/kernel/cpu_setup_6xx.o] Error 126 >>> make[1]: *** [arch/powerpc/kernel] Error 2 >>> make: *** [uImage] Error 2 >>> LTIB> > > 我没做过嵌入式,这看起来像是你的编译环境有问题,试试下面的命令输出什么: > > file scripts/basic/fixdep > > 或者运行一下make ..... mrproper之后再运行make ..... uImage。 > >> >> >>查看./ltib -c正常编译过程的打印输出, >>怀疑问题与在make ... uImage命令之前还执行的这4行语句有关,如下: >>+ '[' -f /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config ']' >>+ cp -f ./.config /home/xk/ltib-mpc8272ads-20080623/config/platform/mpc8272ads/linux_2.6.25_mpc8272_ads.config.dev >>+ '[' -n '' ']' >>+ '[' '%{kernel_series}' = 2.4 ']' >>+ make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' uImage >>scripts/kconfig/conf -s arch/powerpc/Kconfig >> >> >>但我没找到这四行语句来自哪个脚本,不知道'[' '%{kernel_series}' = 2.4 ']'是其什么作用,所以没法进展下去了。 >> > > 你可以看看是不是ltib的调试信息,我没使用过,不知道。 From vividfe在gmail.com Thu May 6 17:42:08 2010 From: vividfe在gmail.com (vital) Date: Thu, 6 May 2010 17:42:08 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> Message-ID: 在 2010年5月6日 下午5:13,hellohello 写道: > 谢谢回复 > ----- Original Message ----- > From: "vital" > To: "hellohello" >> [snip] >> >>> serial在11a82 { >>> device_type = "serial"; >>> compatible = "fsl,mpc8272-smc-uart", >>> "fsl,cpm2-smc-uart"; >> >> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >> >> Bruce > > > > -----8272ads板子是使用scc1做的调试口,我的板子是smc1做的, > 因此我对应修改了寄存器地址,中断号,cpm的命令,波特率brg号 > ,当时,还有个有疑问的地方就是你刚提到的, > compatible = "fsl,mpc8272-scc-uart", > "fsl,cpm2-scc-uart"; > 由于我不清楚这里是如何和驱动代码对应上的,在linux目录下搜不着 > 类似cpm2-scc-的代码,于是就简单的将scc字段改成了smc字段, > 是不是就是这里的问题阿? > Aha. arch/powerpc/boot/serial.c serial_console_init --> ....... dt_is_compatible(devp, "fsl,cpm2-scc-uart") || cpm_console_init ...... PowerPC Linux所有的硬件信息都来自dts,会因此生成platform_device,或者of_device,最后调用相应的驱动。 你改了这个名字,显然没有console可用。 但你可以dump __log_buf,从内存看到启动信息。 Bruce > > > > 下面是修改前后的对比 > /*****hello > serial在11a00 { > device_type = "serial"; > compatible = "fsl,mpc8272-scc-uart", > "fsl,cpm2-scc-uart"; > reg = <11a00 20 8000 100>; > interrupts = <28 8>; > interrupt-parent = <&PIC>; > fsl,cpm-brg = <1>; > fsl,cpm-command = <00800000>; > };*/ > > serial在11a82 { > device_type = "serial"; > compatible = "fsl,mpc8272-smc-uart", > "fsl,cpm2-smc-uart"; > reg = <11a82 10 87fc 1>; > interrupts = <4 8>; > interrupt-parent = <&PIC>; > fsl,cpm-brg = <7>; > fsl,cpm-command = <1d000000>; > }; > > > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > Sent: Thursday, May 06, 2010 4:43 PM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月6日 下午3:41,hellohello 写道: >>> From: "vital" >>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>> 下面是u-boot里tftp内核到内存的运行过程: >>> >>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>> => run ftp1 >> >> [snip] >> >>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>> Updating property 'timebase-frequency' = 01 7d 78 40 >>> Updating property 'bus-frequency' = 05 f5 e1 00 >>> Updating property 'clock-frequency' = 17 d7 84 00 >>> Updating property 'bus-frequency' = 05 f5 e1 00 >>> Updating property 'current-speed' = 00 00 25 80 >>> Updating property 'clock-frequency' = 01 7d 78 40 >>> ## Transferring control to Linux (at address 00000000) ... >>> 这里就死掉了 >> >> 假设你已经起来了kernel。 >> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >> >>> >>> >>> >>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>> 还要做地址偏移,正在查这些资料。 >> >> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >> >>> >>> >>> >>> >> [snip] >> >>> serial在11a82 { >>> device_type = "serial"; >>> compatible = "fsl,mpc8272-smc-uart", >>> "fsl,cpm2-smc-uart"; >> >> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >> >> Bruce >> >> >>> reg = <11a82 10 87fc 1>; >>> interrupts = <4 8>; >>> interrupt-parent = <&PIC>; >>> fsl,cpm-brg = <7>; >>> fsl,cpm-command = <1d000000>; >>> }; >>> } >>> } >>> ... >>> ... >>> chosen { >>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>> }; >>> >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>> Cc: "林志平" ; "linux-kernel" >>> Sent: Thursday, May 06, 2010 3:09 PM >>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>> >>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>> 以前没搞过linux,现在发现开头很费劲, >>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>> ## Transferring control to Linux (at address 00000000) ... >>>> >>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>> 3> cuImage确实可以尝试 >>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>> >>>> 请依次排查。 >>>> >>>> Cheers >>>> Bruce >>>> >>>>> >>>>> >>>>> >>>>> >>>>> . >>>>> >>>>> ----- Original Message ----- >>>>> From: "林志平" >>>>> To: "linux-kernel" >>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>> >>>>> >>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>> 我感觉是我的dtb文件有点问题, >>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>> _______________________________________________ >>>>>> Linux 内核开发中文邮件列表 >>>>>> Linux-kernel在zh-kernel.org >>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>> _______________________________________________ >>>>> Linux 内核开发中文邮件列表 >>>>> Linux-kernel在zh-kernel.org >>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>> >> From jiang.adam在gmail.com Thu May 6 17:45:40 2010 From: jiang.adam在gmail.com (Adam Jiang) Date: Thu, 6 May 2010 18:45:40 +0900 Subject: =?GB2312?B?UmU6ILnY09ogJ21ha2UgQ09ORklHX0RFQlVHX1NFQ1RJT05fTUlTTUFUQ0g9eSDOyg==?= =?GB2312?B?zOI=?= In-Reply-To: <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> Message-ID: 2010/5/4 hellohello : > 谢谢,不过我修改了.config文件还是不行,自动被改恢复了。 > > 我是在ltib的shell下执行 -c 选项进行配置和内核的编译的 > LTIB> ./ltib -c > > 打印到下面menuconfig的时候,出现内核配置界面 > + '[' -n y -o -n '' ']' > + make ARCH=powerpc CROSS_COMPILE= 'HOSTCC=/usr/bin/gcc -B/usr/bin//' menuconfig > scripts/kconfig/mconf arch/powerpc/Kconfig 其他问题似乎不太清楚,但是你的命令行参数可能是不正确的。应该如下才是: make menuconfig make ARCH=powerpc CROSS_COMPILE='' menuconfig需要的仅仅是host的编译工具,只有在真正编译内核的时候才需要使用cross_toolchain. /大头阿当 -- Adam Jiang ----------------------------------- e-mail:jiang.adam在gmail.com http://www.adamjiang.com ----------------------------------- From vividfe在gmail.com Thu May 6 17:45:52 2010 From: vividfe在gmail.com (vital) Date: Thu, 6 May 2010 17:45:52 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <041501caecfd$d656e360$9c1cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041501caecfd$d656e360$9c1cbcc0@sfdomain.com> Message-ID: 在 2010年5月6日 下午5:23,hellohello 写道: > 不是,是8247, > uboot里还是MMUoff的,可以点灯,调好了串口, 不得已调试启动过程在汇编的时候你可以用点灯,其实串口也可以调试汇编。 自己写个early printk吧。 Bruce > 我是看介绍linux的书上写的内核映射到3Gb空间,以为在 > ## Transferring control to Linux (at address 00000000) ... > 之后,应该是内核跑起来了,如果调试,点灯程序要改,正在查 > > ----- Original Message ----- > From: "Baojun Wang" > To: "hellohello" > Cc: "linux-kernel" > Sent: Thursday, May 06, 2010 5:06 PM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >> MPC82xx 启动的时候应该是MMU off的,这时候应该使用的是物理地址 >> 你以前VA-PA一一对应,使用的是MPC85XX? >> >> 2010/5/6 hellohello : >>> From: "vital" >>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>> 下面是u-boot里tftp内核到内存的运行过程: >>> >>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>> => run ftp1 >>> Trying FCC1 ETHERNET >>> fcc_rbase 07ffb210 NetRxPackets 07ffbe4c >>> fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 >>> Using FCC1 ETHERNET device >>> TFTP from server 192.168.1.66; our IP address is 192.168.1.1 >>> Filename '/tftpboot/uImage'. >>> Load address: 0x1000000 >>> Loading: ################################################################# >>> ################################ >>> done >>> Bytes transferred = 1419267 (15a803 hex) >>> Trying FCC1 ETHERNET >>> fcc_rbase 07ffb210 NetRxPackets 07ffbe4c >>> fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 >>> Using FCC1 ETHERNET device >>> TFTP from server 192.168.1.66; our IP address is 192.168.1.1 >>> Filename '/tftpboot/rootfs.ext2.gz.uboot'. >>> Load address: 0x2000000 >>> Loading: ################################################################# >>> ################################################################# >>> ################################################################# >>> ################################################################# >>> ############################ >>> done >>> Bytes transferred = 4220072 (4064a8 hex) >>> Trying FCC1 ETHERNET >>> fcc_rbase 07ffb210 NetRxPackets 07ffbe4c >>> fcc_tbase 07ffb230 NetRxPackets[0] 07ffcb00 >>> Using FCC1 ETHERNET device >>> TFTP from server 192.168.1.66; our IP address is 192.168.1.1 >>> Filename '/tftpboot/mpc8272ads.dtb'. >>> Load address: 0x400000 >>> Loading: # >>> done >>> Bytes transferred = 12288 (3000 hex) >>> ## Booting image at 01000000 ... >>> Image Name: Linux-2.6.25 >>> Image Type: PowerPC Linux Kernel Image (gzip compressed) >>> Data Size: 1419203 Bytes = 1.4 MB >>> Load Address: 00000000 >>> Entry Point: 00000000 >>> Verifying Checksum ... OK >>> Uncompressing Kernel Image ... OK >>> ## Current stack ends at 0x07BC4BF0 => set upper limit to 0x00800000 >>> ## cmdline at 0x007FFF00 ... 0x007FFF38 >>> bd address = 0x07BC4FAC >>> memstart = 0x00000000 >>> memsize = 0x08000000 >>> flashstart = 0xFFF00000 >>> flashsize = 0x00080000 >>> flashoffset = 0x00033000 >>> sramstart = 0x00000000 >>> sramsize = 0x00000000 >>> immr_base = 0xF0000000 >>> bootflags = 0xF0010000 >>> vco = 400 MHz >>> sccfreq = 100 MHz >>> brgfreq = 25 MHz >>> intfreq = 400 MHz >>> cpmfreq = 200 MHz >>> busfreq = 100 MHz >>> ethaddr = 08:00:C0:A8:01:01 >>> eth1addr = 04:00:00:00:00:0B >>> IP addr = 192.168.1.1 >>> baudrate = 9600 bps >>> Not skipping initrd >>> ## Loading RAMDisk Image at 02000000 ... >>> Image Name: uboot ext2 ramdisk rootfs >>> Image Type: PowerPC Linux RAMDisk Image (gzip compressed) >>> Data Size: 4220008 Bytes = 4 MB >>> Load Address: 00000000 >>> Entry Point: 00000000 >>> Verifying Checksum ... OK >>> Booting using the fdt at 0x400000 >>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>> Updating property 'timebase-frequency' = 01 7d 78 40 >>> Updating property 'bus-frequency' = 05 f5 e1 00 >>> Updating property 'clock-frequency' = 17 d7 84 00 >>> Updating property 'bus-frequency' = 05 f5 e1 00 >>> Updating property 'current-speed' = 00 00 25 80 >>> Updating property 'clock-frequency' = 01 7d 78 40 >>> ## Transferring control to Linux (at address 00000000) ... >>> 这里就死掉了 >>> >>> >>> >>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>> 还要做地址偏移,正在查这些资料。 >>> >>> >>> >>> >>> 另外,下面是我用的dts文件 >>> / { >>> model = "MPC8272ADS"; >>> compatible = "fsl,mpc8272ads"; >>> #address-cells = <1>; >>> #size-cells = <1>; >>> >>> cpus { >>> #address-cells = <1>; >>> #size-cells = <0>; >>> >>> PowerPC,8272在0 { >>> device_type = "cpu"; >>> reg = <0>; >>> d-cache-line-size = ; >>> i-cache-line-size = ; >>> d-cache-size = ; >>> i-cache-size = ; >>> timebase-frequency = <0>; >>> bus-frequency = <0>; >>> clock-frequency = <0>; >>> }; >>> }; >>> >>> memory { >>> device_type = "memory"; >>> reg = <0 0>; >>> }; >>> >>> soc在f0000000 { >>> #address-cells = <1>; >>> #size-cells = <1>; >>> device_type = "soc"; >>> compatible = "fsl,mpc8272", "fsl,pq2-soc"; >>> ranges = <00000000 f0000000 00053000>; >>> >>> // Temporary -- will go away once kernel uses ranges for get_immrbase(). >>> reg = ; >>> >>> cpm在119c0 { >>> #address-cells = <1>; >>> #size-cells = <1>; >>> compatible = "fsl,mpc8272-cpm", "fsl,cpm2"; >>> reg = <119c0 30>; >>> ranges; >>> >>> muram在0 { >>> #address-cells = <1>; >>> #size-cells = <1>; >>> ranges = <0 0 10000>; >>> >>> data在0 { >>> compatible = "fsl,cpm-muram-data"; >>> reg = <0 2000 9800 800>; >>> }; >>> }; >>> >>> brg在119f0 { >>> compatible = "fsl,mpc8272-brg", >>> "fsl,cpm2-brg", >>> "fsl,cpm-brg"; >>> reg = <119f0 10 115f0 10>; >>> }; >>> serial在11a82 { >>> device_type = "serial"; >>> compatible = "fsl,mpc8272-smc-uart", >>> "fsl,cpm2-smc-uart"; >>> reg = <11a82 10 87fc 1>; >>> interrupts = <4 8>; >>> interrupt-parent = <&PIC>; >>> fsl,cpm-brg = <7>; >>> fsl,cpm-command = <1d000000>; >>> }; >>> } >>> } >>> ... >>> ... >>> chosen { >>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>> }; >>> >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>> Cc: "林志平" ; "linux-kernel" >>> Sent: Thursday, May 06, 2010 3:09 PM >>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>> >>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>> 以前没搞过linux,现在发现开头很费劲, >>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>> ## Transferring control to Linux (at address 00000000) ... >>>> >>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>> 3> cuImage确实可以尝试 >>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>> >>>> 请依次排查。 >>>> >>>> Cheers >>>> Bruce >>>> >>>>> >>>>> >>>>> >>>>> >>>>> . >>>>> >>>>> ----- Original Message ----- >>>>> From: "林志平" >>>>> To: "linux-kernel" >>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>> >>>>> >>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>> 我感觉是我的dtb文件有点问题, >>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>> _______________________________________________ >>>>>> Linux 内核开发中文邮件列表 >>>>>> Linux-kernel在zh-kernel.org >>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>> _______________________________________________ >>>>> Linux 内核开发中文邮件列表 >>>>> Linux-kernel在zh-kernel.org >>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>> >>> _______________________________________________ >>> Linux 内核开发中文邮件列表 >>> Linux-kernel在zh-kernel.org >>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>> Linux 内核开发中文社区: http://zh-kernel.org >> > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From jiang.adam在gmail.com Thu May 6 17:49:14 2010 From: jiang.adam在gmail.com (Adam Jiang) Date: Thu, 6 May 2010 18:49:14 +0900 Subject: =?GB2312?B?UmU6ILnY09ogJ21ha2UgQ09ORklHX0RFQlVHX1NFQ1RJT05fTUlTTUFUQ0g9eSDOyg==?= =?GB2312?B?zOI=?= In-Reply-To: <01a201caec17$c3a035a0$9c1cbcc0@sfdomain.com> References: <00a701caeb6e$d0dd89b0$9c1cbcc0@sfdomain.com> <4BDFF2C7.9090204@gmail.com> <00be01caeb7a$71286290$9c1cbcc0@sfdomain.com> <20100504141953.GA13311@hack> <013601caebfe$448b4980$9c1cbcc0@sfdomain.com> <20100505043439.GA4294@cr0.nay.redhat.com> <01a201caec17$c3a035a0$9c1cbcc0@sfdomain.com> Message-ID: 2010/5/5 hellohello : > > LTIB> file scripts/basic/fixdep > scripts/basic/fixdep: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped > > 从上面看fixdep是host X86上的程序,这里为何会报错“/bin/sh: line 1: scripts/basic/fixdep: cannot execute binary file”? 看到这里清楚了,你把工具链搞混了。menuconfig或者oldconfig的时候不需要cross_toolchain,这个目标仅仅依赖于host的编译工具链。 Americo Wang提到的用命令行传递CONFIG宏,需要在真正编译内核的时候传递。 /大头阿当 -- Adam Jiang ----------------------------------- e-mail:jiang.adam在gmail.com http://www.adamjiang.com ----------------------------------- From abutter.gao在gmail.com Thu May 6 21:07:51 2010 From: abutter.gao在gmail.com (Gao Ya'nan) Date: Thu, 6 May 2010 21:07:51 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 还没有升级到新的版本啊? 在 2010年5月6日 上午11:38,林志平 写道: > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > 我感觉是我的dtb文件有点问题, > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From zhigang.gong在gmail.com Fri May 7 10:56:24 2010 From: zhigang.gong在gmail.com (zhigang gong) Date: Fri, 7 May 2010 10:56:24 +0800 Subject: =?GB2312?B?UmU6IMfrzspzb2NrZXQgcmF3ILGozsTI57rO1ri2qL3Tv9q3osvN?= In-Reply-To: References: Message-ID: ����DHCPЭ��� DHCP OFFER�����㲥���essionӦ���lient ����ģ�Ȼ��ver�ͻ���lient�ĵ�����ᷢ�����FFER��client�����϶������㲥�����client������������P���������֮ǰ��client���ᷢ���HCPЭ����erver restart���clientҲ����ʲô������ʹ���������HCP OFFER��client�� �²��ϣ���DHCP server ��������Ȼ���������. ��������������һ̨����HCP server�ʵ�HA��High Availability��������£� DHCP server failover �������������Ҫ��olution�� ���һ����������� http://publib.boulder.ibm.com/infocenter/clresctr/vxrx/index.jsp?topic=/com.ibm.cluster.csm16.admin.doc/am7ad_dhcpfaillnx.html 2010/5/6 zhangleo > ����ظ���ʵ����Ǵ��hcp server�� ���er�����client�����p�����������������㲥һ��p > offer�Ϣʹclient�����dhcp > discovery�����㲥�������ˣ��ͻ��˸�����ģ���dhcp��pЭ����ʱ��ent�˻�û�bind����Ķ˿ڡ� > > ����������������ģ� > ------------------------------ > Date: Thu, 6 May 2010 14:29:08 +0800 > > Subject: Re: ��socket raw ����������ӿڷ�� > From: zhigang.gong在gmail.com > > To: zoleooo在hotmail.com > CC: linux-kernel在zh-kernel.org > > man 7 raw, > > ���Կ���������� > If IP_HDRINCL is specified and the IP header has a non-zero destination > address then the destination address of the socket is used to route the > packet. When MSG_DONTROUTE is specified, the destination address should > refer to a local interface, otherwise a routing table lookup is done anyway > but gatewayed routes are ignored. > > ��������> ���route�ķ�ʽ��һ����MSG_DONTROUTE���������P���Ӧ��DZ���an�ĵ����kernel IP layer > �����route table lookup,ֻ����� hop�·�������� > > �ڶ���û���MSG_DONTROUTE, ���P��ĵ��������Ϊ������������route table > lookup�ģ������·��Ҳ�ᷢ���·���� > > �ɼ������l �����ayer 3��������ģ��·�����ȷ����ĸ�erface�����ݳ�� > ���Ļ�������ѡ���һ������8����p��������·����Ҫȥ����ĵ���������뷨������Ӧ��nterface. > > �һ���packet socket Ȼ��d��ij��erface��� man 7 packet > ��Կ�����ڡ������Բο�libpcap����> iface_bind() ��ocket��ָ���Ķ˿ڣ� > pcap_inject_linux() �Ӱ󶨵Ķ˿ڷ����������Ļ�����ernet headerҲ�Ҫ����׼����ˡ� > > > > > > 2010/4/30 zhangleo > > > ������p��� SOCK_RAW��ʽ������8���ӿڣ����ʱ�ָ��ijһ��ڷ������ϣ��������ӿڷ���� > �ʵ�ô�� ��β��_________________________________________________________________ > һ��Ƭ��԰רD�DWindows Live�Ƭ�Ŀɰ��Ƶ�� > http://windowslivesky.spaces.live.com/blog/cns!5892B6048E2498BD!889.entry > _______________________________________________ > Linux ��˿����������� Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux ��˿��������� http://zh-kernel.org > > > > ------------------------------ > ����Ӧ�����������һ����-���,���ͼƬÿ���Ŷ! ������� > From zoleooo在hotmail.com Fri May 7 16:22:18 2010 From: zoleooo在hotmail.com (zhangleo) Date: Fri, 7 May 2010 08:22:18 +0000 Subject: =?gb2312?B?1+7Qwmtlcm5lbLDmsb4=?= =?gb2312?B?yse38dans9a3wHRjcCBy?= =?gb2312?B?c3QgYXR0YWNro78=?= Message-ID: 看到linux2.6.32最新修改了tcp syn cookies相关的代码,不清楚是否已经支持防tcp reset攻击。 _________________________________________________________________ 约会说不清地方?来试试微软地图最新msn互动功能! http://ditu.live.com/?form=TL&swm=1 From xiyou.wangcong在gmail.com Fri May 7 17:27:12 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Fri, 7 May 2010 17:27:12 +0800 Subject: =?utf-8?B?5pyA5pawa2VybmVs54mI5pys5piv?= =?utf-8?B?5ZCm5pSv5oyB6ZiydGNwIHJzdCBhdHRhY2vvvJ8=?= In-Reply-To: References: Message-ID: <20100507092712.GB6501@cr0.nay.redhat.com> On Fri, May 07, 2010 at 08:22:18AM +0000, zhangleo wrote: > >看到linux2.6.32最新修改了tcp syn cookies相关的代码,不清楚是否已经支持防tcp reset攻击。 > 据我了解,linux还没有,FreeBSD好像有,其实就是防止tcp序列号被轻易猜到。 Linux之所以没有是因为有些工具,比如tcpkill,可以合理地利用tcp rst。 From zoleooo在hotmail.com Fri May 7 17:25:02 2010 From: zoleooo在hotmail.com (zhangleo) Date: Fri, 7 May 2010 09:25:02 +0000 Subject: =?gb2312?B?UkU6INfu0MJrZXJu?= =?gb2312?B?ZWyw5rG+yse38dans9a3wHQ=?= =?gb2312?Q?cp_rst_att?= =?gb2312?B?YWNro78=?= In-Reply-To: <20100507092712.GB6501@cr0.nay.redhat.com> References: , <20100507092712.GB6501@cr0.nay.redhat.com> Message-ID: FBSD如何实现,控制rst报文的数量or something else? > Date: Fri, 7 May 2010 17:27:12 +0800 > From: xiyou.wangcong在gmail.com > To: zoleooo在hotmail.com > CC: linux-kernel在zh-kernel.org > Subject: Re: 最新kernel版本是否支持防tcp rst attack? > > On Fri, May 07, 2010 at 08:22:18AM +0000, zhangleo wrote: > > > >看到linux2.6.32最新修改了tcp syn cookies相关的代码,不清楚是否已经支持防tcp reset攻击。 > > > > 据我了解,linux还没有,FreeBSD好像有,其实就是防止tcp序列号被轻易猜到。 > Linux之所以没有是因为有些工具,比如tcpkill,可以合理地利用tcp rst。 _________________________________________________________________ SkyDrive电子画册,带你领略精彩照片,分享“美”时“美”刻! http://www.windowslive.cn/campaigns/e-magazine/ngmchina/?a=c From zoleooo在hotmail.com Fri May 7 17:26:09 2010 From: zoleooo在hotmail.com (zhangleo) Date: Fri, 7 May 2010 09:26:09 +0000 Subject: =?gb2312?B?UkU6INfu0MJrZXJu?= =?gb2312?B?ZWyw5rG+IMrHt/HWp7PWt8A=?= =?gb2312?Q?tcp_rst_at?= =?gb2312?B?dGFja6O/?= In-Reply-To: <4be3d391.9713f30a.0a1c.ffffa0d6@mx.google.com> References: <4be3d391.9713f30a.0a1c.ffffa0d6@mx.google.com> Message-ID: rst报文对断链还是有用处的,不能简单丢弃,你能不响应一个正确的rst报文么? From: liuzhuan23在gmail.com To: zoleooo在hotmail.com; linux-kernel在zh-kernel.org Subject: Re: 最新kernel版本 是否支持防tcp rst attack? Date: Fri, 7 May 2010 16:47:07 +0800 这个有吗? 其实把RST丢掉也未尝不是一种办法。。。。 07/05/10 16:22:18, zhangleo : 看到linux2.6.32最新修改了tcp syn cookies相关的代码,不清楚是否已经支持防tcp reset攻击。 _________________________________________________________________ 约会说不清地方?来试试微软地图最新msn互动功能! http://ditu.live.com/?form=TL&swm=1 _______________________________________________ Linux 内核开发中文邮件列表 Linux-kernel在zh-kernel.org http://zh-kernel.org/mailman/listinfo/linux-kernel Linux 内核开发中文社区: http://zh-kernel.org _________________________________________________________________ MSN十年回馈,每位用户可免费获得价值25元的卡巴斯基反病毒软件2010激活码,快来领取! http://kaba.msn.com.cn/?k=1 From xiaosuo在gmail.com Fri May 7 17:34:05 2010 From: xiaosuo在gmail.com (Changli Gao) Date: Fri, 7 May 2010 17:34:05 +0800 Subject: =?GB2312?B?UmU6INfu0MJrZXJuZWyw5rG+yse38dans9a3wHRjcCByc3QgYXR0YWNr?= =?GB2312?B?o78=?= In-Reply-To: <20100507092712.GB6501@cr0.nay.redhat.com> References: <20100507092712.GB6501@cr0.nay.redhat.com> Message-ID: 2010/5/7 Américo Wang : > On Fri, May 07, 2010 at 08:22:18AM +0000, zhangleo wrote: >> >>看到linux2.6.32最新修改了tcp syn cookies相关的代码,不清楚是否已经支持防tcp reset攻击。 >> > > 据我了解,linux还没有,FreeBSD好像有,其实就是防止tcp序列号被轻易猜到。 > Linux之所以没有是因为有些工具,比如tcpkill,可以合理地利用tcp rst。 static inline __u32 tcp_v4_init_sequence(struct sk_buff *skb) { return secure_tcp_sequence_number(ip_hdr(skb)->daddr, ip_hdr(skb)->saddr, tcp_hdr(skb)->dest, tcp_hdr(skb)->source); } _u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr, __be16 sport, __be16 dport) { __u32 seq; __u32 hash[4]; struct keydata *keyptr = get_keyptr(); /* * Pick a unique starting offset for each TCP connection endpoints * (saddr, daddr, sport, dport). * Note that the words are placed into the starting vector, which is * then mixed with a partial MD4 over random data. */ hash[0] = (__force u32)saddr; hash[1] = (__force u32)daddr; hash[2] = ((__force u16)sport << 16) + (__force u16)dport; hash[3] = keyptr->secret[11]; seq = half_md4_transform(hash, keyptr->secret) & HASH_MASK; seq += keyptr->count; half_md4_transfrom()还不够安全? -- Regards, Changli Gao(xiaosuo在gmail.com) From xiyou.wangcong在gmail.com Fri May 7 17:54:33 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Fri, 7 May 2010 17:54:33 +0800 Subject: =?utf-8?B?5pyA5pawa2VybmVs54mI5pys5piv?= =?utf-8?B?5ZCm5pSv5oyB6ZiydGNwIHJzdCBhdHRhY2vvvJ8=?= In-Reply-To: References: <20100507092712.GB6501@cr0.nay.redhat.com> Message-ID: <20100507095433.GC6501@cr0.nay.redhat.com> On Fri, May 07, 2010 at 05:34:05PM +0800, Changli Gao wrote: >half_md4_transfrom()还不够安全? 这看你如何定义安全,反正tcpkill是可以正常工作的。 我没看tcpkill的源代码,只要它使用的还是tcp序列号猜解,这里的安全性恐怕就不会够。 From gongfan193在gmail.com Fri May 7 18:03:16 2010 From: gongfan193在gmail.com (Drunkard Zhang) Date: Fri, 7 May 2010 18:03:16 +0800 Subject: =?UTF-8?B?UmU6IOacgOaWsGtlcm5lbOeJiOacrOaYr+WQpuaUr+aMgemYsnRjcCByc3QgYXR0YWNr?= =?UTF-8?B?77yf?= In-Reply-To: <20100507095433.GC6501@cr0.nay.redhat.com> References: <20100507092712.GB6501@cr0.nay.redhat.com> <20100507095433.GC6501@cr0.nay.redhat.com> Message-ID: 在 2010年5月7日 下午5:54,Américo Wang 写道: > On Fri, May 07, 2010 at 05:34:05PM +0800, Changli Gao wrote: > >half_md4_transfrom()还不够安全? > > 这看你如何定义安全,反正tcpkill是可以正常工作的。 > 我没看tcpkill的源代码,只要它使用的还是tcp序列号猜解,这里的安全性恐怕就不会够。 > > > tcpkill利用的不是tail /proc/net/nf_conntrack ?我觉得tcpkill只要能 把TCP连接从netfilter连接跟踪列表里踢出就行了,如果他还想继续 和本机的连接,就必须重新建立,因为原来的会话已经断了。 我还没看源码,只是推测;=) From xiyou.wangcong在gmail.com Fri May 7 18:18:56 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Fri, 7 May 2010 18:18:56 +0800 Subject: =?utf-8?B?5pyA5pawa2VybmVs54mI5pys5piv?= =?utf-8?B?5ZCm5pSv5oyB6ZiydGNwIHJzdCBhdHRhY2vvvJ8=?= In-Reply-To: References: <20100507092712.GB6501@cr0.nay.redhat.com> <20100507095433.GC6501@cr0.nay.redhat.com> Message-ID: <20100507101856.GA6847@cr0.nay.redhat.com> On Fri, May 07, 2010 at 06:03:16PM +0800, Drunkard Zhang wrote: >在 2010年5月7日 下午5:54,Américo Wang 写道: > >> On Fri, May 07, 2010 at 05:34:05PM +0800, Changli Gao wrote: >> >half_md4_transfrom()还不够安全? >> >> 这看你如何定义安全,反正tcpkill是可以正常工作的。 >> 我没看tcpkill的源代码,只要它使用的还是tcp序列号猜解,这里的安全性恐怕就不会够。 >> >> >> tcpkill利用的不是tail /proc/net/nf_conntrack ?我觉得tcpkill只要能 >把TCP连接从netfilter连接跟踪列表里踢出就行了,如果他还想继续 >和本机的连接,就必须重新建立,因为原来的会话已经断了。 > >我还没看源码,只是推测;=) 我最后一次看tcpkill的文档是说它用的tcp序列号猜解。;) 现在来看,tcpkill似乎没多大必要存在了,我们有其它方式去中断tcp连接, 我们也有tcp keepalive。 不过应该不仅仅是tcpkill使用了这种手法。。。 From xiaosuo在gmail.com Fri May 7 18:57:01 2010 From: xiaosuo在gmail.com (Changli Gao) Date: Fri, 7 May 2010 18:57:01 +0800 Subject: =?GB2312?B?UmU6INfu0MJrZXJuZWyw5rG+yse38dans9a3wHRjcCByc3QgYXR0YWNr?= =?GB2312?B?o78=?= In-Reply-To: <20100507101856.GA6847@cr0.nay.redhat.com> References: <20100507092712.GB6501@cr0.nay.redhat.com> <20100507095433.GC6501@cr0.nay.redhat.com> <20100507101856.GA6847@cr0.nay.redhat.com> Message-ID: 2010/5/7 Américo Wang : > On Fri, May 07, 2010 at 06:03:16PM +0800, Drunkard Zhang wrote: >>在 2010年5月7日 下午5:54,Américo Wang 写道: >> >>> On Fri, May 07, 2010 at 05:34:05PM +0800, Changli Gao wrote: >>> >half_md4_transfrom()还不够安全? >>> >>> 这看你如何定义安全,反正tcpkill是可以正常工作的。 >>> 我没看tcpkill的源代码,只要它使用的还是tcp序列号猜解,这里的安全性恐怕就不会够。 >>> >>> >>> tcpkill利用的不是tail /proc/net/nf_conntrack ?我觉得tcpkill只要能 >>把TCP连接从netfilter连接跟踪列表里踢出就行了,如果他还想继续 >>和本机的连接,就必须重新建立,因为原来的会话已经断了。 >> >>我还没看源码,只是推测;=) > > 我最后一次看tcpkill的文档是说它用的tcp序列号猜解。;) > 应该是抓包吧?如果都能转到包,序列号也就不用推测了。就像GFW一样。 -- Regards, Changli Gao(xiaosuo在gmail.com) From hellohello008在163.com Fri May 7 19:22:59 2010 From: hellohello008在163.com (hellohello) Date: Fri, 7 May 2010 19:22:59 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> Message-ID: <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> ----- Original Message ----- From: "vital" To: "hellohello" Cc: "林志平" ; "linux-kernel" Sent: Thursday, May 06, 2010 5:42 PM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >在 2010年5月6日 下午5:13,hellohello 写道: >> 谢谢回复 >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >>> [snip] ....... > > 但你可以dump __log_buf,从内存看到启动信息。 > >> ========== 你的这个方法调试起来挺管用,我追踪到了 start_kernel() .... init_IRQ(); printk(KERN_DEBUG "init_IRQ\n"); pidhash_init(); printk(KERN_DEBUG "pidhash_init\n"); "init_IRQ\n"每次都能打印出来,但 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 这么初步看来应该是init_IRQ(); 函数执行后引起的死机了,检查中。 >> >> >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >> Cc: "林志平" ; "linux-kernel" >> Sent: Thursday, May 06, 2010 4:43 PM >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>>在 2010年5月6日 下午3:41,hellohello 写道: >>>> From: "vital" >>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>> 下面是u-boot里tftp内核到内存的运行过程: >>>> >>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>> => run ftp1 >>> >>> [snip] >>> >>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>> Updating property 'current-speed' = 00 00 25 80 >>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>> ## Transferring control to Linux (at address 00000000) ... >>>> 这里就死掉了 >>> >>> 假设你已经起来了kernel。 >>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>> >>>> >>>> >>>> >>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>> 还要做地址偏移,正在查这些资料。 >>> >>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>> >>>> >>>> >>>> >>>> >>> [snip] >>> >>>> serial在11a82 { >>>> device_type = "serial"; >>>> compatible = "fsl,mpc8272-smc-uart", >>>> "fsl,cpm2-smc-uart"; >>> >>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>> >>> Bruce >>> >>> >>>> reg = <11a82 10 87fc 1>; >>>> interrupts = <4 8>; >>>> interrupt-parent = <&PIC>; >>>> fsl,cpm-brg = <7>; >>>> fsl,cpm-command = <1d000000>; >>>> }; >>>> } >>>> } >>>> ... >>>> ... >>>> chosen { >>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>> }; >>>> >>>> ----- Original Message ----- >>>> From: "vital" >>>> To: "hellohello" >>>> Cc: "林志平" ; "linux-kernel" >>>> Sent: Thursday, May 06, 2010 3:09 PM >>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>> >>>> >>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>> >>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>> >>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>> 3> cuImage确实可以尝试 >>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>> >>>>> 请依次排查。 >>>>> >>>>> Cheers >>>>> Bruce >>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> . >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "林志平" >>>>>> To: "linux-kernel" >>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>> >>>>>> >>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>> _______________________________________________ >>>>>>> Linux 内核开发中文邮件列表 >>>>>>> Linux-kernel在zh-kernel.org >>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>> _______________________________________________ >>>>>> Linux 内核开发中文邮件列表 >>>>>> Linux-kernel在zh-kernel.org >>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>> >>> > From dragonlinux在gmail.com Fri May 7 21:55:51 2010 From: dragonlinux在gmail.com (yao zhao) Date: Fri, 7 May 2010 09:55:51 -0400 Subject: 8572 vs 8641D Message-ID: Hi, Anyone is familiar with mpc8572 and mpc8641D. Is there any tricky in mpc8572's tlb flush? thanks, yao From shikonggui在gmail.com Fri May 7 22:00:30 2010 From: shikonggui在gmail.com (shikonggui) Date: Fri, 7 May 2010 22:00:30 +0800 Subject: =?gb2312?B?udjT2lggyKjP3g==?= Message-ID: <201005072200276604649@gmail.com> 大家好,我是新人. 想问个问题.为什么进入目录需要 x 权限? 试了试, # mkdir fortest1 # chmod a-x fortest1 # ls fortest1 ... 头几行显示错误,但最后一行还是会列出此目录下的所有文件,很奇怪,不是不能搜索目录么? # cd fortest1 ... 这里报错,显示权限错误 这是为什么?为什么看目录文件内容(搜索)不是用READ权限而要用X权限? 还有 cd 命令为什么也受X 权限影响? 这个X权限到底有什么深层意义? 谢谢啦 -------------- From adam8157在gmail.com Fri May 7 22:19:04 2010 From: adam8157在gmail.com (Adam Lee) Date: Fri, 7 May 2010 22:19:04 +0800 Subject: =?utf-8?B?5YWz5LqOWCDmnYPpmZA=?= In-Reply-To: <201005072200276604649@gmail.com> References: <201005072200276604649@gmail.com> Message-ID: <20100507141904.GA1920@debian> x实际上赋予了打开文件夹的文件描述符的权利, 你直接ls能看到的只是读文件描述符, 具体的数据你不打开, 不去读里面的各个文件描述符是读不出来的. On Fri, May 07, 2010 at 10:00:30PM +0800, shikonggui wrote: > 大家好,我是新人. > > 想问个问题.为什么进入目录需要 x 权限? > 试了试, > # mkdir fortest1 > # chmod a-x fortest1 > # ls fortest1 > ... 头几行显示错误,但最后一行还是会列出此目录下的所有文件,很奇怪,不是不能搜索目录么? > # cd fortest1 > ... 这里报错,显示权限错误 > > > 这是为什么?为什么看目录文件内容(搜索)不是用READ权限而要用X权限? > 还有 cd 命令为什么也受X 权限影响? > 这个X权限到底有什么深层意义? > > 谢谢啦 > > -------------- > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From aleaxander在gmail.com Sat May 8 01:05:32 2010 From: aleaxander在gmail.com (Liu Aleaxander) Date: Sat, 8 May 2010 01:05:32 +0800 Subject: =?GB2312?B?UmU6ILnY09pYIMioz94=?= In-Reply-To: <201005072200276604649@gmail.com> References: <201005072200276604649@gmail.com> Message-ID: 2010/5/7 shikonggui > 大家好,我是新人. > > 想问个问题.为什么进入目录需要 x 权限? > 试了试, > # mkdir fortest1 > # chmod a-x fortest1 > # ls fortest1 > ... 头几行显示错误,但最后一行还是会列出此目录下的所有文件,很奇怪,不是不能搜索目录么? > # cd fortest1 > ... 这里报错,显示权限错误 > > > 这是为什么?为什么看目录文件内容(搜索)不是用READ权限而要用X权限? > 还有 cd 命令为什么也受X 权限影响? > 这个X权限到底有什么深层意义? > 首先, 你运行的应该不是ls命令, 很有可能是 '/bin/ls --color' 之类的, 你可以通过 alias ls查看。 在linux下, 目录也是文件 , 因此, 理论上说目录只要有 r 权限就可以获得它里面的所有目录项。 不信你可以运行如下命令试试: $ /bin/ls fortest1 # 注意, 这里是/bin/ls 这也就说明了你的第一个问题, 即使前面显示错误信息, 也可以列出目录下的所有文件的原因。 第二, 在linux下, x 表示该文件可以执行, 但对于目录来说, 却代表可以进入该目录访问(请注意 access 与 list 的区别)它下面的目录项, cd 要进入该目录, 自然需要 x 权限 。 接下来就说明为什么会有那些错误信息。 就如我刚才说所, 你运行的应该是 /bin/ls --color, 带了个 --color 参数。 你也应该注意到了, 不同类型的文件, 其文件名会用不同的颜色显示, 这就是--color参数的功能。 但若要正确给一个文件的文件名着色, 那就得知道该文件的信息, 如文件可以执行与否(主要是检测这个), 就自然得访问该文件, 但fortest1目录不具有 x 权限, 所以会显示如下之类的信息: ls: cannot access forteest1/test: Permission denied -- regards Liu Aleaxander From dean.sinaean在gmail.com Sat May 8 11:03:12 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Fri, 7 May 2010 23:03:12 -0400 Subject: QSqlDatabasePrivate::removeDatabase: connection 'dbconnection' is still in use, all queries will cease to work. Message-ID: 大家好, 在用qt连接数据库里,关闭程序,在调试界面出现如题的提示。用的是qt creator 请问大家是什么原因呢?另外求解决办法。 我代码中有: MyDataBase::MyDataBase(QString dbName)//,MainWindow *parent) { // this->parent=parent; this->db=QSqlDatabase::addDatabase("QSQLITE","dbconnection"); db.setDatabaseName(dbName); if(QFile::exists("imarm.db")) //determines whether we need to create a new table { if(!db.open()) { QMessageBox::warning(0,"QMessageBox","An error occured while openning database"); } QSqlQuery query(db); query.exec("create table t(ShowName char(15),MoveId integer,pwm0 integer,pwm1 integer ,pwm2 integer ,pwm3 interger ,pwm4 integer ,pwm5 integer)"); } else { if(!db.open()) { QMessageBox::warning(0,"QMessageBox","An error occured while openning database"); } } this->moveCount=0; } MyDataBase::~MyDataBase() { db.close(); db.removeDatabase("dbconnection"); } From jiayanchung在gmail.com Sat May 8 11:28:02 2010 From: jiayanchung在gmail.com (Juan Chung) Date: Sat, 08 May 2010 11:28:02 +0800 Subject: QSqlDatabasePrivate::removeDatabase: connection 'dbconnection' is still in use, all queries will cease to work. In-Reply-To: References: Message-ID: <4BE4DA42.70704@gmail.com> xd,恭喜您,这个问题您问错地方了。这个邮件列表是讨论内核相关的,您问的问 题是QT开发相关的。所以您应该到QT用户邮件列表问这个问题。 不过,根据我的经验,提醒您一下:您的程序在使用完数据库连接后,是否有显示 地关闭? What you should do is to review your code and check if the database connection is closed after operation. good luck. On 2010-5-8 11:03, Dean Sinaean wrote: > 大家好, > 在用qt连接数据库里,关闭程序,在调试界面出现如题的提示。用的是qt creator 请问大家是什么原因呢?另外求解决办法。 > 我代码中有: > > MyDataBase::MyDataBase(QString dbName)//,MainWindow *parent) > > { > > // this->parent=parent; > > this->db=QSqlDatabase::addDatabase("QSQLITE","dbconnection"); > > db.setDatabaseName(dbName); > > if(QFile::exists("imarm.db")) //determines whether we need to create a new > table > > { > > if(!db.open()) > > { > > QMessageBox::warning(0,"QMessageBox","An error occured while openning > database"); > > } > > QSqlQuery query(db); > > query.exec("create table t(ShowName char(15),MoveId integer,pwm0 > integer,pwm1 integer ,pwm2 integer ,pwm3 interger ,pwm4 integer ,pwm5 > integer)"); > > } > > else > > { > > if(!db.open()) > > { > > QMessageBox::warning(0,"QMessageBox","An error occured while openning > database"); > > } > > } > > this->moveCount=0; > > } > > > > MyDataBase::~MyDataBase() > > { > > db.close(); > > db.removeDatabase("dbconnection"); > > } > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From lujing9101在gmail.com Sat May 8 12:22:22 2010 From: lujing9101在gmail.com (lu) Date: Sat, 8 May 2010 12:22:22 +0800 Subject: =?GB2312?B?TGludXggdGNwsqK3osGsvdPK/c7KzOI=?= Message-ID: Linux tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? From dean.sinaean在gmail.com Sat May 8 13:40:02 2010 From: dean.sinaean在gmail.com (Dean Sinaean) Date: Sat, 8 May 2010 01:40:02 -0400 Subject: QSqlDatabasePrivate::removeDatabase: connection 'dbconnection' is still in use, all queries will cease to work. In-Reply-To: <4BE4DA42.70704@gmail.com> References: <4BE4DA42.70704@gmail.com> Message-ID: 如我的代码所示,析构函数中已经做了关毕和删除。 谢谢你的回复。我的问题解决了,虽然解决方法很奇怪,我把析构函数里的关闭链接代码去掉了。反倒好用了。 另外,大家能否提供些QT的中文列表。 2010/5/7 Juan Chung > xd,恭喜您,这个问题您问错地方了。这个邮件列表是讨论内核相关的,您问的问 题是QT开发相关的。所以您应该到QT用户邮件列表问这个问题。 > > 不过,根据我的经验,提醒您一下:您的程序在使用完数据库连接后,是否有显示 地关闭? > > What you should do is to review your code and check if the database > connection is closed after operation. > > good luck. > > > > On 2010-5-8 11:03, Dean Sinaean wrote: > >> 大家好, >> 在用qt连接数据库里,关闭程序,在调试界面出现如题的提示。用的是qt creator 请问大家是什么原因呢?另外求解决办法。 >> 我代码中有: >> >> MyDataBase::MyDataBase(QString dbName)//,MainWindow *parent) >> >> { >> >> // this->parent=parent; >> >> this->db=QSqlDatabase::addDatabase("QSQLITE","dbconnection"); >> >> db.setDatabaseName(dbName); >> >> if(QFile::exists("imarm.db")) //determines whether we need to create a new >> table >> >> { >> >> if(!db.open()) >> >> { >> >> QMessageBox::warning(0,"QMessageBox","An error occured while openning >> database"); >> >> } >> >> QSqlQuery query(db); >> >> query.exec("create table t(ShowName char(15),MoveId integer,pwm0 >> integer,pwm1 integer ,pwm2 integer ,pwm3 interger ,pwm4 integer ,pwm5 >> integer)"); >> >> } >> >> else >> >> { >> >> if(!db.open()) >> >> { >> >> QMessageBox::warning(0,"QMessageBox","An error occured while openning >> database"); >> >> } >> >> } >> >> this->moveCount=0; >> >> } >> >> >> >> MyDataBase::~MyDataBase() >> >> { >> >> db.close(); >> >> db.removeDatabase("dbconnection"); >> >> } >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org >> > > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From gongfan193在gmail.com Sat May 8 15:28:24 2010 From: gongfan193在gmail.com (Drunkard Zhang) Date: Sat, 8 May 2010 15:28:24 +0800 Subject: =?UTF-8?B?UmU6IExpbnV4IHRjcOW5tuWPkei/nuaOpeaVsOmXrumimA==?= In-Reply-To: References: Message-ID: 在 2010年5月8日 下午12:22,lu 写道: > Linux > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > _______________________________________________ > 可能是netfilter的连接跟踪数满了吧?试试: sysctl -w net.netfilter.nf_conntrack_max=1048576 echo 1048576 > /sys/module/ip_conntrack/parameters/hashsize 这个是100万并发的配置。同时建议更改: net.ipv4.tcp_max_syn_backlog = 4096 net.core.netdev_max_backlog = 2048 kernel.pid_max = 65535 注意内存,别撑满。 -- 张绍文 gongfan193在gmail.com zhangsw在gwbnsh.net.cn 18601633785 From hxboy在163.com Sat May 8 17:01:36 2010 From: hxboy在163.com (hxboy) Date: Sat, 8 May 2010 17:01:36 +0800 (CST) Subject: =?gbk?B?tfe2yNDeuMQ=?= Message-ID: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> 最近在做一个项目,需要将某些特定进程迁移到其他核上,例如: if( !strcmp( prev->comm, "test") )则迁移。我应该怎么该内核的调度程序? From hangbing0203在gmail.com Sat May 8 17:12:44 2010 From: hangbing0203在gmail.com (=?UTF-8?B?5YiY6Ziz?=) Date: Sat, 8 May 2010 17:12:44 +0800 Subject: =?UTF-8?B?5YWz5LqOU0TljaHpqbHliqjkuI3og73lhpnnmoTpl67popg=?= Message-ID: 首先看出现错误信息: root在db1300:/mnt# cat 1.txt cmd->opcode=17 au_readl(HOST_CONFIG2(host))=00000109, au_readl(HOST_CONFIG(host))=000383ff data->bytes_xfered=0 data->bytes_xfered=0 mmc0: 512 bytes transferred: 0 hfasdfsdafdskfds fds f;sd f;sd fg; g;d fg dfglkdsf g df;g dfg;sd fgroot在db1300:/mnt# root在db1300:/mnt# mkdir ddd cmd->opcode=24 au_readl(HOST_CONFIG2(host))=00000101, au_readl(HOST_CONFIG(host))=000383ff data->bytes_xfered=0 data->bytes_xfered=0 mmc0: 0 bytes transferred: -88 mmcblk0: error -88 transferring data, sector 34, nr 1, card status 0x900 cmd->opcode=22 au_readl(HOST_CONFIG2(host))=00000101, au_readl(HOST_CONFIG(host))=000383ff data->bytes_xfered=0 data->bytes_xfered=0 没有其它信息了 SD卡能正确的读, 但是就是不能写。 根据打印信息发现上层传过来的值是字节数大小是0 , 但是我现在不知道在什么地方从上层传第数据来的, 有谁只能 能否告诉我一下。 From vividfe在gmail.com Sun May 9 22:45:28 2010 From: vividfe在gmail.com (vital) Date: Sun, 9 May 2010 22:45:28 +0800 Subject: 8572 vs 8641D In-Reply-To: References: Message-ID: What is the problem? Best Regards Bruce 在 2010年5月7日 下午9:55,yao zhao 写道: > Hi, > > Anyone is familiar with mpc8572 and mpc8641D. > Is there any tricky in mpc8572's tlb flush? > > thanks, > yao > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From wilbur512在gmail.com Mon May 10 00:28:28 2010 From: wilbur512在gmail.com (wilbur.chan) Date: Mon, 10 May 2010 00:28:28 +0800 Subject: =?GB2312?B?UmU6ILX3tsjQ3rjE?= In-Reply-To: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> References: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> Message-ID: 设cpu亲和 在 10-5-8,hxboy 写道: > 最近在做一个项目,需要将某些特定进程迁移到其他核上,例如: if( !strcmp( prev->comm, "test") > )则迁移。我应该怎么该内核的调度程序? > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From vividfe在gmail.com Mon May 10 09:13:56 2010 From: vividfe在gmail.com (vital) Date: Mon, 10 May 2010 09:13:56 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> Message-ID: 在 2010年5月7日 下午7:22,hellohello 写道: > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > Sent: Thursday, May 06, 2010 5:42 PM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月6日 下午5:13,hellohello 写道: >>> 谢谢回复 >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>>> [snip] > ....... >> >> 但你可以dump __log_buf,从内存看到启动信息。 >> >>> > > ========== > 你的这个方法调试起来挺管用,我追踪到了 > start_kernel() > .... > init_IRQ(); > printk(KERN_DEBUG "init_IRQ\n"); > pidhash_init(); > printk(KERN_DEBUG "pidhash_init\n"); > > "init_IRQ\n"每次都能打印出来,但 > 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 > 这么初步看来应该是init_IRQ(); > 函数执行后引起的死机了,检查中。 > Great! Maybe you should check if the mpic register in your board is match as the dts. Best Regards Bruce. > > > > > > >>> >>> >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>> Cc: "林志平" ; "linux-kernel" >>> Sent: Thursday, May 06, 2010 4:43 PM >>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>> From: "vital" >>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>> >>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>> => run ftp1 >>>> >>>> [snip] >>>> >>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>> Updating property 'current-speed' = 00 00 25 80 >>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>> ## Transferring control to Linux (at address 00000000) ... >>>>> 这里就死掉了 >>>> >>>> 假设你已经起来了kernel。 >>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>> >>>>> >>>>> >>>>> >>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>> 还要做地址偏移,正在查这些资料。 >>>> >>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>> >>>>> >>>>> >>>>> >>>>> >>>> [snip] >>>> >>>>> serial在11a82 { >>>>> device_type = "serial"; >>>>> compatible = "fsl,mpc8272-smc-uart", >>>>> "fsl,cpm2-smc-uart"; >>>> >>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>> >>>> Bruce >>>> >>>> >>>>> reg = <11a82 10 87fc 1>; >>>>> interrupts = <4 8>; >>>>> interrupt-parent = <&PIC>; >>>>> fsl,cpm-brg = <7>; >>>>> fsl,cpm-command = <1d000000>; >>>>> }; >>>>> } >>>>> } >>>>> ... >>>>> ... >>>>> chosen { >>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>> }; >>>>> >>>>> ----- Original Message ----- >>>>> From: "vital" >>>>> To: "hellohello" >>>>> Cc: "林志平" ; "linux-kernel" >>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>> >>>>> >>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>> >>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>> >>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>> 3> cuImage确实可以尝试 >>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>> >>>>>> 请依次排查。 >>>>>> >>>>>> Cheers >>>>>> Bruce >>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> . >>>>>>> >>>>>>> ----- Original Message ----- >>>>>>> From: "林志平" >>>>>>> To: "linux-kernel" >>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>> >>>>>>> >>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>> _______________________________________________ >>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>> _______________________________________________ >>>>>>> Linux 内核开发中文邮件列表 >>>>>>> Linux-kernel在zh-kernel.org >>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>> >>>> >> From hu.taoo在gmail.com Mon May 10 10:31:55 2010 From: hu.taoo在gmail.com (hu.taoo在gmail.com) Date: Mon, 10 May 2010 10:31:55 +0800 Subject: Linux =?utf-8?B?dGNw5bm25Y+R6L+e5o6l?= =?utf-8?B?5pWw6Zeu6aKY?= In-Reply-To: References: Message-ID: <20100510023132.GA6004@gentoo> On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > Linux > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 什么应用需要这么多端口? From gqlxj1987在gmail.com Mon May 10 10:45:47 2010 From: gqlxj1987在gmail.com (quanli gui) Date: Mon, 10 May 2010 10:45:47 +0800 Subject: =?GB2312?B?zsS8/s+1zbO50tTYzsrM4g==?= Message-ID: 内核版本:2.6.12 我在该版本下使用mount命令挂载一个我自定义的文件系统,文件系统的功能可以实现,但是使用df命令无法看到该文件系统,这个文件跟文件系统的注册的那个数据结构相关? From gqlxj1987在gmail.com Mon May 10 10:54:18 2010 From: gqlxj1987在gmail.com (quanli gui) Date: Mon, 10 May 2010 10:54:18 +0800 Subject: =?GB2312?B?zsS8/s+1zbPJ/by2?= Message-ID: 我的一个文件系统从2.4.21内核下移植到2.6.12的内核下,功能上移植没有什么问题,就是df命令的时候,2.4内核可以显示该文件系统,但2.6内核下df没有显示该文件系统,而df -a显示该文件系统所占的块为0,是不是这一点出问题?如果修改所占块呢? From suxin0071986在sina.com Mon May 10 12:22:50 2010 From: suxin0071986在sina.com (suxin0071986在sina.com) Date: Mon, 10 May 2010 12:22:50 +0800 Subject: =?GBK?B?udjT2mxpbnV4usHD67y21tC2z7XEzsrM4g==?= Message-ID: <20100510042250.8012C12631A@mail3-143.sinamail.sina.com.cn> Hi, 现在正在写一个ARM平台下的驱动程序,功能是二个声音接收器接收声音产生中断,中断服务程序记录下当前滴答, 但出现个问题,无论发声源位置如何变化,两个接收器产生中断的时间差不变(两接收器相距20厘米),总是在9或10滴答, 不知问题出在哪里,还是就是应该是这样的(我想利用变化的中断时间差判断发生源方向),谢谢 From xiyou.wangcong在gmail.com Mon May 10 12:44:22 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Mon, 10 May 2010 12:44:22 +0800 Subject: =?utf-8?B?5paH5Lu257O757uf5oyC6L296Zeu?= =?utf-8?B?6aKY?= In-Reply-To: References: Message-ID: <20100510044422.GA5250@cr0.nay.redhat.com> On Mon, May 10, 2010 at 10:45:47AM +0800, quanli gui wrote: >内核版本:2.6.12 >我在该版本下使用mount命令挂载一个我自定义的文件系统,文件系统的功能可以实现,但是使用df命令无法看到该文件系统,这个文件跟文件系统的注册的那个数据结构相关? 你在/etc/mtab里添加上它了嘛? From xiyou.wangcong在gmail.com Mon May 10 12:46:05 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Mon, 10 May 2010 12:46:05 +0800 Subject: =?utf-8?B?5paH5Lu257O757uf5Y2H57qn?= In-Reply-To: References: Message-ID: <20100510044605.GB5250@cr0.nay.redhat.com> On Mon, May 10, 2010 at 10:54:18AM +0800, quanli gui wrote: >我的一个文件系统从2.4.21内核下移植到2.6.12的内核下,功能上移植没有什么问题,就是df命令的时候,2.4内核可以显示该文件系统,但2.6内核下df没有显示该文件系统,而df >-a显示该文件系统所占的块为0,是不是这一点出问题?如果修改所占块呢? 你如何实现的 .statfs? From xiao.zhang在windriver.com Mon May 10 13:21:21 2010 From: xiao.zhang在windriver.com (ZhangXiao) Date: Mon, 10 May 2010 13:21:21 +0800 Subject: =?UTF-8?B?5YWz5LqObGludXjmr6vnp5LnuqfkuK3mlq3nmoTpl67popg=?= In-Reply-To: <20100510042250.8012C12631A@mail3-143.sinamail.sina.com.cn> References: <20100510042250.8012C12631A@mail3-143.sinamail.sina.com.cn> Message-ID: <4BE797D1.1050200@windriver.com> suxin0071986在sina.com wrote: > Hi, 现在正在写一个ARM平台下的驱动程序,功能是二个声音接收器接收声音产生中断,中断服务程序记录下当前滴答, > 但出现个问题,无论发声源位置如何变化,两个接收器产生中断的时间差不变(两接收器相距20厘米),总是在9或10滴答, > 不知问题出在哪里,还是就是应该是这样的(我想利用变化的中断时间差判断发生源方向),谢谢 > 这个结果貌似不对劲,先排除下操作系统之外的因素。用其他方法查下你的声音接 收器产生中断的时间,比如示波器。另:声音在空气中是一秒钟好几百米,也就是 一毫秒就能窜出去好几十厘米,毫秒级的精度好使么?是不是应该找找精度更高的 计时器啊? > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From gqlxj1987在gmail.com Mon May 10 14:14:42 2010 From: gqlxj1987在gmail.com (quanli gui) Date: Mon, 10 May 2010 14:14:42 +0800 Subject: =?GB2312?B?UmU6IM7EvP7Ptc2zudLU2M7KzOI=?= In-Reply-To: <20100510044422.GA5250@cr0.nay.redhat.com> References: <20100510044422.GA5250@cr0.nay.redhat.com> Message-ID: 在挂载完之后,/etc/mtab自动就添加了,但df仍然看不到该文件系统 在 2010年5月10日 下午12:44,Américo Wang 写道: > On Mon, May 10, 2010 at 10:45:47AM +0800, quanli gui wrote: > >内核版本:2.6.12 > > >我在该版本下使用mount命令挂载一个我自定义的文件系统,文件系统的功能可以实现,但是使用df命令无法看到该文件系统,这个文件跟文件系统的注册的那个数据结构相关? > > 你在/etc/mtab里添加上它了嘛? > From xiyou.wangcong在gmail.com Mon May 10 14:47:07 2010 From: xiyou.wangcong在gmail.com (=?utf-8?Q?Am=C3=A9rico?= Wang) Date: Mon, 10 May 2010 14:47:07 +0800 Subject: =?utf-8?B?5paH5Lu257O757uf5oyC6L296Zeu?= =?utf-8?B?6aKY?= In-Reply-To: References: <20100510044422.GA5250@cr0.nay.redhat.com> Message-ID: <20100510064707.GC5250@cr0.nay.redhat.com> On Mon, May 10, 2010 at 02:14:42PM +0800, quanli gui wrote: >在挂载完之后,/etc/mtab自动就添加了,但df仍然看不到该文件系统 > strace df 输出什么? From solyn123在gmail.com Mon May 10 17:13:38 2010 From: solyn123在gmail.com (=?GB2312?B?wdbWvsa9?=) Date: Mon, 10 May 2010 17:13:38 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 以前的搞定了,现在又有新的需求 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: > 还没有升级到新的版本啊? > > 在 2010年5月6日 上午11:38,林志平 写道: > > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > > 我感觉是我的dtb文件有点问题, > > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > From linux-kernel在rigui.org Mon May 10 17:27:46 2010 From: linux-kernel在rigui.org (kernel linux) Date: Mon, 10 May 2010 17:27:46 +0800 Subject: =?GB2312?B?UmU6IM7EvP7Ptc2zudLU2M7KzOI=?= In-Reply-To: <20100510064707.GC5250@cr0.nay.redhat.com> References: <20100510044422.GA5250@cr0.nay.redhat.com> <20100510064707.GC5250@cr0.nay.redhat.com> Message-ID: 我的是输出: root> strace df execve("/bin/df", ["df"], [/* 19 vars */]) = 0 brk(0) = 0x8052000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/i686/sse2", 0xbfa3be9c) = -1 ENOENT (No such file or directory) open("/lib/tls/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/i686", 0xbfa3be9c) = -1 ENOENT (No such file or directory) open("/lib/tls/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls/sse2", 0xbfa3be9c) = -1 ENOENT (No such file or directory) open("/lib/tls/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/tls", {st_mode=S_IFDIR|0555, st_size=4096, ...}) = 0 open("/lib/i686/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/i686/sse2", 0xbfa3be9c) = -1 ENOENT (No such file or directory) open("/lib/i686/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/i686", 0xbfa3be9c) = -1 ENOENT (No such file or directory) open("/lib/sse2/libc.so.6", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/lib/sse2", 0xbfa3be9c) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 g{I4\0\0\0"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1297732, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7894000 mmap2(0x497a0000, 1304144, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x497a0000 mmap2(0x498d9000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x138) = 0x498d9000 mmap2(0x498dc000, 9808, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x498dc000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7893000 set_thread_area({entry_number:-1 -> 6, base_addr:0xb78936c0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 mprotect(0x498d9000, 8192, PROT_READ) = 0 mprotect(0x4979c000, 4096, PROT_READ) = 0 brk(0) = 0x8052000 brk(0x8073000) = 0x8073000 open("/etc/mtab", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=177, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7892000 read(3, "rootfs / rootfs rw 0 0\nproc /pro"..., 4096) = 177 read(3, "", 4096) = 0 close(3) = 0 munmap(0xb7892000, 4096) = 0 statfs64("/", 84, {f_type="NFS_SUPER_MAGIC", f_bsize=4096, f_blocks=158438606, f_bfree=95156585, f_bavail=87108355, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(5, 1), ...}) = 0 ioctl(1, SNDCTL_TMR_TIMEBASE or TCGETS, {B115200 opost isig icanon echo ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7892000 write(1, "Filesystem 1K-blocks "..., 67Filesystem 1K-blocks Used Available Use% Mounted on ) = 67 write(1, "rootfs 633754424 2"..., 58rootfs 633754424 253128084 348433420 43% / ) = 58 statfs64("/sys", 84, {f_type="SYSFS_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 statfs64("/dev/pts", 84, {f_type="DEVPTS_SUPER_MAGIC", f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 statfs64("/dev/shm", 84, {f_type=0x1021994, f_bsize=4096, f_blocks=503150, f_bfree=503150, f_bavail=503150, f_files=217835, f_ffree=217834, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 write(1, "tmpfs 2012600 "..., 65tmpfs 2012600 0 2012600 0% /dev/shm ) = 65 statfs64("/proc/sys/fs/binfmt_misc", 84, {f_type=0x42494e4d, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0 close(1) = 0 munmap(0xb7892000, 4096) = 0 close(2) = 0 exit_group(0) = ? 什么 意思? 在 2010年5月10日 下午2:47,Américo Wang 写道: > On Mon, May 10, 2010 at 02:14:42PM +0800, quanli gui wrote: > >在挂载完之后,/etc/mtab自动就添加了,但df仍然看不到该文件系统 > > > > strace df 输出什么? > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From vividfe在gmail.com Mon May 10 17:31:09 2010 From: vividfe在gmail.com (vital) Date: Mon, 10 May 2010 17:31:09 +0800 Subject: =?GB2312?B?UmU6ILnY09psaW51eLrBw+u8ttbQts+1xM7KzOI=?= In-Reply-To: <20100510042250.8012C12631A@mail3-143.sinamail.sina.com.cn> References: <20100510042250.8012C12631A@mail3-143.sinamail.sina.com.cn> Message-ID: 在 2010年5月10日 下午12:22, 写道: > Hi, 现在正在写一个ARM平台下的驱动程序,功能是二个声音接收器接收声音产生中断,中断服务程序记录下当前滴答, > 但出现个问题,无论发声源位置如何变化,两个接收器产生中断的时间差不变(两接收器相距20厘米),总是在9或10滴答, > 不知问题出在哪里,还是就是应该是这样的(我想利用变化的中断时间差判断发生源方向),谢谢 我想起以前做过的网络探测仪。 只能是你接收器的敏感度/精度不够,模拟部分,你必须根据声音的频率去设计采样,无非最后都是模数转化而已。还有就是如果能给声音编码就够好了,有利于信号清楚,消除杂波。 这个跟Linux没有关系。 Bruce > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From gqlxj1987在gmail.com Mon May 10 21:19:13 2010 From: gqlxj1987在gmail.com (quanli gui) Date: Mon, 10 May 2010 21:19:13 +0800 Subject: =?GB2312?B?zsS8/s+1zbOy4srU?= Message-ID: 有人用过iometer测试过文件系统没?文件系统能在df -h下显示,但是iometer却找不到,提示error invalid arugment From abutter.gao在gmail.com Tue May 11 07:19:39 2010 From: abutter.gao在gmail.com (Gao Ya'nan) Date: Tue, 11 May 2010 07:19:39 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 在 2010年5月10日 下午5:13,林志平 写道: > 以前的搞定了,现在又有新的需求 > > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: >> >> 还没有升级到新的版本啊? >> >> 在 2010年5月6日 上午11:38,林志平 写道: >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 >> > 我感觉是我的dtb文件有点问题, >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >> > _______________________________________________ >> > Linux 内核开发中文邮件列表 >> > Linux-kernel在zh-kernel.org >> > http://zh-kernel.org/mailman/listinfo/linux-kernel >> > Linux 内核开发中文社区: http://zh-kernel.org > > From hangbing0203在gmail.com Tue May 11 10:06:30 2010 From: hangbing0203在gmail.com (=?UTF-8?B?5YiY6Ziz?=) Date: Tue, 11 May 2010 10:06:30 +0800 Subject: =?UTF-8?B?UmU6IOWFs+S6jlNE5Y2h6amx5Yqo5LiN6IO95YaZ55qE6Zeu6aKY?= In-Reply-To: <201005081721413590701@dahuatech.com> References: <201005081721413590701@dahuatech.com> Message-ID: 问题已经解决了:在发cmd命令与data中间加一个delay. 谢谢大家 在 2010年5月8日 下午5:21,li_xiaojun 写道: > 刘阳,您好! > > driver/mmc/card/block.c 里static int mmc_blk_issue_rq(struct mmc_queue *mq, > struct request *req) > > 致 > 礼 > 李晓君/2010-05-08 17:20:52 > ------------------------------------------------------------- > 发件人:刘阳 > 发送日期:2010-05-08 17:12:54 > 收件人:linux-kernel > 抄送: > 主题:关于SD卡驱动不能写的问题 > > 首先看出现错误信息: > root在db1300:/mnt# cat 1.txt > cmd->opcode=17 > au_readl(HOST_CONFIG2(host))=00000109, > au_readl(HOST_CONFIG(host))=000383ff > data->bytes_xfered=0 > data->bytes_xfered=0 > mmc0: 512 bytes transferred: 0 > hfasdfsdafdskfds > fds > f;sd > f;sd > fg; > g;d > fg > dfglkdsf > g > df;g > dfg;sd > fgroot在db1300:/mnt# > root在db1300:/mnt# mkdir ddd > cmd->opcode=24 > au_readl(HOST_CONFIG2(host))=00000101, > au_readl(HOST_CONFIG(host))=000383ff > data->bytes_xfered=0 > data->bytes_xfered=0 > mmc0: 0 bytes transferred: -88 > mmcblk0: error -88 transferring data, sector 34, nr 1, card status 0x900 > cmd->opcode=22 > au_readl(HOST_CONFIG2(host))=00000101, > au_readl(HOST_CONFIG(host))=000383ff > data->bytes_xfered=0 > data->bytes_xfered=0 > 没有其它信息了 > > SD卡能正确的读, 但是就是不能写。 根据打印信息发现上层传过来的值是字节数大小是0 , > 但是我现在不知道在什么地方从上层传第数据来的, 有谁只能 能否告诉我一下。 > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From wangxiaolong.china在gmail.com Tue May 11 14:15:52 2010 From: wangxiaolong.china在gmail.com (xiaolong wang) Date: Tue, 11 May 2010 14:15:52 +0800 Subject: =?GB2312?B?yOe6ztTaxNq6y9bQzO2802tkYqO/?= Message-ID: 我在linux-2.6.33.3内核中打上kdb补丁后,重新编译,出现了下面的错误: arch/x86/kdb/kdba_support.c:1167: undefined reference to `kdba_get_stack_info_alternate' 如何修改,谢谢. From crquan在gmail.com Tue May 11 14:17:48 2010 From: crquan在gmail.com (Cheng Renquan) Date: Tue, 11 May 2010 14:17:48 +0800 Subject: =?UTF-8?B?SlZNLCBMb25nZW5lIGluIExpbnV4IEtlcm5lbCBbV2FzIFJlOiDkuLrku4DkuYjkuI0=?= =?UTF-8?B?5oqKSlZN5Yqg5YWlS2VybmVs5ZGi77yfKFdoeSBub3QgYWRkIEpWTSBpbnRvIEtlcm5lbCld?= Message-ID: 2010/5/7 Liang Guo : > > 在 2010年5月7日 下午4:47,Avanpak 写道: >> >> Linux下有很多Java应用,如openoffice, >> 为什么不把JVM加入Kernel,让这些应用跑起来更顺畅呢? >> >> There're many Java applications on Linux, such as openoffice. >> Why not add JVM into Kernel, and let them run better. > > Why do you think JVM in kernel space is better in user space ? 我个人觉得:除了法律、GPL的要求之外,没有什么技术上的理由说 JVM 不可以放进内核, 我想真正唯一的理由是:谁去做它? 谁有能力、有需求的人士不妨可以去尝试, 但当前有没有谁想去接上这个活儿,这是个问题, 当时 03,04 年我们还在 linuxsir 的内核区讨论 “把 XWindow 移进内核让它像 运行Windows图形一样快, 如何?”, 支持和反对者辩论了很久,支持者认为会提高性能 让Linux图形和Windows一样快,反对者认为会引入BUG让Linux像Windows一样不稳定, 经常崩溃;这样的辩论在各 Linux 社区都时常可见,但都没什么结果,因为没有人真正 去做,全部都是空谈没有意义, http://www.linuxsir.org/bbs/thread147361-1.html 我们当时确实没有能力去实现 内核态XWindow 这么一件大工程,现在来看,内核模式设定 KMS 可以被 内核接受,被各Linux发行版引用,其本质就是把一部分 XWindow代码移进了 内核态运行 (Xorg 的显卡驱动的一部分,), 证实了这个方向确实是可行的, @Avanpak, 你说的内核态JVM是目的让 内核态直接能运行 Java应用程序的class 文件? 这样以后运行 Eclipse 确实应该快些, 位于 杭州 - 浙大网新 - 毛德操老师引领的 Longene 项目与此目的倒是有些类似, 让 Linux内核直接运行Windows的PE格式exe可执行程序, http://www.longene.org/ 初期版本的方案是内核模式的wine, 但0.3版以后实现有改变?其git仓库还是没变化,Jack能否发布点文档? "longene-0.3初步定于5月底发布,新版本将去除wineserver,所有功能在内核模块中完成。敬请期待!" "整体移植wineserver至模块中,所有发往wineserver的请求通过系统调用方式直接进入内核, 在wine中去掉wineserver进程。移植完成后,预计完成后性能会有较大地提高。" http://www.longene.org/newslist.php http://www.longene.org/forum/viewtopic.php?f=2&t=4159 http://www.longene.org/gitweb/?p=unifiedkernel.git 回到 JVM 和 Logene 问题本身,技术上没有什么不可以做的,有了需求,有了 motivation, 还要有人坚持不懈把它做出来才行,Avanpak 您愿意开始 内核JVM 工作吗? > > -- > Liang Guo > http://bluestone.cublog.cn -- Cheng Renquan From jiang.adam在gmail.com Tue May 11 17:53:17 2010 From: jiang.adam在gmail.com (Adam Jiang) Date: Tue, 11 May 2010 18:53:17 +0900 Subject: =?GB2312?B?UmU6ILX3tsjQ3rjE?= In-Reply-To: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> References: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> Message-ID: 2010/5/8 hxboy : > 最近在做一个项目,需要将某些特定进程迁移到其他核上,例如: if( !strcmp( prev->comm, "test") )则迁移。我应该怎么该内核的调度程序? Hello, 你可以用这些关键字google一下,相信可以找到很多设置处理器亲和的例子 Processor affinity CPU affinity How to set processor affinity Linux 如果你需要动态的条正多核之间的平衡,或者将指定的进程搬迁到某个core上去, 可能需要对调度器下点功夫。 -- Adam Jiang ----------------------------------- e-mail:jiang.adam在gmail.com http://www.adamjiang.com ----------------------------------- From zhangsw在gwbnsh.net.cn Tue May 11 18:05:58 2010 From: zhangsw在gwbnsh.net.cn (=?UTF-8?B?5byg57uN5paH?=) Date: Tue, 11 May 2010 18:05:58 +0800 Subject: =?UTF-8?B?UmU6IOiwg+W6puS/ruaUuQ==?= In-Reply-To: References: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> Message-ID: 在 2010年5月11日 下午5:53,Adam Jiang 写道: > 2010/5/8 hxboy : >>     最近在做一个项目,需要将某些特定进程迁移到其他核上,例如: if( !strcmp( prev->comm, "test") )则迁移。我应该怎么该内核的调度程序? > > Hello, 你可以用这些关键字google一下,相信可以找到很多设置处理器亲和的例子 > > Processor affinity > CPU affinity > How to set processor affinity Linux > > 如果你需要动态的条正多核之间的平衡,或者将指定的进程搬迁到某个core上去, > 可能需要对调度器下点功夫。 > 内核的源码中就有文档: Documentation/IRQ-affinity.txt 顺便附上我的文档,建议帖到文本编辑器,用等宽字体查看: # 原始文档是Documentation/IRQ-affinity.txt # 4核CPU上: echo 0000000c >/proc/irq/55/smp_affinity # eth1 to CPU 2,3 echo 00000003 >/proc/irq/54/smp_affinity # eth0 to CPU 0,1 # 下面2个例子的CPU按从大到小的顺序写,主要是由于计算方便,符合习惯; 3 2 1 0 <= CPUs,按顺序; + + + + <= 4个CPU 1 1 0 0 <= 十六进制c,使用CPU 2,3; 0 0 1 1 <= 十六进制3,使用CPU 0,1; 7 6 5 4 3 2 1 0 <= CPUs,按顺序; + + + + + + + + <= 8个CPU 1 1 1 1 0 0 0 0 <= 十六进制f0,使用CPU 4,5,6,7; 0 0 0 0 1 1 1 1 <= 十六进制0f,使用CPU 0,1,2,3; # 实际情况: CPU0 CPU1 CPU2 CPU3 CPU4 CPU5 CPU6 CPU7 + + + + + + + + 0 0 0 1 0 0 0 0 # 8 0 0 0 0 0 0 0 1 # 80 > -- > Adam Jiang > ----------------------------------- > e-mail:jiang.adam在gmail.com > http://www.adamjiang.com > ----------------------------------- > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org -- 张绍文 gongfan193在gmail.com zhangsw在gwbnsh.net.cn 18601633785 From dongbiao.fang在gmail.com Tue May 11 18:12:32 2010 From: dongbiao.fang在gmail.com (dongbiao fang) Date: Tue, 11 May 2010 18:12:32 +0800 Subject: =?GB2312?B?bGludXggtfe2yMvjt6ggveG5uczltcTA7b3ic3RydWN0IGlvX2NvbnRl?= =?GB2312?B?eHQ=?= Message-ID: linux 的调度算法 和结构体 struct io_context 有关 有没有人帮我介绍一下 From jiang.adam在gmail.com Tue May 11 18:22:33 2010 From: jiang.adam在gmail.com (Adam Jiang) Date: Tue, 11 May 2010 19:22:33 +0900 Subject: =?GB2312?B?UmU6ILX3tsjQ3rjE?= In-Reply-To: References: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> Message-ID: 2010/5/11 张绍文 : > 在 2010年5月11日 下午5:53,Adam Jiang 写道: >> 2010/5/8 hxboy : >>> 最近在做一个项目,需要将某些特定进程迁移到其他核上,例如: if( !strcmp( prev->comm, "test") )则迁移。我应该怎么该内核的调度程序? >> >> Hello, 你可以用这些关键字google一下,相信可以找到很多设置处理器亲和的例子 >> >> Processor affinity >> CPU affinity >> How to set processor affinity Linux >> >> 如果你需要动态的条正多核之间的平衡,或者将指定的进程搬迁到某个core上去, >> 可能需要对调度器下点功夫。 >> 这个地方他提到的是 进程 需要调度到某个Core上去,而非 中断。所以, 我想可能还是于调度器有关。 /大头阿当 -- Adam Jiang ----------------------------------- e-mail:jiang.adam在gmail.com http://www.adamjiang.com ----------------------------------- From raise.sail在gmail.com Tue May 11 18:24:36 2010 From: raise.sail在gmail.com (Li Yu) Date: Tue, 11 May 2010 18:24:36 +0800 Subject: =?GB2312?B?UmU6IFJlOiC197bI0N64xA==?= In-Reply-To: <5ba5bd.2a66.1287cc20658.Coremail.hxboy@163.com> References: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> <5ba5bd.2a66.1287cc20658.Coremail.hxboy@163.com> Message-ID: 我看了一下代码,2.6.18 & 2.6.32 , sched_setaffinity,()系统调用会等待到目标任务迁移完成后才返回。 在 2010年5月9日 下午7:10,hxboy 写道: > 你好: > 谢谢你的提醒,但是设置"亲和性"以后,进程会在什么时候被迁移,这个延迟大约有多长? > daka > > > ________________________________ > 网易为中小企业免费提供企业邮箱(自主域名) From hellohello008在163.com Tue May 11 18:39:23 2010 From: hellohello008在163.com (hellohello) Date: Tue, 11 May 2010 18:39:23 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> Message-ID: <030101caf0f6$39826b70$961cbcc0@sfdomain.com> 在arch\powerpc\sysdev\cpm2.c中有语句: cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); 我在这里添加了 printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); 结果打印出 <7>cpm2_immr fdfc0000 f0000000 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, 各位,如何能知道这种映射正确与否呢? ----- Original Message ----- From: "vital" To: "hellohello" Cc: "林志平" ; "linux-kernel" Sent: Monday, May 10, 2010 9:13 AM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >在 2010年5月7日 下午7:22,hellohello 写道: >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >> Cc: "林志平" ; "linux-kernel" >> Sent: Thursday, May 06, 2010 5:42 PM >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>>在 2010年5月6日 下午5:13,hellohello 写道: >>>> 谢谢回复 >>>> ----- Original Message ----- >>>> From: "vital" >>>> To: "hellohello" >>>>> [snip] >> ....... >>> >>> 但你可以dump __log_buf,从内存看到启动信息。 >>> >>>> >> >> ========== >> 你的这个方法调试起来挺管用,我追踪到了 >> start_kernel() >> .... >> init_IRQ(); >> printk(KERN_DEBUG "init_IRQ\n"); >> pidhash_init(); >> printk(KERN_DEBUG "pidhash_init\n"); >> >> "init_IRQ\n"每次都能打印出来,但 >> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 >> 这么初步看来应该是init_IRQ(); >> 函数执行后引起的死机了,检查中。 >> > > Great! Maybe you should check if the mpic register in your board is > match as the dts. > > Best Regards > Bruce. > > >> >> >> >> >> >> >>>> >>>> >>>> ----- Original Message ----- >>>> From: "vital" >>>> To: "hellohello" >>>> Cc: "林志平" ; "linux-kernel" >>>> Sent: Thursday, May 06, 2010 4:43 PM >>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>> >>>> >>>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>>> From: "vital" >>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>>> >>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>>> => run ftp1 >>>>> >>>>> [snip] >>>>> >>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>> Updating property 'current-speed' = 00 00 25 80 >>>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>> 这里就死掉了 >>>>> >>>>> 假设你已经起来了kernel。 >>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>>> >>>>>> >>>>>> >>>>>> >>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>>> 还要做地址偏移,正在查这些资料。 >>>>> >>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>> [snip] >>>>> >>>>>> serial在11a82 { >>>>>> device_type = "serial"; >>>>>> compatible = "fsl,mpc8272-smc-uart", >>>>>> "fsl,cpm2-smc-uart"; >>>>> >>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>>> >>>>> Bruce >>>>> >>>>> >>>>>> reg = <11a82 10 87fc 1>; >>>>>> interrupts = <4 8>; >>>>>> interrupt-parent = <&PIC>; >>>>>> fsl,cpm-brg = <7>; >>>>>> fsl,cpm-command = <1d000000>; >>>>>> }; >>>>>> } >>>>>> } >>>>>> ... >>>>>> ... >>>>>> chosen { >>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>>> }; >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "vital" >>>>>> To: "hellohello" >>>>>> Cc: "林志平" ; "linux-kernel" >>>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>> >>>>>> >>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>>> >>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>> >>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>> 3> cuImage确实可以尝试 >>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>> >>>>>>> 请依次排查。 >>>>>>> >>>>>>> Cheers >>>>>>> Bruce >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> . >>>>>>>> >>>>>>>> ----- Original Message ----- >>>>>>>> From: "林志平" >>>>>>>> To: "linux-kernel" >>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>> >>>>>>>> >>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>>> _______________________________________________ >>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>> _______________________________________________ >>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>> >>>>> >>> > From robert.zhangle在gmail.com Tue May 11 21:29:05 2010 From: robert.zhangle在gmail.com (Zhang Le) Date: Tue, 11 May 2010 21:29:05 +0800 Subject: =?UTF-8?B?UmU6IEpWTSwgTG9uZ2VuZSBpbiBMaW51eCBLZXJuZWwgW1dhcyBSZTog5Li65LuA5LmI?= =?UTF-8?B?5LiN5oqKSlZN5Yqg5YWlS2VybmVs5ZGi77yfKFdoeSBub3QgYWRkIEpWTSBpbnRvIEtlcm5lbCld?= In-Reply-To: References: Message-ID: 2010/5/11 Cheng Renquan : > 2010/5/7 Liang Guo : >> >> 在 2010年5月7日 下午4:47,Avanpak 写道: >>> >>> Linux下有很多Java应用,如openoffice, >>> 为什么不把JVM加入Kernel,让这些应用跑起来更顺畅呢? >>> >>> There're many Java applications on Linux, such as openoffice. >>> Why not add JVM into Kernel, and let them run better. >> >> Why do you think JVM in kernel space is better in user space ? > > 我个人觉得:除了法律、GPL的要求之外,没有什么技术上的理由说 JVM 不可以放进内核, > > 我想真正唯一的理由是:谁去做它? 谁有能力、有需求的人士不妨可以去尝试, > 但当前有没有谁想去接上这个活儿,这是个问题, > > 当时 03,04 年我们还在 linuxsir 的内核区讨论 “把 XWindow 移进内核让它像 > 运行Windows图形一样快, 如何?”, 支持和反对者辩论了很久,支持者认为会提高性能 > 让Linux图形和Windows一样快,反对者认为会引入BUG让Linux像Windows一样不稳定, > 经常崩溃;这样的辩论在各 Linux 社区都时常可见,但都没什么结果,因为没有人真正 > 去做,全部都是空谈没有意义, > http://www.linuxsir.org/bbs/thread147361-1.html > > 我们当时确实没有能力去实现 内核态XWindow 这么一件大工程,现在来看,内核模式设定 >  KMS 可以被 内核接受,被各Linux发行版引用,其本质就是把一部分 XWindow代码移进了 > 内核态运行 (Xorg 的显卡驱动的一部分,), 证实了这个方向确实是可行的, > > @Avanpak, 你说的内核态JVM是目的让 内核态直接能运行 Java应用程序的class 文件? > 这样以后运行 Eclipse 确实应该快些, > > 位于 杭州 - 浙大网新 - 毛德操老师引领的 Longene 项目与此目的倒是有些类似, > 让 Linux内核直接运行Windows的PE格式exe可执行程序, > http://www.longene.org/ > > 初期版本的方案是内核模式的wine, 但0.3版以后实现有改变?其git仓库还是没变化,Jack能否发布点文档? > > "longene-0.3初步定于5月底发布,新版本将去除wineserver,所有功能在内核模块中完成。敬请期待!" > "整体移植wineserver至模块中,所有发往wineserver的请求通过系统调用方式直接进入内核, > 在wine中去掉wineserver进程。移植完成后,预计完成后性能会有较大地提高。" > > http://www.longene.org/newslist.php > http://www.longene.org/forum/viewtopic.php?f=2&t=4159 > http://www.longene.org/gitweb/?p=unifiedkernel.git > > 回到 JVM 和 Logene 问题本身,技术上没有什么不可以做的,有了需求,有了 motivation, > 还要有人坚持不懈把它做出来才行,Avanpak 您愿意开始 内核JVM 工作吗? What about Java processor? http://en.wikipedia.org/wiki/Java_processor -- Zhang Le, Robert Gentoo/Loongson(龙芯) Developer http://zhangle.is-a-geek.org From robert.zhangle在gmail.com Tue May 11 21:48:58 2010 From: robert.zhangle在gmail.com (Zhang Le) Date: Tue, 11 May 2010 21:48:58 +0800 Subject: =?UTF-8?B?UmU6IOWmguS9leWcqOWGheaguOS4rea3u+WKoGtkYu+8nw==?= In-Reply-To: References: Message-ID: 2010/5/11 xiaolong wang : > 我在linux-2.6.33.3内核中打上kdb补丁后,重新编译,出现了下面的错误: > arch/x86/kdb/kdba_support.c:1167: undefined reference to > `kdba_get_stack_info_alternate' 现在的内核已经集成kgdb -- Zhang Le, Robert Gentoo/Loongson(龙芯) Developer http://zhangle.is-a-geek.org From changyongid在163.com Tue May 11 22:42:05 2010 From: changyongid在163.com (changyongid) Date: Tue, 11 May 2010 22:42:05 +0800 (CST) Subject: 00 In-Reply-To: References: Message-ID: <1b224b3.92ec.12887d0c5f0.Coremail.changyongid@163.com> help From dragonlinux在gmail.com Wed May 12 04:58:44 2010 From: dragonlinux在gmail.com (yao zhao) Date: Tue, 11 May 2010 16:58:44 -0400 Subject: 8572 vs 8641D In-Reply-To: References: Message-ID: It is tested that 8572's tlb flush is much slower than 8641D. I didn't try Linux but on our OS 8572 is 10 times slower than 8641D, it didn't make any sense. And our kernel architecture said it has good reasons so just curious anyone knows anything, please show some lights. on 8572 there are 2 tlbs, I didn't read user manual too much. How Linux uses these 2? thanks, yao 2010/5/9 vital : > What is the problem? > > Best Regards > Bruce > > 在 2010年5月7日 下午9:55,yao zhao 写道: >> Hi, >> >> Anyone is familiar with mpc8572 and mpc8641D. >> Is there any tricky in mpc8572's tlb flush? >> >> thanks, >> yao >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > From dragonlinux在gmail.com Wed May 12 05:02:55 2010 From: dragonlinux在gmail.com (yao zhao) Date: Tue, 11 May 2010 17:02:55 -0400 Subject: =?GB2312?B?UmU6IMjnus7U2sTausvW0MztvNNrZGKjvw==?= In-Reply-To: References: Message-ID: Just curious, what is the difference of kdb and kgdb? thanks, yao 2010/5/11 Zhang Le : > 2010/5/11 xiaolong wang : >> 我在linux-2.6.33.3内核中打上kdb补丁后,重新编译,出现了下面的错误: >> arch/x86/kdb/kdba_support.c:1167: undefined reference to >> `kdba_get_stack_info_alternate' > > 现在的内核已经集成kgdb > > > -- > Zhang Le, Robert > Gentoo/Loongson(龙芯) Developer > http://zhangle.is-a-geek.org > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From feixiangniao26在gmail.com Wed May 12 09:34:58 2010 From: feixiangniao26在gmail.com (enzo fang) Date: Wed, 12 May 2010 09:34:58 +0800 Subject: =?UTF-8?B?UmU6IOWmguS9leWcqOWGheaguOS4rea3u+WKoGtkYu+8nw==?= In-Reply-To: References: Message-ID: kdb是汇编级别的,kgdb可以看c源码,kgdb比较方便,因为我不是很懂汇编 在 2010年5月12日 上午5:02,yao zhao 写道: > Just curious, what is the difference of kdb and kgdb? > > thanks, > yao > > 2010/5/11 Zhang Le : >> 2010/5/11 xiaolong wang : >>> 我在linux-2.6.33.3内核中打上kdb补丁后,重新编译,出现了下面的错误: >>> arch/x86/kdb/kdba_support.c:1167: undefined reference to >>> `kdba_get_stack_info_alternate' >> >> 现在的内核已经集成kgdb >> >> >> -- >> Zhang Le, Robert >> Gentoo/Loongson(龙芯) Developer >> http://zhangle.is-a-geek.org >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org -- Best Regards From vividfe在gmail.com Wed May 12 09:41:57 2010 From: vividfe在gmail.com (vital) Date: Wed, 12 May 2010 09:41:57 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <030101caf0f6$39826b70$961cbcc0@sfdomain.com> References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> <030101caf0f6$39826b70$961cbcc0@sfdomain.com> Message-ID: 在 2010年5月11日 下午6:39,hellohello 写道: > 在arch\powerpc\sysdev\cpm2.c中有语句: > > cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); > > 我在这里添加了 > printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); > 结果打印出 > <7>cpm2_immr fdfc0000 f0000000 > > 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, > 各位,如何能知道这种映射正确与否呢? 映射没有问题。 Bruce > > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > Sent: Monday, May 10, 2010 9:13 AM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月7日 下午7:22,hellohello 写道: >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>> Cc: "林志平" ; "linux-kernel" >>> Sent: Thursday, May 06, 2010 5:42 PM >>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>>在 2010年5月6日 下午5:13,hellohello 写道: >>>>> 谢谢回复 >>>>> ----- Original Message ----- >>>>> From: "vital" >>>>> To: "hellohello" >>>>>> [snip] >>> ....... >>>> >>>> 但你可以dump __log_buf,从内存看到启动信息。 >>>> >>>>> >>> >>> ========== >>> 你的这个方法调试起来挺管用,我追踪到了 >>> start_kernel() >>> .... >>> init_IRQ(); >>> printk(KERN_DEBUG "init_IRQ\n"); >>> pidhash_init(); >>> printk(KERN_DEBUG "pidhash_init\n"); >>> >>> "init_IRQ\n"每次都能打印出来,但 >>> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 >>> 这么初步看来应该是init_IRQ(); >>> 函数执行后引起的死机了,检查中。 >>> >> >> Great! Maybe you should check if the mpic register in your board is >> match as the dts. >> >> Best Regards >> Bruce. >> >> >>> >>> >>> >>> >>> >>> >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: "vital" >>>>> To: "hellohello" >>>>> Cc: "林志平" ; "linux-kernel" >>>>> Sent: Thursday, May 06, 2010 4:43 PM >>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>> >>>>> >>>>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>>>> From: "vital" >>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>>>> >>>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>>>> => run ftp1 >>>>>> >>>>>> [snip] >>>>>> >>>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>> Updating property 'current-speed' = 00 00 25 80 >>>>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>> 这里就死掉了 >>>>>> >>>>>> 假设你已经起来了kernel。 >>>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>>>> 还要做地址偏移,正在查这些资料。 >>>>>> >>>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>> [snip] >>>>>> >>>>>>> serial在11a82 { >>>>>>> device_type = "serial"; >>>>>>> compatible = "fsl,mpc8272-smc-uart", >>>>>>> "fsl,cpm2-smc-uart"; >>>>>> >>>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>>>> >>>>>> Bruce >>>>>> >>>>>> >>>>>>> reg = <11a82 10 87fc 1>; >>>>>>> interrupts = <4 8>; >>>>>>> interrupt-parent = <&PIC>; >>>>>>> fsl,cpm-brg = <7>; >>>>>>> fsl,cpm-command = <1d000000>; >>>>>>> }; >>>>>>> } >>>>>>> } >>>>>>> ... >>>>>>> ... >>>>>>> chosen { >>>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>>>> }; >>>>>>> >>>>>>> ----- Original Message ----- >>>>>>> From: "vital" >>>>>>> To: "hellohello" >>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>> >>>>>>> >>>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>>>> >>>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>> >>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>> 3> cuImage确实可以尝试 >>>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>> >>>>>>>> 请依次排查。 >>>>>>>> >>>>>>>> Cheers >>>>>>>> Bruce >>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> . >>>>>>>>> >>>>>>>>> ----- Original Message ----- >>>>>>>>> From: "林志平" >>>>>>>>> To: "linux-kernel" >>>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>> >>>>>>>>> >>>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>>>> _______________________________________________ >>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>> _______________________________________________ >>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>> >>>>>> >>>> >> From helena.cai在oracle.com Wed May 12 11:42:38 2010 From: helena.cai在oracle.com (Helena Cai) Date: Tue, 11 May 2010 20:42:38 -0700 (PDT) Subject: =?UTF-8?B?T3JhY2xl5YWs5Y+45YyX5LqsIOaLm+iBmCBzZW5pb3IgbGk=?= =?UTF-8?B?bnV4IGtlcm5lbOW8gOWPkSYgbGludXjmtYvor5Ug5Lq65omN?= Message-ID: <2f031d59-a6df-44ef-80f5-fd26be21c67f@default> 对以下职位感兴趣的朋友,可以将简历发至 HYPERLINK "mailto:helena.cai在hotmail.com"helena.cai在hotmail.com   工作地点:北京   *Linux Sustaining Engineer   Debug and patch the Linux kernel, Xen Hypervisor, and work on Open Source projects with Oracle's Linux Sustaining team. . The main focus of our development revolves around the Linux kernel, Xen, the standard C libraries and OracleVM manager. Requirement:  Advanced/expert fluency with C and linux kernal  One of below: ·       Experience working with UNIX kernels, Xen Hypervisor, or demonstrably similar large software projects ·       Operational knowledge of Enterprise Linux distributions is expected (e.g. RHEL4, SLES9, CentOS) ·       Knowledge of bash, perl, and/or python are a bonus.   * Linux Engineer - BDE Be responsible for diagnosing, resolving, and debugging Linux kernel, user space and Oracle VM Server/Manager for x86 problems from world-wide customers. Interface with development teams when assistance or code fixes are needed. Also, you will diagnose and identify bugs which are filed by engineers. Requirement 1. Good working knowledge of C 2. Good verbal and written English communication skills 3. Excellent system-level debugging skills 4. Experience with one or more Linux distributions 5. Experience with patching and rebuilding Linux packages       *Solaris IO framework development Looking for engineers to work on implementing new features in Solaris platform sowftware in the areas of  Solaris IO framework, ie PCI/E, hotplug, interrupt, I/O virtualization, Fault Management, Solaris scalability for both SPARC & x86 architectures. - Good knowledge in Software Programming, Operating System design and Computer architecture.  - Strong C programming language skills. - Understanding of UNIX/Solaris internals   * Solaris QE Solaris Quality Engineer working on Solaris device driver related testing Strong C programming, shell scripting skills required                         From jiang.adam在gmail.com Wed May 12 12:49:25 2010 From: jiang.adam在gmail.com (Adam Jiang) Date: Wed, 12 May 2010 13:49:25 +0900 Subject: =?GB2312?B?UmU6IFJlOiC197bI0N64xA==?= In-Reply-To: References: <190659d.92e0.1287725f698.Coremail.hxboy@163.com> <5ba5bd.2a66.1287cc20658.Coremail.hxboy@163.com> Message-ID: 2010/5/11 Li Yu : > 我看了一下代码,2.6.18 & 2.6.32 , > > sched_setaffinity,()系统调用会等待到目标任务迁移完成后才返回。 如果从用户空间设置的话,这个syscall就是正解了! 看看这篇文章 http://www.linuxjournal.com/article/6799 /大头阿当 -- Adam Jiang ----------------------------------- e-mail:jiang.adam在gmail.com http://www.adamjiang.com ----------------------------------- From qingshenlwy在gmail.com Wed May 12 13:43:10 2010 From: qingshenlwy在gmail.com (Wenyi Liu) Date: Wed, 12 May 2010 13:43:10 +0800 Subject: =?GB2312?B?UmU6IEpWTSwgTG9uZ2VuZSBpbiBMaW51eCBLZXJuZWwgW1dhcyBSZTogzqrKssO0?= =?GB2312?B?sruw0UpWTbzTyOtLZXJuZWzE2KO/KFdoeSBub3QgYWRkIEpWTSBpbnRvIEtlcm5lbCld?= In-Reply-To: References: Message-ID: 为什么要这样??? 如果都这样加入,那么Linux内核将是一个大杂烩。 而且java那么多的OO的思想,就算加入能够提升java运行速度,那么系统整体速度和效率呢? 你可以尝试下往内核里推patch,但是估计被接受的可能性不大。 在 2010年5月11日 下午2:17,Cheng Renquan 写道: > 2010/5/7 Liang Guo : > > > > 在 2010年5月7日 下午4:47,Avanpak 写道: > >> > >> Linux下有很多Java应用,如openoffice, > >> 为什么不把JVM加入Kernel,让这些应用跑起来更顺畅呢? > >> > >> There're many Java applications on Linux, such as openoffice. > >> Why not add JVM into Kernel, and let them run better. > > > > Why do you think JVM in kernel space is better in user space ? > > 我个人觉得:除了法律、GPL的要求之外,没有什么技术上的理由说 JVM 不可以放进内核, > > 我想真正唯一的理由是:谁去做它? 谁有能力、有需求的人士不妨可以去尝试, > 但当前有没有谁想去接上这个活儿,这是个问题, > > 当时 03,04 年我们还在 linuxsir 的内核区讨论 “把 XWindow 移进内核让它像 > 运行Windows图形一样快, 如何?”, 支持和反对者辩论了很久,支持者认为会提高性能 > 让Linux图形和Windows一样快,反对者认为会引入BUG让Linux像Windows一样不稳定, > 经常崩溃;这样的辩论在各 Linux 社区都时常可见,但都没什么结果,因为没有人真正 > 去做,全部都是空谈没有意义, > http://www.linuxsir.org/bbs/thread147361-1.html > > 我们当时确实没有能力去实现 内核态XWindow 这么一件大工程,现在来看,内核模式设定 > KMS 可以被 内核接受,被各Linux发行版引用,其本质就是把一部分 XWindow代码移进了 > 内核态运行 (Xorg 的显卡驱动的一部分,), 证实了这个方向确实是可行的, > > @Avanpak, 你说的内核态JVM是目的让 内核态直接能运行 Java应用程序的class 文件? > 这样以后运行 Eclipse 确实应该快些, > > 位于 杭州 - 浙大网新 - 毛德操老师引领的 Longene 项目与此目的倒是有些类似, > 让 Linux内核直接运行Windows的PE格式exe可执行程序, > http://www.longene.org/ > > 初期版本的方案是内核模式的wine, 但0.3版以后实现有改变?其git仓库还是没变化,Jack能否发布点文档? > > "longene-0.3初步定于5月底发布,新版本将去除wineserver,所有功能在内核模块中完成。敬请期待!" > "整体移植wineserver至模块中,所有发往wineserver的请求通过系统调用方式直接进入内核, > 在wine中去掉wineserver进程。移植完成后,预计完成后性能会有较大地提高。" > > http://www.longene.org/newslist.php > http://www.longene.org/forum/viewtopic.php?f=2&t=4159 > http://www.longene.org/gitweb/?p=unifiedkernel.git > > 回到 JVM 和 Logene 问题本身,技术上没有什么不可以做的,有了需求,有了 motivation, > 还要有人坚持不懈把它做出来才行,Avanpak 您愿意开始 内核JVM 工作吗? > > > > > -- > > Liang Guo > > http://bluestone.cublog.cn > > -- > Cheng Renquan > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From vividfe在gmail.com Wed May 12 13:59:49 2010 From: vividfe在gmail.com (vital) Date: Wed, 12 May 2010 13:59:49 +0800 Subject: 8572 vs 8641D In-Reply-To: References: Message-ID: 在 2010年5月12日 上午4:58,yao zhao 写道: > It is tested that 8572's tlb flush is much slower than 8641D. I'm interested in your way. Can you share that with us? > I didn't try Linux but on our OS 8572 is 10 times slower than 8641D, Which OS is your OS? For latest Linux version Linux use mmucfg to invalidate some TLB. But I don't know how your OS do exactly. And Linux implements many tlb flush functions, such as flush_tlb_page, flush_tlb_mm and so on. So Kernel can use them according to different requirement. Obviously it's efficient. > it didn't make any sense. > And our kernel architecture said it has good reasons so just curious > anyone knows anything, please show some lights. > > on 8572 there are 2 tlbs, I didn't read user manual too much. How > Linux uses these 2? > TLB1 supports many page sizes but TLB0 is fixed 4K byte page. Often TLB1 is used to map kernel space to real memory, and TLB0 is for those common MMU handler. Bruce > thanks, > yao > > 2010/5/9 vital : >> What is the problem? >> >> Best Regards >> Bruce >> >> 在 2010年5月7日 下午9:55,yao zhao 写道: >>> Hi, >>> >>> Anyone is familiar with mpc8572 and mpc8641D. >>> Is there any tricky in mpc8572's tlb flush? >>> >>> thanks, >>> yao >>> _______________________________________________ >>> Linux 内核开发中文邮件列表 >>> Linux-kernel在zh-kernel.org >>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>> Linux 内核开发中文社区: http://zh-kernel.org >> > From yetiboy1230在gmail.com Wed May 12 15:57:04 2010 From: yetiboy1230在gmail.com (Liu Yuan) Date: Wed, 12 May 2010 15:57:04 +0800 Subject: =?UTF-8?B?UmU6IEpWTSwgTG9uZ2VuZSBpbiBMaW51eCBLZXJuZWwgW1dhcyBSZTog5Li65LuA5LmI?= =?UTF-8?B?5LiN5oqKSlZN5Yqg5YWlS2VybmVs5ZGi77yfKFdoeSBub3QgYWRkIEpWTSBpbnRvIEtlcm5lbCld?= In-Reply-To: References: Message-ID: 首先,layering & object-oriented 设计一直都是large scale system比如OS的设计方法用以实现modular。Edsger W. Dijkstra的THE(1968)就是一个非常典型的layering设计,70年代初的操作系统Hydra, CAL system是非常典型的OO设计,MULTICS也一样,比如它的processor multiplexing, memory multiplexing机制随着UNIX的流传成了事实上的实现标准,process, address space这些都是对象。各种机制的内部structuring也是非常的OO,比如VM中的page, block, process中的thread, context,都是一个个对象或者说abstractions.这是一个递归的过程,比如page这个对象实现中又包含了page table这个对象。 JAVA在内核中实现我不知道有没有意义,但是java的性能瓶颈不在kernel吧,kernel已经给JAVA虚拟机提够了足够多的service和各种必要的抽象(thread, address space等等),而这些东西肯定不是制约java的瓶颈。 Thanks Yuan 2010/5/12 Wenyi Liu > 为什么要这样??? > > 如果都这样加入,那么Linux内核将是一个大杂烩。 > > 而且java那么多的OO的思想,就算加入能够提升java运行速度,那么系统整体速度和效率呢? > > 你可以尝试下往内核里推patch,但是估计被接受的可能性不大。 > > > > 在 2010年5月11日 下午2:17,Cheng Renquan 写道: > > > 2010/5/7 Liang Guo : > > > > > > 在 2010年5月7日 下午4:47,Avanpak 写道: > > >> > > >> Linux下有很多Java应用,如openoffice, > > >> 为什么不把JVM加入Kernel,让这些应用跑起来更顺畅呢? > > >> > > >> There're many Java applications on Linux, such as openoffice. > > >> Why not add JVM into Kernel, and let them run better. > > > > > > Why do you think JVM in kernel space is better in user space ? > > > > 我个人觉得:除了法律、GPL的要求之外,没有什么技术上的理由说 JVM 不可以放进内核, > > > > 我想真正唯一的理由是:谁去做它? 谁有能力、有需求的人士不妨可以去尝试, > > 但当前有没有谁想去接上这个活儿,这是个问题, > > > > 当时 03,04 年我们还在 linuxsir 的内核区讨论 “把 XWindow 移进内核让它像 > > 运行Windows图形一样快, 如何?”, 支持和反对者辩论了很久,支持者认为会提高性能 > > 让Linux图形和Windows一样快,反对者认为会引入BUG让Linux像Windows一样不稳定, > > 经常崩溃;这样的辩论在各 Linux 社区都时常可见,但都没什么结果,因为没有人真正 > > 去做,全部都是空谈没有意义, > > http://www.linuxsir.org/bbs/thread147361-1.html > > > > 我们当时确实没有能力去实现 内核态XWindow 这么一件大工程,现在来看,内核模式设定 > > KMS 可以被 内核接受,被各Linux发行版引用,其本质就是把一部分 XWindow代码移进了 > > 内核态运行 (Xorg 的显卡驱动的一部分,), 证实了这个方向确实是可行的, > > > > @Avanpak, 你说的内核态JVM是目的让 内核态直接能运行 Java应用程序的class 文件? > > 这样以后运行 Eclipse 确实应该快些, > > > > 位于 杭州 - 浙大网新 - 毛德操老师引领的 Longene 项目与此目的倒是有些类似, > > 让 Linux内核直接运行Windows的PE格式exe可执行程序, > > http://www.longene.org/ > > > > 初期版本的方案是内核模式的wine, 但0.3版以后实现有改变?其git仓库还是没变化,Jack能否发布点文档? > > > > "longene-0.3初步定于5月底发布,新版本将去除wineserver,所有功能在内核模块中完成。敬请期待!" > > "整体移植wineserver至模块中,所有发往wineserver的请求通过系统调用方式直接进入内核, > > 在wine中去掉wineserver进程。移植完成后,预计完成后性能会有较大地提高。" > > > > http://www.longene.org/newslist.php > > http://www.longene.org/forum/viewtopic.php?f=2&t=4159 > > http://www.longene.org/gitweb/?p=unifiedkernel.git > > > > 回到 JVM 和 Logene 问题本身,技术上没有什么不可以做的,有了需求,有了 motivation, > > 还要有人坚持不懈把它做出来才行,Avanpak 您愿意开始 内核JVM 工作吗? > > > > > > > > -- > > > Liang Guo > > > http://bluestone.cublog.cn > > > > -- > > Cheng Renquan > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From hangbing0203在gmail.com Wed May 12 16:17:14 2010 From: hangbing0203在gmail.com (=?UTF-8?B?5YiY6Ziz?=) Date: Wed, 12 May 2010 16:17:14 +0800 Subject: =?UTF-8?B?5LiL6L29bWlwc2FuZHJvaWTmupDku6PnoIHlh7rnjrDnmoTpl67popjjgII=?= Message-ID: 大家好,我在mipsandroid网站下载android源代码死活都不能下载。 一直叫我输入用户名和邮箱。我输入的都是对的。 觉得很奇怪, 不知道大家遇到这样的问题没有呢。 From hangbing0203在gmail.com Wed May 12 16:51:57 2010 From: hangbing0203在gmail.com (=?UTF-8?B?5YiY6Ziz?=) Date: Wed, 12 May 2010 16:51:57 +0800 Subject: =?UTF-8?B?57yW6K+RYW5kcm9pZOWHuueOsOmXrumimOOAgg==?= Message-ID: 源代码是同事那里的肯定能编译, 但是到我这机器上来都编译不过去了, java都正确的安装了的。 Directory: out/target/product/hmp10/data target Jar: core-tests (out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar) java.util.zip.ZipException: duplicate entry: hyts_Foo.c at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175) at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92) at sun.tools.jar.Main.addFile(Main.java:713) at sun.tools.jar.Main.update(Main.java:567) at sun.tools.jar.Main.run(Main.java:202) at sun.tools.jar.Main.main(Main.java:1149) make: *** [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] Error 1 make: *** Deleting file `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar' From solyn123在gmail.com Wed May 12 16:52:14 2010 From: solyn123在gmail.com (=?GB2312?B?wdbWvsa9?=) Date: Wed, 12 May 2010 16:52:14 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 呃,以前用2.4.31的,现在需要升级到2.6 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: > 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 > > 在 2010年5月10日 下午5:13,林志平 写道: > > 以前的搞定了,现在又有新的需求 > > > > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: > >> > >> 还没有升级到新的版本啊? > >> > >> 在 2010年5月6日 上午11:38,林志平 写道: > >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > >> > 我感觉是我的dtb文件有点问题, > >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > >> > _______________________________________________ > >> > Linux 内核开发中文邮件列表 > >> > Linux-kernel在zh-kernel.org > >> > http://zh-kernel.org/mailman/listinfo/linux-kernel > >> > Linux 内核开发中文社区: http://zh-kernel.org > > > > > From mylatex在gmail.com Wed May 12 16:57:56 2010 From: mylatex在gmail.com (mylatex mylatex) Date: Wed, 12 May 2010 16:57:56 +0800 Subject: =?GB2312?B?UmU6IExpbnV4IHRjcLKit6LBrL3Tyv3Oyszi?= In-Reply-To: <20100510023132.GA6004@gentoo> References: <20100510023132.GA6004@gentoo> Message-ID: 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 在 2010年5月10日 上午10:31, 写道: > On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > > Linux > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > > 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > > 什么应用需要这么多端口? > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From vividfe在gmail.com Wed May 12 16:59:38 2010 From: vividfe在gmail.com (vital) Date: Wed, 12 May 2010 16:59:38 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 在 2010年5月12日 下午4:52,林志平 写道: > 呃,以前用2.4.31的,现在需要升级到2.6 > 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? 态度严重有问题。没有调研过,就这么武断下结论,对技术人员是要不得的。 你可知道dtb的便利性? 如今连ARM,MIPS都在引入。 Bruce > 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: > >> 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 >> >> 在 2010年5月10日 下午5:13,林志平 写道: >> > 以前的搞定了,现在又有新的需求 >> > >> > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: >> >> >> >> 还没有升级到新的版本啊? >> >> >> >> 在 2010年5月6日 上午11:38,林志平 写道: >> >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >> >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 >> >> > 我感觉是我的dtb文件有点问题, >> >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >> >> > _______________________________________________ >> >> > Linux 内核开发中文邮件列表 >> >> > Linux-kernel在zh-kernel.org >> >> > http://zh-kernel.org/mailman/listinfo/linux-kernel >> >> > Linux 内核开发中文社区: http://zh-kernel.org >> > >> > >> > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From zhangsw在gwbnsh.net.cn Wed May 12 17:09:23 2010 From: zhangsw在gwbnsh.net.cn (=?UTF-8?B?5byg57uN5paH?=) Date: Wed, 12 May 2010 17:09:23 +0800 Subject: =?UTF-8?B?UmU6IExpbnV4IHRjcOW5tuWPkei/nuaOpeaVsOmXrumimA==?= In-Reply-To: References: <20100510023132.GA6004@gentoo> Message-ID: 在 2010年5月12日 下午4:57,mylatex mylatex 写道: > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > 应该没混,本地要建立一个向外的连接必须使用一个本地端口,问题就在于建立的连接太 多,把本地的端口用完了。。。我只在用polygraph做压力测试的时候碰到过这种情 况,实际中不常见。 四元组是netfilter的表,好像是两码事吧。 > > > 在 2010年5月10日 上午10:31, 写道: > >> On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: >> > Linux >> > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 >> > >> 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? >> >> 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 >> >> 什么应用需要这么多端口? >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org >> > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org -- 张绍文 gongfan193在gmail.com zhangsw在gwbnsh.net.cn 18601633785 From liu-dj在neusoft.com Wed May 12 17:15:03 2010 From: liu-dj在neusoft.com (Dejun.Liu) Date: Wed, 12 May 2010 05:15:03 -0400 Subject: Linux =?UTF-8?Q?tcp=E5=B9=B6=E5=8F=91=E8=BF=9E=E6=8E=A5=E6=95=B0=E9=97=AE?= =?UTF-8?Q?=E9=A2=98?= In-Reply-To: References: <20100510023132.GA6004@gentoo> Message-ID: <1273655703.23529.14.camel@dejunliu-desktop> 可不可以说明一下具体的应用。 On Wed, 2010-05-12 at 16:57 +0800, mylatex mylatex wrote: > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > > > > 在 2010年5月10日 上午10:31, 写道: > > > On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > > > Linux > > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > > > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > > > > 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > > > > 什么应用需要这么多端口? > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org --------------------------------------------------------------------------------------------------- Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) is intended only for the use of the intended recipient and may be confidential and/or privileged of Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is not the intended recipient, unauthorized use, forwarding, printing, storing, disclosure or copying is strictly prohibited, and may be unlawful.If you have received this communication in error,please immediately notify the sender by return e-mail, and delete the original message and all copies from your system. Thank you. --------------------------------------------------------------------------------------------------- From gejunly在sina.com Wed May 12 17:22:51 2010 From: gejunly在sina.com (gejunly) Date: Wed, 12 May 2010 17:22:51 +0800 Subject: =?gb2312?B?yPXI9bXEzsrSu8/CudjT2mx1c3RyZbXEzsrM4g==?= Message-ID: <201005121722444567259@sina.com> 请问各位哥哥姐姐们,谁能发点关于在RED HAT AS5上配置lustre1.8的技术手册吗?我在安装完毕后,出现了无法导入文件系统的错误。小弟在这里重谢了。 2010-05-12 gejunly From hellohello008在163.com Wed May 12 21:14:44 2010 From: hellohello008在163.com (hellohello) Date: Wed, 12 May 2010 21:14:44 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <03ac01caece8$35240000$9c1cbcc0@sfdomain.com> <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> <030101caf0f6$39826b70$961cbcc0@sfdomain.com> Message-ID: <00c501caf1d5$178bdad0$961cbcc0@sfdomain.com> 谢谢,这两天虽然已找到引起死机的地方,但我还没能找到该处与死机间的因果关系。 引起死机的关键语句在/arch/powerpc/sysdev/cpm2_pic.c 中 cpm2_pic_init() { ... cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, 64, &cpm2_pic_host_ops, 64); } 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, 如果注释掉这行代码,就会一直执行到对console 口的初始化处,给出失败信息。 跑到irq_alloc_host 函数里面看了一下, 主要就是为struct irq_host *host 分配了内存: host = zalloc_maybe_bootmem(size, GFP_KERNEL); 然后根据传进来的参数64(mpc8247的中断源个数64),将数组初始化为 NO_IRQ for (i = 0; i < revmap_arg; i++) rmap[i] = NO_IRQ; 看不出有特别的地方。 与板子移植相关的smc io管脚配置、smc brg设置、中断号我也检查过了, 82xx/mpc8272_ads.c看过了, 目前都还未发现有问题,奇怪。 ----- Original Message ----- From: "vital" To: "hellohello" Cc: "林志平" ; "linux-kernel" Sent: Wednesday, May 12, 2010 9:41 AM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >在 2010年5月11日 下午6:39,hellohello 写道: >> 在arch\powerpc\sysdev\cpm2.c中有语句: >> >> cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); >> >> 我在这里添加了 >> printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); >> 结果打印出 >> <7>cpm2_immr fdfc0000 f0000000 >> >> 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, >> 各位,如何能知道这种映射正确与否呢? > > 映射没有问题。 > > Bruce > >> >> >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >> Cc: "林志平" ; "linux-kernel" >> Sent: Monday, May 10, 2010 9:13 AM >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>>在 2010年5月7日 下午7:22,hellohello 写道: >>>> ----- Original Message ----- >>>> From: "vital" >>>> To: "hellohello" >>>> Cc: "林志平" ; "linux-kernel" >>>> Sent: Thursday, May 06, 2010 5:42 PM >>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>> >>>> >>>>>在 2010年5月6日 下午5:13,hellohello 写道: >>>>>> 谢谢回复 >>>>>> ----- Original Message ----- >>>>>> From: "vital" >>>>>> To: "hellohello" >>>>>>> [snip] >>>> ....... >>>>> >>>>> 但你可以dump __log_buf,从内存看到启动信息。 >>>>> >>>>>> >>>> >>>> ========== >>>> 你的这个方法调试起来挺管用,我追踪到了 >>>> start_kernel() >>>> .... >>>> init_IRQ(); >>>> printk(KERN_DEBUG "init_IRQ\n"); >>>> pidhash_init(); >>>> printk(KERN_DEBUG "pidhash_init\n"); >>>> >>>> "init_IRQ\n"每次都能打印出来,但 >>>> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 >>>> 这么初步看来应该是init_IRQ(); >>>> 函数执行后引起的死机了,检查中。 >>>> >>> >>> Great! Maybe you should check if the mpic register in your board is >>> match as the dts. >>> >>> Best Regards >>> Bruce. >>> >>> >>>> >>>> >>>> >>>> >>>> >>>> >>>>>> >>>>>> >>>>>> ----- Original Message ----- >>>>>> From: "vital" >>>>>> To: "hellohello" >>>>>> Cc: "林志平" ; "linux-kernel" >>>>>> Sent: Thursday, May 06, 2010 4:43 PM >>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>> >>>>>> >>>>>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>>>>> From: "vital" >>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>>>>> >>>>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>>>>> => run ftp1 >>>>>>> >>>>>>> [snip] >>>>>>> >>>>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>> Updating property 'current-speed' = 00 00 25 80 >>>>>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>> 这里就死掉了 >>>>>>> >>>>>>> 假设你已经起来了kernel。 >>>>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>>>>> 还要做地址偏移,正在查这些资料。 >>>>>>> >>>>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> [snip] >>>>>>> >>>>>>>> serial在11a82 { >>>>>>>> device_type = "serial"; >>>>>>>> compatible = "fsl,mpc8272-smc-uart", >>>>>>>> "fsl,cpm2-smc-uart"; >>>>>>> >>>>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>>>>> >>>>>>> Bruce >>>>>>> >>>>>>> >>>>>>>> reg = <11a82 10 87fc 1>; >>>>>>>> interrupts = <4 8>; >>>>>>>> interrupt-parent = <&PIC>; >>>>>>>> fsl,cpm-brg = <7>; >>>>>>>> fsl,cpm-command = <1d000000>; >>>>>>>> }; >>>>>>>> } >>>>>>>> } >>>>>>>> ... >>>>>>>> ... >>>>>>>> chosen { >>>>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>>>>> }; >>>>>>>> >>>>>>>> ----- Original Message ----- >>>>>>>> From: "vital" >>>>>>>> To: "hellohello" >>>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>> >>>>>>>> >>>>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>>>>> >>>>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>> >>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>> 3> cuImage确实可以尝试 >>>>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>> >>>>>>>>> 请依次排查。 >>>>>>>>> >>>>>>>>> Cheers >>>>>>>>> Bruce >>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> . >>>>>>>>>> >>>>>>>>>> ----- Original Message ----- >>>>>>>>>> From: "林志平" >>>>>>>>>> To: "linux-kernel" >>>>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>> _______________________________________________ >>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>> >>>>>>> >>>>> >>> > From lujing9101在gmail.com Wed May 12 23:17:07 2010 From: lujing9101在gmail.com (lu) Date: Wed, 12 May 2010 23:17:07 +0800 Subject: =?GB2312?B?UmU6IExpbnV4LWtlcm5lbCDVqtKqLCC+7SAzNCwgt6KyvCAyMg==?= In-Reply-To: References: Message-ID: 我要做高并发连接的代理服务器,最少要支持500K并发连接,目前只能到60k。 在 2010年5月12日 下午9:15, 写道: > 想在 Linux-kernel 邮件列表发言,请写信给: > linux-kernel在zh-kernel.org > > 要订阅或者退订列表,可以访问万维网地址: > http://zh-kernel.org/mailman/listinfo/linux-kernel > 或者可以向: > linux-kernel-request在zh-kernel.org > 发送主题或者正文为'help'的邮件。 > > 您可以通过邮件地址: > linux-kernel-owner在zh-kernel.org > 联系到此列表的管理员。 > > 当回信时,请给一个适当的标题,这样会比 "Re: > Contents of Linux-kernel digest..."更清楚明白。 > > > 这是邮件列表的摘要。如果想要回复此邮件,请务必注意: > 1. 根据要回复的主题,重新给邮件加上合适的标题 > 2. 去除和回复无关的其他引文。 > > 本日主题: > > 1. 编译android出现问题。 (刘阳) > 2. Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > (林志平) > 3. Re: Linux tcp并发连接数问题 (mylatex mylatex) > 4. Re: u-boot1.1.2版本是否支持dtb的参数传递方式 (vital) > 5. Re: Linux tcp并发连接数问题 (张绍文) > 6. Re: Linux tcp并发连接数问题 (Dejun.Liu) > 7. 弱弱的问一下关于lustre的问题 (gejunly) > 8. Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > (hellohello) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Wed, 12 May 2010 16:51:57 +0800 > From: 刘阳 > To: linux-kernel在zh-kernel.org > Subject: 编译android出现问题。 > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > 源代码是同事那里的肯定能编译, 但是到我这机器上来都编译不过去了, java都正确的安装了的。 > Directory: out/target/product/hmp10/data > target Jar: core-tests > (out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar) > java.util.zip.ZipException: duplicate entry: hyts_Foo.c > at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175) > at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92) > at sun.tools.jar.Main.addFile(Main.java:713) > at sun.tools.jar.Main.update(Main.java:567) > at sun.tools.jar.Main.run(Main.java:202) > at sun.tools.jar.Main.main(Main.java:1149) > make: *** > [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] > Error 1 > make: *** Deleting file > `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar' > > > ------------------------------ > > Message: 2 > Date: Wed, 12 May 2010 16:52:14 +0800 > From: 林志平 > To: "Gao Ya'nan" > Cc: linux-kernel > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > Message-ID: > > Content-Type: text/plain; charset=GB2312 > > 呃,以前用2.4.31的,现在需要升级到2.6 > 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? > 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: > > > 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 > > > > 在 2010年5月10日 下午5:13,林志平 写道: > > > 以前的搞定了,现在又有新的需求 > > > > > > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: > > >> > > >> 还没有升级到新的版本啊? > > >> > > >> 在 2010年5月6日 上午11:38,林志平 写道: > > >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > > >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > > >> > 我感觉是我的dtb文件有点问题, > > >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > > >> > _______________________________________________ > > >> > Linux 内核开发中文邮件列表 > > >> > Linux-kernel在zh-kernel.org > > >> > http://zh-kernel.org/mailman/listinfo/linux-kernel > > >> > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > > > > > ------------------------------ > > Message: 3 > Date: Wed, 12 May 2010 16:57:56 +0800 > From: mylatex mylatex > To: Linux-kernel在zh-kernel.org > Subject: Re: Linux tcp并发连接数问题 > Message-ID: > > Content-Type: text/plain; charset=GB2312 > > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > > > > 在 2010年5月10日 上午10:31, 写道: > > > On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > > > Linux > > > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > > > > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > > > > 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > > > > 什么应用需要这么多端口? > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > > ------------------------------ > > Message: 4 > Date: Wed, 12 May 2010 16:59:38 +0800 > From: vital > To: 林志平 > Cc: linux-kernel > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > Message-ID: > > Content-Type: text/plain; charset=GB2312 > > 在 2010年5月12日 下午4:52,林志平 写道: > > 呃,以前用2.4.31的,现在需要升级到2.6 > > 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? > > 态度严重有问题。没有调研过,就这么武断下结论,对技术人员是要不得的。 > > 你可知道dtb的便利性? > 如今连ARM,MIPS都在引入。 > > Bruce > > > 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: > > > >> 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 > >> > >> 在 2010年5月10日 下午5:13,林志平 写道: > >> > 以前的搞定了,现在又有新的需求 > >> > > >> > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: > >> >> > >> >> 还没有升级到新的版本啊? > >> >> > >> >> 在 2010年5月6日 上午11:38,林志平 写道: > >> >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > >> >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > >> >> > 我感觉是我的dtb文件有点问题, > >> >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > >> >> > _______________________________________________ > >> >> > Linux 内核开发中文邮件列表 > >> >> > Linux-kernel在zh-kernel.org > >> >> > http://zh-kernel.org/mailman/listinfo/linux-kernel > >> >> > Linux 内核开发中文社区: http://zh-kernel.org > >> > > >> > > >> > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > ------------------------------ > > Message: 5 > Date: Wed, 12 May 2010 17:09:23 +0800 > From: 张绍文 > To: mylatex mylatex > Cc: Linux-kernel在zh-kernel.org > Subject: Re: Linux tcp并发连接数问题 > Message-ID: > > Content-Type: text/plain; charset=UTF-8 > > 在 2010年5月12日 下午4:57,mylatex mylatex 写道: > > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > > > > 应该没混,本地要建立一个向外的连接必须使用一个本地端口,问题就在于建立的连接太 > 多,把本地的端口用完了。。。我只在用polygraph做压力测试的时候碰到过这种情 > 况,实际中不常见。 > > 四元组是netfilter的表,好像是两码事吧。 > > > > > > > 在 2010年5月10日 上午10:31, 写道: > > > >> On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > >> > Linux > >> > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > >> > > >> > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > >> > >> 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > >> > >> 什么应用需要这么多端口? > >> _______________________________________________ > >> Linux 内核开发中文邮件列表 > >> Linux-kernel在zh-kernel.org > >> http://zh-kernel.org/mailman/listinfo/linux-kernel > >> Linux 内核开发中文社区: http://zh-kernel.org > >> > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > > -- > 张绍文 > gongfan193在gmail.com > zhangsw在gwbnsh.net.cn > 18601633785 > > ------------------------------ > > Message: 6 > Date: Wed, 12 May 2010 05:15:03 -0400 > From: "Dejun.Liu" > To: mylatex mylatex > Cc: Linux-kernel在zh-kernel.org > Subject: Re: Linux tcp并发连接数问题 > Message-ID: <1273655703.23529.14.camel在dejunliu-desktop> > Content-Type: text/plain; charset="utf-8" > > 可不可以说明一下具体的应用。 > > On Wed, 2010-05-12 at 16:57 +0800, mylatex mylatex wrote: > > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > > > > > > > > 在 2010年5月10日 上午10:31, 写道: > > > > > On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > > > > Linux > > > > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > > > > > > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > > > > > > 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > > > > > > 什么应用需要这么多端口? > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > --------------------------------------------------------------------------------------------------- > Confidentiality Notice: The information contained in this e-mail and any > accompanying attachment(s) > is intended only for the use of the intended recipient and may be > confidential and/or privileged of > Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader > of this communication is > not the intended recipient, unauthorized use, forwarding, printing, > storing, disclosure or copying > is strictly prohibited, and may be unlawful.If you have received this > communication in error,please > immediately notify the sender by return e-mail, and delete the original > message and all copies from > your system. Thank you. > > --------------------------------------------------------------------------------------------------- > > ------------------------------ > > Message: 7 > Date: Wed, 12 May 2010 17:22:51 +0800 > From: "gejunly" > To: "Linux-kernel" > Subject: 弱弱的问一下关于lustre的问题 > Message-ID: <201005121722444567259在sina.com> > Content-Type: text/plain; charset="gb2312" > > > 请问各位哥哥姐姐们,谁能发点关于在RED HAT > AS5上配置lustre1.8的技术手册吗?我在安装完毕后,出现了无法导入文件系统的错误。小弟在这里重谢了。 > 2010-05-12 > > > > gejunly > > ------------------------------ > > Message: 8 > Date: Wed, 12 May 2010 21:14:44 +0800 > From: "hellohello" > To: "vital" > Cc: linux-kernel > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > Message-ID: <00c501caf1d5$178bdad0$961cbcc0在sfdomain.com> > Content-Type: text/plain; charset="gb2312" > > 谢谢,这两天虽然已找到引起死机的地方,但我还没能找到该处与死机间的因果关系。 > > 引起死机的关键语句在/arch/powerpc/sysdev/cpm2_pic.c 中 > cpm2_pic_init() > { > ... > cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, > 64, &cpm2_pic_host_ops, 64); > } > > 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, > 如果注释掉这行代码,就会一直执行到对console 口的初始化处,给出失败信息。 > > > 跑到irq_alloc_host 函数里面看了一下, > 主要就是为struct irq_host *host 分配了内存: > host = zalloc_maybe_bootmem(size, GFP_KERNEL); > 然后根据传进来的参数64(mpc8247的中断源个数64),将数组初始化为 NO_IRQ > for (i = 0; i < revmap_arg; i++) > rmap[i] = NO_IRQ; > > 看不出有特别的地方。 > > > > 与板子移植相关的smc io管脚配置、smc brg设置、中断号我也检查过了, > 82xx/mpc8272_ads.c看过了, > 目前都还未发现有问题,奇怪。 > > > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > > Sent: Wednesday, May 12, 2010 9:41 AM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > > >在 2010年5月11日 下午6:39,hellohello 写道: > >> 在arch\powerpc\sysdev\cpm2.c中有语句: > >> > >> cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); > >> > >> 我在这里添加了 > >> printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); > >> 结果打印出 > >> <7>cpm2_immr fdfc0000 f0000000 > >> > >> 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, > >> 各位,如何能知道这种映射正确与否呢? > > > > 映射没有问题。 > > > > Bruce > > > >> > >> > >> ----- Original Message ----- > >> From: "vital" > >> To: "hellohello" > >> Cc: "林志平" ; "linux-kernel" < > linux-kernel在zh-kernel.org> > >> Sent: Monday, May 10, 2010 9:13 AM > >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > >> > >> > >>>在 2010年5月7日 下午7:22,hellohello 写道: > >>>> ----- Original Message ----- > >>>> From: "vital" > >>>> To: "hellohello" > >>>> Cc: "林志平" ; "linux-kernel" < > linux-kernel在zh-kernel.org> > >>>> Sent: Thursday, May 06, 2010 5:42 PM > >>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > >>>> > >>>> > >>>>>在 2010年5月6日 下午5:13,hellohello 写道: > >>>>>> 谢谢回复 > >>>>>> ----- Original Message ----- > >>>>>> From: "vital" > >>>>>> To: "hellohello" > >>>>>>> [snip] > >>>> ....... > >>>>> > >>>>> 但你可以dump __log_buf,从内存看到启动信息。 > >>>>> > >>>>>> > >>>> > >>>> ========== > >>>> 你的这个方法调试起来挺管用,我追踪到了 > >>>> start_kernel() > >>>> .... > >>>> init_IRQ(); > >>>> printk(KERN_DEBUG "init_IRQ\n"); > >>>> pidhash_init(); > >>>> printk(KERN_DEBUG "pidhash_init\n"); > >>>> > >>>> "init_IRQ\n"每次都能打印出来,但 > >>>> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 > >>>> 这么初步看来应该是init_IRQ(); > >>>> 函数执行后引起的死机了,检查中。 > >>>> > >>> > >>> Great! Maybe you should check if the mpic register in your board is > >>> match as the dts. > >>> > >>> Best Regards > >>> Bruce. > >>> > >>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>> > >>>>>> > >>>>>> > >>>>>> ----- Original Message ----- > >>>>>> From: "vital" > >>>>>> To: "hellohello" > >>>>>> Cc: "林志平" ; "linux-kernel" < > linux-kernel在zh-kernel.org> > >>>>>> Sent: Thursday, May 06, 2010 4:43 PM > >>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > >>>>>> > >>>>>> > >>>>>>>在 2010年5月6日 下午3:41,hellohello 写道: > >>>>>>>> From: "vital" > >>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? > >>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) > >>>>>>>> 下面是u-boot里tftp内核到内存的运行过程: > >>>>>>>> > >>>>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 > console=ttyCPM0,9600 > >>>>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 > /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; > bootm 1000000 2000000 400000' > >>>>>>>> => run ftp1 > >>>>>>> > >>>>>>> [snip] > >>>>>>> > >>>>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) > >>>>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK > >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' > = 08 00 c0 a8 01 01 > >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' > = 08 00 c0 a8 01 01 > >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' > = 04 00 00 00 00 0b > >>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' > = 04 00 00 00 00 0b > >>>>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 > >>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 > >>>>>>>> Updating property 'clock-frequency' = 17 d7 84 00 > >>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 > >>>>>>>> Updating property 'current-speed' = 00 00 25 80 > >>>>>>>> Updating property 'clock-frequency' = 01 7d 78 40 > >>>>>>>> ## Transferring control to Linux (at address 00000000) ... > >>>>>>>> 这里就死掉了 > >>>>>>> > >>>>>>> 假设你已经起来了kernel。 > >>>>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 > >>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 > >>>>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 > >>>>>>>> 还要做地址偏移,正在查这些资料。 > >>>>>>> > >>>>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART > BASE地址的定义。 > >>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>>> > >>>>>>> [snip] > >>>>>>> > >>>>>>>> serial在11a82 { > >>>>>>>> device_type = "serial"; > >>>>>>>> compatible = "fsl,mpc8272-smc-uart", > >>>>>>>> "fsl,cpm2-smc-uart"; > >>>>>>> > >>>>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? > >>>>>>> > >>>>>>> Bruce > >>>>>>> > >>>>>>> > >>>>>>>> reg = <11a82 10 87fc 1>; > >>>>>>>> interrupts = <4 8>; > >>>>>>>> interrupt-parent = <&PIC>; > >>>>>>>> fsl,cpm-brg = <7>; > >>>>>>>> fsl,cpm-command = <1d000000>; > >>>>>>>> }; > >>>>>>>> } > >>>>>>>> } > >>>>>>>> ... > >>>>>>>> ... > >>>>>>>> chosen { > >>>>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; > >>>>>>>> }; > >>>>>>>> > >>>>>>>> ----- Original Message ----- > >>>>>>>> From: "vital" > >>>>>>>> To: "hellohello" > >>>>>>>> Cc: "林志平" ; "linux-kernel" < > linux-kernel在zh-kernel.org> > >>>>>>>> Sent: Thursday, May 06, 2010 3:09 PM > >>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > >>>>>>>> > >>>>>>>> > >>>>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: > >>>>>>>>>> > >>>>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 > >>>>>>>>>> 以前没搞过linux,现在发现开头很费劲, > >>>>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso > >>>>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 > >>>>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 > >>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... > >>>>>>>>> > >>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? > >>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) > >>>>>>>>> 3> cuImage确实可以尝试 > >>>>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? > >>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 > >>>>>>>>> > >>>>>>>>> 请依次排查。 > >>>>>>>>> > >>>>>>>>> Cheers > >>>>>>>>> Bruce > >>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>> . > >>>>>>>>>> > >>>>>>>>>> ----- Original Message ----- > >>>>>>>>>> From: "林志平" > >>>>>>>>>> To: "linux-kernel" > >>>>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM > >>>>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 > >>>>>>>>>> > >>>>>>>>>> > >>>>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > >>>>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 > >>>>>>>>>>> 我感觉是我的dtb文件有点问题, > >>>>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > >>>>>>>>>>> _______________________________________________ > >>>>>>>>>>> Linux 内核开发中文邮件列表 > >>>>>>>>>>> Linux-kernel在zh-kernel.org > >>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > >>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org > >>>>>>>>>> _______________________________________________ > >>>>>>>>>> Linux 内核开发中文邮件列表 > >>>>>>>>>> Linux-kernel在zh-kernel.org > >>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel > >>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org > >>>>>>>>> > >>>>>>> > >>>>> > >>> > > > > ------------------------------ > > _______________________________________________ > Linux内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > > 结束Linux-kernel 摘要, 卷 34, 发布 22 > ******************************************** > From dragonlinux在gmail.com Thu May 13 02:52:19 2010 From: dragonlinux在gmail.com (yao zhao) Date: Wed, 12 May 2010 14:52:19 -0400 Subject: 8572 vs 8641D In-Reply-To: References: Message-ID: I googled and read our 8641's implementation, on 600 we use segment register to map but on 8572 there is no DBAT and segment register any more, so we have to stuck with tlbs. thanks, yao 2010/5/12 vital : > 在 2010年5月12日 上午4:58,yao zhao 写道: >> It is tested that 8572's tlb flush is much slower than 8641D. > > I'm interested in your way. Can you share that with us? It is bad that our kernel source was still open until last month. the OS is qnx. > >> I didn't try Linux but on our OS 8572 is 10 times slower than 8641D, > > Which OS is your OS? > > For latest Linux version Linux use mmucfg to invalidate some TLB. But > I don't know how your OS do exactly. > Actually there is a very simple case: process A writes some data to process B address space, in kernel it will map process B's buffer to process A's space, it is a small buffer 6x bytes so maximum we only need to flush 2 tlbs(assume it crossed page) but kernel flushes all tlbs(I didn't understand this part). I got a reply from our kernel guy, it seems that there is something we haven't done yet, it is OS related. I believe Linux shouldn't do like that:( > And Linux implements many tlb flush functions, such as flush_tlb_page, > flush_tlb_mm and so on. So Kernel can use them according to different > requirement. > Obviously it's efficient. > I believe it should implement like this. >> it didn't make any sense. >> And our kernel architecture said it has good reasons so just curious >> anyone knows anything, please show some lights. >> >> on 8572 there are 2 tlbs, I didn't read user manual too much. How >> Linux uses these 2? >> > > TLB1 supports many page sizes but TLB0 is fixed 4K byte page. Often TLB1 > is used to map kernel space to real memory, and TLB0 is for those common > MMU handler. > > Bruce > >> thanks, >> yao >> >> 2010/5/9 vital : >>> What is the problem? >>> >>> Best Regards >>> Bruce >>> >>> 在 2010年5月7日 下午9:55,yao zhao 写道: >>>> Hi, >>>> >>>> Anyone is familiar with mpc8572 and mpc8641D. >>>> Is there any tricky in mpc8572's tlb flush? >>>> >>>> thanks, >>>> yao >>>> _______________________________________________ >>>> Linux 内核开发中文邮件列表 >>>> Linux-kernel在zh-kernel.org >>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>> Linux 内核开发中文社区: http://zh-kernel.org >>> >> > From qingshenlwy在gmail.com Thu May 13 09:07:59 2010 From: qingshenlwy在gmail.com (Wenyi Liu) Date: Thu, 13 May 2010 09:07:59 +0800 Subject: =?GB2312?B?UmU6ILHg0uthbmRyb2lks/bP1s7KzOKhow==?= In-Reply-To: References: Message-ID: 不是代码的问题,那就可能环境的问题了,跟同事对比下环境差异呢,比如说JAVA的具体版本号。 在 2010年5月12日 下午4:51,刘阳 写道: > 源代码是同事那里的肯定能编译, 但是到我这机器上来都编译不过去了, java都正确的安装了的。 > Directory: out/target/product/hmp10/data > target Jar: core-tests > (out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar) > java.util.zip.ZipException: duplicate entry: hyts_Foo.c > at java.util.zip.ZipOutputStream.putNextEntry(ZipOutputStream.java:175) > at java.util.jar.JarOutputStream.putNextEntry(JarOutputStream.java:92) > at sun.tools.jar.Main.addFile(Main.java:713) > at sun.tools.jar.Main.update(Main.java:567) > at sun.tools.jar.Main.run(Main.java:202) > at sun.tools.jar.Main.main(Main.java:1149) > make: *** > [out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar] > Error 1 > make: *** Deleting file > `out/target/common/obj/JAVA_LIBRARIES/core-tests_intermediates/javalib.jar' > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From dreamice.jiang在gmail.com Thu May 13 09:12:16 2010 From: dreamice.jiang在gmail.com (Junyong Jiang) Date: Thu, 13 May 2010 09:12:16 +0800 Subject: =?UTF-8?B?UmU6IExpbnV4IHRjcOW5tuWPkei/nuaOpeaVsOmXrumimA==?= In-Reply-To: <1273655703.23529.14.camel@dejunliu-desktop> References: <20100510023132.GA6004@gentoo> <1273655703.23529.14.camel@dejunliu-desktop> Message-ID: 本地建立的连接和netfilter的conntrack是不一样的。本地新建一个连接需要占用一个端口,而conntrack在内核态中,虽然他们标识连接都是五元组,但内核态中源端口可以不同,而在用户态,必须要绑定一个本地端口才能主动发起建立连接,所以用户太支持的连接数受端口数的限制,而内核态不受这个约束。当然,如果是被动接受建立链接的情况,通常如web服务器,则应该不受这个限制。 目前Linux内核中,默认情况下也将conntrack max设置为65535,只是为了内存使用的考虑,和tcp端口没有直接的关系。 在 2010年5月12日 下午5:15,Dejun.Liu 写道: > 可不可以说明一下具体的应用。 > > On Wed, 2010-05-12 at 16:57 +0800, mylatex mylatex wrote: > > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > > > > > > > > 在 2010年5月10日 上午10:31, 写道: > > > > > On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > > > > Linux > > > > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > > > > > > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > > > > > > 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > > > > > > 什么应用需要这么多端口? > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > --------------------------------------------------------------------------------------------------- > Confidentiality Notice: The information contained in this e-mail and any > accompanying attachment(s) > is intended only for the use of the intended recipient and may be > confidential and/or privileged of > Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader > of this communication is > not the intended recipient, unauthorized use, forwarding, printing, > storing, disclosure or copying > is strictly prohibited, and may be unlawful.If you have received this > communication in error,please > immediately notify the sender by return e-mail, and delete the original > message and all copies from > your system. Thank you. > > --------------------------------------------------------------------------------------------------- > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From peterlinux2010在gmail.com Thu May 13 12:09:52 2010 From: peterlinux2010在gmail.com (peter linux) Date: Thu, 13 May 2010 12:09:52 +0800 Subject: =?GB2312?B?UmU6IM/C1NhtaXBzYW5kcm9pZNS0tPrC67P2z9a1xM7KzOKhow==?= In-Reply-To: References: Message-ID: 在 2010年5月12日 下午4:17,刘阳 写道: > 大家好,我在mipsandroid网站下载android源代码死活都不能下载。 > 一直叫我输入用户名和邮箱。我输入的都是对的。 觉得很奇怪, 不知道大家遇到这样的问题没有呢。 > 没有试过你那种方法。 建议看看下面网址的方法,我已经下载成功,总共大概有3.6G的源代码 http://www.androidin.net/bbs/viewthread.php?tid=92775 -- Best Regards, Peter Zhou From oncemore2000在gmail.com Thu May 13 13:36:46 2010 From: oncemore2000在gmail.com (Xingtai Wang) Date: Thu, 13 May 2010 13:36:46 +0800 Subject: =?UTF-8?B?UmU6IOW8seW8seeahOmXruS4gOS4i+WFs+S6jmx1c3RyZeeahOmXrumimA==?= In-Reply-To: <201005121722444567259@sina.com> References: <201005121722444567259@sina.com> Message-ID: 在 2010年5月12日 下午5:22,gejunly 写道: > > 请问各位哥哥姐姐们,谁能发点关于在RED HAT AS5上配置lustre1.8的技术手册吗?我在安装完毕后,出现了无法导入文件系统的错误。小弟在这里重谢了。 Lustre-discuss mailing list Lustre-discuss在lists.lustre.org 有guide 写的很详细 > 2010-05-12 > > > > gejunly > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org From vividfe在gmail.com Thu May 13 14:45:54 2010 From: vividfe在gmail.com (vital) Date: Thu, 13 May 2010 14:45:54 +0800 Subject: 8572 vs 8641D In-Reply-To: References: Message-ID: 在 2010年5月13日 上午2:52,yao zhao 写道: > I googled and read our 8641's implementation, on 600 we use segment > register to map but on 8572 there is no DBAT and segment register any > more, so we have to stuck with tlbs. Yes. E500 should be BOOK E. MMU is not same as E600. > > thanks, > yao > 2010/5/12 vital : >> 在 2010年5月12日 上午4:58,yao zhao 写道: >>> It is tested that 8572's tlb flush is much slower than 8641D. >> >> I'm interested in your way. Can you share that with us? > It is bad that our kernel source was still open until last month. the OS is qnx. I only know a bit about this. It's great RTOS. >> >>> I didn't try Linux but on our OS 8572 is 10 times slower than 8641D, >> >> Which OS is your OS? >> >> For latest Linux version Linux use mmucfg to invalidate some TLB. But >> I don't know how your OS do exactly. >> > Actually there is a very simple case: process A writes some data to > process B address space, in kernel it will map process B's buffer to > process A's space, it is a small buffer 6x bytes so maximum we only > need to flush 2 tlbs(assume it crossed page) but kernel flushes all > tlbs(I didn't understand this part). For E600 tlbie should be used. It will invalidate four entries indexed EA directly. And I recalled tlbia should not implemented on E600. So looks OS will flush all tlb entries once you want to invalidate one given entry. Maybe you should check if you call proper flush API on QNX as you expect. Unless it's goal of QNX to flush all entries regardless of tlb operation is done by who/where. But I really don't think so. Beet Regards Bruce > I got a reply from our kernel guy, it seems that there is something we > haven't done yet, it is OS related. I believe Linux shouldn't do like > that:( > >> And Linux implements many tlb flush functions, such as flush_tlb_page, >> flush_tlb_mm and so on. So Kernel can use them according to different >> requirement. >> Obviously it's efficient. >> > I believe it should implement like this. >>> it didn't make any sense. >>> And our kernel architecture said it has good reasons so just curious >>> anyone knows anything, please show some lights. >>> >>> on 8572 there are 2 tlbs, I didn't read user manual too much. How >>> Linux uses these 2? >>> >> >> TLB1 supports many page sizes but TLB0 is fixed 4K byte page. Often TLB1 >> is used to map kernel space to real memory, and TLB0 is for those common >> MMU handler. >> >> Bruce >> >>> thanks, >>> yao >>> >>> 2010/5/9 vital : >>>> What is the problem? >>>> >>>> Best Regards >>>> Bruce >>>> >>>> 在 2010年5月7日 下午9:55,yao zhao 写道: >>>>> Hi, >>>>> >>>>> Anyone is familiar with mpc8572 and mpc8641D. >>>>> Is there any tricky in mpc8572's tlb flush? >>>>> >>>>> thanks, >>>>> yao >>>>> _______________________________________________ >>>>> Linux 内核开发中文邮件列表 >>>>> Linux-kernel在zh-kernel.org >>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>> >>> >> > From vividfe在gmail.com Thu May 13 14:56:49 2010 From: vividfe在gmail.com (vital) Date: Thu, 13 May 2010 14:56:49 +0800 Subject: =?GB2312?B?UmU6ILTwuLQ6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzg==?= =?GB2312?B?yv20q7Xdt73KvQ==?= In-Reply-To: <002301caf1b4$1c8a3f70$559ebe50$@com> References: <002301caf1b4$1c8a3f70$559ebe50$@com> Message-ID: 在 2010年5月12日 下午5:18,ChenLong 写道: > 能讲述一下dtb的方便性吗?或者在哪儿能找到对dtb描述比较多文档?我们当前正要做arm平台中类似dtb的开发工作,非常感谢! 入门篇:Documentation/powerpc/booting-without-of.txt。 深入篇:Power.org(tm) Standard for Embedded Power Architecture(tm) Platform Requirements (ePAPR) 我记得还有一篇pdf还可以,Device trees everywhere。可以给你一个全面概念,文章也不长。 ARM有人在做,你可以看看邮件:arm/devicetree。其实你可以参考powerpc的。 Bruce > > -----邮件原件----- > 发件人: linux-kernel-bounces在zh-kernel.org [mailto:linux-kernel-bounces在zh-kernel.org] 代表 vital > 发送时间: 2010年5月12日 17:00 > 收件人: 林志平 > 抄送: linux-kernel > 主题: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > 在 2010年5月12日 下午4:52,林志平 写道: >> 呃,以前用2.4.31的,现在需要升级到2.6 >> 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? > > 态度严重有问题。没有调研过,就这么武断下结论,对技术人员是要不得的。 > > 你可知道dtb的便利性? > 如今连ARM,MIPS都在引入。 > > Bruce > >> 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: >> >>> 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 >>> >>> 在 2010年5月10日 下午5:13,林志平 写道: >>> > 以前的搞定了,现在又有新的需求 >>> > >>> > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: >>> >> >>> >> 还没有升级到新的版本啊? >>> >> >>> >> 在 2010年5月6日 上午11:38,林志平 写道: >>> >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>> >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>> >> > 我感觉是我的dtb文件有点问题, >>> >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>> >> > _______________________________________________ >>> >> > Linux 内核开发中文邮件列表 >>> >> > Linux-kernel在zh-kernel.org >>> >> > http://zh-kernel.org/mailman/listinfo/linux-kernel >>> >> > Linux 内核开发中文社区: http://zh-kernel.org >>> > >>> > >>> >> _______________________________________________ >> Linux 内核开发中文邮件列表 >> Linux-kernel在zh-kernel.org >> http://zh-kernel.org/mailman/listinfo/linux-kernel >> Linux 内核开发中文社区: http://zh-kernel.org > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org > From r58472在freescale.com Thu May 13 15:57:11 2010 From: r58472在freescale.com (Li Yang-R58472) Date: Thu, 13 May 2010 15:57:11 +0800 Subject: =?utf-8?B?UkU6IExpbnV4LWtlcm5lbCDmkZjopoEsIOWNtyAzNCwg5Y+R5biDIDIy?= In-Reply-To: References: Message-ID: <3A45394FD742FA419B760BB8D398F9ED0183B9D7@zch01exm26.fsl.freescale.net> ... >> 这是邮件列表的摘要。如果想要回复此邮件,请务必注意: >> 1. 根据要回复的主题,重新给邮件加上合适的标题 >> 2. 去除和回复无关的其他引文。 !!!!!!!!!!!!! >> >> 本日主题: >> >> 1. 编译android出现问题。 (刘阳) ... From vividfe在gmail.com Thu May 13 16:06:23 2010 From: vividfe在gmail.com (vital) Date: Thu, 13 May 2010 16:06:23 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <00c501caf1d5$178bdad0$961cbcc0@sfdomain.com> References: <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> <030101caf0f6$39826b70$961cbcc0@sfdomain.com> <00c501caf1d5$178bdad0$961cbcc0@sfdomain.com> Message-ID: 在 2010年5月12日 下午9:14,hellohello 写道: > 谢谢,这两天虽然已找到引起死机的地方,但我还没能找到该处与死机间的因果关系。 > > 引起死机的关键语句在/arch/powerpc/sysdev/cpm2_pic.c 中 > cpm2_pic_init() > { > ... > cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, > 64, &cpm2_pic_host_ops, 64); > } > > 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, Hang or panic? > 如果注释掉这行代码,就会一直执行到对console 口的初始化处,给出失败信息。 I still recommend you should implement simple printk. For example, uart_putc. Then 'udbg_putc = uart_putc'. If you cannot access uart, we have to double check your imme base. And did you validate your platform with some raw program, not complex OS? I means you should avoid the hardware issue firstly. Bruce > > > 跑到irq_alloc_host 函数里面看了一下, > 主要就是为struct irq_host *host 分配了内存: > host = zalloc_maybe_bootmem(size, GFP_KERNEL); > 然后根据传进来的参数64(mpc8247的中断源个数64),将数组初始化为 NO_IRQ > for (i = 0; i < revmap_arg; i++) > rmap[i] = NO_IRQ; > > 看不出有特别的地方。 > > > > 与板子移植相关的smc io管脚配置、smc brg设置、中断号我也检查过了, > 82xx/mpc8272_ads.c看过了, > 目前都还未发现有问题,奇怪。 > > > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "林志平" ; "linux-kernel" > Sent: Wednesday, May 12, 2010 9:41 AM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月11日 下午6:39,hellohello 写道: >>> 在arch\powerpc\sysdev\cpm2.c中有语句: >>> >>> cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); >>> >>> 我在这里添加了 >>> printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); >>> 结果打印出 >>> <7>cpm2_immr fdfc0000 f0000000 >>> >>> 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, >>> 各位,如何能知道这种映射正确与否呢? >> >> 映射没有问题。 >> >> Bruce >> >>> >>> >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>> Cc: "林志平" ; "linux-kernel" >>> Sent: Monday, May 10, 2010 9:13 AM >>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>>在 2010年5月7日 下午7:22,hellohello 写道: >>>>> ----- Original Message ----- >>>>> From: "vital" >>>>> To: "hellohello" >>>>> Cc: "林志平" ; "linux-kernel" >>>>> Sent: Thursday, May 06, 2010 5:42 PM >>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>> >>>>> >>>>>>在 2010年5月6日 下午5:13,hellohello 写道: >>>>>>> 谢谢回复 >>>>>>> ----- Original Message ----- >>>>>>> From: "vital" >>>>>>> To: "hellohello" >>>>>>>> [snip] >>>>> ....... >>>>>> >>>>>> 但你可以dump __log_buf,从内存看到启动信息。 >>>>>> >>>>>>> >>>>> >>>>> ========== >>>>> 你的这个方法调试起来挺管用,我追踪到了 >>>>> start_kernel() >>>>> .... >>>>> init_IRQ(); >>>>> printk(KERN_DEBUG "init_IRQ\n"); >>>>> pidhash_init(); >>>>> printk(KERN_DEBUG "pidhash_init\n"); >>>>> >>>>> "init_IRQ\n"每次都能打印出来,但 >>>>> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 >>>>> 这么初步看来应该是init_IRQ(); >>>>> 函数执行后引起的死机了,检查中。 >>>>> >>>> >>>> Great! Maybe you should check if the mpic register in your board is >>>> match as the dts. >>>> >>>> Best Regards >>>> Bruce. >>>> >>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> >>>>>>> >>>>>>> >>>>>>> ----- Original Message ----- >>>>>>> From: "vital" >>>>>>> To: "hellohello" >>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>> Sent: Thursday, May 06, 2010 4:43 PM >>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>> >>>>>>> >>>>>>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>>>>>> From: "vital" >>>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>>>>>> >>>>>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>>>>>> => run ftp1 >>>>>>>> >>>>>>>> [snip] >>>>>>>> >>>>>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>>> Updating property 'current-speed' = 00 00 25 80 >>>>>>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>> 这里就死掉了 >>>>>>>> >>>>>>>> 假设你已经起来了kernel。 >>>>>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>>>>>> 还要做地址偏移,正在查这些资料。 >>>>>>>> >>>>>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> [snip] >>>>>>>> >>>>>>>>> serial在11a82 { >>>>>>>>> device_type = "serial"; >>>>>>>>> compatible = "fsl,mpc8272-smc-uart", >>>>>>>>> "fsl,cpm2-smc-uart"; >>>>>>>> >>>>>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>>>>>> >>>>>>>> Bruce >>>>>>>> >>>>>>>> >>>>>>>>> reg = <11a82 10 87fc 1>; >>>>>>>>> interrupts = <4 8>; >>>>>>>>> interrupt-parent = <&PIC>; >>>>>>>>> fsl,cpm-brg = <7>; >>>>>>>>> fsl,cpm-command = <1d000000>; >>>>>>>>> }; >>>>>>>>> } >>>>>>>>> } >>>>>>>>> ... >>>>>>>>> ... >>>>>>>>> chosen { >>>>>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>>>>>> }; >>>>>>>>> >>>>>>>>> ----- Original Message ----- >>>>>>>>> From: "vital" >>>>>>>>> To: "hellohello" >>>>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>> >>>>>>>>> >>>>>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>>>>>> >>>>>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>>> >>>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>>> 3> cuImage确实可以尝试 >>>>>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>>> >>>>>>>>>> 请依次排查。 >>>>>>>>>> >>>>>>>>>> Cheers >>>>>>>>>> Bruce >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> . >>>>>>>>>>> >>>>>>>>>>> ----- Original Message ----- >>>>>>>>>>> From: "林志平" >>>>>>>>>>> To: "linux-kernel" >>>>>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>>> _______________________________________________ >>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>> >>>>>>>> >>>>>> >>>> >> From solyn123在gmail.com Thu May 13 16:15:48 2010 From: solyn123在gmail.com (=?GB2312?B?wdbWvsa9?=) Date: Thu, 13 May 2010 16:15:48 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 因为我用dtb,只感觉到更加麻烦,没有给我提供什么便利的地方。。。 相比较而言,我个人还是更加喜欢以前uboot的那套传递方式,对调试也更加方便。 我现在的板子用uboot1.1.2起linux2.6.25,使用cuImage.mpc8272ads 起来后打印了cuImage的一部分信息,之后将任务交给kernel,之后就直接死掉了。 以后ARM、MIPS都要用dtb的话,那真是一场混乱 在 2010年5月12日 下午4:59,vital 写道: > 在 2010年5月12日 下午4:52,林志平 写道: > > 呃,以前用2.4.31的,现在需要升级到2.6 > > 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? > > 态度严重有问题。没有调研过,就这么武断下结论,对技术人员是要不得的。 > > 你可知道dtb的便利性? > 如今连ARM,MIPS都在引入。 > > Bruce > > > 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: > > > >> 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 > >> > >> 在 2010年5月10日 下午5:13,林志平 写道: > >> > 以前的搞定了,现在又有新的需求 > >> > > >> > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: > >> >> > >> >> 还没有升级到新的版本啊? > >> >> > >> >> 在 2010年5月6日 上午11:38,林志平 写道: > >> >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 > >> >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 > >> >> > 我感觉是我的dtb文件有点问题, > >> >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 > >> >> > _______________________________________________ > >> >> > Linux 内核开发中文邮件列表 > >> >> > Linux-kernel在zh-kernel.org > >> >> > http://zh-kernel.org/mailman/listinfo/linux-kernel > >> >> > Linux 内核开发中文社区: http://zh-kernel.org > >> > > >> > > >> > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > From hellohello008在163.com Thu May 13 16:20:42 2010 From: hellohello008在163.com (hellohello) Date: Thu, 13 May 2010 16:20:42 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <03d601caecef$91b1d4d0$9c1cbcc0@sfdomain.com> <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> <030101caf0f6$39826b70$961cbcc0@sfdomain.com> <00c501caf1d5$178bdad0$961cbcc0@sfdomain.com> Message-ID: <020301caf275$2e0e6070$961cbcc0@sfdomain.com> > 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, > > Hang or panic? ----我插入的printk打印一半,就没了。 > > I still recommend you should implement simple printk. For example, > uart_putc. Then 'udbg_putc = uart_putc'. ----这个我试试。 did you validate your platform with some raw program, not complex OS? > I means you should avoid the hardware issue firstly. > ----原来使用的vxworks,硬件pci 2个网卡,smc1串口, flash, scc以太网,fcc以太网都调通过的。 移植到uboot下,调通了smc1串口,flash,fcc以太网, pci屏蔽掉了。 现在轮到调linux内核。dts树,pci屏蔽掉了,82xx/mpc8272_ads.c中也相应改了。 硬件没问题。 ----- Original Message ----- From: "vital" To: "hellohello" Cc: "linux-kernel" Sent: Thursday, May 13, 2010 4:06 PM Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >在 2010年5月12日 下午9:14,hellohello 写道: >> 谢谢,这两天虽然已找到引起死机的地方,但我还没能找到该处与死机间的因果关系。 >> >> 引起死机的关键语句在/arch/powerpc/sysdev/cpm2_pic.c 中 >> cpm2_pic_init() >> { >> ... >> cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, >> 64, &cpm2_pic_host_ops, 64); >> } >> >> 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, > > Hang or panic? > >> 如果注释掉这行代码,就会一直执行到对console 口的初始化处,给出失败信息。 > > I still recommend you should implement simple printk. For example, > uart_putc. Then 'udbg_putc = uart_putc'. > > If you cannot access uart, we have to double check your imme base. And > did you validate your platform with some raw program, not complex OS? > I means you should avoid the hardware issue firstly. > > Bruce > >> >> >> 跑到irq_alloc_host 函数里面看了一下, >> 主要就是为struct irq_host *host 分配了内存: >> host = zalloc_maybe_bootmem(size, GFP_KERNEL); >> 然后根据传进来的参数64(mpc8247的中断源个数64),将数组初始化为 NO_IRQ >> for (i = 0; i < revmap_arg; i++) >> rmap[i] = NO_IRQ; >> >> 看不出有特别的地方。 >> >> >> >> 与板子移植相关的smc io管脚配置、smc brg设置、中断号我也检查过了, >> 82xx/mpc8272_ads.c看过了, >> 目前都还未发现有问题,奇怪。 >> >> >> >> ----- Original Message ----- >> From: "vital" >> To: "hellohello" >> Cc: "林志平" ; "linux-kernel" >> Sent: Wednesday, May 12, 2010 9:41 AM >> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >> >> >>>在 2010年5月11日 下午6:39,hellohello 写道: >>>> 在arch\powerpc\sysdev\cpm2.c中有语句: >>>> >>>> cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); >>>> >>>> 我在这里添加了 >>>> printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); >>>> 结果打印出 >>>> <7>cpm2_immr fdfc0000 f0000000 >>>> >>>> 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, >>>> 各位,如何能知道这种映射正确与否呢? >>> >>> 映射没有问题。 >>> >>> Bruce >>> >>>> >>>> >>>> ----- Original Message ----- >>>> From: "vital" >>>> To: "hellohello" >>>> Cc: "林志平" ; "linux-kernel" >>>> Sent: Monday, May 10, 2010 9:13 AM >>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>> >>>> >>>>>在 2010年5月7日 下午7:22,hellohello 写道: >>>>>> ----- Original Message ----- >>>>>> From: "vital" >>>>>> To: "hellohello" >>>>>> Cc: "林志平" ; "linux-kernel" >>>>>> Sent: Thursday, May 06, 2010 5:42 PM >>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>> >>>>>> >>>>>>>在 2010年5月6日 下午5:13,hellohello 写道: >>>>>>>> 谢谢回复 >>>>>>>> ----- Original Message ----- >>>>>>>> From: "vital" >>>>>>>> To: "hellohello" >>>>>>>>> [snip] >>>>>> ....... >>>>>>> >>>>>>> 但你可以dump __log_buf,从内存看到启动信息。 >>>>>>> >>>>>>>> >>>>>> >>>>>> ========== >>>>>> 你的这个方法调试起来挺管用,我追踪到了 >>>>>> start_kernel() >>>>>> .... >>>>>> init_IRQ(); >>>>>> printk(KERN_DEBUG "init_IRQ\n"); >>>>>> pidhash_init(); >>>>>> printk(KERN_DEBUG "pidhash_init\n"); >>>>>> >>>>>> "init_IRQ\n"每次都能打印出来,但 >>>>>> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 >>>>>> 这么初步看来应该是init_IRQ(); >>>>>> 函数执行后引起的死机了,检查中。 >>>>>> >>>>> >>>>> Great! Maybe you should check if the mpic register in your board is >>>>> match as the dts. >>>>> >>>>> Best Regards >>>>> Bruce. >>>>> >>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>>>> >>>>>>>> >>>>>>>> ----- Original Message ----- >>>>>>>> From: "vital" >>>>>>>> To: "hellohello" >>>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>>> Sent: Thursday, May 06, 2010 4:43 PM >>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>> >>>>>>>> >>>>>>>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>>>>>>> From: "vital" >>>>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>>>>>>> >>>>>>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>>>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>>>>>>> => run ftp1 >>>>>>>>> >>>>>>>>> [snip] >>>>>>>>> >>>>>>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>>>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>>>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>>>> Updating property 'current-speed' = 00 00 25 80 >>>>>>>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>>> 这里就死掉了 >>>>>>>>> >>>>>>>>> 假设你已经起来了kernel。 >>>>>>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>>>>>>> 还要做地址偏移,正在查这些资料。 >>>>>>>>> >>>>>>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> [snip] >>>>>>>>> >>>>>>>>>> serial在11a82 { >>>>>>>>>> device_type = "serial"; >>>>>>>>>> compatible = "fsl,mpc8272-smc-uart", >>>>>>>>>> "fsl,cpm2-smc-uart"; >>>>>>>>> >>>>>>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>>>>>>> >>>>>>>>> Bruce >>>>>>>>> >>>>>>>>> >>>>>>>>>> reg = <11a82 10 87fc 1>; >>>>>>>>>> interrupts = <4 8>; >>>>>>>>>> interrupt-parent = <&PIC>; >>>>>>>>>> fsl,cpm-brg = <7>; >>>>>>>>>> fsl,cpm-command = <1d000000>; >>>>>>>>>> }; >>>>>>>>>> } >>>>>>>>>> } >>>>>>>>>> ... >>>>>>>>>> ... >>>>>>>>>> chosen { >>>>>>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>>>>>>> }; >>>>>>>>>> >>>>>>>>>> ----- Original Message ----- >>>>>>>>>> From: "vital" >>>>>>>>>> To: "hellohello" >>>>>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>>>>>>> >>>>>>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>>>> >>>>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>>>> 3> cuImage确实可以尝试 >>>>>>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>>>> >>>>>>>>>>> 请依次排查。 >>>>>>>>>>> >>>>>>>>>>> Cheers >>>>>>>>>>> Bruce >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> . >>>>>>>>>>>> >>>>>>>>>>>> ----- Original Message ----- >>>>>>>>>>>> From: "林志平" >>>>>>>>>>>> To: "linux-kernel" >>>>>>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>>> >>>>>>>>> >>>>>>> >>>>> >>> > From vividfe在gmail.com Thu May 13 16:37:29 2010 From: vividfe在gmail.com (vital) Date: Thu, 13 May 2010 16:37:29 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: References: Message-ID: 在 2010年5月13日 下午4:15,林志平 写道: > 因为我用dtb,只感觉到更加麻烦,没有给我提供什么便利的地方。。。 何以见得? 当你的硬件变动了,你现在只需要集中在dts一个文件,不需要你修改kernel。也不用重新编译kernel,难道不方便吗? > 相比较而言,我个人还是更加喜欢以前uboot的那套传递方式,对调试也更加方便。 这跟调试有什么关系? > 我现在的板子用uboot1.1.2起linux2.6.25,使用cuImage.mpc8272ads 你为什么死守1.1.2,逼迫自己的新kernel用cuImage这种要被淘汰的东西? > 起来后打印了cuImage的一部分信息,之后将任务交给kernel,之后就直接死掉了。 什么事情都容易平趟过去,工作还有意思吗?谁都能搞好的东西,还要你搞什么? > 以后ARM、MIPS都要用dtb的话,那真是一场混乱 谁都会遇阻的时候,埋怨还不如掌握它,让它为自己服务。 Bruce > > 在 2010年5月12日 下午4:59,vital 写道: >> >> 在 2010年5月12日 下午4:52,林志平 写道: >> > 呃,以前用2.4.31的,现在需要升级到2.6 >> > 又要接触dtb。。。内核开发人员,为什么不抛弃dtb啊?? >> >> 态度严重有问题。没有调研过,就这么武断下结论,对技术人员是要不得的。 >> >> 你可知道dtb的便利性? >> 如今连ARM,MIPS都在引入。 >> >> Bruce >> >> > 在 2010年5月11日 上午7:19,Gao Ya'nan 写道: >> > >> >> 相信我,不用较新版本的核,问题会一个一个来的,呵呵。 >> >> >> >> 在 2010年5月10日 下午5:13,林志平 写道: >> >> > 以前的搞定了,现在又有新的需求 >> >> > >> >> > 在 2010年5月6日 下午9:07,Gao Ya'nan 写道: >> >> >> >> >> >> 还没有升级到新的版本啊? >> >> >> >> >> >> 在 2010年5月6日 上午11:38,林志平 写道: >> >> >> > 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >> >> >> > 编译好的内核下到内存中就死掉了,没有任何打印信息。 >> >> >> > 我感觉是我的dtb文件有点问题, >> >> >> > 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >> >> >> > _______________________________________________ >> >> >> > Linux 内核开发中文邮件列表 >> >> >> > Linux-kernel在zh-kernel.org >> >> >> > http://zh-kernel.org/mailman/listinfo/linux-kernel >> >> >> > Linux 内核开发中文社区: http://zh-kernel.org >> >> > >> >> > >> >> >> > _______________________________________________ >> > Linux 内核开发中文邮件列表 >> > Linux-kernel在zh-kernel.org >> > http://zh-kernel.org/mailman/listinfo/linux-kernel >> > Linux 内核开发中文社区: http://zh-kernel.org > > From vividfe在gmail.com Thu May 13 16:54:41 2010 From: vividfe在gmail.com (vital) Date: Thu, 13 May 2010 16:54:41 +0800 Subject: =?GB2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13Q==?= =?GB2312?B?t73KvQ==?= In-Reply-To: <020301caf275$2e0e6070$961cbcc0@sfdomain.com> References: <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> <030101caf0f6$39826b70$961cbcc0@sfdomain.com> <00c501caf1d5$178bdad0$961cbcc0@sfdomain.com> <020301caf275$2e0e6070$961cbcc0@sfdomain.com> Message-ID: 在 2010年5月13日 下午4:20,hellohello 写道: >> 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, >> >> Hang or panic? > ----我插入的printk打印一半,就没了。 我己得你说"如果注释掉这行代码,就会一直执行到对console 口的初始化处,给出失败信息。" 什么失败信息? 此外,"decrementer frequency"是否正常? 可否贴出注释和不注释的log? > > >> >> I still recommend you should implement simple printk. For example, >> uart_putc. Then 'udbg_putc = uart_putc'. > ----这个我试试。 > > did you validate your platform with some raw program, not complex OS? >> I means you should avoid the hardware issue firstly. >> > ----原来使用的vxworks,硬件pci 2个网卡,smc1串口, flash, scc以太网,fcc以太网都调通过的。 > 移植到uboot下,调通了smc1串口,flash,fcc以太网, pci屏蔽掉了。 是否在你平台上设置pic跟原有的Linux有不一致的地方?看看之前的设置。 > 现在轮到调linux内核。dts树,pci屏蔽掉了,82xx/mpc8272_ads.c中也相应改了。 > 硬件没问题。 OK。 Best Regards Bruce > > > ----- Original Message ----- > From: "vital" > To: "hellohello" > Cc: "linux-kernel" > Sent: Thursday, May 13, 2010 4:06 PM > Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 > > >>在 2010年5月12日 下午9:14,hellohello 写道: >>> 谢谢,这两天虽然已找到引起死机的地方,但我还没能找到该处与死机间的因果关系。 >>> >>> 引起死机的关键语句在/arch/powerpc/sysdev/cpm2_pic.c 中 >>> cpm2_pic_init() >>> { >>> ... >>> cpm2_pic_host = irq_alloc_host(of_node_get(node), IRQ_HOST_MAP_LINEAR, >>> 64, &cpm2_pic_host_ops, 64); >>> } >>> >>> 只要irq_alloc_host函数被调用,就会在其后的几条语句死掉, >> >> Hang or panic? >> >>> 如果注释掉这行代码,就会一直执行到对console 口的初始化处,给出失败信息。 >> >> I still recommend you should implement simple printk. For example, >> uart_putc. Then 'udbg_putc = uart_putc'. >> >> If you cannot access uart, we have to double check your imme base. And >> did you validate your platform with some raw program, not complex OS? >> I means you should avoid the hardware issue firstly. >> >> Bruce >> >>> >>> >>> 跑到irq_alloc_host 函数里面看了一下, >>> 主要就是为struct irq_host *host 分配了内存: >>> host = zalloc_maybe_bootmem(size, GFP_KERNEL); >>> 然后根据传进来的参数64(mpc8247的中断源个数64),将数组初始化为 NO_IRQ >>> for (i = 0; i < revmap_arg; i++) >>> rmap[i] = NO_IRQ; >>> >>> 看不出有特别的地方。 >>> >>> >>> >>> 与板子移植相关的smc io管脚配置、smc brg设置、中断号我也检查过了, >>> 82xx/mpc8272_ads.c看过了, >>> 目前都还未发现有问题,奇怪。 >>> >>> >>> >>> ----- Original Message ----- >>> From: "vital" >>> To: "hellohello" >>> Cc: "林志平" ; "linux-kernel" >>> Sent: Wednesday, May 12, 2010 9:41 AM >>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>> >>> >>>>在 2010年5月11日 下午6:39,hellohello 写道: >>>>> 在arch\powerpc\sysdev\cpm2.c中有语句: >>>>> >>>>> cpm2_immr = ioremap(get_immrbase(), CPM_MAP_SIZE); >>>>> >>>>> 我在这里添加了 >>>>> printk(KERN_DEBUG "cpm2_immr %x %x\n", cpm2_immr, get_immrbase()); >>>>> 结果打印出 >>>>> <7>cpm2_immr fdfc0000 f0000000 >>>>> >>>>> 也就是说,将mpc8247的immr原来的地址0xf0000000映射到了0xfdfc0000, >>>>> 各位,如何能知道这种映射正确与否呢? >>>> >>>> 映射没有问题。 >>>> >>>> Bruce >>>> >>>>> >>>>> >>>>> ----- Original Message ----- >>>>> From: "vital" >>>>> To: "hellohello" >>>>> Cc: "林志平" ; "linux-kernel" >>>>> Sent: Monday, May 10, 2010 9:13 AM >>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>> >>>>> >>>>>>在 2010年5月7日 下午7:22,hellohello 写道: >>>>>>> ----- Original Message ----- >>>>>>> From: "vital" >>>>>>> To: "hellohello" >>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>> Sent: Thursday, May 06, 2010 5:42 PM >>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>> >>>>>>> >>>>>>>>在 2010年5月6日 下午5:13,hellohello 写道: >>>>>>>>> 谢谢回复 >>>>>>>>> ----- Original Message ----- >>>>>>>>> From: "vital" >>>>>>>>> To: "hellohello" >>>>>>>>>> [snip] >>>>>>> ....... >>>>>>>> >>>>>>>> 但你可以dump __log_buf,从内存看到启动信息。 >>>>>>>> >>>>>>>>> >>>>>>> >>>>>>> ========== >>>>>>> 你的这个方法调试起来挺管用,我追踪到了 >>>>>>> start_kernel() >>>>>>> .... >>>>>>> init_IRQ(); >>>>>>> printk(KERN_DEBUG "init_IRQ\n"); >>>>>>> pidhash_init(); >>>>>>> printk(KERN_DEBUG "pidhash_init\n"); >>>>>>> >>>>>>> "init_IRQ\n"每次都能打印出来,但 >>>>>>> 有时 pidhash_init能得到执行,有时打印出来一部分语句就没了。 >>>>>>> 这么初步看来应该是init_IRQ(); >>>>>>> 函数执行后引起的死机了,检查中。 >>>>>>> >>>>>> >>>>>> Great! Maybe you should check if the mpic register in your board is >>>>>> match as the dts. >>>>>> >>>>>> Best Regards >>>>>> Bruce. >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> ----- Original Message ----- >>>>>>>>> From: "vital" >>>>>>>>> To: "hellohello" >>>>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>>>> Sent: Thursday, May 06, 2010 4:43 PM >>>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>> >>>>>>>>> >>>>>>>>>>在 2010年5月6日 下午3:41,hellohello 写道: >>>>>>>>>>> From: "vital" >>>>>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>>>> 下面是u-boot里tftp内核到内存的运行过程: >>>>>>>>>>> >>>>>>>>>>> => setenv bootargs root=/dev/ram rw ramdisk_size=13851 console=ttyCPM0,9600 >>>>>>>>>>> => setenv ftp1 'tftp 1000000 /tftpboot/uImage; tftp 2000000 /tftpboot/rootfs.ext2.gz.uboot; tftp 400000 /tftpboot/mpc8272ads.dtb; bootm 1000000 2000000 400000' >>>>>>>>>>> => run ftp1 >>>>>>>>>> >>>>>>>>>> [snip] >>>>>>>>>> >>>>>>>>>>> ## initrd at 0x02000040 ... 0x024064A7 (len=4220008=0x406468) >>>>>>>>>>> Loading Ramdisk to 077bd000, end 07bc3468 ... OK >>>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/mac-address' = 08 00 c0 a8 01 01 >>>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11300/local-mac-address' = 08 00 c0 a8 01 01 >>>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/mac-address' = 04 00 00 00 00 0b >>>>>>>>>>> Updating property '/soc在f0000000/cpm在119c0/ethernet在11320/local-mac-address' = 04 00 00 00 00 0b >>>>>>>>>>> Updating property 'timebase-frequency' = 01 7d 78 40 >>>>>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>>>>> Updating property 'clock-frequency' = 17 d7 84 00 >>>>>>>>>>> Updating property 'bus-frequency' = 05 f5 e1 00 >>>>>>>>>>> Updating property 'current-speed' = 00 00 25 80 >>>>>>>>>>> Updating property 'clock-frequency' = 01 7d 78 40 >>>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>>>> 这里就死掉了 >>>>>>>>>> >>>>>>>>>> 假设你已经起来了kernel。 >>>>>>>>>> 从System.map里找到__log_buf的地址,然后在这里reset板子,在u-boot里dump这个地址,可以看到相关信息。 >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>>>> 想点灯看,但由于刚开始做linux,发现点灯也不是直接写EA地址(原来的系统下MMU是一一对应的),现在好像 >>>>>>>>>>> 还要做地址偏移,正在查这些资料。 >>>>>>>>>> >>>>>>>>>> u-boot已经初始化好串口,你可以直接做个poll模式的uart打印信息。地址可以参考dts里,还有u-boot里UART BASE地址的定义。 >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>> [snip] >>>>>>>>>> >>>>>>>>>>> serial在11a82 { >>>>>>>>>>> device_type = "serial"; >>>>>>>>>>> compatible = "fsl,mpc8272-smc-uart", >>>>>>>>>>> "fsl,cpm2-smc-uart"; >>>>>>>>>> >>>>>>>>>> 这个跟mainline里面的不一致,跟你的实际驱动匹配吗? >>>>>>>>>> >>>>>>>>>> Bruce >>>>>>>>>> >>>>>>>>>> >>>>>>>>>>> reg = <11a82 10 87fc 1>; >>>>>>>>>>> interrupts = <4 8>; >>>>>>>>>>> interrupt-parent = <&PIC>; >>>>>>>>>>> fsl,cpm-brg = <7>; >>>>>>>>>>> fsl,cpm-command = <1d000000>; >>>>>>>>>>> }; >>>>>>>>>>> } >>>>>>>>>>> } >>>>>>>>>>> ... >>>>>>>>>>> ... >>>>>>>>>>> chosen { >>>>>>>>>>> linux,stdout-path = "/soc/cpm/serial在11a82"; >>>>>>>>>>> }; >>>>>>>>>>> >>>>>>>>>>> ----- Original Message ----- >>>>>>>>>>> From: "vital" >>>>>>>>>>> To: "hellohello" >>>>>>>>>>> Cc: "林志平" ; "linux-kernel" >>>>>>>>>>> Sent: Thursday, May 06, 2010 3:09 PM >>>>>>>>>>> Subject: Re: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>>>在 2010年5月6日 下午2:48,hellohello 写道: >>>>>>>>>>>>> >>>>>>>>>>>>> 我也是在mpc8247上移植 Linux Kernel is 2.6.25 >>>>>>>>>>>>> 以前没搞过linux,现在发现开头很费劲, >>>>>>>>>>>>> 我用的是freescale的 MPC8272ADS_20080623-ltib.iso >>>>>>>>>>>>> 里面带的是u-boot-1.3.2,支持dtb。 >>>>>>>>>>>>> 不过我也遇到uboot控制权刚转移到内核就死机的问题 >>>>>>>>>>>>> ## Transferring control to Linux (at address 00000000) ... >>>>>>>>>>>> >>>>>>>>>>>> 1> 对这个0x00000000地址表示怀疑,可否把从board上电开始的所有信息贴出? >>>>>>>>>>>> 2> 在u-boot里bootargs是否设置正确? (printenv on u-boot prompt) >>>>>>>>>>>> 3> cuImage确实可以尝试 >>>>>>>>>>>> 4> 可以在 u-boot里dump __log_buf看看死在哪? >>>>>>>>>>>> 5> 可以自己写个simple uart打印一下信息定位问题 >>>>>>>>>>>> >>>>>>>>>>>> 请依次排查。 >>>>>>>>>>>> >>>>>>>>>>>> Cheers >>>>>>>>>>>> Bruce >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> . >>>>>>>>>>>>> >>>>>>>>>>>>> ----- Original Message ----- >>>>>>>>>>>>> From: "林志平" >>>>>>>>>>>>> To: "linux-kernel" >>>>>>>>>>>>> Sent: Thursday, May 06, 2010 11:38 AM >>>>>>>>>>>>> Subject: u-boot1.1.2版本是否支持dtb的参数传递方式 >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>>> 我在mpc8247的板子上移植linux-2.6.25的内核,uboot是1.1.2的版本 >>>>>>>>>>>>>> 编译好的内核下到内存中就死掉了,没有任何打印信息。 >>>>>>>>>>>>>> 我感觉是我的dtb文件有点问题, >>>>>>>>>>>>>> 但是我还想确认下,这个版本的uboot是否支持dtb的参数传递机制。 >>>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>>>>> _______________________________________________ >>>>>>>>>>>>> Linux 内核开发中文邮件列表 >>>>>>>>>>>>> Linux-kernel在zh-kernel.org >>>>>>>>>>>>> http://zh-kernel.org/mailman/listinfo/linux-kernel >>>>>>>>>>>>> Linux 内核开发中文社区: http://zh-kernel.org >>>>>>>>>>>> >>>>>>>>>> >>>>>>>> >>>>>> >>>> >> From zoleooo在hotmail.com Thu May 13 17:04:33 2010 From: zoleooo在hotmail.com (zhangleo) Date: Thu, 13 May 2010 09:04:33 +0000 Subject: =?gb2312?Q?RE:_Linux_?= =?gb2312?B?dGNwsqK3osGsvdPK/c7KzOI=?= In-Reply-To: References: , <20100510023132.GA6004@gentoo>, , <1273655703.23529.14.camel@dejunliu-desktop>, Message-ID: 本地端口就6w个,实际上去掉保留的可能达不到。 但现在大型门户网站并发数肯定超过了这个限制,难道是多个服务器负载均横实现的? > Date: Thu, 13 May 2010 09:12:16 +0800 > Subject: Re: Linux tcp并发连接数问题 > From: dreamice.jiang在gmail.com > To: liu-dj在neusoft.com > CC: Linux-kernel在zh-kernel.org > > 本地建立的连接和netfilter的conntrack是不一样的。本地新建一个连接需要占用一个端口,而conntrack在内核态中,虽然他们标识连接都是五元组,但内核态中源端口可以不同,而在用户态,必须要绑定一个本地端口才能主动发起建立连接,所以用户太支持的连接数受端口数的限制,而内核态不受这个约束。当然,如果是被动接受建立链接的情况,通常如web服务器,则应该不受这个限制。 > 目前Linux内核中,默认情况下也将conntrack max设置为65535,只是为了内存使用的考虑,和tcp端口没有直接的关系。 > > 在 2010年5月12日 下午5:15,Dejun.Liu 写道: > > > 可不可以说明一下具体的应用。 > > > > On Wed, 2010-05-12 at 16:57 +0800, mylatex mylatex wrote: > > > 楼主是不是把连接数和端口号弄混了?确定一个连接,是四元组 > > > > > > > > > > > > 在 2010年5月10日 上午10:31, 写道: > > > > > > > On Sat, May 08, 2010 at 12:22:22PM +0800, lu wrote: > > > > > Linux > > > > > > > tcp并发连接数最大才6万,因为端口才1024--65535。怎么让它支持更高的并发连接,现在到6万了,bind函数调用就没有可用端口了,狂报错。 > > > > > > > > > > > 现在是用多个ip,也是不行,bind函数端口用0,它自己选用可用端口,但是还是超过不了6万,端口用完了,看内核源码发现,查找可用端口是没用涉及到IP,所以换了IP也没用,只能是6万了。怎么让它支持更高,比如我要并发400K连接,如何做到? > > > > > > > > 想要更多的端口是不可能的,因为 tcp 规定了端口号是 16 位。 > > > > > > > > 什么应用需要这么多端口? > > > > _______________________________________________ > > > > Linux 内核开发中文邮件列表 > > > > Linux-kernel在zh-kernel.org > > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > > _______________________________________________ > > > Linux 内核开发中文邮件列表 > > > Linux-kernel在zh-kernel.org > > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > > Linux 内核开发中文社区: http://zh-kernel.org > > > > > > --------------------------------------------------------------------------------------------------- > > Confidentiality Notice: The information contained in this e-mail and any > > accompanying attachment(s) > > is intended only for the use of the intended recipient and may be > > confidential and/or privileged of > > Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader > > of this communication is > > not the intended recipient, unauthorized use, forwarding, printing, > > storing, disclosure or copying > > is strictly prohibited, and may be unlawful.If you have received this > > communication in error,please > > immediately notify the sender by return e-mail, and delete the original > > message and all copies from > > your system. Thank you. > > > > --------------------------------------------------------------------------------------------------- > > _______________________________________________ > > Linux 内核开发中文邮件列表 > > Linux-kernel在zh-kernel.org > > http://zh-kernel.org/mailman/listinfo/linux-kernel > > Linux 内核开发中文社区: http://zh-kernel.org > > > _______________________________________________ > Linux 内核开发中文邮件列表 > Linux-kernel在zh-kernel.org > http://zh-kernel.org/mailman/listinfo/linux-kernel > Linux 内核开发中文社区: http://zh-kernel.org _________________________________________________________________ 约会说不清地方?来试试微软地图最新msn互动功能! http://ditu.live.com/?form=TL&swm=1 From hellohello008在163.com Thu May 13 17:12:47 2010 From: hellohello008在163.com (hellohello) Date: Thu, 13 May 2010 17:12:47 +0800 Subject: =?gb2312?B?UmU6IHUtYm9vdDEuMS4ysOaxvsrHt/HWp7PWZHRitcSyzsr9tKu13be9yr0=?= References: <041001caecfc$6f60f7a0$9c1cbcc0@sfdomain.com> <001201caedd7$a72790a0$9c1cbcc0@sfdomain.com> <030101caf0f6$39826b70$961cbcc0@sfdomain.com> <00c501caf1d5$178bdad0$961cbcc0@sfdomain.com> <020301caf275$2e0e6070$961cbcc0@sfdomain.com> Message-ID: <021601caf27c$74d3bb20$961cbcc0@sfdomain.com> 下面是内存中的asci码,内存部分我省略了 这个是没有注释irq_alloc_host函数的: <6>Using Freesca le MPC8272 ADS m achine descripti on.<5>Linux vers ion 2.6.25 (xk在x kingred) (gcc ve rsion 4.2.1 (Sou rcery G++ Lite 4 .2-82)) #29 Wed May 12 20:06:19 CST 2010.<4>Foun d initrd at 0xc7 7bd000:0xc7bc34a 7.<7>Entering ad d_active_range(0 , 0, 32768) 0 en tries of 256 use d.<7>cpm2_immr f dfc0000 f0000000 .<7>mpc8272_ads_ setup_arch.<7>To p of RAM: 0x8000 000, Total RAM: 0x8000000.<7>Mem ory hole size: 0 MB.<4>Zone PFN r anges:.<4> DMA 0 -> 32768.<4> N ormal 32768 -> 32768.<4> Movable zone sta rt PFN for each node.<4>early_no de_map[1] active PFN ranges.<4> 0: 0 - > 32768.<7>On node 0 totalpag es: 32768.<7> D MA zone: 256 pag es used for memm ap.<7> DMA zone : 0 pages reserv ed.<7> DMA zone : 32512 pages, L IFO batch:7.<7> Normal zone: 0 pages used for m emmap.<7> Movab le zone: 0 pages used for memmap .<4>Built 1 zone lists in Zone or der, mobility gr ouping on. Tota l pages: 32512.< 5>Kernel command line: root=/dev /ram rw ramdisk_ size=13851 conso le=ttyCPM0,9600. <7>init_IRQ.<7>i nit_mpc8272_ads. <7>simrh:0 fdfd0 c1c.<7>simrl:0 f dfd0c20.<7>simrh :0 fdfd0c1c.<7>s imrl:0 fdfd0c20. <7>init_IRQ end. <4>PID hash tabl e entries: 512 ( order: 9, 2048 b ytes).<7>pidhash _ini............ ................ 这个是注释了irq_alloc_host函数的: <6>Using Freesca le MPC8272 ADS m achine descripti on.<5>Linux vers ion 2.6.25 (xk在x kingred) (gcc ve rsion 4.2.1 (Sou rcery G++ Lite 4 .2-82)) #2 Thu M ay 13 16:56:12 C ST 2010.<4>Found initrd at 0xc77 bd000:0xc7bc3461 .<7>Entering add _active_range(0, 0, 32768) 0 ent ries of 256 used .<7>cpm2_immr fd fc0000 f0000000. <7>mpc8272_iopor ts.<7>pq2_init_p ci.<7>mpc8272_ad s_setup_arch.<7> Top of RAM: 0x80 00000, Total RAM : 0x8000000.<7>M emory hole size: 0MB.<4>Zone PFN ranges:.<4> DM A 0 -> 32768.<4> Normal 327 68 -> 32768.< 4>Movable zone s tart PFN for eac h node.<4>early_ node_map[1] acti ve PFN ranges.<4 > 0: 0 -> 32768.<7> On node 0 totalp ages: 32768.<7> DMA zone: 256 p ages used for me mmap.<7> DMA zo ne: 0 pages rese rved.<7> DMA zo ne: 32512 pages, LIFO batch:7.<7 > Normal zone: 0 pages used for memmap.<7> Mov able zone: 0 pag es used for memm ap.<4>Built 1 zo nelists in Zone order, mobility grouping on. To tal pages: 32512 .<5>Kernel comma nd line: root=/d ev/nfs rw nfsroo t=192.168.1.66: ip=192.168.1.1:1 92.168.1.66::::e th0:off console= ttyCPM0,9600.<7> init_IRQ.<7>init _mpc8272_ads.<7> simrh:0 fdfd0c1c .<7>simrl:0 fdfd 0c20.<7>simrh:0 fdfd0c1c.<7>simr l:0 fdfd0c20.<7> init_IRQ end.<4> PID hash table e ntries: 512 (ord er: 9, 2048 byte s).<7>pidhash_in it.<7>init_timer s.<7>hrtimers_in it.<7>time_init: decrementer fre quency = 25.0000 00 MHz.<7>time_i nit: processor f requency = 400 .000000 MHz.<6>c locksource: time base mult[a00000 0] shift[22] reg istered.<7>clock event: decrement er mult[666] shi ft[16] cpu[0].<7 >time.<7>irq.<4> irq: no irq host found for /soc@ f0000000/interru pt-controller在10 c00 !.<7>console _init.<7>lockdep _info.<7>locking _selftest.<6>Den try cache hash t able entries: 16 384 (order: 4, 6 5536 bytes).<6>I node-cache hash table entries: 8 192 (order: 3, 3 2768 bytes).<6>M emory: 122760k/1 31072k available (2632k kernel c ode, 8160k reser ved, 100k data, 121k bss, 140k i nit).<7>mem.<6>S LUB: Genslabs=12 , HWalign=32, Or der=0-1, MinObje cts=4, CPUs=1, N odes=1.<7>Calibr ating delay loop ... 49.86 BogoMI PS (lpj=249344). <4>Mount-cache h ash table entrie s: 512.<6>net_na mespace: 536 byt es.<6>NET: Regis