OK6410移植linux3.3.5

| superzuo

目录

Linux 3.3.5系统移植    2

LED驱动移植    8

按键驱动移植    9

LCD驱动移植    11

DM9000网卡驱动移植    14

搭建NFS网络文件系统    25

移植触摸屏驱动    38

移植Qt4.8.1    42

tslib移植及测试    42

移植qt-everywhere-opensource-src-4.8.1    45

 

 

今天听了宋宝华(http://www.embedu.org/lecture/index.htm)的讲座,一下子恍然大悟,我必须做点什么。。。。。。

Linux 3.3.5系统移植

  1. 将arch/arm/mach-s3c6410/下的,mach-smdk6410.c cp为mach-my6410.c;
  2. 打开arch/arm/mach-s3c6410/下的Kconfig,仿照MACH_SMDK6410做一个菜单项:

    config MACH_MY6410

        bool "MY6410"

        select CPU_S3C6410

        select SAMSUNG_DEV_ADC

        select S3C_DEV_HSMMC

        select S3C_DEV_HSMMC1

        select S3C_DEV_I2C1

        select SAMSUNG_DEV_IDE

        select S3C_DEV_FB

        select S3C_DEV_RTC

        select SAMSUNG_DEV_TS

        select S3C_DEV_USB_HOST

        select S3C_DEV_USB_HSOTG

        select S3C_DEV_WDT

        select SAMSUNG_DEV_BACKLIGHT

        select SAMSUNG_DEV_KEYPAD

        select SAMSUNG_DEV_PWM

        select HAVE_S3C2410_WATCHDOG if WATCHDOG

        select S3C64XX_SETUP_SDHCI

        select S3C64XX_SETUP_I2C1

        select S3C64XX_SETUP_IDE

        select S3C64XX_SETUP_FB_24BPP

        select S3C64XX_SETUP_KEYPAD

        help

         Machine support for the Pillar MY6410

  3. 打开arch/arm/tools/mach-types文件,这里面存的是机器ID必须要和uboot里面的ID保持一致,将其283行复制添加在后面并修改为:

    smdk6410        MACH_SMDK6410        SMDK6410        1626

xx6410  MACH_XX6410  XX6410  1626 这个机器ID和UBOOT里的机器ID相同时才能启动内核;

  1. 修改BSP文件mach-my6410.c,内容如下:

    将mach-mach-my6410.c文件中的所有smdk6410改成my6410(不要改大写SMDK6410的)

    MACHINE_START(MY6410, "MY6410")//这个要和Kconfig里的MACH-MY6410匹配 

  2. 在当前目录的Makefile最后一行加上 obj-$(CONFIG_MACH_MY6410) += mach-my6410.o
  3.  修改顶层的Makefile:

     ARCH ?= arm

     CROSS_COMPILE ?= /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-

  4. 复制arch/arm/configs/下的s3c6400-defconfig文件,然后将其保存为.config,配置内核支持EABI,再选中XX6410 board这一项,保存退出;
  5. 执行make menuconfig对内核进行配置:

    执行make编译

    执行make zImage生成zImage

    将uboot根目录下的mkimage拷贝到/user/bin目录下

    执行make uImage生成uImage

通过以上几步linux内核移植完了,剩下就移植驱动了。

这里需要注意,每一次修改Kconfig文件都需要make menuconfig对内核进行配置。

 

LED驱动移植

  1. Linu内核下drivers/leds/leds­gpio.c实现了一个体系结构无关的GPIO LED驱动,使用此LED 驱动,开发者不需要修改一行代码,只需要在 BSP 的板文件(对于OK6410 为arch/arm/mach­s3c6410/mach­my6410.c)中定义相关的platform设备和数据。在 MY6410开发板上,GPM0~GPM3 实现了四个 LED,因此其对应的platform 信息如下:

    arch/arm/mach­s3c6410/mach­my6410.c:

    static struct gpio_led my6410_leds[] ={

        [0]= {

            .name = "LED1",

            .gpio = S3C64XX_GPM(0),

            },

        [1]= {

            .name = "LED2",

            .gpio = S3C64XX_GPM(1),

            },

        [2]= {

            .name = "LED3",

            .gpio = S3C64XX_GPM(2),

            },

        [3]= {

            .name = "LED4",

            .gpio = S3C64XX_GPM(3),

            },    

    };

    static struct gpio_led_platform_data my6410_gpio_led_pdata ={

        .num_leds    = ARRAY_SIZE(my6410_leds),

        .leds         =my6410_leds,

    };

    static struct platform_device my6410_device_led ={

        .name    = "leds-gpio",

        .id        = -1,

        .dev    ={

        .platform_data = &my6410_gpio_led_pdata,

        },

    };

  2. 将&my6410_device_led添加到static struct platform_device *my6410_devices[] __initdata中。
  3. 配置内核:

    Device Drivers --->

        [*] LED Support --->

            <*> LED Support for GPIO connected LEDs

    下载内核后开发板上的四个LED这时候已经全部都亮了

 

按键驱动移植

  1. Linux内核下的drivers/input/keyboard/gpio_keys.c 实现了一个体系结构无关的 GPIO 按键驱动,使用此按键驱动,开发者不需要修改一行代码,只需要在BSP 的板文件(对于 MY6410为arch/arm/mach­s3c6410/mach­my6410.c)中定义相关的platform 设备和数据。在 MY6410开发板上,用 GPN0~GPN5实现了DOWN、ENTER、HOME、UP、TAB、END 六个按键,因此其对应的 platform 信息如下:

    arch/arm/mach­s3c6410/mach­my6410.c:

    static struct gpio_keys_button my6410_buttons[] = {

        {

            .gpio        = S3C64XX_GPN(0),

            .code        = KEY_UP,

            .desc        = "Up",

            .active_low    = 1,

            .wakeup        = 0,

        },

        {

            .gpio        = S3C64XX_GPN(1),

            .code        = KEY_DOWN,

            .desc        = "Down",

            .active_low    = 1,

            .wakeup        = 0,

        },

        {

            .gpio        = S3C64XX_GPN(2),

            .code        = KEY_LEFT,

            .desc        = "Left",

            .active_low    = 1,

            .wakeup        = 0,

        },

        {

            .gpio        = S3C64XX_GPN(3),

            .code        = KEY_RIGHT,

            .desc        = "Right",

            .active_low    = 1,

            .wakeup        = 0,

        },

        {

            .gpio        = S3C64XX_GPN(4),

            .code        = KEY_ENTER,

            .desc        = "Enter",

            .active_low    = 1,

            .wakeup        = 0,

        },

        {

            .gpio        = S3C64XX_GPN(5),

            .code        = KEY_ESC,

            .desc        = "Esc",

            .active_low    = 1,

            .wakeup        = 0,

        }

    };

    static struct gpio_keys_platform_data my6410_button_data ={

        .buttons    =my6410_buttons,

        .nbuttons    =ARRAY_SIZE(my6410_buttons),

    };

    static struct platform_device my6410_device_button    = {

        .name        ="gpio-keys",

        .id            = -1,

        .dev        = {

        .platform_data =&my6410_button_data,

        },

    };

  2. 将& my6410_device_button添加到static struct platform_device *my6410_devices[] __initdata中
  3. 配置linux内核

    Device Drivers --->

        Input device support --->

            [*] Keyboards --->

                 <*> GPIO Buttons

    在移植按键驱动时候可能出现一下错误:

    arch/arm/mach-s3c64xx/mach-my6410.c:298: error: array type has incomplete element type

    arch/arm/mach-s3c64xx/mach-my6410.c:300: error: field name not in record or union initializer

    arch/arm/mach-s3c64xx/mach-my6410.c:300: error: (near initialization for 'my6410_buttons')

    arch/arm/mach-s3c64xx/mach-my6410.c:301: error: field name not in record or union initializer

    arch/arm/mach-s3c64xx/mach-my6410.c:301: error: (near initialization for 'my6410_buttons')

    arch/arm/mach-s3c64xx/mach-my6410.c:302: error: field name not in record or union initializer

    arch/arm/mach-s3c64xx/mach-my6410.c:302: error: (near initialization for 'my6410_buttons')

    arch/arm/mach-s3c64xx/mach-my6410.c:303: error: field name not in record or union initializer

    arch/arm/mach-s3c64xx/mach-my6410.c:303: error: (near initialization for 'my6410_buttons')

    arch/arm/mach-s3c64xx/mach-my6410.c:304: error: field name not in record or union initialize

    ………………..

    ………………………

    ……………………………………

    可以看出这个错误提示的意思是没有找到定义的数组,然后其他的就引起一连串的错误,解决的办法很简单就是把

    #include <linux/gpio_keys.h>

    这个头文件添加进去就可以了。

     

     

 

今天已经就做这么多吧,人都快累垮了。。。。。。明天继续。。。。。。

LCD驱动移植

  1. 向mach-my6410.c里面填入相应的平台信息:

    static struct s3c_fb_pd_win my6410_fb_win0 = {

        /* this is to ensure we use win0 */

        .win_mode    = {

            .left_margin    = 2,

            .right_margin    = 2,

            .upper_margin    = 2,

            .lower_margin    = 2,

            .hsync_len    = 41,

            .vsync_len    = 10,

            .xres        = 480,

            .yres        = 272,

        },

        .max_bpp    = 32,

        .default_bpp    = 16,

    };

pixclock = 1000000 / DCLK = 1000000 / 9 = 111111

left_margin = Thb = 2

right_margin = Thf = 2

hsync_len = Thp = 41

upper_margin = Tvb = 2

lower_margin = Tvf = 2

vsync_len = Tvp = 10

xres = Thd = 480

Yres = Tvd = 272

static struct map_desc my6410_iodesc[] = {

    {

        /* LCD support */

        .virtual = (unsigned long)S3C_VA_LCD,

        .pfn = __phys_to_pfn(S3C_PA_FB),

        .length = SZ_16K,

        .type = MT_DEVICE,

    },

};

  1. 然后将28内核中的drviers/video/samsung拷贝到drviers/video/目录下
  2. 修改drviers/video/的Kconfig文件,在文件中加入

    source "drivers/video/samsung/Kconfig"

  3. 修改修改drviers/video/的Makefie文件,再最后一行添加:

    obj-$(CONFIG_FB_S3C_EXT) += samsung/

  4. 在arch/arm/plat-samsung/include/plat/map-base.h里面添加

    

#define S3C_VA_LCD S3C_ADDR(0x01100000)     /* LCD */

  1. 在include/generated/atuoconfig.h里面添加

    #define CONFIG_FB_S3C_EXT_NUM 4

  2. 把drivers/video/samsung/s3cfb_fimd4x.c里面的

第1417行:

s3c6410_pm_do_save(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));

