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

你不可不知的嵌入式內核

發布時間:2013-12-10 10:53    發布者:edu118gct
關鍵詞: 內核



linux內核:

1.linux內核目錄結構

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

內核映像默認存放位置:
linux-2.6.32.2/arch/arm/boot

板級存放位置:
linux-2.6.32.2/arch/arm/mach-s3c2440

CPU平臺相關文件存放位置:
linux-2.6.32.2/arch/arm/plat-s3c
linux-2.6.32.2/arch/arm/plat-s3c34xx


常用文件系統:
cramfs,fat,nfs,ntfs,proc,sysfs[內存],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.參考相近的配置文件,在此基礎上進行修改。

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

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

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

c.4種配置方法:
        (1)make config:詢問式的
        (2)make xconfig:窗口模式,比較適合使用鼠標的人使用
        (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

改版本號:在General setup 后面的local.....里加


system type--ARM system type選對
                --s3c2440 machines--SMDK2440


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


boot options--kernel execute-in-place for rom在u-boot那里的那一場串環境變量

userspace binary for---kernel support for ELF binaries

重點配置對象:
device drivers---網卡支持:network device support--10 or 100--dm9000
                ---character--ledl  beep
                ---graphices support--LCD:幀緩沖設備--s3c2410 lcd   
                                        lcd select--
                ---企鵝Bootup logo[console display d support--framebuffer console support]


        u盤usb support--usb mass storge support
文件系統file system---network file system--

語言native language support--簡體中文 NLS UTF-8選上

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

make -j2

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

然后:make uImage,編譯出uIamge內核鏡像

3.linux內核映像制作


4.添加菜單

每一個目錄都有一個Kconfig和Makefile,Kconfig管理本層菜單,Makefile管理相應的c文件。

有子菜單的選項使用menu作為關鍵字,如下:

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

menu "Device Drivers"

source "drivers/base/Kconfig"

source "drivers/connector/Kconfig"


一下是內部子菜單的書寫格式:

menu "Generic Driver Options"        #菜單名

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

#子菜單關鍵字是bool ,表示這個選項只有選中和不選中兩中狀態。
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.

#關鍵字是tristate,有3種選擇,分別是編譯進內核,編譯出模塊[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的關系:

每選中一項會在.config文件中把生成一個宏名:CONFIG_加上Kconfig對應菜單宏名

比如Kconfig有如下選項:

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

選中時(*)后,對應.config的名字為:
CONFIG_LEDS_S3C2440=y

選中時(M)后,對應.config的名字為:
CONFIG_LEDS_S3C2440=m

不選中時,對應.config的名字為:
#CONFIG_LEDS_S3C2440 is not set
深圳專業嵌入式技術實訓,QQ754634522

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

.config和Makefie的關系:

在driver/char/Makefie有以下語句:

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

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://m.qingdxww.cn/thread-124438-1-1.html     【打印本頁】

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

廠商推薦

  • Microchip視頻專區
  • Dev Tool Bits——使用MPLAB® Discover瀏覽資源
  • Dev Tool Bits——使用條件軟件斷點宏來節省時間和空間
  • Dev Tool Bits——使用DVRT協議查看項目中的數據
  • Dev Tool Bits——使用MPLAB® Data Visualizer進行功率監視
  • 貿澤電子(Mouser)專區

相關視頻

關于我們  -  服務條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯系我們
電子工程網 © 版權所有   京ICP備16069177號 | 京公網安備11010502021702
快速回復 返回頂部 返回列表
主站蜘蛛池模板: 特级毛片永久久免费观看 | 青青青在线观看国产精品 | 极品国产一区二区三区 | 美国做受三级的视频播放 | 人体蜈蚣2在线 | 久久精品8| 成人啪精品视频免费网站 | 春意影院免费入口 | 国产一区二区三区精品视频 | 一级做a爰片性色毛片男 | 国产色91| 2019国产精品| 四虎海外在线永久免费看 | 久久综合偷偷噜噜噜色 | 久热免费在线观看 | avtt2015天堂网 | 亚洲影院一区 | 欧美乱妇高清视频免欢看关 | 国产在线观看一区精品 | 成人欧美一区二区三区在线观看 | 羞羞视频在线观免费观看 | 精品卡通动漫在线观看视频一区 | 午夜精品一区二区三区免费视频 | 欧美综合在线观看 | 高清一区二区三区免费 | 日韩精品欧美高清区 | 四虎网站在线观看 | 欧美日b片| 国产综合精品久久久久成人影 | 91视频国内 | 久久久久国产精品美女毛片 | 久久精品亚洲一区二区三区浴池 | 亚洲另类视频在线观看 | 日韩欧美国产亚洲 | 成人影院app| 亚洲日韩欧美一区二区在线 | 99国内精品久久久久久久 | 国产乱在线观看完整版视频 | 国产极品白嫩超清在线观看 | 三级黄色毛片 | 365导航免费视频 |