主题 : 从零做起,让我们共同彷徨到天亮。Suffer Together, Share Each Other. 复制链接 | 浏览器收藏 | 打印
路漫漫其修远兮,吾将上下而求索!
级别: 新手上路
UID: 14671
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2010-02-20
最后登录: 2015-06-26
楼主  发表于: 2010-03-20 05:30

 从零做起,让我们共同彷徨到天亮。Suffer Together, Share Each Other.

一个月前,我决定学Linux,从此我就开始彷徨。
如果你也刚刚开始决定学Linux,你要说你不彷徨,你自己也会说你在撒谎。

由于时间和经济上的考虑,我们不可能每个人都去上课。

而且周围基本上没有可以请教的朋友。

我所经历的苦恼是我们的先行者都经历过的,我想你也不会例外。
我将在我以后的帖子中,公布我真实的实验结果和源程序。希望和我一样处在彷徨中的朋友与我一起做实验。
让我们一起痛苦,彷徨,分享。

这一个月来,我按照韦东山老师书上的步骤重复了N遍。
我在老的2410板上做,看到的都是:
Warning: unable to open an initial console.
Failed to execute /sbin/init.  Attempting defaults...
Kernel panic - not syng: No init found.  Try passing init= option to kernel.
我在2410板子上反复U-BOOT, Kernel, BusyBox. 不知道三个中那个或哪几个我没搞对.

直到前天我放弃了2410板。开始在2440板上测试。
结果在第一次Nand Scrub后就有一个坏块.
第三次烧写Nor Flash 就读不到片子的ID.  .........

几经周折,得到了与2410板子同样的结果.

直到前天才有点结果。终于看到了我的内核和文件系统真正工作了。

和我一样刚刚起步的朋友,如果你的内核和文件系统还没有启动起来的话,我劝你暂时放弃它。
这里有好多老师,我才刚刚起步就如此劝大家,难免有些过分。

为什么呢?
首先,对一个初学者来说,要他把U-boot,Kernel,Busy-box柔到一起来配置,编译,下载,运行,调试,Debug,...,
这无疑是一种灭绝人性的做法。

其次,我们大多数人我想只是想用到Linux的部分功能。而这些功能大部分在厂家提供的现成平台上就能实现。
为什么我们不用高手搭成的现有平台呢?
我想我们不是想刚刚开始就想显示自己比老师牛吧?

再次,我们最初编译出来的内核和做出的文件系统基本上没有什么实用价值。

所以我劝各位暂时放弃。
不要象大办钢铁时期,家家户户都炼铁。

要知道我们大多数人学Linux,是为了用它,而不是研究它。
我们需要一个平台,一个框架,但我们没有必要都去自己编译内核和做文件系统,除非我们的应用到了非这么做不可的阶段。

所以今天我恢复了MINI2440原装的系统。


平台有了,用它来做什么呢?

我首先想到的就是串口通讯。
因为工作中需要它的地方太多了。

我在网上下载了一个程序: http://www.phpfans.net/ask/answer1/4814150316.html
经过了我反复修改,编译,测试。

我在此声明,我在所有的帖子中的例子,如果不是我的原创,我都注明出处。 如果拥有者觉得不妥,请通知我,谢谢!
我以后一定会有实用的原创源码,所有的朋友可以分享。


注意板子上有四个口,CON0和CON1都是同一个信号源,只是电平不一样。

下面是源程序和实验结果:   Frank_Uart-V1.0.rar (3 K) 下载次数:26

/*
   File name: Frank_Uart-V1.0.c
   The source is from http://www.phpfans.net/ask/answer1/4814150316.html
   Modified by Frank Tu on 19MAR10
   Use /dev/ttySAC1 as the testing port. Send back "1" if anything received from /dev/ttySAC1.
   Also output received data to the console which might be another port(/dev/ttySAC0 in this file) by printf("\n%s\n",buff);
   the baud rate for /dev/ttySAC1 is 9600. If it is 115200, my voltage convertor dosn't work properly.
    
   Environment
    Operating system is Ubuntu 9.10    (PC)
    Using MINI2440 original installation: http://www.mini-box.com/mini2440v2
    Using default user directory /home/plg for FTP (MINI2440)
    Board ip address: 192.168.1.230
       Testing directory is: /home/frank/frank/test/Frank_Uart
    
    On PC:
     cd /home/frank/frank/test/Frank_Uart
      arm-linux-g++ -static Frank_Uart.c will create a.out

        frank@frank-laptop:~$ ftp 192.168.1.230
        Connected to 192.168.1.230.
        220 FriendlyARM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
        Name (192.168.1.230:frank): plg
        331 Password required for plg.
        Password:
        230 User plg logged in.
        Remote system type is UNIX.
        Using binary mode to transfer files.
        ftp> put a.out
        local: a.out remote: a.out
        200 PORT command successful.
        150 Opening BINARY mode data connection for 'a.out'.
        226 Transfer complete.
        518827 bytes sent in 0.30 secs (1705.8 kB/s)
        ftp>
    
    On MINI2440:
        cd /home/plg
        ./a.out

    Now on the console we can see:(PC)
        open ttySAC1
        fcntl=0
        isatty success!
        set done!
    Now on the PC-B: Set hyperTerminal to 9600,8bit, none parity 1 stop bit, none flow control.
        If you input 123456FrankTu, you can see from the console(PC-A):
            1ello

            2ello

            3ello

            4ello

            5ello

            6ello

            Fello

            rello

            aello

            nello

            kello

            Tello

            uello

    On PC-B you can see:
            112131415161F1r1a1n1k1T1u1
    On PC-A, enter Ctrl+C will terminate ttySAC1 communication.

Conenction:

                                                              _________________
                                                             |                 |
                         ------------------------------------|    Router       |--------------------------------
                         |                                   |_________________|                                |
                         |                                            |                                         |
                         |                                            |                                         |
                         |                                            |                                         |
                         |                                            |                                         |
                         |                                            |                                         |
                  PC-A  \|/                                 Mini2440 \|/                              PC-B     \|/
              -----------------                              -----------------                        -----------------
             |                 |                            |                 |                      |                 |
             |                 |   115200,8,0,'N',1         |                 |                      |                 |
             |           RS-232|<-------------------------->|ttySAC0(CON0)    |                      |                 |
             |                 |                            |                 |      __________      |                 |
             |                 |                            |                 |     | Voltage  |     |                 |
             |                 |                            |   ttySAC1(CON2) |<----| Convertor|---->|RS-232           |
             |                 |                            |                 |     |__________|     |(9600,8,0,'N',1) |
             |                 |                            |                 |                      |                 |
             |                 |                            |                 |                      |                 |
             |                 |                            |                 |                      |                 |
              -----------------                              -----------------                        -----------------
                Ubuntu 9.10                                                                             Windows-XP


        CON2:   pin1--TXD1, pin2--RXD1, pin4--GND
            pin1 is on the power switch side

    
*/

