• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
    • 軟件測試技術
    • 軟件測試博客
    • 軟件測試視頻
    • 開源軟件測試技術
    • 軟件測試論壇
    • 軟件測試沙龍
    • 軟件測試資料下載
    • 軟件測試雜志
    • 軟件測試人才招聘
      暫時沒有公告

    字號: | 推薦給好友 上一篇 | 下一篇

    Building External Linux Kernel Modules Under FC3

    發布: 2007-7-04 12:06 | 作者: admin | 來源:  網友評論 | 查看: 9次 | 進入軟件測試論壇討論

    領測軟件測試網

    Building External Linux Kernel Modules UnderFedora Core 3

    Kernel Preparation

    First you need to fetch the proper kernel source rpm. Obtainyour kernel version using the command:

    # uname -r

    My computer gives:

    2.6.9-1.667

    Fetch the kernel source rpm from a rpmfind web site. I obtainedkernel-2.6.9-1.667.FC3.src.rpm. Next, install thekernel source rpm using rpm as root. I used thefollowing command. Your kernel version may vary.

    # rpm -ivh kernel-2.6.9-1.667.FC3.src.rpm

    Now change your working directory to the SPECSdirectory and extract the kernel source using rpmbuild:

    # cd /usr/src/redhat/SPECS
    # rpmbuild -bp kernel-2.6.spec

    rpmbuild only prepared the kernel for compilation.We do not need to actually compile kernel. Next, change yourcurrent working directory to the kernel source. The path willvary depending on your kernel version. Copy the appropriatearchitecture either i586, i686, i586-smp, or i686-smp config filefrom the configs directory to the root of the kerneltree and call the copy .config. Use unameto obtain your architecture. My computer has an architecture ofi686.

    # cd /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9
    # uname -m
    i686
    # cp configs/kernel-2.6.9-i686.config .config

    The final step to prepare the kernel is to build the make targetmodules_prepare.

    # make modules_prepare

    Building External Modules

    After creating a Makefile and writing module codein a different directory, using make to build yourmodule. Refer to The Linux Kernel Module Programming Guidefor information about writing module Makefiles and code. makerequires the path to the kernel source, the variable Mset to the current working directory and the target modules.It will vary depending on your kernel version. For my computer:

    # cd ~/mydriver
    # vi Makefile
    # vi mydevice.c
    # make -C /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 M=$PWD modules

    You can use the target clean as well.

    Building Specific Internal Modules

    To build all configured moduleswithin a particular subdirectory in the Linux kernel tree, issuethe same make command as for external modules. Only modules thathave been configured in the .config file will bebuilt. This means the make variable related to a particularmodules must exist and have a value of a lower case m.For example, for the kernel module blkmtd to bebuilt, the associated make variable called CONFIG_MTD_BLKMTDmust appears in the .config file as follows:

    CONFIG_MTD_BLKMTD=m

    The associated make variable name can be found in the localMakefile, for this case in drivers/mtd/devices/Makefile.To compile the module, including several others in the directory,give the following command

    # cd /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9/drivers/mtd/devices 
    # make -C /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 M=$PWD modules

    Alternatively, you can copy the desired files out of the kernelsource tree, edit the Makefile, and treat the result like anexternal module. Again, see The Linux Kernel ModuleProgramming Guide to helpyou edit the Makefile.

    # cp blkmtd.c Makefile /tmp
    # vi Makefile
    # make -C /usr/src/redhat/BUILD/kernel-2.6.9/linux-2.6.9 M=$PWD modules

    延伸閱讀

    文章來源于領測軟件測試網 http://www.kjueaiud.com/


    關于領測軟件測試網 | 領測軟件測試網合作伙伴 | 廣告服務 | 投稿指南 | 聯系我們 | 網站地圖 | 友情鏈接
    版權所有(C) 2003-2010 TestAge(領測軟件測試網)|領測國際科技(北京)有限公司|軟件測試工程師培訓網 All Rights Reserved
    北京市海淀區中關村南大街9號北京理工科技大廈1402室 京ICP備10010545號-5
    技術支持和業務聯系:info@testage.com.cn 電話:010-51297073

    軟件測試 | 領測國際ISTQBISTQB官網TMMiTMMi認證國際軟件測試工程師認證領測軟件測試網

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>