新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > 基于S3C2410的嵌入式Linux系統構建

        基于S3C2410的嵌入式Linux系統構建

        作者: 時間:2011-01-24 來源:網絡 收藏

        2.2 linux2.6.14內核的移植

        2.2.1 內核的選擇

        linux內核版本的更新速度非???,但linux的內核版本發行同linux對處理器支持程度的發展是不同步的,因此,需要對特定的處理器體系結構選擇合適的內核,并且根據其硬件功能部件加上相應的補丁。根據$3c2410的體系結構以及外圍硬件特性,該系統采用linux2.6.14內核,所用的編譯器為arm-linux-gcc一3.4.1版本;由于該系統采用的是yaffs2文件系統,因此需要從網上下載yaffs2.tar.gz文件,解壓并執行./patch.ker.sh/i.inux2.6.14命令,對i.inux內核打補丁使其支持yaffs2文件系統。

        2.2.2 內核的修改

        (1)修改內核源碼中makefile的交義編譯項:

        arm?=arm;cross一compile?=/usr/local/arm/3.4.1/bin/arm-linux一;

        (2)在arch/arm/mach-s3c2410/devs.c文件中:

        ①增加頭文件定義:

        #includelinux/mtd/pa rtitions.hi>

        #includelinux/mtd/nand.h>

        #ineludeasm/arch/nand.h>

        ②增加static struct mtd-partition partition-info[]函數,建立分區表信息,分區內容如表1所示;

        ③加入nand flash分區:struet s3c24 1 o-nand-set nandset一{nr_partitions:5,partitions:partition-info,};

        ④建立nand flash 芯片支持struct s3c24 10-platform-nand superlpplatform={tacls:o,twrph0:30,twrphl:0,sets:&.nandset,nr-sets:1,};

        ⑤在nand flash驅動里加入nand flash芯片支持:在s3c-device-nand中增加.dev一{.platform一data一&super-lpplatform}。

        (3)在arch/arm/machs3c2410/machsmdk2410.c中的一initdata部分增加s3c-device-nand,使內核啟動時初始化nand flash信息。

        (4)為了使內核支持devfs并在啟動時在/sbin/init運行之前自動掛載/dev為devfs文件系統.修改fs/kconfig.并在menupseudo filesystetns下添加如下語句:config devfs_fsbooi/dev flie system support(obolete)default yconfig devfs-mountboolautomatically mount at bootdefault ydepends on devfs fs

        2.2.3 內核的編譯和加載

        (1)執行make mrproper:編譯內核前清理編譯環境。

        (2)執行make menuconfig:對內核進行配置是量體裁衣的過程.是十分復雜的過程,配置適合自已的內核可能需要多次重復的配置操作。以下根據該系統對部分配置做簡單介紹: boot options一一一>default kernel command st ring

        noinitrd root=/dev/mtdblock3 init=/linuxrc

        console--ttysac0.1 15200

        說明:mtdblock3代表nand fash第4個分區,他足該系統的root分區;

        floating point emulation一一一>

        [*]nwfpe math emulation

        #選擇在內核中使用nwfpe浮點模擬

        file systems一一一>

        >second extended fs support

        #去除對ext2的支持

        pseudo file
        [*]/proc file system support

        [*]virtual memory file system support(former

        shm fs)

        [*]/dev file system support(obsolete)

        [*]automatically mount at boot(new)

        這里會看到前面修改fs/kconfig的結果,devfs已經被支持。

        miscellaneous filesystems一-- >

        #選擇yaffs2根文件系統

        *>yaffs2 file system support

        ------51 2 byte/page devices

        [*]lets yaffs do its own ecc

        [ ]use the same ecc byte order as steven hill's nand-ecc.c

        一一一2048 byte (or larger)/page devices

        [*]autoselect yaffs2 format

        [*]disable lazy loading

        (1 0)reserved blocks for checkpointing

        [*]turn off wide tnodes

        []force chunk erase check

        []cache short names in ram

        network file systems---〉

        *〉nfs file system support

        linux操作系統文章專題:linux操作系統詳解(linux不再難懂)


        關鍵詞: 嵌入式

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 伊春市| 遂川县| 循化| 宾川县| 梅州市| 清水河县| 贡山| 盱眙县| 南昌县| 宕昌县| 伊金霍洛旗| 青海省| 丹寨县| 芜湖县| 哈尔滨市| 福建省| 铁岭市| 徐汇区| 凉山| 临桂县| 集安市| 赞皇县| 中卫市| 夏津县| 永年县| 光山县| 乌海市| 壤塘县| 沧州市| 会理县| 平顺县| 望城县| 曲麻莱县| 临朐县| 罗平县| 乌兰浩特市| 株洲市| 罗田县| 平江县| 凤山县| 扎囊县|