#include<unistd.h>
#include<sys/types.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
#include<errno.h>
#include<termios.h>
int open_port(int fd,int comport)
{
   char *dev[]={"/dev/ttySAC0","/dev/ttySAC1","/dev/ttySAC2"};
   if(comport==1)
    {
    fd=open("/dev/ttySAC0",O_RDWR|O_NOCTTY|O_NDELAY);
    if(-1==fd)
    {
         perror("can't open serial port");
        return(-1);
    }
    else
        printf("open ttySAC0\n");
    }
    if(comport==2)
    {
    fd=open("/dev/ttySAC1",O_RDWR|O_NOCTTY|O_NDELAY);
    if(-1==fd)
    {
         perror("can't open serial port");
        return(-1);
    }
    else
        printf("open ttySAC1\n");
    }
    if(comport==3)
    {
    fd=open("/dev/ttySAC2",O_RDWR|O_NOCTTY|O_NDELAY);
    if(-1==fd)
    {
         perror("can't open serial port");
        return(-1);
    }
    else
        printf("open ttySAC2\n");
    }
    if(fcntl(fd,F_SETFL,0)<0)
       printf("fcnt failed!\n");
    else
    printf("fcntl=%d\n",fcntl(fd,F_SETFL,0));
    if(isatty(STDIN_FILENO)==0)
    printf("standard input is not a terminal device\n");
    else
    printf("isatty success!\n");
    return fd;
    
}
int set_opt(int fd,int nSpeed,int nBits,int nFctl,char nEvent,int nStop)
{
    struct termios newtio,oldtio;
    if(tcgetattr(fd,&oldtio)!=0)
    {
        perror("SetupSerial 1");
        exit(1);
    }
    bzero(&newtio,sizeof(newtio));
    newtio.c_cflag |=CLOCAL | CREAD;//
    newtio.c_cflag &= ~CSIZE;
    //newtio.c_iflag &= ~(ICRNL|IGNCR);
    //newtio.c_lflag &=~(ICANON|ECHO|ECHOE|ISIG);
    //newtio.c_oflag &=~OPOST;
    switch(nBits)
    {
    case 7:
        newtio.c_cflag |= CS7;
        break;
    case 8:
        newtio.c_cflag |= CS8;
        break;
    }
    switch(nFctl)
    {
    case 0:
        newtio.c_cflag &=~CRTSCTS;
        break;
    case 1:
        newtio.c_cflag |=CRTSCTS;
        break;
    case 2:
        newtio.c_cflag |=IXON|IXOFF|IXANY;
        break;
    }
    switch(nEvent)
    {
    case'O':
        newtio.c_cflag |= PARENB;//enble
        newtio.c_cflag |= PARODD;
        newtio.c_iflag |= (INPCK| ISTRIP);
        break;
    case'E':
        newtio.c_iflag |= (INPCK | ISTRIP);
        newtio.c_cflag |= PARENB;
        newtio.c_cflag &= ~PARODD;
        break;
    case'N':
        newtio.c_cflag &=~PARENB;
        break;
    }
    switch(nSpeed)
    {
    case 2400:
        cfsetispeed(&newtio,B2400);
        cfsetospeed(&newtio,B2400);
        break;
    case 4800:
        cfsetispeed(&newtio,B4800);
        cfsetospeed(&newtio,B4800);
        break;
    case 9600:
        cfsetispeed(&newtio,B9600);
        cfsetospeed(&newtio,B9600);
        break;
    case 115200:
        cfsetispeed(&newtio,B115200);
        cfsetospeed(&newtio,B115200);
        break;
    default:
        cfsetispeed(&newtio,B9600);
        cfsetospeed(&newtio,B9600);
        break;
    }
    if(nStop==1)
        newtio.c_cflag &=~CSTOPB;
    else if(nStop==2)
        newtio.c_cflag |= CSTOPB;
    newtio.c_cc[VTIME]=5;
    newtio.c_cc[VMIN]=0;
    newtio.c_lflag &=~(ICANON|ECHO|ECHOE|ISIG);
    newtio.c_oflag &=~OPOST;
    tcflush(fd,TCIFLUSH);
    if((tcsetattr(fd,TCSANOW,&newtio))!=0)
    {
        perror("com set error");
        return -1;
    }
    printf("set done!\n");
    return 0;
}
int main(void)
{
  int fd=-1;
  int i,nread;
   char buff[512]="hello";
  if((fd=open_port(fd,2))<0)
   {
    perror("open_port erro");
        exit(1) ;
   }
  if((i=set_opt(fd,9600,8,0,'N',2))<0)
  {
    perror("set_opt error");
    return 1;
  }
  printf("ID IS: %d",fd);
while(1)
{
  while((nread=read(fd,buff,512))>0)
  {

     //  printf("len %d\n",nread);
//    nread=read(fd,buff,512);
    write(fd, "1" , 1);
    printf("\n%s\n",buff);    
  }
}

if(close(fd)<0){
    perror("close:");
    exit(1);
   }
   else
    printf("close ok");
   exit(0);

}


