Installing Linux Kernel n n n Kernel selection

  • Slides: 16
Download presentation
Installing Linux Kernel n 임베디드 시스템에 리눅스 커널을 사용하기 위 한 준비 과정 n

Installing Linux Kernel n 임베디드 시스템에 리눅스 커널을 사용하기 위 한 준비 과정 n n Kernel selection Configuration Compilation Installation 충북대학교 임베디드 시스템 연구실 1

6 -1 리눅스 커널의 구조 process 1 process 2 process 3 process n User

6 -1 리눅스 커널의 구조 process 1 process 2 process 3 process n User Space System Call Interface Filesystem Manager Ext 2 fs proc xiafs ntfs msdos Process Manager Memory Manager Paging/Segmentation Task Management Scheduler Signaling IPC Kernel Space Buffer Cache Device Manager block Network Manager character socket Ir. DA Console KBD SCSI CD-ROM PCI ethernet Ipv 6 Bluetooth Hardware Interface dev 1 dev 2 dev 3 충북대학교 임베디드 시스템 연구실 dev 4 devn 2

프로세서별 커널 저장소 Processor Kernel location Download means X 86 http: //www. kernel. org/

프로세서별 커널 저장소 Processor Kernel location Download means X 86 http: //www. kernel. org/ ftp, http, rsync ARM http: //www. arm. linux. org. uk ftp, rsync /developer/ Power. PC http: //penguinppc. org/ MIPS http: //www. linux-mips. org/ cvs Super. H http: //linuxsh_sourceforge. net/ cvs M 68 K http: //www. linux-m 68 k. org ftp, http 충북대학교 임베디드 시스템 연구실 ftp, http, rsync, bitkeeper 4

Configuring options n n n n Code maturity level options Loadable module support General

Configuring options n n n n Code maturity level options Loadable module support General setup Memory technology devices Block devices Network options ATA/IDE/MFM/RLL support 충북대학교 임베디드 시스템 연구실 n n n n SCSI support Network device support Input core support Character devices Filesystems Console drivers Sound Kernel hacking 8

n 프로세서 선택 옵션 Processor architecture System and processor selection option Kernel name x

n 프로세서 선택 옵션 Processor architecture System and processor selection option Kernel name x 86 i 386 ARM Processor type features System type PPC Platform support ppc MIPS Machine selection/CPU selection mips or mips 64 and architecture arm SH Processor type and sh features M 68 k Platform-dependent m 68 k support • n make command를 실행할 때 ARCH variable을 커널 Makefiles가 인식하는 architecture name으로 설정하여야 한다. 충북대학교 임베디드 시스템 연구실 9

Configuration methods n make config n n n make oldconfig n n 기존의. configuration

Configuration methods n make config n n n make oldconfig n n 기존의. configuration file을 기반으로 이전에 설정하지 않은 옵 션들만 구성하도록 메뉴가 나타난다. make menuconfig n n 각 옵션을 하나씩 물어보는 a command-line interface 만일. configuration file이 존재하면, 그 파일의 내용으로 default 값을 설정한다. Displays a curses-based terminal configuration menu. 만일. configuration file이 존재하면, 그 파일의 내용으로 default 값을 설정한다. 가장 많이 사용하는 방법 make xconfig n n Displays a Tk-based X Window configuration menu. 만일. configuration file이 존재하면, 그 파일의 내용으로 default 값을 설정한다. 충북대학교 임베디드 시스템 연구실 10

Configuration 과정 n 생성되는 파일 n n n ARM-based user interface modules를 위한 command

Configuration 과정 n 생성되는 파일 n n n ARM-based user interface modules를 위한 command line 예 n n 커널 소스의 root directory에 a. config file을 생성한다. a few header files and symbolic links도 함께 생성된다. $ make ARCH=arm CROSS_COMPILE=arm-linuxmenuconfig Configuration 과정 n n Target에 적절한 configuration options를 선택 많은 특징과 드라이버들을 n n n 커널 안에 포함시키거나 모듈로 빌드하도록 만들 수 있다. Escape key or Exit을 선택하여 빠져 나오고, Save 충북대학교 임베디드 시스템 연구실 11

3. Compiling the kernel n 컴파일 단계: n n n building the kernel dependencies

3. Compiling the kernel n 컴파일 단계: n n n building the kernel dependencies building the kernel image building the kernel modules 충북대학교 임베디드 시스템 연구실 12

Building the modules n Build the kernel modules: n n $ make ARCH=arm CROSS_COMPILE=arm-linux-

Building the modules n Build the kernel modules: n n $ make ARCH=arm CROSS_COMPILE=arm-linux- modules 커널 소스들을 모두 정리하고(clean up) configuration, dependency building, or compilation 이전의 상태로 되돌아 가기 위한 명령: n $ make ARCH=arm CROSS_COMPILE=arm-linux- distclean n n . config file, all object files, and the kernel images 등 이전 단계 에서 생성한 모든 파일들을 지운다. 이 명령을 수행하기 전에 kernel configuration file을 반드시 백업 할것 충북대학교 임베디드 시스템 연구실 15

4. Installing the Kernel n 생성된 커널 이미지들을 ${PRJROOT}/images 디렉토 리로 복사한다. n n

4. Installing the Kernel n 생성된 커널 이미지들을 ${PRJROOT}/images 디렉토 리로 복사한다. n n 여러 가지 kernel configurations에 따라 다른 커널 이미지들을 생성한다. 각 kernel configurations마다 네 개의 파일들을 복사 해야 한다. n The compressed kernel image: z. Image or bz. Image n n n arch/YOUR_ARCH/boot 디렉토리에 있다. 예) arch/arm/boot/z. Image The uncompressed kernel image: vmlinux The kernel symbol map: System. map The configuration file: . config n 마지막 세 개는 커널 소스의 루트 디렉토리에 있다. 충북대학교 임베디드 시스템 연구실 16