'2019/03/07'에 해당되는 글 2건

  1. 2019.03.07 Visual Studio Code for Linux ==> 리눅스 개발자의 친구
  2. 2019.03.07 linux kernel build on ubuntu
IT이야기2019. 3. 7. 03:33

Debugging Linux Kernel with Visual Studio?? 예전에 이런 질문/글 올리면 동서를 막논하고 미친놈 소리를 들었지요. 참 기본이 없다, 운전으로 말하면 김여사구만 취급당했는데... 세월이 흘러 MS(마이크로소프트, Microsoft)가 미친건지 제정신으로 돌아온건지 세월이 많이 바뀌었네요.

Visual Sutio로 Linux kernel 개발을 돕는 plugin/extension도 파는 회사가 있고요

  • http://sysprogs.com/VisualKernel/
  • https://sysprogs.com/tutorials/creating-a-basic-linux-kernel-module-with-visual-studio/

Tutorials > VisualKernel > Kernel Modification Tutorials > Building and modifying Linux Kernel with Visual Studio

Visual Studio Code는 기존의 Visual Studio와 이름만 공유하고 전혀 다른 open source tool입니다. 기존 VS는 C/C++로 개발되었다고 알려져 있고 주로 C/C++개발자용이었는데, VS Code는 완전 자유도 100%인 멀티 platform 개발툴이며 에디터 editor 입니다. 오픈 소스라 코드도 공개되어 있는데 열어보면 기절. 세상이 많이 변했구나 이제 은퇴할때가 되었나 생각하게 하는...

VS Code를 이용해서 UML diagram을 Linux에서 그리고 version control하는 방법을 팀 사람들에게 보여줬더니 다들 기절.

UML diagram 공유하기 in Linux (or Windows or Mac)

  1. Visual Studio Code (open source tools for multi platforms)
    1. https://code.visualstudio.com/download
    2. https://github.com/Microsoft/vscode
  2. PlantUML plugin
    1. http://plantuml.com/
    2. http://plantuml.com/sequence-diagram
  3. GraphViz
    1. https://graphviz.gitlab.io/download/

PlantUML은 plugin 으로 설치하니 확장자을 *.plantuml로 하는거 이외에는 할게 없고, GraphViz는 Ubuntu에서 설치하면 /usr/bin/dot 으로 copy되서 할일없음. 

sudo apt install graphviz

Windows에서는 GraphViz설치하고 환경변수를 하나 만들어줘야함.

GRAPHVIZ_DOT=c:\graphviz\bin\


  1. TODO: WebSequenceDiagram문법과 같은건가?
  2. TODO: Visual Studio Code에서 리눅스 커널/모듈 개발 어떻게 하는지 다음에 정리


Posted by 쁘레드
Programming2019. 3. 7. 03:06

Short note

---------

# 1. Clone the kernel to your local machine

$ git clone git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git

$ cd linux-stable


# 1.1 optional Github mirror link, i prefer github over kernel.org

$ git clone https://github.com/torvalds/linux.git

$ cd linux


# 2. check kernel version

$ make kernelversion

$ uname -ra


# 3. Find the tag for the version you want

$ git tag -l | grep 4.20

v4.20

v4.20.rc...


# 4. Create a new branch with that tag

$ git checkout -b my4.20 v4.20


# 5. use Ubuntu proper config

# 5.1 use default defconfig for the system

$ make defconfig


# 5.2 use current ubuntu config, /boot/config-*

$ cp /boot/config-`uname -r` .config


# if same version or very close to current version

$ make oldconfig


# otherwise, choose default one, very safe

$ yes '' | make oldconfig


# 5.2.1 optional, change kernel options

$ make menuconfig


#make debian packages, *.deb will be copied in ../ (outside of linux build root)

$ make deb-pkg -j 16


# copied *.deb to target machine. Generally 3 files

# then install debian package. No particular order is required

$ sudo dpkg -i *.deb

Posted by 쁘레드