[ 此帖被franktu在2010-03-21 04:14重新编辑 ]
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
1楼  发表于: 2010-03-20 08:57
来到这里,你不会没有可以请教的朋友;
不管是成功的喜悦还是失败的教训,只要分享出来,你会得到更多 -- 这才是Linux世界的游戏规则
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
路漫漫其修远兮,吾将上下而求索!
级别: 新手上路
UID: 14671
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2010-02-20
最后登录: 2015-06-26
2楼  发表于: 2010-03-20 13:02
谢谢总版主!
路漫漫其修远兮,吾将上下而求索!
级别: 新手上路
UID: 14671
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2010-02-20
最后登录: 2015-06-26
3楼  发表于: 2010-03-21 03:57

 Frank MINI2440 实验 2 --- 定时器

今天在板子上测试了定时器,下面的程序不用修改一个字,可以直接编译通过。
timer.c.zip (2 K) 下载次数:9
/*
   Environment
    Operating system is Ubuntu 9.10    (PC)
    Using MINI2440 original installation: http://www.mini-box.com/mini2440v2
    Using default user directory /home/plg for FTP (MINI2440)
    Board ip address: 192.168.2.230
       Testing directory is: /home/frank/frank/test/Frank_Timer
    
    On PC:
     cd /home/frank/frank/test/Frank_Timer
      arm-linux-g++ -static Frank_timer.c will create a.out

    frank@frank-laptop:~/frank/test/Frank_Timer$ ftp 192.168.2.230
    Connected to 192.168.2.230.
    220 FriendlyARM FTP server (Version 6.4/OpenBSD/Linux-ftpd-0.17) ready.
    Name (192.168.2.230:frank): plg
    331 Password required for plg.
    Password:
    230 User plg logged in.
    Remote system type is UNIX.
    Using binary mode to transfer files.
    ftp> put a.out
    local: a.out remote: a.out
    200 PORT command successful.
    150 Opening BINARY mode data connection for 'a.out'.
    226 Transfer complete.
    513951 bytes sent in 0.30 secs (1658.2 kB/s)
    ftp>

    
    On MINI2440:
        cd /home/plg
        ./a.out

    Now on the console we can see:(PC)
         sec = 1121673296      usec = 463275
     2005 - 7 - 18 15:54:56
     sec = 1121673301      usec = 463274
     2005 - 7 - 18 15:55:1
     sec = 1121673306      usec = 463279
     2005 - 7 - 18 15:55:6
     sec = 1121673311      usec = 463274
     2005 - 7 - 18 15:55:11
     sec = 1121673316      usec = 463278
     2005 - 7 - 18 15:55:16
     sec = 1121673321      usec = 463278
     2005 - 7 - 18 15:55:21
     sec = 1121673326      usec = 463280
     2005 - 7 - 18 15:55:26
     sec = 1121673331      usec = 463279
     2005 - 7 - 18 15:55:31
     sec = 1121673336      usec = 463280
     2005 - 7 - 18 15:55:36
     sec = 1121673341      usec = 463284
     2005 - 7 - 18 15:55:41
     sec = 1121673346      usec = 463276
     2005 - 7 - 18 15:55:46

Output every five seconds.
Enter Ctrl+C will terminate the timer.

*/

// Source from http://sns.linuxpk.com/space-1717-do-blog-id-13229.html
/*******************************************************
*  Copyright (C), 2008
*
*   文件名  : timer.c
*
*   创建人  : Bai Huai Wei  <bhw1996@126.com>
*
*   日期   :2008
*
*   版本号  : 1.0
*
*文件描述 :定时器中断。
********************************************************/
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <termios.h>
#include <signal.h>
#include <sys/ioctl.h>
#include <time.h>
#include <sys/time.h>
#include <sys/timeb.h>
/*********************************************************
* 函数名 :static void ElsfTimer(int signo)
*
* 参数  :int signo
*
* 功能描述 :得到当前时间。
*    
* 返回值 :无
**********************************************************/
static void ElsfTimer(int signo)
{
struct timeval  tp;
struct tm *tm;

//tp.tv_sec 秒。 tp.tv_usec 微妙
gettimeofday(&tp,NULL);

tm=localtime(&tp.tv_sec);
printf(" sec = %ld \t",tp.tv_sec);
printf(" usec = %ld \n",tp.tv_usec);
printf(" %d - %d - %d %d:%d:%d \n",tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,\
   tm->tm_min,tm->tm_sec);
}

/*********************************************************
* 函数名 :staitc void InitTime(void)
*
* 参数  :无
*
* 功能描述 :初始化定时器。
*    
* 返回值 :无
**********************************************************/
static void InitTime(int tv_sec,int tv_usec)
{
struct itimerval value;
  
signal(SIGALRM, ElsfTimer);

value.it_value.tv_sec = tv_sec;  //秒
value.it_value.tv_usec = tv_usec; // 纳秒
value.it_interval.tv_sec = tv_sec;
value.it_interval.tv_usec = tv_usec;
setitimer(ITIMER_REAL, &value, NULL);
}

int main( void)
{
InitTime(5,0);
while(1)
{
}
exit( 0 );
}
路漫漫其修远兮,吾将上下而求索!
级别: 新手上路
UID: 14671
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2010-02-20
最后登录: 2015-06-26
4楼  发表于: 2010-03-23 05:59

 Frank MINI2440 实验 3~8

实验 3~8:
  1. 把Timer和Uart 一起调试。
  2. 换了编译器。不再用 -static 选项。
  3. 测试Cplus。用和不用-static选项,前后文件大小差400多倍。
  4. 测试Thread程序。
  5. 测试出MINI2440应用程序时间中断最小时间间隔是5ms.
  6. 分开客户端和服务器端的程序,用程序中固定的参数,编译并且测试。


22MAR10    Frank_MINI2440_Test_4_Compiler
Inatall: arm-linux-gcc-4.3.2

    When MINI2440 start up, it outputs
        Linux version 2.6.32.2-FriendlyARM (root@tom) (gcc version 4.3.2 (Sourcery G++ Lite 2008q3-72) ) #1 Fri Jan 8 12:53:23 CST 2010

    For the compiled files work properly. We should match our compiler to gcc version 4.3.2)

    down load arm-linux-gcc-4.3.2.tgz from friendlyarm.com,    Ubuntu fireFox can not download properly, use Chrome or IE
     sudo tar xvzf arm-linux-gcc-4.3.2.tgz -C /
    change /etc/enviroment to PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/arm/4.3.2/bin"

    /usr/local/arm/4.3.2/bin/arm-linux-gcc Frank_Timer_Uart.c Frank_Uart.c -o Frank_Timer_Uart
    Will output Frank_Timer_Uart executable file.
    so we do not need -static any more.

    Before the updating, we always got "-/bin/sh: XXX: not found",(XXX is the file name)
    This might be these reasons:
    1. No XXX file.
    2. No dependent lib.
    3. XXX was compiled by the different compiler from the one used to compile the kernel.

Frank_MINI2440_Test_5_Cplus
/usr/local/arm/4.3.2/bin/arm-linux-g++ cplus.c++ -o test_5_cplus
    the size is from 3.4M to 8k----------more than 400 times!!!
Frank_MINI2440_Test_6_Thread
Frank_MINI2440_Test_7_Timer_interal_5ms    the minimum interval is 5ms for the timer interrupt.
Frank_MINI2440_Test_8_Udptalk_sever_client    seperate server and client, no parameters are needed for executing the file

Frank_MINI2440_Test_1_to_8.tar (190 K) 下载次数:7
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:39 Frank_MINI2440_Test_1_Uart
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:39 Frank_MINI2440_Test_2_Timer
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:38 Frank_MINI2440_Test_3_Timer_Uart
    drwxr-xr-x  2 frank frank   4096 2010-03-22 14:35 Frank_MINI2440_Test_4_Compiler
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:38 Frank_MINI2440_Test_5_Cplus
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:40 Frank_MINI2440_Test_6_Thread
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:40 Frank_MINI2440_Test_7_Timer_interal_5ms
    drwxr-xr-x  2 frank frank   4096 2010-03-22 17:04 Frank_MINI2440_Test_8_Udptalk_sever_client
[ 此帖被franktu在2010-03-23 06:34重新编辑 ]
路漫漫其修远兮,吾将上下而求索!
级别: 新手上路
UID: 14671
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2010-02-20
最后登录: 2015-06-26
5楼  发表于: 2010-03-26 00:48

 Frank MINI2440 实验 9,10 --Timer, Thread, Socket

