国产毛片a精品毛-国产毛片黄片-国产毛片久久国产-国产毛片久久精品-青娱乐极品在线-青娱乐精品

你不可不知的嵌入式內(nèi)核

發(fā)布時(shí)間:2013-12-10 10:53    發(fā)布者:edu118gct
關(guān)鍵詞: 內(nèi)核



linux內(nèi)核:

1.linux內(nèi)核目錄結(jié)構(gòu)

開發(fā)板的配置信息文件存放位置:
linux-2.6.32.2/arch/arm/configs

內(nèi)核映像默認(rèn)存放位置:
linux-2.6.32.2/arch/arm/boot

板級(jí)存放位置:
linux-2.6.32.2/arch/arm/mach-s3c2440

CPU平臺(tái)相關(guān)文件存放位置:
linux-2.6.32.2/arch/arm/plat-s3c
linux-2.6.32.2/arch/arm/plat-s3c34xx


常用文件系統(tǒng):
cramfs,fat,nfs,ntfs,proc,sysfs[內(nèi)存],yaffs,jffs2,ext2,ext3,ext4.



2.linux裁剪方法

1)修改交叉編譯器:打開頂層Makefie,搜索ARCH,CROSS_COMPILE,修改如下:
183 ARCH        = arm
184 # CROSS_COMPILE = arm-linux-
185 CROSS_COMPILE      = arm-none-linux-gnueabi-

2)配置,裁剪功能。

a.參考相近的配置文件,在此基礎(chǔ)上進(jìn)行修改。

  [root@dhua linux-2.6.32.2]# make help 把所有配置都列出來(lái)

  只列出包含2440的配置文件
  [root@dhua linux-2.6.32.2]# make help | grep 2440
  mini2440_defconfig       - Build for mini2440

b.備份配置好的文件,把.config文件保存為config_back[這步的前提是你配置好過(guò)內(nèi)核]
[root@dhua linux-2.6.32.2]# cp .config config_back

c.4種配置方法:
        (1)make config:詢問(wèn)式的
        (2)make xconfig:窗口模式,比較適合使用鼠標(biāo)的人使用
        (3)make menuconfig:終端中顯示菜單,比較適合熟悉鍵盤的人使用
        (4)直接使用vi編輯器/文本編輯器修改.config文件

===========================================================================================

參考mini2440_defconfig,把mini2440_defconfig的配置文件覆蓋.config,

[root@dhua linux-2.6.32.2]# make mini2440_defconfig
  HOSTLD  scripts/kconfig/conf
#
# configuration written to .config
#
[root@dhua linux-2.6.32.2]# make menuconfig

改版本號(hào):在General setup 后面的local.....里加


system type--ARM system type選對(duì)
                --s3c2440 machines--SMDK2440


kernel features--Memory split選3G/1G
        選上EABI


boot options--kernel execute-in-place for rom在u-boot那里的那一場(chǎng)串環(huán)境變量

userspace binary for---kernel support for ELF binaries

重點(diǎn)配置對(duì)象:
device drivers---網(wǎng)卡支持:network device support--10 or 100--dm9000
                ---character--ledl  beep
                ---graphices support--LCD:幀緩沖設(shè)備--s3c2410 lcd   
                                        lcd select--
                ---企鵝Bootup logo[console display d support--framebuffer console support]


        u盤usb support--usb mass storge support
文件系統(tǒng)file system---network file system--

語(yǔ)言native language support--簡(jiǎn)體中文 NLS UTF-8選上

==============================================================================================

make -j2

然后在u-boot-1.3.4/tools/將mkimage拷到系統(tǒng)的bin目錄下或者交叉編譯器的目錄下去,

然后:make uImage,編譯出uIamge內(nèi)核鏡像

3.linux內(nèi)核映像制作


4.添加菜單

每一個(gè)目錄都有一個(gè)Kconfig和Makefile,Kconfig管理本層菜單,Makefile管理相應(yīng)的c文件。

有子菜單的選項(xiàng)使用menu作為關(guān)鍵字,如下:

上層菜單包含下層菜單的Kconfig

menu "Device Drivers"

source "drivers/base/Kconfig"

source "drivers/connector/Kconfig"


一下是內(nèi)部子菜單的書寫格式:

menu "Generic Driver Options"        #菜單名

#子菜單關(guān)鍵字是string ,表示菜單式輸文字的
config UEVENT_HELPER_PATH        #菜單對(duì)于宏
        string "path to uevent helper"        #子菜單名
        depends on HOTPLUG                #依賴條件
        default "/sbin/hotplug"                #默認(rèn)值
        help                                #幫組信息
          Path to uevent helper program forked by the kernel for
          every uevent.

#子菜單關(guān)鍵字是bool ,表示這個(gè)選項(xiàng)只有選中和不選中兩中狀態(tài)。
config DEVTMPFS
        bool "Create a kernel maintained /dev tmpfs (EXPERIMENTAL)"
        depends on HOTPLUG && SHMEM && TMPFS
        help
          This creates a tmpfs filesystem, and mounts it at bootup
          and mounts it at /dev. The kernel driver core creates device
          nodes for all registered devices in that filesystem. All device
          nodes are owned by root and have the default mode of 0600.
          Userspace can add and delete the nodes as needed. This is
          intended to simplify bootup, and make it possible to delay
          the initial coldplug at bootup done by udev in userspace.
          It should also provide a simpler way for rescue systems
          to bring up a kernel with dynamic major/minor numbers.
          Meaningful symlinks, permissions and device ownership must
          still be handled by userspace.
          If unsure, say N here.