改成

s3c_pm_do_save(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));

第1438行

s3c6410_pm_do_restore(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));

改成

s3c_pm_do_restore(s3c_lcd_save, ARRAY_SIZE(s3c_lcd_save));

  1. 配置内核:

    Device Drivers --->

Graphics support --->

<*> Support for frame buffer devices ---> (里面的都空选)

<*> Support for frame buffer devices --->

[ ] Backlight & LCD device support --->

<*> S3C Framebuffer Support (eXtended)(修改Kconfig之后才有这个选)

Select LCD Type (4.3 inch 480x272 TFT LCD) --->

(X) 4.3 inch 480x272 TFT LCD

<*> Advanced options for S3C Framebuffer

Select BPP(Bits Per Pixel) (16 BPP) --->

(4) Number of Framebuffers

[ ] Enable Virtual Screen

[*] Enable Double Buffering

Console display driver support --->

<*> Framebuffer Console support

[*] Bootup logo --->(显示小企鹅)

[*] Standard 224-color Linux logo

如果驱动移植成功内核启动的时候会打印一下信息:

S3C_LCD clock got enabled :: 133.000 Mhz

LCD TYPE :: LTE480WV will be initialized

Window[0] - FB1: map_video_memory: clear ffd80000:0007f800

FB1: map_video_memory: dma=5f900000 cpu=ffd80000 size=0007f800

Window[0] - FB2: map_video_memory: clear ffdbfc00:0003fc00

FB2: map_video_memory: dma=5f93fc00 cpu=ffdbfc00 size=0003fc00

Console: switching to colour frame buffer device 60x34

fb0: s3cfb frame buffer device

Window[1] - FB1: map_video_memory: clear ffd00000:0007f800

FB1: map_video_memory: dma=5f980000 cpu=ffd00000 size=0007f800

Window[1] - FB2: map_video_memory: clear ffd3fc00:0003fc00

FB2: map_video_memory: dma=5f9bfc00 cpu=ffd3fc00 size=0003fc00

fb1: s3cfb frame buffer device

Window[2] - FB1: map_video_memory: clear ffcc0000:0003fc00

FB1: map_video_memory: dma=5fa00000 cpu=ffcc0000 size=0003fc00

fb2: s3cfb frame buffer device

Window[3] - FB1: map_video_memory: clear ffc80000:0003fc00

FB1: map_video_memory: dma=5fa40000 cpu=ffc80000 size=0003fc00

fb3: s3cfb frame buffer device

在LCD还会显示小企鹅:

相应的驱动程序都在

drviers/video/Samsung/s3cfb.c目录下

 

 

今天就为这驱动搞了一天,其实早就可以成功的,TMMD的不知道是不是手贱还是怎么的,

竟然把System Type --->

[* ] SMDK6400

选上了,最后系统一直打印都是SMDK6400的信息。幸好我靠

printk(KERN_INFO "DEBUG\n\n\n\n");

找到了原因。

以后有时间好好对LCD驱动做一下分析。

DM9000网卡驱动移植

  1. Linux内核里面已经 支持了dm9000的网卡驱动,所以驱动程序我们不需要写了,只需要添加 相应的平台信息。在linux-3.3.5/arch/arm/mach-s3c64xx/mach-my6410.c里面添加都文件#include <linux/dm9000.h>
  2. 在linux-3.3.5/arch/arm/mach-s3c64xx/mach-my6410.c里面添加以下平台信息:

    #define S3C64XX_PA_DM9000    (0x18000000)

    #define S3C64XX_SZ_DM9000    SZ_1M

    static struct resource my6410_dm9000_resources[] = {

    [0] = {

    .start= S3C64XX_PA_DM9000,

    .end= S3C64XX_PA_DM9000 + 3,

    .flags= IORESOURCE_MEM,

    },

    [1] = {

    .start= S3C64XX_PA_DM9000 + 4,

    .end= S3C64XX_PA_DM9000 + S3C64XX_SZ_DM9000 - 1,

    .flags= IORESOURCE_MEM,

    },

    [2] = {

    .start= IRQ_EINT(7),

    .end= IRQ_EINT(7),

    .flags= IORESOURCE_IRQ | IRQF_TRIGGER_HIGH,

    },

};

 

static struct dm9000_plat_data my6410_dm9000_platdata = {

.flags= DM9000_PLATF_16BITONLY,

.dev_addr= { 0x08, 0x90, 0x00, 0xa0, 0x90, 0x90 },

};

 

static struct platform_device my6410_device_dm9000 = {

.name= "dm9000",

.id= 0,

.num_resources= ARRAY_SIZE(my6410_dm9000_resources),

.resource= my6410_dm9000_resources,

.dev= {

.platform_data = &my6410_dm9000_platdata,

}

};

然后在static struct platform_device *my6410_devices[] __initdata =里面添加

&my6410_device_dm9000,

  1. 配置内核,这里网络配置的选项很多,但都要根据实际选对:

 

 

  1. 出现的问题及解决方案:
    1. 编译的时候出现:

      SYSMAP System.map

      SYSMAP .tmp_System.map

      Inconsistent kallsyms data

      This is a bug - please report about it

      Try make KALLSYMS_EXTRA_PASS=1 as a workaround

      make: *** [vmlinux] 错误 1

这样的错误没有任何提示,经过总结,我发现这样的错误出现的原因就是内核中有些设备没有配置但是在BSP里面却定义了,或者是 BSP里面定义了,但是内核没有配置。

解决方法是把static struct platform_device *my6410_devices[] __initdata里面一些三星的东西去掉,其实如果从一个空模版移植是不会出现这类问题的,这里我还是有些偷懒。修改以后的内容如下:

static struct platform_device *my6410_devices[] __initdata = {

#ifdef CONFIG_SMDK6410_SD_CH0

&s3c_device_hsmmc0,

#endif

&my6410_device_button,

&my6410_device_led,

&my6410_device_dm9000,

#ifdef CONFIG_SMDK6410_SD_CH1

&s3c_device_hsmmc1,

#endif

&s3c_device_i2c0,

//&s3c_device_i2c1,

&s3c_device_fb,

&s3c_device_ohci,

&s3c_device_usb_hsotg,

&samsung_asoc_dma,

//&s3c64xx_device_iisv4,

//&samsung_device_keypad,

 

#ifdef CONFIG_REGULATOR

//&my6410_b_pwr_5v,

#endif

//&my6410_lcd_powerdev,

 

//&my6410_smsc911x,

//&s3c_device_adc,

//&s3c_device_cfcon,

&s3c_device_rtc,

&s3c_device_ts,

//&s3c_device_wdt,

};

  1. 启动过程中出现这样的问题:

smsc911x: failed to claim resource 0(这个提示原来在这儿我怎么没有发现

------------[ cut here ]------------

WARNING: at drivers/base/core.c:194 device_release+0x74/0x80()

Device 'platform-lcd.0' does not have a release() function, it is broken and must be fixed.

Modules linked in:

[<c0013e1c>] (unwind_backtrace+0x0/0xf8) from [<c001d968>] (warn_slowpath_common+0x4c/0x64)

[<c001d968>] (warn_slowpath_common+0x4c/0x64) from [<c001da14>] (warn_slowpath_fmt+0x30/0x40)

[<c001da14>] (warn_slowpath_fmt+0x30/0x40) from [<c0175d6c>] (device_release+0x74/0x80)

[<c0175d6c>] (device_release+0x74/0x80) from [<c0126ac0>] (kobject_release+0x44/0x78)

[<c0126ac0>] (kobject_release+0x44/0x78) from [<c0179910>] (platform_add_devices+0x54/0x68)

[<c0179910>] (platform_add_devices+0x54/0x68) from [<c03826c4>] (customize_machine+0x20/0x30)

[<c03826c4>] (customize_machine+0x20/0x30) from [<c00087a8>] (do_one_initcall+0x11c/0x170)

[<c00087a8>] (do_one_initcall+0x11c/0x170) from [<c037f564>] (kernel_init+0x84/0x128)

[<c037f564>] (kernel_init+0x84/0x128) from [<c000f28c>] (kernel_thread_exit+0x0/0x8)

---[ end trace 1b75b31a2719ed1c ]---

------------[ cut here ]------------

WARNING: at drivers/base/core.c:194 device_release+0x74/0x80()

Device 'samsung-keypad' does not have a release() function, it is broken and must be fixed.

Modules linked in:

[<c0013e1c>] (unwind_backtrace+0x0/0xf8) from [<c001d968>] (warn_slowpath_common+0x4c/0x64)

[<c001d968>] (warn_slowpath_common+0x4c/0x64) from [<c001da14>] (warn_slowpath_fmt+0x30/0x40)

[<c001da14>] (warn_slowpath_fmt+0x30/0x40) from [<c0175d6c>] (device_release+0x74/0x80)

[<c0175d6c>] (device_release+0x74/0x80) from [<c0126ac0>] (kobject_release+0x44/0x78)

[<c0126ac0>] (kobject_release+0x44/0x78) from [<c0179910>] (platform_add_devices+0x54/0x68)

[<c0179910>] (platform_add_devices+0x54/0x68) from [<c03826c4>] (customize_machine+0x20/0x30)

[<c03826c4>] (customize_machine+0x20/0x30) from [<c00087a8>] (do_one_initcall+0x11c/0x170)

[<c00087a8>] (do_one_initcall+0x11c/0x170) from [<c037f564>] (kernel_init+0x84/0x128)

[<c037f564>] (kernel_init+0x84/0x128) from [<c000f28c>] (kernel_thread_exit+0x0/0x8)

---[ end trace 1b75b31a2719ed1d ]---

------------[ cut here ]------------

WARNING: at drivers/base/core.c:194 device_release+0x74/0x80()

Device 'samsung-i2s.2' does not have a release() function, it is broken and must be fixed.

Modules linked in:

[<c0013e1c>] (unwind_backtrace+0x0/0xf8) from [<c001d968>] (warn_slowpath_common+0x4c/0x64)

[<c001d968>] (warn_slowpath_common+0x4c/0x64) from [<c001da14>] (warn_slowpath_fmt+0x30/0x40)

[<c001da14>] (warn_slowpath_fmt+0x30/0x40) from [<c0175d6c>] (device_release+0x74/0x80)

[<c0175d6c>] (device_release+0x74/0x80) from [<c0126ac0>] (kobject_release+0x44/0x78)

[<c0126ac0>] (kobject_release+0x44/0x78) from [<c0179910>] (platform_add_devices+0x54/0x68)

[<c0179910>] (platform_add_devices+0x54/0x68) from [<c03826c4>] (customize_machine+0x20/0x30)

[<c03826c4>] (customize_machine+0x20/0x30) from [<c00087a8>] (do_one_initcall+0x11c/0x170)

[<c00087a8>] (do_one_initcall+0x11c/0x170) from [<c037f564>] (kernel_init+0x84/0x128)

[<c037f564>] (kernel_init+0x84/0x128) from [<c000f28c>] (kernel_thread_exit+0x0/0x8)

---[ end trace 1b75b31a2719ed1e ]---

出现这个这个错误的原因根据提示可以知道那个玩意儿没有得到资源。

原来它在arch/arm/mach-s3c64xx/include/mach/map.h  被这样定义

#define S3C64XX_PA_XM0CSN1 (18000000)

这个刚好我我们定义的DM9000的物理地址相同

所以就冲突了。解决方法很简单,就是把

static struct platform_device *my6410_devices[] __initdata里面的

//&my6410_smsc911x,注释掉。

  1. 最后系统启动信息如下:

SMDK6410 # bootm c0008000

## Booting image at c0008000 ...

Image Name: Linux-3.3.5

Created: 2012-05-10 8:00:27 UTC

Image Type: ARM Linux Kernel Image (uncompressed)

Data Size: 1987128 Bytes = 1.9 MB

Load Address: 50008000

Entry Point: 50008000

Verifying Checksum ... OK

OK

 

Starting kernel ...

 

Uncompressing Linux... done, booting the kernel.

Booting Linux on physical CPU 0

Linux version 3.3.5 (root@superzuo) (gcc version 4.2.2) #38 Thu May 10 16:00:17 CST 2012

CPU: ARMv6-compatible processor [410fb766] revision 6 (ARMv7), cr=00c5387d

CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache

Machine: my6410

Memory policy: ECC disabled, Data cache writeback

CPU S3C6410 (id 0x36410101)

S3C24XX Clocks, Copyright 2004 Simtec Electronics

camera: no parent clock specified

S3C64XX: PLL settings, A=532000000, M=532000000, E=24000000

S3C64XX: HCLK2=266000000, HCLK=133000000, PCLK=66500000

mout_apll: source is fout_apll (1), rate is 532000000

mout_epll: source is epll (1), rate is 24000000

mout_mpll: source is mpll (1), rate is 532000000

usb-bus-host: source is clk_48m (0), rate is 48000000

audio-bus: source is mout_epll (0), rate is 24000000

audio-bus: source is mout_epll (0), rate is 24000000

audio-bus: source is mout_epll (0), rate is 24000000

irda-bus: source is mout_epll (0), rate is 24000000

camera: no parent clock specified

CPU: found DTCM0 8k @ 00000000, not enabled

CPU: moved DTCM0 8k to fffe8000, enabled

CPU: found DTCM1 8k @ 00000000, not enabled

CPU: moved DTCM1 8k to fffea000, enabled

CPU: found ITCM0 8k @ 00000000, not enabled

CPU: moved ITCM0 8k to fffe0000, enabled

CPU: found ITCM1 8k @ 00000000, not enabled

CPU: moved ITCM1 8k to fffe2000, enabled

Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024

Kernel command line: noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 console=ttySAC0 init=/linuxrc video=fb:AT070TN83

PID hash table entries: 1024 (order: 0, 4096 bytes)

Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)

Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)

Memory: 256MB = 256MB total

Memory: 255740k/255740k available, 6404k reserved, 0K highmem

Virtual kernel memory layout:

vector : 0xffff0000 - 0xffff1000 ( 4 kB)

DTCM : 0xfffe8000 - 0xfffec000 ( 16 kB)

ITCM : 0xfffe0000 - 0xfffe4000 ( 16 kB)

fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB)

vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)

lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)

modules : 0xbf000000 - 0xc0000000 ( 16 MB)

.text : 0xc0008000 - 0xc037e238 (3545 kB)

.init : 0xc037f000 - 0xc03a0000 ( 132 kB)

.data : 0xc03a0000 - 0xc03c8440 ( 162 kB)

.bss : 0xc03c9024 - 0xc03fe3eb ( 213 kB)

SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1

NR_IRQS:246

VIC @f6000000: id 0x00041192, vendor 0x41

VIC @f6010000: id 0x00041192, vendor 0x41

Console: colour dummy device 80x30

Calibrating delay loop... 528.79 BogoMIPS (lpj=2643968)

pid_max: default: 32768 minimum: 301

Mount-cache hash table entries: 512

CPU: Testing write buffer coherency: ok

Setting up static identity map for 0x50299118 - 0x50299174

gpiochip_add: registered GPIOs 38 to 53 on device: GPF

gpiochip_add: registered GPIOs 74 to 89 on device: GPI

gpiochip_add: registered GPIOs 91 to 102 on device: GPJ

gpiochip_add: registered GPIOs 161 to 176 on device: GPO

gpiochip_add: registered GPIOs 178 to 192 on device: GPP

gpiochip_add: registered GPIOs 194 to 202 on device: GPQ

gpiochip_add: registered GPIOs 144 to 159 on device: GPN

gpiochip_add: registered GPIOs 0 to 7 on device: GPA

gpiochip_add: registered GPIOs 9 to 15 on device: GPB

gpiochip_add: registered GPIOs 17 to 24 on device: GPC

gpiochip_add: registered GPIOs 26 to 30 on device: GPD

gpiochip_add: registered GPIOs 32 to 36 on device: GPE

gpiochip_add: registered GPIOs 55 to 61 on device: GPG

gpiochip_add: registered GPIOs 137 to 142 on device: GPM

gpiochip_add: registered GPIOs 63 to 72 on device: GPH

gpiochip_add: registered GPIOs 104 to 119 on device: GPK

gpiochip_add: registered GPIOs 121 to 135 on device: GPL

NET: Registered protocol family 16

fb frame buffer device

s3c64xx_dma_init: Registering DMA channels

PL080: IRQ 73, at d0804000, channels 0..8

PL080: IRQ 74, at d0806000, channels 8..16

S3C6410: Initialising architecture

bio: create slab <bio-0> at 0

usbcore: registered new interface driver usbfs

usbcore: registered new interface driver hub

usbcore: registered new device driver usb

s3c-i2c s3c2440-i2c.0: slave address 0x10

s3c-i2c s3c2440-i2c.0: bus frequency set to 64 KHz

s3c-i2c s3c2440-i2c.0: i2c-0: S3C I2C adapter

cfg80211: Calling CRDA to update world regulatory domain

ROMFS MTD (C) 2007 Red Hat, Inc.

io scheduler noop registered

io scheduler deadline registered

io scheduler cfq registered (default)

start plist test

end plist test

LCD probe

 