Frank_MINI_Test_9_10.tar (110 K) 下载次数:8
Test--9:
combine timer and client.

make -f Make_client -o client
make -f make_server -o server

client sends 0 to 255 repeatly to server.
output on the client:

sec = 1122014104      usec = 169543
2005 - 7 - 22 14:35:4
sendto ok
sec = 1122014104      usec = 174537
2005 - 7 - 22 14:35:4
sendto ok
sec = 1122014104      usec = 179845
2005 - 7 - 22 14:35:4
sendto ok
sec = 1122014104      usec = 184552
2005 - 7 - 22 14:35:4
sendto ok
sec = 1122014104      usec = 189544
2005 - 7 - 22 14:35:4
sendto ok
sec = 1122014104      usec = 194543
2005 - 7 - 22 14:35:4
sendto ok
........

output on the server:
                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?            

  
                     ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?            

...........


Test--10:
combine thread and client.

make -f Make_client -o client
make -f make_server -o server

client sends 0 to 255 repeatly to server.
output on the client:

make a new item
consume item
sendto ok
make a new item
consume item
sendto ok
make a new item
consume item
sendto ok
make a new item
consume item
sendto ok
make a new item
consume item
sendto ok
make a new item
consume item
sendto ok

........

output on the server:
                  ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?            

  
                     ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~  锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?锟?            

...........
自由,自强,共享,共创。
级别: 论坛版主
UID: 12573
精华: 27
发帖: 8838
金钱: 46490 两
威望: 9298 点
贡献值: 27 点
综合积分: 18216 分
注册时间: 2010-01-09
最后登录: 2019-07-16
6楼  发表于: 2010-03-26 10:58
大部分初学者都是像你一样一开始就抱着u-boot, kernel, busybox甚至更底层的驱动去啃,结果碰了石头,经多次尝试依然搞不定,结果大部分就放弃了,少部分人绕过了这些所谓的“底层和开源”,转而走了你后面的路。
新手如何向我们反馈有效的信息,以便解决问题,见此贴:
http://www.arm9home.net/read.php?tid-14431.html

[注]: 此处签名链接仅为指引方向,而非解答问题本身.
路漫漫其修远兮,吾将上下而求索!
级别: 新手上路
UID: 14671
精华: 0
发帖: 40
金钱: 200 两
威望: 40 点
贡献值: 0 点
综合积分: 80 分
注册时间: 2010-02-20
最后登录: 2015-06-26
7楼  发表于: 2010-03-27 04:48
是的,这个系统实在是太大了,我们只能先做我们能做的,也许会慢慢建立我们的信心。

我从昨天开始想编译x86-qtopia-2.2.0_20100108 和arm-qtopia-2.2.0_20100108。
我的系统是Ubuntu,始终编译不过去。不知道Ubuntu下编译qtopia是否有什么特殊要求。求版主指点一下。

现在的局面我只能暂时放弃,我反复折腾了N次了。机器也累了。
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
8楼  发表于: 2010-03-27 09:03
我的系统是Ubuntu,始终编译不过去。不知道Ubuntu下编译qtopia是否有什么特殊要求。求版主指点一下。

现在的局面我只能暂时放弃,我反复折腾了N次了。机器也累了。

把问题提出来,这样别人才能帮你。
关于如何记录问题,参考http://www.aiothome.net/read.php?tid-3776.html
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."
*無鈳取玳
级别: 论坛版主
UID: 27
精华: 12
发帖: 5398
金钱: 40120 两
威望: 17929 点
贡献值: 71 点
综合积分: 11036 分
注册时间: 2008-01-16
最后登录: 2014-11-22
9楼  发表于: 2010-03-27 09:06
另外,建议你不要再在超过晚上11点之后看程序了,那种状态下是看不出什么结果来的。
"If you have an apple and I have an apple and we exchange apples, then you and I will
still each have one apple. But if you have an idea and I have an idea and we exchange
these ideas, then each of us will have two ideas."