#關(guān)鍵字是tristate,有3種選擇,分別是編譯進(jìn)內(nèi)核,編譯出模塊[M],不選中[]。
config LEDS_S3C2440
        tristate "LED Support for S3C2440 GPIO LEDs"
        depends on   ARCH_S3C2410
        default y if ARCH_S3C2410
        help
          This option enables support for LEDs connected to GPIO lines
          on S3C2440 boards.


-------------------------------------------------------------

Kconfig和.config的關(guān)系:

每選中一項(xiàng)會(huì)在.config文件中把生成一個(gè)宏名:CONFIG_加上Kconfig對(duì)應(yīng)菜單宏名

比如Kconfig有如下選項(xiàng):

config LEDS_S3C2440
        tristate "LED Support for S3C2440 GPIO LEDs"
        depends on   ARCH_S3C2410        #CONFIG_ARCH_S3C2410也是Kconfig中的一個(gè)菜單宏名,如果ARCH_S3C2410選中,這項(xiàng)菜單才會(huì)顯示出來(lái),
        default y if ARCH_S3C2410        #顯示出來(lái)的默認(rèn)狀態(tài):y 顯示 * ;m 顯示 M ,n 顯示不選中
        help
          This option enables support for LEDs connected to GPIO lines
          on S3C2440 boards.

選中時(shí)(*)后,對(duì)應(yīng).config的名字為:
CONFIG_LEDS_S3C2440=y

選中時(shí)(M)后,對(duì)應(yīng).config的名字為:
CONFIG_LEDS_S3C2440=m

不選中時(shí),對(duì)應(yīng).config的名字為:
#CONFIG_LEDS_S3C2440 is not set
深圳專業(yè)嵌入式技術(shù)實(shí)訓(xùn),QQ754634522

-----------------------------------------------------------

.config和Makefie的關(guān)系:

在driver/char/Makefie有以下語(yǔ)句:

############################################################################

obj-$(CONFIG_LEDS_S3C2440)        += s3c2440_leds.o        #$為在后面累加字符串
obj-$(CONFIG_S3C2440_BUTTONS)        += s3c2440_buttons.o
obj-$(CONFIG_S3C2440_BUZZER)        += s3c2440_pwm.o
obj-$(CONFIG_S3C2440_ADC)        += s3c2440_adc.o











本文地址:http://www.qingdxww.cn/thread-124438-1-1.html     【打印本頁(yè)】

本站部分文章為轉(zhuǎn)載或網(wǎng)友發(fā)布,目的在于傳遞和分享信息,并不代表本網(wǎng)贊同其觀點(diǎn)和對(duì)其真實(shí)性負(fù)責(zé);文章版權(quán)歸原作者及原出處所有,如涉及作品內(nèi)容、版權(quán)和其它問(wèn)題,我們將根據(jù)著作權(quán)人的要求,第一時(shí)間更正或刪除。
上網(wǎng)去溜溜 發(fā)表于 2013-12-17 09:14:45
漲姿勢(shì)了
edu118gct 發(fā)表于 2013-12-30 14:28:29
歡迎學(xué)習(xí)、交流
您需要登錄后才可以發(fā)表評(píng)論 登錄 | 立即注冊(cè)

廠商推薦

  • Microchip視頻專區(qū)
  • 想要避免發(fā)生災(zāi)難,就用MPLAB® SiC電源仿真器!
  • 為何選擇集成電平轉(zhuǎn)換?
  • 基于CEC1712實(shí)現(xiàn)的處理器SPI FLASH固件安全彈性方案培訓(xùn)教程
  • 5分鐘詳解定時(shí)器/計(jì)數(shù)器E和波形擴(kuò)展!
  • 貿(mào)澤電子(Mouser)專區(qū)

相關(guān)視頻

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點(diǎn)地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權(quán)所有   京ICP備16069177號(hào) | 京公網(wǎng)安備11010502021702
快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 1024亚洲 | 国产精品久久久久有声小说 | 久久福利资源站免费观看i 久久福利资源网站免费看 久久福利影院 | 麻豆爱爱视频 | 青青视频国产 | 亚洲国产成人精品91久久久 | 特级毛片在线观看 | 国产一级成人毛片 | 视频二区 国产精品 职场同事 | 在线国产一区二区三区 | 国产色区| 在线免费观看麻豆 | 一级黄色毛片视频 | 色花堂的网站永久地址 | 亚洲欧美日韩国产 | 免费逼片| 国产精品久久久亚洲456 | 久免费视频 | 2020国产麻豆剧传媒 | 国产伦| 中文一区二区视频 | 国产极品在线观看视频 | 久久的精品99精品66 | 极品美女在线 | 91av在线网站 | 亚洲不卡一区二区三区在线 | 天天综合天天色 | 欧美精品无播放器在线观看 | 久久se精品动漫一区二区三区 | 国产成人一区二区在线不卡 | 精品国产福利一区二区在线 | 精品亚洲大全 | 操操操干干 | 欧美系列在线观看 | 韩国年轻漂亮女教师6 | 五月天美女 | 四虎最新网| 男人天堂网站在线 | 中文字幕avv | 免费日本视频 | 在线看片日本 |