Microsoft PowerPoint - Building.pptx

Similar documents
슬라이드 제목 없음

Microsoft PowerPoint - 03-Development-Environment-2.ppt

Microsoft PowerPoint - em8-리눅스설치.ppt

PowerPoint 프레젠테이션

망고100 보드로 놀아보자-4

Chap 2 임베디드시스템 개발환경구성

DE1-SoC Board

6주차.key

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

K7VT2_QIG_v3

임베디드시스템설계강의자료 4 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

Solaris Express Developer Edition

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT END USERS. Oracle programs, including any oper

PowerPoint 프레젠테이션

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

Microsoft PowerPoint - 02-Development-Environment-1.ppt

Mango220 Android How to compile and Transfer image to Target

PCServerMgmt7

PowerPoint 프레젠테이션

Assign an IP Address and Access the Video Stream - Installation Guide

Copyright 2004 Sun Microsystems, Inc Network Circle, Santa Clara, CA U.S.A..,,. Sun. Sun. Berkeley BSD. UNIX X/Open Company, Ltd.. Sun, Su

Remote UI Guide

지난시간에... 우리는 kernel compile을위하여 cross compile 환경을구축했음. UBUNTU 12.04에서 arm-2009q3를사용하여 간단한 c source를빌드함. 한번은 intel CPU를위한 gcc로, 한번은 ARM CPU를위한 gcc로. AR

1217 WebTrafMon II

슬라이드 1

LXR 설치 및 사용법.doc

Raspbian 설치 라즈비안 OS (Raspbian OS) 라즈베리파이 3 Model B USB 마우스 USB 키보드 마이크로 SD 카드 마이크로 SD 카드리더기 HDM I 케이블모니터

GNU/Linux 1, GNU/Linux MS-DOS LOADLIN DOS-MBR LILO DOS-MBR LILO... 6

untitled

교육지원 IT시스템 선진화

Microsoft PowerPoint APUE(Intro).ppt

Chapter. 5 Embedded System I Bootloader, Kernel, Ramdisk Professor. Jaeheung, Lee

°í¼®ÁÖ Ãâ·Â

Microsoft PowerPoint - ch07.ppt

Copyright 2012, Oracle and/or its affiliates. All rights reserved.,,,,,,,,,,,,,.,..., U.S. GOVERNMENT END USERS. Oracle programs, including any operat

<31325FB1E8B0E6BCBA2E687770>

28 THE ASIAN JOURNAL OF TEX [2] ko.tex [5]

ESP1ºÎ-04

휠세미나3 ver0.4

Sun Java System Messaging Server 63 64

KDTÁ¾ÇÕ-2-07/03

05Àå

Copyright 0, Oracle and/or its affiliates. All rights reserved.,.,,,,,,,,,,,,.,...,. U.S. GOVERNMENT RIGHTS Programs, software, databases, and related

歯J PDF

APOGEE Insight_KR_Base_3P11


PowerPoint 프레젠테이션

Microsoft PowerPoint - 13-em14-안드로이드.ppt [호환 모드]

MAX+plus II Getting Started - 무작정따라하기

untitled

Mango-AM335x LCD Type 커널 Module Parameter에서 변경하기

KDTÁ¾ÇÕ-1-07/03

untitled

Sena Technologies, Inc. HelloDevice Super 1.1.0

리눅스설치가이드 3. 3Rabbitz Book 을리눅스에서설치하기위한절차는다음과같습니다. 설치에대한예시는우분투서버 기준으로진행됩니다. 1. Java Development Kit (JDK) 또는 Java Runtime Environment (JRE) 를설치합니다. 2.

Microsoft PowerPoint - Cross Development Environment [호환 모드]

CD-RW_Advanced.PDF

PowerPoint 프레젠테이션

SMB_ICMP_UDP(huichang).PDF

Mango-IMX6Q mfgtool을 이용한 이미지 Write하기

목차 개발환경 JTAG Bootp TFTP NFS 1

LN_5_Rootfs

PRO1_04E [읽기 전용]

Microsoft PowerPoint - ARM 개발 환경.ppt

벤처연구사업(전동휠체어) 평가

ISP and CodeVisionAVR C Compiler.hwp

서현수

PowerPoint 프레젠테이션

1. 안드로이드개발환경설정 안드로이드개발을위해선툴체인을비롯한다양한소프트웨어패키지가필요합니다 툴체인 (Cross-Compiler) 설치 안드로이드 2.2 프로요부터는소스에기본툴체인이 prebuilt 라는이름으로포함되어있지만, 리눅스 나부트로더 (U-boot)

Orcad Capture 9.x

목차 제 1 장 inexio Touch Driver소개 소개 및 주요 기능 제품사양... 4 제 2 장 설치 및 실행 설치 시 주의사항 설치 권고 사양 프로그램 설치 하드웨

초보자를 위한 C++

<4D F736F F D E20B4DCB8BB20C1A1B0CB20B9D720C1B6C4A120B8C5B4BABEF35F76312E335F2E646F63>

Microsoft Word - ntasFrameBuilderInstallGuide2.5.doc

소개 TeraStation 을 구입해 주셔서 감사합니다! 이 사용 설명서는 TeraStation 구성 정보를 제공합니다. 제품은 계속 업데이트되므로, 이 설명서의 이미지 및 텍스트는 사용자가 보유 중인 TeraStation 에 표시 된 이미지 및 텍스트와 약간 다를 수

vm-웨어-앞부속

(SW3704) Gingerbread Source Build & Working Guide

hd1300_k_v1r2_Final_.PDF

Microsoft Word - Fedora Core 9 개발환경 최종본.docx

Code Generation in Rapid

Chap 10 안드로이드커널 (Kernel)

Microsoft Word ARM_ver2_0a.docx

Oracle9i Real Application Clusters

커알못의 커널 탐방기 이 세상의 모든 커알못을 위해서

고급 프로그래밍 설계

페도라 코어 5 설치 가이드

본문01

Abstract View of System Components

R50_51_kor_ch1

0125_ 워크샵 발표자료_완성.key

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

untitled

목차 운영체제운영체제종류실시간시스템임베디드운영체제임베디드운영체제의개념임베디드리눅스리눅스리눅스부팅과정리눅스디렉토리구조리눅스디렉토리설명리눅스파일시스템리눅스소프트웨어패키지리눅스컴파일러 1

MySQL-Ch10

Chap06(Interprocess Communication).PDF

이도경, 최덕재 Dokyeong Lee, Deokjai Choi 1. 서론

PowerPoint 프레젠테이션

Transcription:

Building Embedded Linux System Toolchains Bootloader Kernel Root File System

정의 Toolchain 소스를컴파일하여바이너리실행파일를생성하기위해필요한컴파일러및라이브러리, 바이너리유틸리티모음

구성요소 Toolchain GCC : 컴파일러 Binutils : 어셈블러및로더, 바이너리파일편집유틸리티 Glibc : 크로스컴파일을위한라이브러리및일반라이브러리 Linux 커널 : 리눅스커널소스, Kernel headers

Toolchain

Toolchain

Toolchain

Toolchain

/opt/toolchains 디렉토리를만든다 # mkdir /opt/toolchains Toolchain 압축파일의압축을푼다. Toolchain 설치 # tar jxvf arm-2014.05-29-arm-none-linux-gnueabi-i686-pclinux-gnu.tar.bz2 -C /opt/toolchains/

Toolchain 설치 컴파일에사용되는명령어들을어느디렉토리에서나실행할수있기위해서는.bashrc 파일의 PATH환경변수에 /opt/toolchains/arm- 2014.05/bin을추가해주어야한다. 크로스컴파일러의명령어디렉토리 (/opt/toolchains/arm-2014.05/bin)

Toolchain 설치.bashrc 파일수정 # vi.bashrc source 명령을통해변경된.bashrc 을쉘에적용 # source.bashrc

Toolchain Test X86 계열에서사용하는리눅스 gcc 와다른점은생성되는코드가 ARM 용으로생성된다는것이다. 간단한프로그램을작성하여테스트한다. 테스트프로그램작성

컴파일 Toolchain Test # gcc o hello hello.c # arm-none-linux-gnueabi-gcc o hello-arm hello.c 컴파일된파일정보확인 (file 명령사용 )

Minicom 이란? TARGET은출력을위한별도의터미널을가지고있지않음 일반적으로 serial port를통한터미널프로그램이용 Linux에서는일반적으로 minicom 사용 Windows 에서는 HyperTerminal 과유사한프로그램을사용 Minicom 이란? 호스트와타겟을연결해주는가상터미널이다. 하이퍼터미널과유사한프로그램이고, 타켓의화면을호스트에서볼수있게해준다. Minicom 프로그램을사용하기위해먼저설정을해준다. minicom 프로그램은시리얼에연결되어있기때문에타겟의시리얼설정에맞는호스트설정이필요하다. Minicom 용도 부트로더의명령프롬프트 임베디드리눅스의쉘프롬프트를위한콘솔로사용

Minicom 설정 minicom 설치 # apt-get install minicom Serial port 확인 # dmesg

Minicom 설정 minicom 환경설정모드로진입 # minicom s

COM Port 선택 Minicom 설정 Serial port setup 항목을선택한다. A 를선택하여 Serial Device 를직렬케이블이연결된직렬포트로설정한다.

설정값저장 Minicom 설정 Save setup as dfl 를선택한후 Enter 를눌러설정된값을저장한다. 저장후 Exit 를눌러설정밖으로나간다. ( 그후타켓보드를켜면부팅되면서그화면이 minicom 으로보여진다.)

TFTP(Trivial File Transfer Protocol) 란? TFTP 란? FTP 보다간단하지만기능이조금덜한네트워크어플리케이션이다. 이것은사용자인증이불필요하고, 디렉토리를보여주지않아도되는곳에사용된다. 부트로더에서 kernel 이미지를 Host 에서 Target 으로이더넷포트를통하여다운로드하기위해사용한다.

프로그램을설치 # apt-get install tftp tftpd xinetd TFTP-Server 설치하기 이미설치되어있을경우의화면

/etc/xinet.d/tftp 파일작성또는수정 # vi /etc/xinetd.d/tftp service tftp { protocol = udp socket_type = dgram wait = yes user = root server = /usr/sbin/in.tftpd server_args = -s /tftpboot disable = no per_source = 11 cps = 100 2 flags = IPv4 } TFTP-Server 환경설정

tftpboot 디렉토리생성 TFTP-Server 환경설정 tftp가연결된디렉토리이다. /tftpboot라는디렉토리가없으면 mkdir로만들어준다. # mkdir /tftpboot tftp 가실행되도록다음명령을실행한다. # /etc/init.d/xinetd restart 또는 # service xinetd restart # netstat -a grep tftp

TFTP 시험 TFTP

NFS(Network File System) NFS 컴퓨터사용자가원격지컴퓨터에있는파일을마치자신의컴퓨터에있는것처럼검색하고, 저장하거나수정하도록해주는클라이언트 / 서버형태의메커니즘 NFS 서버설치 # apt-get install nfs-kernel-server NFS 서버설정 공유디렉토리생성 # mkdir /nfsroot /etc/exports 파일수정 # vi /etc/exports /nfsroot *(rw,sync,no_root_squash,no_subtree_check)

NFS NFS 시작 NFS 데몬재시작 # /etc/init.d/nfs-kernel-server restart 또는 # service nfs-kernel-server restart # netstat -a grep nfs NFS 테스트

Bootloader

Target Board Initialization Memory setting CPU clock setting GPIO setting Serial port setting MAC address and Ethernet port setting Bootloader Overview Kernel Booting Image download from host by tftp Copy image from Flash to ram or from ram to flash. Jump to kernel Command line interface

Bootloader 와 PC BIOS 의비교

Bootloader 의종류

Bootloader 의종류 x86 X86에서는아래의 2가지타입이주로사용된다. : LILO and GRUB LILO: http://brun.dyndns.org/pub/linux/lilo/ GRUB: http://www.gnu.org/software/grub/ 그외의bootloader: Rolo, EtherBoot, LinuxBIOS Arm architecture U-Boot ARM bootloader의표준이되어가고있다. Armboot로합쳐진 ppcboot는 u-boot로진화 http://armboot.sourceforge.net/ BLOB LART hardware project에서소개된 bootloader 다양한 ARM-based system에포팅 http://www.lart.tudelft.nl/lartware/blob

1 Reset 후내부ROM 코드실행 2 Operating Mode 에따라부트디바이스선택 3 BL1과일부초기화코드를내부 RAM으로복사 4 BL1에서 U-Boot 복사 5 U-Boot 실행시작 Booting Sequence

Kernel

Kernel Overview Kernel 의역사 UNIX: 1969 Thompson & Ritchie AT&T Bell Labs. BSD: 1978 Berkeley Software Distribution. Commercial Vendors: Sun, HP, IBM, SGI, DEC. GNU: 1984 Richard Stallman, FSF. POSIX: 1986 IEEE Portable Operating System unix. Minix: 1987 Andy Tannenbaum. SVR4: 1989 AT&T and Sun. Linux: 1991 Linus Torvalds Intel 386 (i386). Open Source: GPL.

Kernel Overview Linux 의특징 UNIX-like operating system. 특징 : Preemptive multitasking. Virtual memory (protected memory, paging). Shared libraries. Demand loading, dynamic kernel modules. Shared copy-on-write executables. TCP/IP networking. SMP support. Open source.

Kernel Overview kernel 이란? AKA: executive, system monitor. hardware에접근하는것을제어하고중재한다. 핵심적인개념을구현하고지원한다 : Processes, files, devices etc. Schedules / allocates system resources: Memory, CPU, disk, descriptors, etc. Security와 protection 수행. service (system calls) 를위한사용자요청에대한응답.

Kernel Core Kernel Overview

Linux Kernel Kernel Overview 운영체제에서가장기초적이고핵심적인기능을담당. 프로세스의관리, CPU 스케쥴링, 입출력제어 메모리, 파일, 주변장치와같은시스템관리 Monolithic Kernel이지만 Micro Kernel의특징인모듈을이용 Monolithic kernel: 하나의 Kernel 에필요한모든기능이통합. 같은메모리공간에필요한기능이존재, 함수호출방식으로 Kernel 에서제공하는기능에접근. 구현이간편하고효율적, 포팅과확장이어렵다. Micro kernel 필요한기능들은작은서버모듈로나뉘어설계, 서버를관리할수있는최소의크기, 하드웨어환경에따라기능의확장과기능재구성이용이. 단점은서비스를사용하는과정에서여러번의메시지전송과 Context Switching 이발생. 높은자원사용.

Process Management Linux Kernel 하나의프로그램은하나이상의프로세스를가질수있다. Kernel은해당프로세스가시스템자원을분배하고, 다른자원을침해할수없도록관리 프로세스의생성과소멸에대한전반적인내용을관리한다. Memory Management 시스템에서구동되는프로세스는프로세스만의독립적인메모리를갖는다. Linux는물리메모리에직접적으로데이터를기록하는것을허용하지않는다 반환된메모리의관리등과같은기능을수행

File System Management Linux Kernel Linux 는범용운영체제로다양한파일시스템을지원 Linux 에서모든장치는파일로표현된다. CDFS, FAT, JFFS, YAFFS, FAT16/32, EXT3/4, NTFS등을지원 Device Management Bootloader에서초기화된이후모든디바이스는 Kernel 의관리를받는다. 응용프로그램에서디바이스를이용해야하는경우 Kernel 을통해야만제어가가능하다. 사용하고자하는장치드라이버에따라서문자, 블록방식으로나뉘게된다. Network Management Kernel 은기기와외부시스템이정상적인네트워크를통해서통신할수있도록한다. IPv4, IPv6, Ethernet, ATM, CDMA등이지원된다.

Linux Kernel

Kernel source www.kernel.org Kernel의대부분은 C로작성되어있다. Kernel Directories Kernel Source Tree

Kernel Source Tree arch/ CPU dependent (arch/i386, arch/alpha, arch/arm ) arch/arm/boot/ Boot Strap arch/arm/kernel/ Hardware dependent kernel management routines Trap, Interrupt processing routines Context Switching routines Device configuration, initialization arch/arm/mm/ Hardware dependent memory management routines init/ Hardware independent kernel initialization (start_kernel) Task 0 (init_task or task[0]) creation Demon process creation - Task 1, 2, 3 and so on

Kernel Source Tree kernel/ Central section of the kernel Hardware independent kernel management routines fork, exit Scheduler Signal handling Time management mm/ Hardware independent memory management routines Virtual Memory Management Paging / Swapping

Kernel Source Tree fs/ Virtual file system Management open, read file system related system call routines Subdirectories for special file systems (ext2, fat,... ) ipc/ IPC between processes Semaphores Shared memory Message queues

drivers/ Device driver routines drivers/block/ : Block device driver drivers/char/ : Character device driver drivers/net : Network device driver drivers/pci/ : PCI bus control drivers/sound/ : sound card device driver drivers/cdrom/ : CD-ROM device driver drivers/scsi/ : SCSI device driver net/ Network protocols : TCP/IP, ARP and so on Socket interface Kernel Source Tree

Kernel Source Tree include/ Header files for the kernel Hardware independent : include/linux/ Hardware dependent : include/asm-***/ modules/ Kernel module routines insmod(modprobe), rmmod : dynamic load and removal lib/ Kernel library routines Doc/ Kernel document

Kernel Image Writing

Root File System for Embedded Linux

Minimum Components init: The program that starts everything off, usually by running a series of scripts. shell: Needed to give you a command prompt but, more importantly, to run the shell scripts called by init and other programs. daemons: Various server programs, started by init. libraries: Usually, the programs mentioned so far are linked with shared libraries which must be present in the root file system. Configuration files: The configuration for init and other daemons is stored in a series of ASCII text files, usually in the /etc directory.

Minimum Components Device nodes: The special files that give access to various device drivers. /proc and /sys: Two pseudo file systems that represent kernel data structures as a hierarchy of directories and files. Many programs and library functions read these files. kernel modules: If you have configured some parts of your kernel to be modules, they will be here, usually in /lib/modules/[kernel version].

Directory Layout /bin: programs essential for all users /dev: device nodes and other special files /etc: system configuration /lib: essential shared libraries, for example, those that make up the C library /proc: the proc files ystem /sbin: programs essential to the system administrator /sys: the sysfs file system /tmp: a place to put temporary or volatile files /usr: as a minimum, this should contain the directories /usr/bin, /usr/lib and /usr/sbin, which contain additional programs, libraries, and system administrator utilities /var: a hierarchy of files and directories that may be modified at runtime, for example, log messages, some of which must be retained after boot

Programs for the root file system The init program You have seen in the previous chapter that init is the first program to be run and so has PID 1. It runs as the root user and so has maximum access to system resources. Usually, it runs shell scripts which start daemons: a daemon is a program that runs in the background with no connection to a terminal, in other places it would be called a server program. Shell We need a shell to run scripts and to give us a command-line prompt so that we can interact with the system. An interactive shell is probably not necessary in a production device, but it is useful for development, debugging, and maintenance.

Utilities Programs for the root file system The shell is just a way of launching other programs and a shell script is little more than a list of programs to run, with some flow control and a means of passing information between programs. To make a shell useful, you need the utility programs that the Unix command-line is based on. Even for a basic root filesystem, there are approximately 50 utilities, which presents two problems. Firstly, tracking down the source code for each and cross compiling it would be quite a big job. Secondly, the resulting collection of programs would take up several tens of megabytes, which was a real problem in the early days of embedded Linux when a few megabytes was all you had. To solve this problem, BusyBox was born. BusyBox

Files for the root file system Libraries for the root file system Device nodes $ sudo mknod -m 666 dev/null c 1 3 $ sudo mknod -m 600 dev/console c 5 1 $ ls -l dev total 0 crw------- 1 root root 5, 1 Oct 28 11:37 console crw-rw-rw- 1 root root 1, 3 Oct 28 11:37 null

Build Systems The idea of a build system is to automate all the steps. A build system should be able to build, from upstream source code, some or all of the following: The toolchain The bootloader The kernel The root file system

Build Systems Buildroot: An easy-to-use system using GNU make and Kconfig (http://buildroot.org) EmbToolkit: A simple system for generating root filesystems; the only one at the time of writing that supports LLVM/Clang out of the box (https://www.embtoolkit.org) OpenEmbedded: A powerful system which is also a core component of the Yocto Project and others (http://openembedded.org) OpenWrt: A build tool oriented towards building firmware for wireless routers (https://openwrt.org) PTXdist: An open source build system sponsored by Pengutronix (http://www.pengutronix.de/software/ptxdist/index_en.html) Tizen: A comprehensive system, with emphasis on mobile, media, and invehicle devices (https://www.tizen.org) The Yocto Project: This extends the OpenEmbedded core with configuration, layers, tools, and documentation: probably the most popular system (http://www.yoctoproject.org)

SD Booting

NFS Booting