S3C_LCD clock got enabled :: 133.000 Mhz(LCD驱动是OK的

LCD TYPE :: LTE480WV will be initialized

Window[0] - FB1: map_video_memory: clear ffd80000:0007f800

FB1: map_video_memory: dma=5f900000 cpu=ffd80000 size=0007f800

Window[0] - FB2: map_video_memory: clear ffdbfc00:0003fc00

FB2: map_video_memory: dma=5f93fc00 cpu=ffdbfc00 size=0003fc00

Console: switching to colour frame buffer device 60x34

fb0: s3cfb frame buffer device

Window[1] - FB1: map_video_memory: clear ffd00000:0007f800

FB1: map_video_memory: dma=5f980000 cpu=ffd00000 size=0007f800

Window[1] - FB2: map_video_memory: clear ffd3fc00:0003fc00

FB2: map_video_memory: dma=5f9bfc00 cpu=ffd3fc00 size=0003fc00

fb1: s3cfb frame buffer device

Window[2] - FB1: map_video_memory: clear ffcc0000:0003fc00

FB1: map_video_memory: dma=5fa00000 cpu=ffcc0000 size=0003fc00

fb2: s3cfb frame buffer device

Window[3] - FB1: map_video_memory: clear ffc80000:0003fc00

FB1: map_video_memory: dma=5fa40000 cpu=ffc80000 size=0003fc00

fb3: s3cfb frame buffer device

jkq debug VIDCON0 is 353

Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled

s3c6400-uart.0: ttySAC0 at MMIO 0x7f005000 (irq = 69) is a S3C6400/10

console [ttySAC0] enabled

s3c6400-uart.1: ttySAC1 at MMIO 0x7f005400 (irq = 70) is a S3C6400/10

s3c6400-uart.2: ttySAC2 at MMIO 0x7f005800 (irq = 71) is a S3C6400/10

s3c6400-uart.3: ttySAC3 at MMIO 0x7f005c00 (irq = 72) is a S3C6400/10

brd: module loaded

loop: module loaded

at24 0-0050: 1024 byte 24c08 EEPROM, writable, 1 bytes/write

S3C24XX NAND Driver, (c) 2004 Simtec Electronics

dm9000 Ethernet Driver, V1.31(DM9000网卡驱动是OK的

eth0: dm9000a at d0816000,d0a00004 IRQ 108 MAC: 08:90:00:a0:90:90 (platform data)

PPP generic driver version 2.4.2

PPP BSD Compression module registered

PPP Deflate Compression module registered

PPP MPPE Compression module registered

NET: Registered protocol family 24

libertas_sdio: Libertas SDIO driver

libertas_sdio: Copyright Pierre Ossman

usbcore: registered new interface driver rt73usb

ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver

s3c2410-ohci s3c2410-ohci: S3C24XX OHCI

s3c2410-ohci s3c2410-ohci: new USB bus registered, assigned bus number 1

s3c2410-ohci s3c2410-ohci: irq 79, io mem 0x74300000

s3c2410-ohci s3c2410-ohci: init err (00000000 0000)

ohci_hcd: can't start s3c24xx

s3c2410-ohci s3c2410-ohci: startup error -75

s3c2410-ohci s3c2410-ohci: USB bus 1 deregistered

s3c2410-ohci: probe of s3c2410-ohci failed with error -75

mousedev: PS/2 mouse device common for all mice

s3c-rtc s3c64xx-rtc: rtc disabled, re-enabling

s3c-rtc s3c64xx-rtc: rtc core: registered s3c as rtc0

i2c /dev entries driver

sdhci: Secure Digital Host Controller Interface driver

sdhci: Copyright(c) Pierre Ossman

usbcore: registered new interface driver usbhid

usbhid: USB HID core driver

lib80211: common routines for IEEE802.11 drivers

VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5

input: gpio-keys as /devices/platform/gpio-keys/input/input0

s3c-rtc s3c64xx-rtc: setting system clock to 2000-07-27 04:53:53 UTC (964673633)

VFS: Cannot open root device "mtdblock3" or unknown-block(0,0)

Please append a correct "root=" boot option; here are the available partitions:

Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

[<c0013e1c>] (unwind_backtrace+0x0/0xf8) from [<c001db00>] (panic+0x8c/0x200)

[<c001db00>] (panic+0x8c/0x200) from [<c037fc20>] (mount_block_root+0x10c/0x2b0)

[<c037fc20>] (mount_block_root+0x10c/0x2b0) from [<c037ff7c>] (prepare_namespace+0x14c/0x1dc)

[<c037ff7c>] (prepare_namespace+0x14c/0x1dc) from [<c037f5c8>] (kernel_init+0xe8/0x128)

[<c037f5c8>] (kernel_init+0xe8/0x128) from [<c000f28c>] (kernel_thread_exit+0x0/0x8)

 

搭建NFS网络文件系统

  1. 制作文件系统的工具就是传说中的瑞士军刀busybox在他的官网http://www.busybox.net 下载最新的版本为busybox-1.20.0
  2. 修改busybox的makefile:

    CROSS_COMPILE ?= arm-linux-

    ARCH ?= arm

  3. Make menuconfig配置busybox

    Busybox Settings --->

        Build Options --->

    Installation Options ("make install" behavior) --->

    Busybox Library Tuning --->

  4. 编译busybox执行

    Make install

    这时候会提示一个错误提示说:

    miscutils/ubi_tools.c:63:26: error: mtd/ubi-user.h: No such file or directory
    miscutils/ubi_tools.c: In function 'ubi_tools_main':
    miscutils/ubi_tools.c:133: error: 'UBI_DEV_NUM_AUTO' undeclared (first use in this function)
    miscutils/ubi_tools.c:133: error: (Each undeclared identifier is reported only once
    miscutils/ubi_tools.c:133: error: for each function it appears in.)
    miscutils/ubi_tools.c:134: error: 'UBI_VOL_NUM_AUTO' undeclared (first use in this function)
    miscutils/ubi_tools.c:153: error: storage size of 'req' isn't known
    miscutils/ubi_tools.c:161: error: 'UBI_IOCATT' undeclared (first use in this function)
    miscutils/ubi_tools.c:153: warning: unused variable 'req'

make[1]: *** [miscutils/ubi_tools.o] 错误 1
make: *** [miscutils] 错误 2

出现这么多的错误,核心问题就是出现在miscutils/ubi_tools.c:63:26: error: mtd/ubi-user.h: No such file or directory这个上面,无法找到mtd/ubi-user.h头文件,查阅了相关资料后,原来这是一个Linux下新支持的UBI文件系统,需要手 工加入。从Linux3.3.5的include\mtd\ubi-user.h拷贝到busybox下的include\mtd下,如果 busybox下的include没有mtd文件夹,那就先建立一个mtd文件夹,然后复制了。这样做了之后,编译就OK了。出现下面的信息就说明编译成 功了。

  1. 建立根目录,这里我们直接写一个脚本程序运create_rootfs.sh行就可以了,脚本的内容如下:

    #!/bin/sh
    echo "------Create rootfs directons start...--------"
    mkdir rootfs
    cd rootfs
    echo "--------Create root,dev....----------"
    mkdir root dev etc boot tmp var sys proc lib mnt home usr
    mkdir etc/init.d etc/rc.d etc/sysconfig
    mkdir usr/sbin usr/bin usr/lib usr/modules
    echo "make node in dev/console dev/null"
    mknod -m 600 dev/console c 5 1
    mknod -m 600 dev/null c 1 3
    mkdir mnt/etc mnt/jffs2 mnt/yaffs mnt/data mnt/temp
    mkdir var/lib var/lock var/run var/tmp
    chmod 777 tmp
    chmod 777 var/tmp
    echo "-------make direction done---------"

    运行脚本执行:

    ./ create_rootfs.sh

    ls rootfs

    boot  dev  etc  home  lib  mnt  proc  root  sys  tmp  usr  var

  2. etc/inittab 系统init进程配置文件,并更改权限 chmod +x inittab

    ::sysinit:/etc/init.d/rcS
    ::askfirst:-/bin/sh #没有这就不行,就不能打开console控制台。
    ::restart:/sbin/init
    ::ctrlaltdel:/sbin/reboot
    ::shutdown:/bin/umount -a -r
    ::shutdown:/sbin/swapoff –a

  3. etc/init.d/rcS系统启动加载项文件,并更改权限chmod +x etc/init.d/rcS

    #!/bin/sh
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    runlevel=S
    prevlevel=N
    umask 022
    export PATH runlevel prevlevel
    mount -a
    mkdir /dev/pts
    mount -t devpts devpts /dev/pts #用于telnet登录时使用

    echo /sbin/mdev > /proc/sys/kernel/hotplug
    mdev -s
    mkdir -p /var/lock
    /bin/hostname -F /etc/sysconfig/HOSTNAME

  4. etc/fstab 系统挂载文件系统列表文件

    #device mount-point type option dump fsck order
    proc /proc proc defaults 0 0
    sysfs /sys sysfs defaults 0 0
    mdev /dev ramfs defaults 0 0
    none /var ramfs defaults 0 0
    none /tmp ramfs defaults 0 0

  5. etc/profile用户环境配置文件

    # Ash profile
    # vim: syntax= sh
    # No core file by defaults
    # ulimit - S - c 0> / dev/ null 2> & 1

    USER="id -un"
    LOGNAME=$USER
    PS1="[\u@\h \w]#"  #\w 目录将显示全路径
    PATH=$PATH
    HOSTNAME= '/bin/hostname'
    alias cls="clear"
    export USER LOGNAME PS1 PATH 

  6. /etc/passwd shadow 用户文件以及密码

    把主机的passwd shadow 文件拷贝到/etc下

    # cp /etc/passwd  rootfs/etc
    # cp /etc/group rootfs/etc
    # cp /etc/shadow rootfs/etc

  7. etc/sysconfig/HOSTNAME的内容为你自己的名字即可,内容为"Pillar"

    gedit /etc/sysconfig/HOSTNAME  然后键入 Pillar

  8. 在busybox目录下会看见 _install目录,里面有/bin /sbin l inuxr三个文件
    将这三个目录或文件拷到第一步所建的rootfs文件夹下。

    #cp bin/ sbin/ linuxrc /home/rootfs -ra 

    在把_install目录的usr里面的bin,sbin也按照刚才的方法拷贝到rootfs目录下

    切记一定要带上-a的参数,因为bin目录里大部分都是链接,如果不带-a的参数,拷过去之后会做相应的复制,不再是链接的形式

    将交叉编译器下的lib下的库拷贝到lib文件夹下
    cp /usr/local/arm/4.2.2-eabi/lib/* ./

  9. 这时候rootfs目录下的tree应该是这个样子的:

    .

    ├── bin

    │   ├── addgroup -> busybox

    │   ├── adduser -> busybox

    │   ├── ash -> busybox

    │   ├── base64 -> busybox

    │   ├── busybox

    │   ├── cat -> busybox

    │   ├── catv -> busybox

    │   ├── chattr -> busybox

    │   ├── chgrp -> busybox

    │   ├── chmod -> busybox

    │   ├── chown -> busybox

    │   ├── conspy -> busybox

    │   ├── cp -> busybox

    │   ├── cpio -> busybox

    │   ├── cttyhack -> busybox

    │   ├── date -> busybox

    │   ├── dd -> busybox

    │   ├── delgroup -> busybox

    │   ├── deluser -> busybox

    │   ├── df -> busybox

    │   ├── dmesg -> busybox

    │   ├── dnsdomainname -> busybox

    │   ├── dumpkmap -> busybox

    │   ├── echo -> busybox

    │   ├── ed -> busybox

    │   ├── egrep -> busybox

    │   ├── false -> busybox

    │   ├── fdflush -> busybox

    │   ├── fgrep -> busybox

    │   ├── fsync -> busybox

    │   ├── getopt -> busybox

    │   ├── grep -> busybox

    │   ├── gunzip -> busybox

    │   ├── gzip -> busybox

    │   ├── hostname -> busybox

    │   ├── hush -> busybox

    │   ├── ionice -> busybox

    │   ├── iostat -> busybox

    │   ├── ip -> busybox

    │   ├── ipaddr -> busybox

    │   ├── ipcalc -> busybox

    │   ├── iplink -> busybox

    │   ├── iproute -> busybox

    │   ├── iprule -> busybox

    │   ├── iptunnel -> busybox

    │   ├── kill -> busybox

    │   ├── linux32 -> busybox

    │   ├── linux64 -> busybox

    │   ├── ln -> busybox

    │   ├── login -> busybox

    │   ├── ls -> busybox

    │   ├── lsattr -> busybox

    │   ├── lzop -> busybox

    │   ├── makemime -> busybox

    │   ├── mkdir -> busybox

    │   ├── mknod -> busybox

    │   ├── mktemp -> busybox

    │   ├── more -> busybox

    │   ├── mount -> busybox

    │   ├── mountpoint -> busybox

    │   ├── mpstat -> busybox

    │   ├── mt -> busybox

    │   ├── mv -> busybox

    │   ├── netstat -> busybox

    │   ├── nice -> busybox

    │   ├── pidof -> busybox

    │   ├── ping -> busybox

    │   ├── ping6 -> busybox

    │   ├── pipe_progress -> busybox

    │   ├── powertop -> busybox

    │   ├── printenv -> busybox

    │   ├── ps -> busybox

    │   ├── pwd -> busybox

    │   ├── reformime -> busybox

    │   ├── rev -> busybox

    │   ├── rm -> busybox

    │   ├── rmdir -> busybox

    │   ├── rpm -> busybox

    │   ├── run-parts -> busybox

    │   ├── scriptreplay -> busybox

    │   ├── sed -> busybox

    │   ├── setarch -> busybox

    │   ├── setserial -> busybox

    │   ├── sh -> busybox

    │   ├── sleep -> busybox

    │   ├── stat -> busybox

    │   ├── stty -> busybox

    │   ├── su -> busybox

    │   ├── sync -> busybox

    │   ├── tar -> busybox

    │   ├── touch -> busybox

    │   ├── true -> busybox

    │   ├── umount -> busybox

    │   ├── uname -> busybox

    │   ├── usleep -> busybox

    │   ├── vi -> busybox

    │   ├── watch -> busybox

    │   └── zcat -> busybox

    ├── boot

    ├── dev

    │   ├── console

    │   └── null

    ├── etc

    │   ├── fstab

    │   ├── group

    │   ├── init.d

    │   │   └── rcS

    │   ├── inittab

    │   ├── passwd

    │   ├── profile

    │   ├── rc.d

    │   ├── resolv.conf

    │   ├── shadow

    │   └── sysconfig

    │   └── HOSTNAME

    ├── home

    ├── lib

    ├── linuxrc -> bin/busybox

    ├── mnt

    │   ├── data

    │   ├── etc

    │   ├── jffs2

    │   ├── temp

    │   └── yaffs

    ├── proc

    ├── root

    ├── sbin

    │   ├── acpid -> ../bin/busybox

    │   ├── adjtimex -> ../bin/busybox

    │   ├── arp -> ../bin/busybox

    │   ├── blkid -> ../bin/busybox

    │   ├── blockdev -> ../bin/busybox

    │   ├── bootchartd -> ../bin/busybox

    │   ├── depmod -> ../bin/busybox

    │   ├── devmem -> ../bin/busybox

    │   ├── fbsplash -> ../bin/busybox

    │   ├── fdisk -> ../bin/busybox

    │   ├── findfs -> ../bin/busybox

    │   ├── freeramdisk -> ../bin/busybox

    │   ├── fsck -> ../bin/busybox

    │   ├── fsck.minix -> ../bin/busybox

    │   ├── getty -> ../bin/busybox

    │   ├── halt -> ../bin/busybox

    │   ├── hdparm -> ../bin/busybox

    │   ├── hwclock -> ../bin/busybox

    │   ├── ifconfig -> ../bin/busybox

    │   ├── ifdown -> ../bin/busybox

    │   ├── ifenslave -> ../bin/busybox

    │   ├── ifup -> ../bin/busybox

    │   ├── init -> ../bin/busybox

    │   ├── insmod -> ../bin/busybox

    │   ├── klogd -> ../bin/busybox

    │   ├── loadkmap -> ../bin/busybox

    │   ├── logread -> ../bin/busybox

    │   ├── losetup -> ../bin/busybox

    │   ├── lsmod -> ../bin/busybox

    │   ├── makedevs -> ../bin/busybox

    │   ├── man -> ../bin/busybox

    │   ├── mdev -> ../bin/busybox

    │   ├── mkdosfs -> ../bin/busybox

    │   ├── mke2fs -> ../bin/busybox

    │   ├── mkfs.ext2 -> ../bin/busybox

    │   ├── mkfs.minix -> ../bin/busybox

    │   ├── mkfs.vfat -> ../bin/busybox

    │   ├── mkswap -> ../bin/busybox

    │   ├── modinfo -> ../bin/busybox

    │   ├── modprobe -> ../bin/busybox

    │   ├── nameif -> ../bin/busybox

    │   ├── pivot_root -> ../bin/busybox

    │   ├── poweroff -> ../bin/busybox

    │   ├── raidautorun -> ../bin/busybox

    │   ├── reboot -> ../bin/busybox

    │   ├── rmmod -> ../bin/busybox

    │   ├── route -> ../bin/busybox

    │   ├── runlevel -> ../bin/busybox

    │   ├── setconsole -> ../bin/busybox

    │   ├── slattach -> ../bin/busybox

    │   ├── start-stop-daemon -> ../bin/busybox

    │   ├── sulogin -> ../bin/busybox

    │   ├── swapoff -> ../bin/busybox

    │   ├── swapon -> ../bin/busybox

    │   ├── switch_root -> ../bin/busybox

    │   ├── sysctl -> ../bin/busybox

    │   ├── syslogd -> ../bin/busybox

    │   ├── tunctl -> ../bin/busybox

    │   ├── udhcpc -> ../bin/busybox

    │   ├── vconfig -> ../bin/busybox

    │   ├── watchdog -> ../bin/busybox

    │   └── zcip -> ../bin/busybox

    ├── sys

    ├── tmp

    ├── usr

    │   ├── bin

    │   │   ├── [ -> http://www.cnblogs.com/bin/busybox

    │   │   ├── [[ -> http://www.cnblogs.com/bin/busybox

    │   │   ├── add-shell -> http://www.cnblogs.com/bin/busybox

    │   │   ├── arping -> http://www.cnblogs.com/bin/busybox

    │   │   ├── awk -> http://www.cnblogs.com/bin/busybox

    │   │   ├── basename -> http://www.cnblogs.com/bin/busybox

    │   │   ├── beep -> http://www.cnblogs.com/bin/busybox

    │   │   ├── bunzip2 -> http://www.cnblogs.com/bin/busybox

    │   │   ├── bzcat -> http://www.cnblogs.com/bin/busybox

    │   │   ├── bzip2 -> http://www.cnblogs.com/bin/busybox

    │   │   ├── cal -> http://www.cnblogs.com/bin/busybox

    │   │   ├── chat -> http://www.cnblogs.com/bin/busybox

    │   │   ├── chpst -> http://www.cnblogs.com/bin/busybox

    │   │   ├── chrt -> http://www.cnblogs.com/bin/busybox

    │   │   ├── chvt -> http://www.cnblogs.com/bin/busybox

    │   │   ├── cksum -> http://www.cnblogs.com/bin/busybox

    │   │   ├── clear -> http://www.cnblogs.com/bin/busybox

    │   │   ├── cmp -> http://www.cnblogs.com/bin/busybox

    │   │   ├── comm -> http://www.cnblogs.com/bin/busybox

    │   │   ├── crontab -> http://www.cnblogs.com/bin/busybox

    │   │   ├── cryptpw -> http://www.cnblogs.com/bin/busybox

    │   │   ├── cut -> http://www.cnblogs.com/bin/busybox

    │   │   ├── dc -> http://www.cnblogs.com/bin/busybox

    │   │   ├── deallocvt -> http://www.cnblogs.com/bin/busybox

    │   │   ├── diff -> http://www.cnblogs.com/bin/busybox

    │   │   ├── dirname -> http://www.cnblogs.com/bin/busybox

    │   │   ├── dos2unix -> http://www.cnblogs.com/bin/busybox

    │   │   ├── du -> http://www.cnblogs.com/bin/busybox

    │   │   ├── dumpleases -> http://www.cnblogs.com/bin/busybox

    │   │   ├── eject -> http://www.cnblogs.com/bin/busybox

    │   │   ├── env -> http://www.cnblogs.com/bin/busybox

    │   │   ├── envdir -> http://www.cnblogs.com/bin/busybox

    │   │   ├── envuidgid -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ether-wake -> http://www.cnblogs.com/bin/busybox

    │   │   ├── expand -> http://www.cnblogs.com/bin/busybox

    │   │   ├── expr -> http://www.cnblogs.com/bin/busybox

    │   │   ├── fdformat -> http://www.cnblogs.com/bin/busybox

    │   │   ├── fgconsole -> http://www.cnblogs.com/bin/busybox

    │   │   ├── find -> http://www.cnblogs.com/bin/busybox

    │   │   ├── flock -> http://www.cnblogs.com/bin/busybox

    │   │   ├── fold -> http://www.cnblogs.com/bin/busybox

    │   │   ├── free -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ftpget -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ftpput -> http://www.cnblogs.com/bin/busybox

    │   │   ├── fuser -> http://www.cnblogs.com/bin/busybox

    │   │   ├── groups -> http://www.cnblogs.com/bin/busybox

    │   │   ├── hd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── head -> http://www.cnblogs.com/bin/busybox

    │   │   ├── hexdump -> http://www.cnblogs.com/bin/busybox

    │   │   ├── hostid -> http://www.cnblogs.com/bin/busybox

    │   │   ├── id -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ifplugd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── install -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ipcrm -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ipcs -> http://www.cnblogs.com/bin/busybox

    │   │   ├── kbd_mode -> http://www.cnblogs.com/bin/busybox

    │   │   ├── killall -> http://www.cnblogs.com/bin/busybox

    │   │   ├── killall5 -> http://www.cnblogs.com/bin/busybox

    │   │   ├── last -> http://www.cnblogs.com/bin/busybox

    │   │   ├── less -> http://www.cnblogs.com/bin/busybox

    │   │   ├── logger -> http://www.cnblogs.com/bin/busybox

    │   │   ├── logname -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lpq -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lpr -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lsof -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lspci -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lsusb -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lzcat -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lzma -> http://www.cnblogs.com/bin/busybox

    │   │   ├── lzopcat -> http://www.cnblogs.com/bin/busybox

    │   │   ├── md5sum -> http://www.cnblogs.com/bin/busybox

    │   │   ├── mesg -> http://www.cnblogs.com/bin/busybox

    │   │   ├── microcom -> http://www.cnblogs.com/bin/busybox

    │   │   ├── mkfifo -> http://www.cnblogs.com/bin/busybox

    │   │   ├── mkpasswd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── nc -> http://www.cnblogs.com/bin/busybox

    │   │   ├── nmeter -> http://www.cnblogs.com/bin/busybox

    │   │   ├── nohup -> http://www.cnblogs.com/bin/busybox

    │   │   ├── nslookup -> http://www.cnblogs.com/bin/busybox

    │   │   ├── od -> http://www.cnblogs.com/bin/busybox

    │   │   ├── openvt -> http://www.cnblogs.com/bin/busybox

    │   │   ├── passwd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── patch -> http://www.cnblogs.com/bin/busybox

    │   │   ├── pgrep -> http://www.cnblogs.com/bin/busybox

    │   │   ├── pkill -> http://www.cnblogs.com/bin/busybox

    │   │   ├── pmap -> http://www.cnblogs.com/bin/busybox

    │   │   ├── printf -> http://www.cnblogs.com/bin/busybox

    │   │   ├── pscan -> http://www.cnblogs.com/bin/busybox

    │   │   ├── pstree -> http://www.cnblogs.com/bin/busybox

    │   │   ├── pwdx -> http://www.cnblogs.com/bin/busybox

    │   │   ├── readahead -> http://www.cnblogs.com/bin/busybox

    │   │   ├── readlink -> http://www.cnblogs.com/bin/busybox

    │   │   ├── realpath -> http://www.cnblogs.com/bin/busybox

    │   │   ├── remove-shell -> http://www.cnblogs.com/bin/busybox

    │   │   ├── renice -> http://www.cnblogs.com/bin/busybox

    │   │   ├── reset -> http://www.cnblogs.com/bin/busybox

    │   │   ├── resize -> http://www.cnblogs.com/bin/busybox

    │   │   ├── rpm2cpio -> http://www.cnblogs.com/bin/busybox

    │   │   ├── rtcwake -> http://www.cnblogs.com/bin/busybox

    │   │   ├── runsv -> http://www.cnblogs.com/bin/busybox

    │   │   ├── runsvdir -> http://www.cnblogs.com/bin/busybox

    │   │   ├── rx -> http://www.cnblogs.com/bin/busybox

    │   │   ├── script -> http://www.cnblogs.com/bin/busybox

    │   │   ├── seq -> http://www.cnblogs.com/bin/busybox

    │   │   ├── setkeycodes -> http://www.cnblogs.com/bin/busybox

    │   │   ├── setsid -> http://www.cnblogs.com/bin/busybox

    │   │   ├── setuidgid -> http://www.cnblogs.com/bin/busybox

    │   │   ├── sha1sum -> http://www.cnblogs.com/bin/busybox

    │   │   ├── sha256sum -> http://www.cnblogs.com/bin/busybox

    │   │   ├── sha512sum -> http://www.cnblogs.com/bin/busybox

    │   │   ├── showkey -> http://www.cnblogs.com/bin/busybox

    │   │   ├── smemcap -> http://www.cnblogs.com/bin/busybox

    │   │   ├── softlimit -> http://www.cnblogs.com/bin/busybox

    │   │   ├── sort -> http://www.cnblogs.com/bin/busybox

    │   │   ├── split -> http://www.cnblogs.com/bin/busybox

    │   │   ├── strings -> http://www.cnblogs.com/bin/busybox

    │   │   ├── sum -> http://www.cnblogs.com/bin/busybox

    │   │   ├── sv -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tac -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tail -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tcpsvd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tee -> http://www.cnblogs.com/bin/busybox

    │   │   ├── telnet -> http://www.cnblogs.com/bin/busybox

    │   │   ├── test -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tftp -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tftpd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── time -> http://www.cnblogs.com/bin/busybox

    │   │   ├── timeout -> http://www.cnblogs.com/bin/busybox

    │   │   ├── top -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tr -> http://www.cnblogs.com/bin/busybox

    │   │   ├── traceroute -> http://www.cnblogs.com/bin/busybox

    │   │   ├── traceroute6 -> http://www.cnblogs.com/bin/busybox

    │   │   ├── tty -> http://www.cnblogs.com/bin/busybox

    │   │   ├── ttysize -> http://www.cnblogs.com/bin/busybox

    │   │   ├── udpsvd -> http://www.cnblogs.com/bin/busybox

    │   │   ├── unexpand -> http://www.cnblogs.com/bin/busybox

    │   │   ├── uniq -> http://www.cnblogs.com/bin/busybox

    │   │   ├── unix2dos -> http://www.cnblogs.com/bin/busybox

    │   │   ├── unlzma -> http://www.cnblogs.com/bin/busybox

    │   │   ├── unlzop -> http://www.cnblogs.com/bin/busybox

    │   │   ├── unxz -> http://www.cnblogs.com/bin/busybox

    │   │   ├── unzip -> http://www.cnblogs.com/bin/busybox

    │   │   ├── uptime -> http://www.cnblogs.com/bin/busybox

    │   │   ├── users -> http://www.cnblogs.com/bin/busybox

    │   │   ├── uudecode -> http://www.cnblogs.com/bin/busybox

    │   │   ├── uuencode -> http://www.cnblogs.com/bin/busybox

    │   │   ├── vlock -> http://www.cnblogs.com/bin/busybox

    │   │   ├── volname -> http://www.cnblogs.com/bin/busybox

    │   │   ├── wall -> http://www.cnblogs.com/bin/busybox

    │   │   ├── wc -> http://www.cnblogs.com/bin/busybox

    │   │   ├── wget -> http://www.cnblogs.com/bin/busybox

    │   │   ├── which -> http://www.cnblogs.com/bin/busybox

    │   │   ├── who -> http://www.cnblogs.com/bin/busybox

    │   │   ├── whoami -> http://www.cnblogs.com/bin/busybox

    │   │   ├── whois -> http://www.cnblogs.com/bin/busybox

    │   │   ├── xargs -> http://www.cnblogs.com/bin/busybox

    │   │   ├── xz -> http://www.cnblogs.com/bin/busybox

    │   │   ├── xzcat -> http://www.cnblogs.com/bin/busybox

    │   │   └── yes -> http://www.cnblogs.com/bin/busybox

    │   ├── lib

    │   ├── modules

    │   └── sbin

    │   ├── brctl -> http://www.cnblogs.com/bin/busybox

    │   ├── chpasswd -> http://www.cnblogs.com/bin/busybox

    │   ├── chroot -> http://www.cnblogs.com/bin/busybox

    │   ├── crond -> http://www.cnblogs.com/bin/busybox

    │   ├── dhcprelay -> http://www.cnblogs.com/bin/busybox

    │   ├── dnsd -> http://www.cnblogs.com/bin/busybox

    │   ├── fakeidentd -> http://www.cnblogs.com/bin/busybox

    │   ├── fbset -> http://www.cnblogs.com/bin/busybox

    │   ├── ftpd -> http://www.cnblogs.com/bin/busybox

    │   ├── httpd -> http://www.cnblogs.com/bin/busybox

    │   ├── inetd -> http://www.cnblogs.com/bin/busybox

    │   ├── loadfont -> http://www.cnblogs.com/bin/busybox

    │   ├── lpd -> http://www.cnblogs.com/bin/busybox

    │   ├── nanddump -> http://www.cnblogs.com/bin/busybox

    │   ├── nandwrite -> http://www.cnblogs.com/bin/busybox

    │   ├── nbd-client -> http://www.cnblogs.com/bin/busybox

    │   ├── ntpd -> http://www.cnblogs.com/bin/busybox

    │   ├── popmaildir -> http://www.cnblogs.com/bin/busybox

    │   ├── rdate -> http://www.cnblogs.com/bin/busybox

    │   ├── rdev -> http://www.cnblogs.com/bin/busybox

    │   ├── readprofile -> http://www.cnblogs.com/bin/busybox

    │   ├── sendmail -> http://www.cnblogs.com/bin/busybox

    │   ├── setfont -> http://www.cnblogs.com/bin/busybox

    │   ├── setlogcons -> http://www.cnblogs.com/bin/busybox

    │   ├── svlogd -> http://www.cnblogs.com/bin/busybox

    │   ├── telnetd -> http://www.cnblogs.com/bin/busybox

    │   ├── ubiattach -> http://www.cnblogs.com/bin/busybox

    │   ├── ubidetach -> http://www.cnblogs.com/bin/busybox

    │   ├── ubimkvol -> http://www.cnblogs.com/bin/busybox

    │   ├── ubirmvol -> http://www.cnblogs.com/bin/busybox

    │   ├── ubirsvol -> http://www.cnblogs.com/bin/busybox

    │   ├── ubiupdatevol -> http://www.cnblogs.com/bin/busybox

    │   └── udhcpd -> http://www.cnblogs.com/bin/busybox

    └── var

    ├── lib

    ├── lock

    ├── run

    │   └── utmp

    └── tmp

     

    30 directories, 365 files

  10. 修改uboot的bootargs为下面内容:

    setenv bootargs noinitrd root=/dev/nfs ip=192.168.1.104:192.168.1.103:192.168.1.1:255.255.255.0::eth0:off nfsroot=192.168.1.103:/home/superzuo/rootfs,nolock,proto=tcp consloe=ttySAC0,115200

    其中192.168.1.104为开发板的IP地址(用print命令可以查看)

    192.168.1.103为虚拟机的IP地址

    192.168.1.1为路由器的网关,在电脑上可以用ipconfig /all命令查看

    255.255.255.0为子网掩码,在电脑上可以用ipconfig /all命令查看

    先备份一下之前用yaffs2的启动

    noinitrd root=/dev/mtdblock3 rootfstype=yaffs2 console=ttySAC0 init=/linuxrc video=fb:AT070TN83

  11. 使开发板支持域名解析:

  1. 配置内核:

    [*] Networking support --->

    File systems --->

        [*] Network File Systems --->

  2. 启动开发板就可以看见一下信息:

    Registering the dns_resolver key type

    VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5

    input: gpio-keys as /devices/platform/gpio-keys/input/input0

    s3c-rtc s3c64xx-rtc: setting system clock to 2000-07-27 09:18:46 UTC (964689526)

    dm9000 dm9000.0: eth0: link down

    IP-Config: Complete:

    device=eth0, addr=192.168.1.104, mask=255.255.255.0, gw=192.168.1.1,

    host=192.168.1.104, domain=, nis-domain=(none),

    bootserver=192.168.103.0, rootserver=192.168.1.103, rootpath=

    dm9000 dm9000.0: eth0: link up, 100Mbps, full-duplex, lpa 0x4DE1

    VFS: Mounted root (nfs filesystem) on device 0:10.

    Freeing init memory: 156K

     

    Please press Enter to activate this console.

    Pillar

    [root@Pillar /]#ls

    bin dev home linuxrc proc sbin tmp var

    boot etc lib mnt root sys usr

    这说明NFS已经完全挂载上了,这比飞凌官网提供的系统好多了,我这里文件系统支持文件路径显示和主机信息显示。

    在启动的过程中可能 会碰到一个问题:

    Starting pid 768, console /dev/console: '/etc/init.d/rcS' (这个错误就在启动信息的最后一行一定要注意)

    解决的方法是在主机给rcS修改权限:

      chmod -R 777 init.d/*

    最后来一个启动信息最后的截图:

今天就搞了一个dm9000和一个nfs网络文件系统。。。。。。。。

移植触摸屏驱动

  1. 以下copy 是指需要飞凌提供的内核里的驱动源码, dev-ts.c  ts 板载初始化和platform 资源初始化 文件。

    arch/arm/mach-s3c64xx/mach-smdk6410.c

    注销掉头文件  #include<plat/ts.h>
    添加头文件    #include<mach/ts.h>
    copy arch/arm/mach-s3c64xx/include/mach/ts.h 到目标内核目录

    copy arch/arm/mach-s3c64xx/dev-ts.c 到目标内核目录在 arch/arm/mach-s3c64xx/Makefile 中添加 
       obj-$(CONFIG_TOUCHSCREEN_S3C)   += dev-ts.o

    在里面 添加宏定义arch/arm/mach-s3c64xx/dev-ts.c

        #define SZ_256 0x00000100

    添加头文件#include <linux/slab.h>,这就有很多linux3.3和2.6不同的地方

  2. 添加 ts  设备初始化 ,在smdk6410_machine_init ()  结构体中

    //s3c24xx_ts_set_platdata(NULL);

    s3c_ts_set_platdata(&s3c_ts_platform);

 

    添加结构体s3c_ts_platform

static struct s3c_ts_mach_info s3c_ts_platform __initdata = {

    .delay            = 10000,

    .presc            = 49,

    .oversampling_shift    = 2,

    .resol_bit        = 12,        

    .s3c_adc_con        = ADC_TYPE_2,    

 

};

  1. 把飞凌官方的s3c-tc.c拷贝到drivers/input/touchscreen/这里建议拷贝他3.0的系统的
  2. 修改 drivers/input/touchscreen/Makefile 
              添加 obj-$(CONFIG_TOUCHSCREEN_S3C)     += s3c-ts.o
  3. 修改 drivers/input/tourch/screen/Kconfig
              添加 config TOUCHSCREEN_S3C 

    config TOUCHSCREEN_S3C

    tristate "S3C touchscreen driver"

    depends on ARCH_S3C2410 || ARCH_S3C64XX || ARCH_S5P64XX || ARCH_S5PC1XX

    default y

    help

    Say Y here to enable the driver for the touchscreen on the

    S3C SMDK board.

  4. 注释掉arch/arm/plat-samsung/devs.c里面大概1223到1277行的如下代码:

    /* Touchscreen */

     

    //#ifdef CONFIG_PLAT_S3C24XX

    /*static struct resource s3c_ts_resource[] = {

        [0] = DEFINE_RES_MEM(S3C24XX_PA_ADC, S3C24XX_SZ_ADC),

        [1] = DEFINE_RES_IRQ(IRQ_TC),

    };

     

    struct platform_device s3c_device_ts = {

        .name        = "s3c2410-ts",

        .id        = -1,

        .dev.parent    = &s3c_device_adc.dev,

        .num_resources    = ARRAY_SIZE(s3c_ts_resource),

        .resource    = s3c_ts_resource,

    };

     

    void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *hard_s3c2410ts_info)

    {

        s3c_set_platdata(hard_s3c2410ts_info,

                 sizeof(struct s3c2410_ts_mach_info), &s3c_device_ts);

    }

    */

    //#endif /* CONFIG_PLAT_S3C24XX */

     

    /*#ifdef CONFIG_SAMSUNG_DEV_TS

    static struct resource s3c_ts_resource[] = {

        [0] = DEFINE_RES_MEM(SAMSUNG_PA_ADC, SZ_256),

        [1] = DEFINE_RES_IRQ(IRQ_TC),

    };

    */

    /*static struct s3c2410_ts_mach_info default_ts_data __initdata = {

        .delay            = 10000,

        .presc            = 49,

        .oversampling_shift    = 2,

    };

     

    struct platform_device s3c_device_ts = {

        .name        = "s3c64xx-ts",

        .id        = -1,

        .num_resources    = ARRAY_SIZE(s3c_ts_resource),

        .resource    = s3c_ts_resource,

    };

     

    void __init s3c24xx_ts_set_platdata(struct s3c2410_ts_mach_info *pd)

    {

        if (!pd)

            pd = &default_ts_data;

     

        s3c_set_platdata(pd, sizeof(struct s3c2410_ts_mach_info),

                 &s3c_device_ts);

    }

    */

    //#endif /* CONFIG_SAMSUNG_DEV_TS */

  5. 在arch/arm/ plat-samsung/include/plat/regs-adc.h的后面添加以下代码:

    #define S3C_ADCREG(x)             (x)

     

    #define S3C_ADCCON             S3C_ADCREG(0x00)

    #define S3C_ADCTSC             S3C_ADCREG(0x04)

    #define S3C_ADCDLY             S3C_ADCREG(0x08)

    #define S3C_ADCDAT0             S3C_ADCREG(0x0C)

    #define S3C_ADCDAT1             S3C_ADCREG(0x10)

    #define S3C_ADCUPDN            S3C_ADCREG(0x14)

    #define S3C_ADCCLRINT            S3C_ADCREG(0x18)

    #define S3C_ADCMUX            S3C_ADCREG(0x1C)

    #define S3C_ADCCLRWK            S3C_ADCREG(0x20)

     

    /* ADCCON Register Bits */

    #define S3C_ADCCON_RESSEL_10BIT        (0x0<<16)

    #define S3C_ADCCON_RESSEL_12BIT        (0x1<<16)

    #define S3C_ADCCON_ECFLG        (1<<15)

    #define S3C_ADCCON_PRSCEN        (1<<14)

    #define S3C_ADCCON_PRSCVL(x)        (((x)&0xFF)<<6)

    #define S3C_ADCCON_PRSCVLMASK        (0xFF<<6)

    #define S3C_ADCCON_SELMUX(x)        (((x)&0x7)<<3)

    #define S3C_ADCCON_SELMUX_1(x)        (((x)&0xF)<<0)

    #define S3C_ADCCON_MUXMASK        (0x7<<3)

    #define S3C_ADCCON_RESSEL_10BIT_1    (0x0<<3)

    #define S3C_ADCCON_RESSEL_12BIT_1    (0x1<<3)

    #define S3C_ADCCON_STDBM        (1<<2)

    #define S3C_ADCCON_READ_START        (1<<1)

    #define S3C_ADCCON_ENABLE_START        (1<<0)

    #define S3C_ADCCON_STARTMASK        (0x3<<0)

     

    /* ADCTSC Register Bits */

    #define S3C_ADCTSC_UD_SEN        (1<<8)

    #define S3C_ADCTSC_YM_SEN        (1<<7)

    #define S3C_ADCTSC_YP_SEN        (1<<6)

    #define S3C_ADCTSC_XM_SEN        (1<<5)

    #define S3C_ADCTSC_XP_SEN        (1<<4)

    #define S3C_ADCTSC_PULL_UP_DISABLE    (1<<3)

    #define S3C_ADCTSC_AUTO_PST        (1<<2)

    #define S3C_ADCTSC_XY_PST(x)        (((x)&0x3)<<0)

     

    /* ADCDAT0 Bits */

    #define S3C_ADCDAT0_UPDOWN        (1<<15)

    #define S3C_ADCDAT0_AUTO_PST        (1<<14)

    #define S3C_ADCDAT0_XY_PST        (0x3<<12)

    #define S3C_ADCDAT0_XPDATA_MASK        (0x03FF)

    #define S3C_ADCDAT0_XPDATA_MASK_12BIT    (0x0FFF)

     

    /* ADCDAT1 Bits */

    #define S3C_ADCDAT1_UPDOWN        (1<<15)

    #define S3C_ADCDAT1_AUTO_PST        (1<<14)

    #define S3C_ADCDAT1_XY_PST        (0x3<<12)

    #define S3C_ADCDAT1_YPDATA_MASK        (0x03FF)

    #define S3C_ADCDAT1_YPDATA_MASK_12BIT    (0x0FFF)

    #endif /* __ASM_ARCH_REGS_ADC_H */

     

     

     

  6. 配置内核:

     

    System Type --->

        [*] ADC common driver support

Device Drivers --->

    Input device support --->

        [*] Touchscreens --->

<*> S3C touchscreen driver (只选这一个,其他的不要选)

<*> Event interface

  1. 如果触摸屏驱动没有问题的会就会出现以下驱动信息:

S3C Touchscreen driver, (c) 2008 Samsung Electronics

S3C TouchScreen got loaded successfully : 12 bits

input: S3C TouchScreen as /devices/virtual/input/input0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

移植Qt4.8.1

tslib移植及测试

在采用触摸屏的移动终端中,触摸屏性能的调试是个重要问题之一,因为电磁噪声的缘故,触摸屏容易存在点击不准确、有抖动等问题。

  Tslib是一个开源的程序,能够为触摸屏驱动获得的采样提供诸如滤波、去抖、校准等功能,通常作为触摸屏驱动的适配层,为上层的应用提供了一个统一的接口。

  1. https://github.com/kergoth/tslib下载了最新的tslib
  2. 为虚拟机里的Linux系统安装工具:

    sudo apt-get install autoconf

    sudo apt-get install automake

    sudo apt-get install libtool

  3. 解压后编译

    mv xxx(解压后名字) tslib  //名字改为tslib 

    cd tslib

    ./autogen.sh 

    mkdir tmp

    echo "ac_cv_func_malloc_0_nonnull=yes" >arm-linux.cache

    ./configure --host=arm-linux --cache-file=arm-linux.cache --prefix=$(pwd)/tmp

    make

    make install

  4. 打开tmp目录,里面有四个文件夹,分别是bin、etc、include、lib。将etc目录下的ts.conf里的第2行去掉注释。即:

    # module_raw input

    改为:

    module_raw input

  5. 将bin/etc/lib目录下的文件及连接拷贝到文件系统下对应同名目录。include目录估计是编译应用程序时用的,在此可以不使用
  6. 在文件系统的/etc/profile后面添加以下环节变量:

    export USER LOGNAME PS1 PATH

    export TSLIB_TSDEVICE=/dev/event0

    export TSLIB_CALIBFILE=/etc/pointercal

    export TSLIB_CONFFILE=/etc/ts.conf

    export TSLIB_PLUGINDIR=/lib/ts

    export TSLIB_CONSOLEDEVICE=none

    export TSLIB_FBDEVICE=/dev/fb0

  7. 重启开发板执行env命令,查看是否有以下环境变量:

    TSLIB_TSDEVICE=/dev/event0

    USER=id -un

    HOME=/

    TSLIB_FBDEVICE=/dev/fb0

    PS1=[\u@\h \w]#

    TSLIB_PLUGINDIR=/lib/ts

    TSLIB_CONSOLEDEVICE=none

    LOGNAME=id -un

    TERM=vt102

    PATH=/sbin:/usr/sbin:/bin:/usr/bin

    TSLIB_CONFFILE=/etc/ts.conf

    SHELL=/bin/sh

    PWD=/

    TSLIB_CALIBFILE=/etc/pointercal

    这个TSLIB_TSDEVICE=/dev/event0环境变量所指的位置很重要,错了就会出现

    ts_open:ts_open no such file or directory这样的错误

  8. 执行ts_test命令,就会出现以下画面:

    如果出现-/bin/sh: ts_test: not found这样的错误,说明交叉编译器里面的库没有拷贝进来,对于交叉编译器4.3.2是arm-none-linux-gnueabi/libc/lib

    执行ts_calibrate命令就会出现以下画面:

移植qt-everywhere-opensource-src-4.8.1

  1. 解压qt-everywhere-opensource-src-4.8.1,在解压目录下我们自己先写一个autu.sh的脚本,脚本内容如下:

./configure -prefix /usr/local/Qt \
> -no-qt3support \
> -qt-zlib \
> -qt-libtiff \
> -qt-libpng \
> -qt-libmng \
> -qt-libjpeg \
> -make libs \
> -nomake examples \ (因为这个是arm版本,所以编译出来的程序只能在arm开发板上运行,编译时把这些给去掉,加快编译过程)
> -nomake demos \
> -nomake docs \
> -no-nis \
> -no-cups \
> -no-iconv \
> -xplatform qws/linux-arm-g++ \
> -embedded arm \
> -little-endian \
> -qt-freetype \
> -depths 8,16,24,32 \
> -qt-gfx-linuxfb \
> -no-gfx-transformed \
> -no-gfx-qvfb \
> -no-gfx-vnc \
> -no-gfx-multiscreen \
> -qt-kbd-usb \
> -qt-kbd-tty \
> -qt-mouse-pc \
> -no-glib \
> -qt-mouse-tslib

-I /usr/local/Tslib/include \

-L /usr/local/tslib/lib
make
make install

至于这些选项的含义搭建可以直接到Qt官网上去查。

如果最后出现这个错误:

./autoconfig.sh: 行 37: -I/usr/local/tslib/include: 没有那个文件或目录最后直接用

export QMAKE_INCDIR=/usr/local/tslib/include/

         export QMAKE_LIBDIR=/usr/local/tslib/lib/

这样的设置经验证好像只有在arm-linux-gcc-4.4.1的版本中可行

  1. 在rootfs/usr/下新建一个文件为qtlib,将/usr/local/Qt/lib下的所有文件复制到qtlib目录下
  2. 设置环境变量:将rootfs/etc/profile里面添加一下环境变量:

    export QTDIR=/usr/qilib

    export QPEDIR=$QTDIR

    export QT_PLUGIN_PATH=/usr/qilib

    export T_ROOT=/usr/tslib

    export PATH=$QTDIR/:$PATH

    export QWS_MOUSE_PROTO=Tslib:/dev/event0

    export LD_LIBRARY_PATH=$T_ROOT/lib:$QTDIR

    export QT_QWS_FONTDIR=/usr/qilib/fonts

  3. 修改启动设置,修改rootfs/etc/init.d/rcS,添加一下内容:

    source /etc/profile

    echo "" > /dev/tty1

    echo "" > /dev/tty1

    echo "Designer is Pillar !" > /dev/tty1

    echo "Staring touch calibrate..." > /dev/tty1

    echo "" > /etc/tty1

    sleep 1

    /bin/ts_calibrate & #开机运行ts_calibrate

    到这里qt-everywhere-opensource-src-4.8.1就移植完了

 

嵌入式Qt开发环境搭建

  1. 下载Qt集成开发环境

    http://qt.nokia.com/downloads/sdk-linux-x11-32bit-cpp-offline

    执行一下命令安装:

    chmod u+x Qt_SDK_Lin32_offline_v1_2_en.run
./Qt_SDK_Lin32_offline_v1_2_en.run

配置集成

  1. 开发环境

新建工程,然后:

最后可以用file 命令查看文件属性

将文件拷贝到rootfs目录下:

执行:./books

就可以运行。

  1. 修改启动文件让开机就运行改文件,在rootf/etc/init.d/rcS文件中添加以下内容:

    if [ -f "$TSLIB_CALIBFILE" ];

    then

    books -qws&

    else

    ts_calibrate

  2. 运行应用程序常见文件及错误分析:
    1. Cannot create semaphore /tmp/qtembedded-root/QtEmbedded-0

      这是说明系统禁止了锁,可以在内核配置的第一个 generated配置里面找到:

      [*] System V IPC

      选上它,重新编译,再次烧入内核

    2. Illegal instruction

      库添加错误,一定要正确的添加交叉编译器的库和qt-everywhere-opensource-src-4.8.1编译生成的库

    3. Segmentation fault

    编译应用程序的编译器不对,推荐从内核到文件系统都用同一个交叉编译器,经验证

    arm-linux-gcc-4.4.1这个编译器稳定性不错

     

     

     

     

    这两天就搞了和Qt相关的这些事,错不多所有的的东西都是在5天的时间内搞定的,今天早上是6点钟起来写文档,不知道什么时候,我自己变得这么疯狂。

    还有很多问题没有解决:

    1. 本来想搞个opia的,比如Qt Extended,其实就是Qtopia.我搞的时候才发现:

      Qt Extended是由Nokia的子公司Qt Software(前称Trolltech)所开发。2009年3月3日,Qt Software宣布Qt Extended不再继续作为独立产品而开发,部份功能整合进Qt Framework。别人都终止了,所以就不提供源码了,网上有很多源码可以都可以下载,但是大多数都是别人改过的。飞凌的提供的源码也被他改的乱七八糟,我死都编译不过去,既然连源码都找不到,我移植就没有办法下手了。

    2. 还有一个交叉编译器的库的问题。仔细一点你会发现我用的arm-linux-gcc-4.4.1里面有好的的lib还有好的名字是重复的。大家可以看看这篇文章对交叉编译器的理解http://wenku.baidu.com/view/45f3b6f29e31433239689382.html

 

 

下一阶段就是移植完剩下的驱动和分析驱动源码,最后必须要搞一个opia,比如android

posted @ 2012-05-13 14:04  Lonely Warrior  阅读(18113)  评论(8编辑  收藏  举报