ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • UDOO 커널(Kernel) 빌드
    Linux/UDOO board 2020. 7. 13. 21:08
    반응형

    | 커널 파일 압축 풀기

     

    먼저 커널 파일을 위한 디렉토리를 생성 해주고 그 안으로 이동한다

    명령어 : cd udoo_linux_bsp/
               mkdir kernel
               cd kernel/

     

     

     

    samba를 이용해서 커널 파일을 복사해 온다

    명령어 : cp /srv/samba/3.14-1.0.x-udoo.zip

     

     

     

    커널 파일의 압축을 풀어준다

    명령어 : unzip 3.14-1.0.x-udoo.zip

     

     

     

     

     

    명령어 : ARCH=arm make udoo_quad_dual_defconfig

     

     

     

     

     

    명령어 : ARCH=arm make menuconfig

     

     

    menuconfig에서는 그냥 Exit로 나오기만 하면 된다

     

     

    명령어: ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- make zImage -j4 (약 5분 정도 걸린다아)

     

     

     명령어 : cp arch/arm/boot/zImage /srv/nfs/

                cd /srv/nfs/

     

     

    udooer에서 hello.ko가 nfs를 이용해서 제대로 넘어왔는지 확인해 준다 

    명령어 : cd /mnt/lect_nfs/

     

     

     

    zImage를 nfs가 마운트 해 있는 디렉토리에서  /boot로 옮겨준다

    명령어 : cp zImage /home/udooer

               sudo cp zImage /boot/.

     

     

    심볼 링크로 타겟 보드 디바이스 드라이버 디렉토리를 링크해준다 (지금 상태에서는 lsmod를 해도 연결된 모듈이 없다)

     명령어 : sudo ln -s 3.14.56-udooqdl-02044-gddaad11 3.14.56

     

     

    리부트를 해준뒤 lsmod를 이요해서 확인해 주면  연결된 모듈이 보인다

     

     

     

    명령어를 이용해서 커널 빌드 시간을 확인해 준다

    명령어 : uname -a

     

     

     

     

    | 모듈 빌드

     

    주어진 hello.d를 이용해서 PC에서 만든 ko 파일을 타겟보드에 전송해서  모듈을 커널에 삽입/삭제해 보는 과정이다

     

     

    먼저 hello.d가 있는 디렉토리로 이동해준다

     

     

     

    Makefile

     

    vi 편집기를 이용해서 Makefile 파일을 위와 같이 편집해 준 뒤 make clean >> make를 통해 

    cp hello.ko /srv/nfs 명령어가 실행 된 것을 확인해 준다

     

     

     

    nfs 폴더에 들어있는 hello.ko

     

     

    UDOO board 에서

     

    nfs를 PC의 ubuntu에 연결해준다

    명령어 : sudo mount -t nfs -o nfsvers=3 192.168.1.41:/srv/nfs /mnt/lect_nfs/

     

     

     

     

    insmod 명령어를 이용해서 모듈을 커널에 삽입하고 lsmod로 확인해준다

    명령어 : sudo insmod  hello.ko 

               lsmod

     

     

    dmesg 명령어로 모듈이 출력한 메세지 확인한뒤, 

    rmmod 명령어로 커널에서 모듈을 제거해준다 dmesg를 이용하면 삭제되면서 모듈이 남긴 메세지를 볼 수 있다 Goodbye, world

     

     

    명령어 : dmesg

              sudo rmmod hello

     

     

     

    728x90

    'Linux > UDOO board' 카테고리의 다른 글

    부트로더 응용 실습  (0) 2020.07.20
    UDOO 부트로더(Bootloader) 빌드  (0) 2020.07.13
    UDOO 파일시스템 빌드  (0) 2020.07.13
    UDOO board nfs 설치  (0) 2020.07.13
    UDOO board samba 설치  (0) 2020.07.13

    댓글

Designed by Tistory.