10
12 1 Embedded Software Lab. OS 실실 Embedded Software Lab. 실실실 , 실실실 Lecture 3. Kernel fusing, printk

12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

Embed Size (px)

Citation preview

Page 1: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

1

Embedded Software Lab.

OS 실습Embedded Software Lab.

박대준 , 박은수

Lecture 3. Kernel fusing, printk

Page 2: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

2

Embedded Software Lab.

Cross Compiler 설치 & 코드 다운로드Cross Compiler 설치 :

$ sudo apt-get install gcc-arm-linux-gnueabihf

코드 저장 위치 설정 :

$ cd $HOME

$ mkdir work

$ cd work

소스 코드 다운로드 : $ git clone --depth 1 https://github.com/hardkernel/linux.git -b odroid-

3.8.y

Page 3: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

3

Embedded Software Lab.

http://odroid.us/mediawiki/index.php?title=Step-by-step_Cross-compiling_a_Kernel 참고

$ sudo apt-get install libncurses5-dev

Toolchain 환경변수 설정 빌드

Cross-compile 설정

Page 4: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

4

Embedded Software Lab.

커널 컴파일

$ cd linux-odroid-3.8.y/

$ export ARCH=arm$ export CROSS_COMPILE=arm-linux-gnueabihf-$ make odroidu_defconfig $ make zImage –j8$ make modules

Page 5: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

5

Embedded Software Lab.

• mkdir ../rfs

• export INSTALL_MOD_PATH=$PWD/../rfs

• make modules_install

• cd ../rfs

• # remove symlinks that point to files we do not need in root file system

• find . -name source | xargs rm

• find . -name build | xargs rm

• # Compress

• sudo tar -cvzf ../modules.tgz .

• cd ../

Module

Page 6: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

6

Embedded Software Lab.

• Copy source_tree/arch/arm/boot/zImage to odroidu3:/boot/

zImage 설치

Page 7: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

7

Embedded Software Lab.

• tar -xvzf modules.tgz

• rm modules.tgz

• sync

• reboot

Module 설치

Page 8: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

8

Embedded Software Lab.

• The kernel print function

• behaves almost identically to the C library printf() func-tion

• callable from just about anywhere in the kernel at any time

• unusable before a certain point in the kernel boot process– early_printk()

printk()

Page 9: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

9

Embedded Software Lab.

• printk("<4>This is a warning!\n");

• printk("<7>This is a debug notice!\n");

• printk("<4>did not specify a loglevel!\n");

• printk(KERN_WARNING "This is a warning!\n");

• printk(KERN_DEBUG "This is a debug notice!\n");

• printk("I did not specify a loglevel!\n");

printk-Loglevels

Page 10: 12 1 Embedded Software Lab. OS 실습 Embedded Software Lab. 박대준, 박은수 Lecture 3. Kernel fusing, printk

12

10

Embedded Software Lab.

H/W