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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM