SlideShare a Scribd company logo
$ git clone https://github.com/RobertCNelson/linux-dev.git bbb-kernel
$ cd bbb-kernel/
$ ls
3rdparty LICENSE build_deb.sh build_kernel.sh build_mainline.sh patch.sh patches readme.md
repo_maintenance scripts system.sh.sample tools version.sh
Beaglebone Black(BBB) Kernel Download
※ build_kernel.sh : BBB용 커널 Download & Build 자동화 Script
$ mkdir -p logs
$ vi build_kernel.sh
Beaglebone Black(BBB) Kernel Build Script Edit
# In build_kernel.sh script…
109 make_kernel () {
….
127 make V=1 -j${CORES} ARCH=${KERNEL_ARCH} LOCALVERSION=${BUILD} CROSS_COMPILE="${CC}"
${address} ${image} modules > ../logs/build.log
※ make_kernel()함수 내 make zImage 명령에 V=1 및 > ../logs/build.log 추가
※ V=1 : Make 실행 시 수행되는 명령어 출력
$ ./build_kernel.sh
Beaglebone Black(BBB) Kernel Build
+ Detected build host [Ubuntu 14.04.4 LTS]
+ host: [x86_64]
+ git HEAD commit: [fa3dbf5d372bb7e2473fb09120209be64a877944]
…
※ build_kernel.sh 명령으로 BBB용 리눅스 커널 빌드 시작
$ ls -al
..
drwxrwxr-x 26 hcyang hcyang 4096 8월 21 23:35 KERNEL
-rw-rw-r-- 1 hcyang hcyang 1111 8월 15 23:38 LICENSE
-rwxrwxr-x 1 hcyang hcyang 5165 8월 15 23:38 build_deb.sh
-rwxrwxr-x 1 hcyang hcyang 8966 8월 21 19:04 build_kernel.sh
-rwxrwxr-x 1 hcyang hcyang 7405 8월 15 23:38 build_mainline.sh
..
※ 스크립트가 끝나면 KERNEL 디렉토리에 커널 소스가 다운로드 및 빌드가 수행되어져 있음.
$ cat logs/build.log
Beaglebone Black(BBB) Kernel Build Log
make -f ./Makefile silentoldconfig
make -f ./scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f ./scripts/Makefile.build obj=scripts/kconfig silentoldconfig
mkdir -p include/config include/generated
scripts/kconfig/conf --silentoldconfig Kconfig
set -e; : ' CHK include/config/kernel.release'; mkdir -p include/config/; echo "4.8.0-
rc2$(/bin/bash ./scripts/setlocalversion .)" < include/config/auto.conf > include/config/kernel.release.tmp; if [ -r
include/config/kernel.release ] && cmp -s include/config/kernel.release include/config/kernel.release.tmp; then
rm -f include/config/kernel.release.tmp; else : ' UPD include/config/kernel.release'; mv -f
include/config/kernel.release.tmp include/config/kernel.release; fi
make -f ./scripts/Makefile.asm-generic 
src=asm obj=arch/arm/include/generated/asm
…
※ 빌드 완료 후 logs/build.log 파일이 생성되었는지 확인
해당 Log 파일은 이후 Visual Studio 개발 환경 구축을 위해 사용됨
Download Beaglebone Black(BBB) Kernel to Windows
SCP / FTP 등을 통해 KERNEL 디렉토리를 윈도우 개발환경으로 다운받거나
NFS / 삼바 / SSHFS 등을 통해 윈도우 개발환경으로 연결.
Visual Studio Project Setup – 빈 Win32 콘솔 응용 프로그램 생성 1/2
Visual Studio Project Setup – 빈 Win32 콘솔 응용 프로그램 생성 2/2
Visual Studio Project Setup
분석을 원하는 소스코드 프로젝트에 추가 (e.g. drivers/char/ttyprink.c)
Visual Studio Project Setup
Include 경로 / Macro 등이 설정되어 있지 않아 header file이나 Symbol 등을 찾지 못함
Visual Studio Project Setup - include directory / Macros 추가
빌드 과정 중 생성된 build.log 에서 분석을 원하는 파일에 대한 Build 명령 검색
Visual Studio Project Setup - include directory / Macros 추가
해당 명령에서 –I / -include / -D 옵션 추출
Visual Studio Project Setup - include directory / Macros 추가
-I 옵션 : 프로젝트 속성  VC++ 디렉토리  포함 디렉토리에 추가
Visual Studio Project Setup - include directory / Macros 추가
-D 옵션 : 프로젝트 속성  C/C++  전처리기  전처리기 정의에서 기존 내용 모두 삭제 후 추가
Visual Studio Project Setup - include directory / Macros 추가
-include 옵션 파일은 직접 프로젝트의 헤더파일 항목에 에 추가.
Visual Studio Project Setup - include directory / Macros 추가
Include 경로 및 Definition Peeking 등의 기능 정상 동작 확인
요약
1. Makefile 에 V=1 옵션을 넣어 Build 명령을 추출할 수 있게 한다.
2. Build 명령에서 필요한 include directory / Macro 등을 추출한다.
3. Visual Studio 의 프로젝트 설정에서 추출한 내용들을 적절히 추가한다.

More Related Content

PDF
Dockerfile과 Bash
PDF
Docker로 서버 개발 편하게 하기
PDF
CoreOS를 이용한 Docker 관리툴 소개
PDF
박진호 - 우분투 부팅 과정에 대한 이야기 (2012Y07M28D)
PDF
[1A6]Docker로 보는 서버 운영의 미래
PPTX
Ffmpeg for android
PPTX
Docker 로 Linux 없이 Linux 환경에서 개발하기
PDF
[오픈소스컨설팅] RPM 만들기
Dockerfile과 Bash
Docker로 서버 개발 편하게 하기
CoreOS를 이용한 Docker 관리툴 소개
박진호 - 우분투 부팅 과정에 대한 이야기 (2012Y07M28D)
[1A6]Docker로 보는 서버 운영의 미래
Ffmpeg for android
Docker 로 Linux 없이 Linux 환경에서 개발하기
[오픈소스컨설팅] RPM 만들기

What's hot (20)

PDF
Tech planet 2015 Docker 클라우드 구축 프로젝트 - d4
PDF
Docker기반 분산 플랫폼
PPTX
Docker 사내교육 자료
PDF
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
PDF
도커(Docker) 메트릭스 & 로그 수집
PDF
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
PDF
3.ubuntu custom
PDF
XECon2015 :: [1-3] 김덕홍 - Git Workflow with GitHub
PDF
docker_quick_start
PPTX
안드로이드Jni 사용설치
PDF
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
PDF
XECon2015 :: [3-4] 조정현 - Laravel with cloud
PDF
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
PDF
docker-based remote desktop
PDF
Ninja
PDF
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
PDF
초심자를 위한 도커 소개 및 입문
PDF
Docker (Compose) 활용 - 개발 환경 구성하기
PPTX
Docker 사용가이드 public v0.1
PDF
Docker 기반 개발환경 구축 - XE Open seminar #2
Tech planet 2015 Docker 클라우드 구축 프로젝트 - d4
Docker기반 분산 플랫폼
Docker 사내교육 자료
XECon2015 :: [1-5] 김훈민 - 서버 운영자가 꼭 알아야 할 Docker
도커(Docker) 메트릭스 & 로그 수집
강분도 - 나만의 우분투 배포판 만들기 (2011Y06M25D)
3.ubuntu custom
XECon2015 :: [1-3] 김덕홍 - Git Workflow with GitHub
docker_quick_start
안드로이드Jni 사용설치
Confd, systemd, fleet을 이용한 어플리케이션 배포 in CoreOS
XECon2015 :: [3-4] 조정현 - Laravel with cloud
[오픈소스컨설팅]Subversion vs git - 참을 수 없는 간단함
docker-based remote desktop
Ninja
[오픈소스컨설팅] Docker를 활용한 Gitlab CI/CD 구성 테스트
초심자를 위한 도커 소개 및 입문
Docker (Compose) 활용 - 개발 환경 구성하기
Docker 사용가이드 public v0.1
Docker 기반 개발환경 구축 - XE Open seminar #2
Ad

