ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • Ubuntu Kenrel Build
    2013. 2. 26. comments

    linux kernel을 다운받고 코드를 살펴보는 것은 쉽다. 인터넷만 빠르면 바로 받아서 볼수가 있다. 하지만 빌드하고 테스트하는 것은 linux 배포판마다 차이가 있어서 준비가 간단하지 않다. 보통은 커뮤니티에서 확인할 수 있는데 이 글에서는 Ubuntu 환경에서 커널 모듈을 작성하고 빌드 하는 방법을 정리하는 글이다.


    Ubuntu 커널 컴파일 가이드

    • https://help.ubuntu.com/community/Kernel/Compile


    개발 도구 설치


    sudo apt-get install fakeroot build-essential crash kexec-tools makedumpfile kernel-wedge
    sudo apt-get build-dep linux
    sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc binutils-dev


    gcc, makefile, ncuses등 커널 빌드 도구들과 소스코드 관리 툴인 git, 커널 crash가 발생할 때 trace할 수 있는 도구들을 다운로드 받는다.



    커널 코드 다운로드

    Ubuntu에서 관리하는 코드를 git을 통하여 다운로드 한다.

     quantal    git://kernel.ubuntu.com/ubuntu/ubuntu-quantal.git
     precise    git://kernel.ubuntu.com/ubuntu/ubuntu-precise.git
     oneiric    git://kernel.ubuntu.com/ubuntu/ubuntu-oneiric.git
     natty    git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git
     lucid    git://kernel.ubuntu.com/ubuntu/ubuntu-lucid.git
     hardy  

     git://kernel.ubuntu.com/ubuntu/ubuntu-hardy.git



    커널 모듈 개발

    커널 모듈 및 드라이버를 개발한다.



     빌드

    make defconfig

    make



    빌드된 커널 모듈을 insmod 명령을 통하여 올려서 테스트를 진행한다.

    insmod KERNEL_MODULE_FILE





    반응형

    댓글

Designed by Tistory.