Similar to Linux in Visual Studio (20)

PDF
Kernel 2.6 makefile_분석(송형주)
PPTX
우분투 커널 컴파일
PDF
이호민 - 우분투 환경에서의 임베디드 개발환경 구축 및 어플리케이션 개발 (2010Y06M24D)
PDF
리눅스 커널 디버거 KGDB/KDB
PDF
제로부터시작하는 Git 두번째 이야기
PPTX
IoT with Raspberry Pi + Node JS - Chapter 1
PDF
망고100 보드로 놀아보자 11
PDF
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
PPTX
Kinect 사용을 위한 OpenCV, PCL 라이브러리 설치
PDF
postgres_빌드_및_디버깅.pdf
PDF
Kubuntu 9.10에 Cubrid 8.2.0.2005 Linux
PPTX
Cmake tutorial
PDF
JetsonTX2 Python
PDF
리얼리눅스 제 1 회 세미나: "리눅스, 제대로 알고 코딩하자!"
PDF
망고100 보드로 놀아보자 9
PDF
제로부터시작하는오픈소스
PDF
Foss open sorucesw_6902
PDF
강좌 03 개발환경 구축
PPTX
cross compile
PDF
200725 AWS 클라우드 컴퓨팅으로 배우는 생물정보학 - 덕성여대 강연
Kernel 2.6 makefile_분석(송형주)
우분투 커널 컴파일
이호민 - 우분투 환경에서의 임베디드 개발환경 구축 및 어플리케이션 개발 (2010Y06M24D)
리눅스 커널 디버거 KGDB/KDB
제로부터시작하는 Git 두번째 이야기
IoT with Raspberry Pi + Node JS - Chapter 1
망고100 보드로 놀아보자 11
Linux Kernel Boot Process , SOSCON 2015, By Mario Cho
Kinect 사용을 위한 OpenCV, PCL 라이브러리 설치
postgres_빌드_및_디버깅.pdf
Kubuntu 9.10에 Cubrid 8.2.0.2005 Linux
Cmake tutorial
JetsonTX2 Python
리얼리눅스 제 1 회 세미나: "리눅스, 제대로 알고 코딩하자!"
망고100 보드로 놀아보자 9
제로부터시작하는오픈소스
Foss open sorucesw_6902
강좌 03 개발환경 구축
cross compile
200725 AWS 클라우드 컴퓨팅으로 배우는 생물정보학 - 덕성여대 강연
Ad

Linux in Visual Studio

  • 1. $ git clone https://github.com/RobertCNelson/linux-dev.git bbb-kernel $ cd bbb-kernel/ $ ls 3rdparty LICENSE build_deb.sh build_kernel.sh build_mainline.sh patch.sh patches readme.md repo_maintenance scripts system.sh.sample tools version.sh Beaglebone Black(BBB) Kernel Download ※ build_kernel.sh : BBB용 커널 Download & Build 자동화 Script
  • 2. $ mkdir -p logs $ vi build_kernel.sh Beaglebone Black(BBB) Kernel Build Script Edit # In build_kernel.sh script… 109 make_kernel () { …. 127 make V=1 -j${CORES} ARCH=${KERNEL_ARCH} LOCALVERSION=${BUILD} CROSS_COMPILE="${CC}" ${address} ${image} modules > ../logs/build.log ※ make_kernel()함수 내 make zImage 명령에 V=1 및 > ../logs/build.log 추가 ※ V=1 : Make 실행 시 수행되는 명령어 출력
  • 3. $ ./build_kernel.sh Beaglebone Black(BBB) Kernel Build + Detected build host [Ubuntu 14.04.4 LTS] + host: [x86_64] + git HEAD commit: [fa3dbf5d372bb7e2473fb09120209be64a877944] … ※ build_kernel.sh 명령으로 BBB용 리눅스 커널 빌드 시작 $ ls -al .. drwxrwxr-x 26 hcyang hcyang 4096 8월 21 23:35 KERNEL -rw-rw-r-- 1 hcyang hcyang 1111 8월 15 23:38 LICENSE -rwxrwxr-x 1 hcyang hcyang 5165 8월 15 23:38 build_deb.sh -rwxrwxr-x 1 hcyang hcyang 8966 8월 21 19:04 build_kernel.sh -rwxrwxr-x 1 hcyang hcyang 7405 8월 15 23:38 build_mainline.sh .. ※ 스크립트가 끝나면 KERNEL 디렉토리에 커널 소스가 다운로드 및 빌드가 수행되어져 있음.
  • 4. $ cat logs/build.log Beaglebone Black(BBB) Kernel Build Log make -f ./Makefile silentoldconfig make -f ./scripts/Makefile.build obj=scripts/basic rm -f .tmp_quiet_recordmcount make -f ./scripts/Makefile.build obj=scripts/kconfig silentoldconfig mkdir -p include/config include/generated scripts/kconfig/conf --silentoldconfig Kconfig set -e; : ' CHK include/config/kernel.release'; mkdir -p include/config/; echo "4.8.0- rc2$(/bin/bash ./scripts/setlocalversion .)" < include/config/auto.conf > include/config/kernel.release.tmp; if [ -r include/config/kernel.release ] && cmp -s include/config/kernel.release include/config/kernel.release.tmp; then rm -f include/config/kernel.release.tmp; else : ' UPD include/config/kernel.release'; mv -f include/config/kernel.release.tmp include/config/kernel.release; fi make -f ./scripts/Makefile.asm-generic src=asm obj=arch/arm/include/generated/asm … ※ 빌드 완료 후 logs/build.log 파일이 생성되었는지 확인 해당 Log 파일은 이후 Visual Studio 개발 환경 구축을 위해 사용됨
  • 5. Download Beaglebone Black(BBB) Kernel to Windows SCP / FTP 등을 통해 KERNEL 디렉토리를 윈도우 개발환경으로 다운받거나 NFS / 삼바 / SSHFS 등을 통해 윈도우 개발환경으로 연결.
  • 6. Visual Studio Project Setup – 빈 Win32 콘솔 응용 프로그램 생성 1/2
  • 7. Visual Studio Project Setup – 빈 Win32 콘솔 응용 프로그램 생성 2/2
  • 8. Visual Studio Project Setup 분석을 원하는 소스코드 프로젝트에 추가 (e.g. drivers/char/ttyprink.c)
  • 9. Visual Studio Project Setup Include 경로 / Macro 등이 설정되어 있지 않아 header file이나 Symbol 등을 찾지 못함
  • 10. Visual Studio Project Setup - include directory / Macros 추가 빌드 과정 중 생성된 build.log 에서 분석을 원하는 파일에 대한 Build 명령 검색
  • 11. Visual Studio Project Setup - include directory / Macros 추가 해당 명령에서 –I / -include / -D 옵션 추출
  • 12. Visual Studio Project Setup - include directory / Macros 추가 -I 옵션 : 프로젝트 속성  VC++ 디렉토리  포함 디렉토리에 추가
  • 13. Visual Studio Project Setup - include directory / Macros 추가 -D 옵션 : 프로젝트 속성  C/C++  전처리기  전처리기 정의에서 기존 내용 모두 삭제 후 추가
  • 14. Visual Studio Project Setup - include directory / Macros 추가 -include 옵션 파일은 직접 프로젝트의 헤더파일 항목에 에 추가.
  • 15. Visual Studio Project Setup - include directory / Macros 추가 Include 경로 및 Definition Peeking 등의 기능 정상 동작 확인
  • 16. 요약 1. Makefile 에 V=1 옵션을 넣어 Build 명령을 추출할 수 있게 한다. 2. Build 명령에서 필요한 include directory / Macro 등을 추출한다. 3. Visual Studio 의 프로젝트 설정에서 추출한 내용들을 적절히 추가한다.