2012년 2월 21일 화요일

Embedded Debian Project 에서 제공하는 유용한 개발 도구 설치하기

Emdebian에서 제공하는 패키지는 다음과 같은 것들이 있다. 현재 시냅틱 패키지에서 검색되는 내용들이다.

emdebian-crush
emdebian-archive-keyring
emdebian-grip
emdebian-grip-server
libdebian-packages-compare
multistrap
emdebian-tdeb

* toolchain
설치하기 위해서 source.list에 emdebian.org를 추가하거나 /etc/apt/source.list.d/밑에 emdebain.list 파일을 다음의 내용을 갖도록 생성해야한다.

deb http://www.emdebian.org/debian/ stable main

그리고 패키지 정보를 갱신한다.

# apt-get update

gpg 어쩌구 저쩌구 하면서 에러를 내뱄는다. 그레서 keying에 해당하는 것을 설치해 보았다.

# apt-get install emdebian-archive-keyring

그리고 다시 패키지 정보를 갱신해 보았다. 된다.

그럼 armel에 해당하는 architecture관련 사항들을 패키지 캐시에서 검색해보자.

# apt-cache search armel


asterisk-prompt-fr-armelle - French voice prompts for Asterisk by Armelle Desjardins
debian-installer-6.0-netboot-armel - Debian-installer network boot images for armel
installation-guide-armel - Debian installation guide for armel
icedtea-6-jre-cacao - Alternative JVM for OpenJDK, using Cacao
icedtea-6-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
icedtea-7-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
cpp-4.3-arm-linux-gnueabi - The GNU C preprocessor
cpp-4.4-arm-linux-gnueabi - The GNU C preprocessor
g++-4.3-arm-linux-gnueabi - The GNU C++ compiler
g++-4.4-arm-linux-gnueabi - The GNU C++ compiler
gcc-4.3-arm-linux-gnueabi - The GNU C compiler
gcc-4.4-arm-linux-gnueabi - The GNU C compiler
gcc-4.4-base-armel-cross - The GNU Compiler Collection (base package) (for cross-compiling)
libc-bin-armel-cross - Embedded GNU C Library: Binaries (for cross-compiling)
libc-dev-bin-armel-cross - Embedded GNU C Library: Development binaries (for cross-compiling)
libc6-armel-cross - Embedded GNU C Library: Shared libraries (for cross-compiling)
libc6-dev-armel-cross - Embedded GNU C Library: Development Libraries and Header Files (for cross-compiling)
libgcc1-armel-cross - GCC support library (for cross-compiling)
libgcc1-dbg-armel-cross - GCC support library (debug symbols)
libgfortran3-armel-cross - Runtime library for GNU Fortran applications
libgfortran3-dbg-armel-cross - Runtime library for GNU Fortran applications (debug symbols)
libgmp3-dev-armel-cross - Multiprecision arithmetic library developers tools (for cross-compiling)
libgmp3c2-armel-cross - Multiprecision arithmetic library (for cross-compiling)
libgmpxx4ldbl-armel-cross - Multiprecision arithmetic library (C++ bindings) (for cross-compiling)
libgomp1-armel-cross - GCC OpenMP (GOMP) support library
libgomp1-dbg-armel-cross - GCC OpenMP (GOMP) support library (debug symbols)
libmpfr-dev-armel-cross - multiple precision floating-point computation developers tools (for cross-compiling)
libmpfr4-armel-cross - multiple precision floating-point computation (for cross-compiling)
libmudflap0-4.4-dev-armel-cross - GCC mudflap support libraries (development files)
libmudflap0-armel-cross - GCC mudflap shared support libraries
libmudflap0-dbg-armel-cross - GCC mudflap shared support libraries (debug symbols)
libobjc2-armel-cross - Runtime library for GNU Objective-C applications
libobjc2-dbg-armel-cross - Runtime library for GNU Objective-C applications (debug symbols)
libstdc++6-4.3-dbg-armel-cross - The GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.3-dev-armel-cross - The GNU Standard C++ Library v3 (development files)
libstdc++6-4.3-pic-armel-cross - The GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-4.4-dbg-armel-cross - The GNU Standard C++ Library v3 (debugging files)
libstdc++6-4.4-dev-armel-cross - The GNU Standard C++ Library v3 (development files)
libstdc++6-4.4-pic-armel-cross - The GNU Standard C++ Library v3 (shared library subset kit)
libstdc++6-armel-cross - The GNU Standard C++ Library v3 (for cross-compiling)
linux-libc-dev-armel-cross - Linux support headers for userspace development (for cross-compiling)
tzdata-armel-cross - time zone and daylight-saving time data (for cross-compiling)
zlib1g-armel-cross - compression library - runtime (for cross-compiling)
zlib1g-dev-armel-cross - compression library - development (for cross-compiling)

좀 많다. 다 파악하지는 못하겠지만 컴파일러, 라이브러리 등이라고 파악된다. 그 중 눈에 띄는 것이 있는데 다음 패키지이다.

"installation-guide-armel - Debian installation guide for armel"

설치하는데 필요한 도움글이 되겠다. 우선 설치해서 살펴보자.

# apt-get install installation-guide-armel

설치되고 실행하거나 읽어볼 내용에 대한 아무런 연관고리가 없어서 설치된 파일을 찾아 보았다.

"/var/lib/doc-base/documents/installation-guide-armel-en"에 있었다.

Document: installation-guide-armel-en
Section: Debian/Installation
Title: Debian Installation Guide for ARM in English
Author: Debian Installer team
Abstract: Manual describing how to install a Debian system
 using the Debian Installer.

Format: HTML
Index: /usr/share/doc/installation-guide-armel/en/index.html
Files: /usr/share/doc/installation-guide-armel/en/*.html

Format: pdf
Files: /usr/share/doc/installation-guide-armel/en/install.en.pdf.gz

Format: text
Files: /usr/share/doc/installation-guide-armel/en/install.en.txt.gz

그럼 해당 파일을 참고해서 살펴 보았다. 해당 내용은 그냥 데비안 설치 도움글이다. 일반적인 도움글로 데이안이 무엇인가?에서 시작해서 CD에서 설치하는 법 서버 설정법 등이다. 지우자.

# apt-get remove installation-guide-armel

그럼 다시 되돌아 가서 다음 링크의 내용들을 충실히 따라해서 toolchain과 라이브러리를 설치하자.




2012년 2월 15일 수요일

USB to RS485/RS422 with protection circuit and Isolation housing

http://www.kisansystem.kr/index/shop/item.php?it_id=1263307062
http://www.eleparts.co.kr/front/productdetail.php?productcode=035011001000000074

합리주의 혹은 중용의 도

중용과 합리주의 이 둘의 언급 순서를 어떻게 해야 할지 먼저 생각하게 된다. 이 둘은 울림은 개인적으로 비슷하게 느껴지지만, 아직은 중용 보다는 합리주의라는 말이 가슴에 와 닿는 말이다. 아무튼 같다고는 할 수 없지만 이 둘은 공통된 부분을 공감하며 살아간다는 일들이 왠만히 부지런하지 않으면 쉬운 일이 아닌 것 같다. 당연히 지켜져야 할 일들이 짜증나게 사소한 것들에서 부터 추상적인 담론까지 챙기지 못한다면 못된 사람들의 꽃노름에 휘둘이기에 쉽다. 너무나도 혼잡하다. 개인적인 내적 탐구도 힘든데 외부적으로 바른 길을 찾는 길도 힘들다.

2012년 2월 13일 월요일

AVR development environment with eclipse in debian

* install "eclipse"
# apt-get install eclipse-cdt

* install "AVR-plugin"
Execute "eclipse" -> Help -> Install New Software... -> Add -> type "AVR Plugin" in Name tab and insert "http://avr-eclipse.sourceforge.net/updatesite/" in Location tab -> install "AVR Eclipse Plugin"

*install "C99 LC Parser" in eclipse

* install gcc-avr, task-c-devel, gcc-doc, gcc-4.2 avr-libc, binutils-avr, and avrdude, avrdude-doc libftdi1
# apt-get install gcc-avr task-c-devel, gcc-doc, gcc-4.2, avr-libc, binutils-avr avrdude avrdude-doc libftdi1


2012년 2월 11일 토요일

미국 일하러 가기 준비

* 보통 연봉 : 5만달러 (현재 시점 6천만원)

* H1비자는 세금 25%

* 9시 출근 5시 퇴근

* Silver Spring에 위치한 Lado라는 학교와 University of Maryland 의 어학 연수프로그램, 전자는 회화위주의 사설 교육기간 Beltsville에서 차로 15분 정도거리 후자는 차로 13분 정도의 거리이다.

* 가정용 공구 : 몽키 스패, 펜치, 프라이어, 니퍼, 롱노즈프라이어, 망치, 드라이버 +,- x 대소너, 육각렌치

* 전기 장판 : 110, 220 겸용 http://itempage3.auction.co.kr/DetailView.aspx?ItemNo=A594372381&frm3=V2 한일 전기요 대형 180x 135

* 주거지
rollins park
http://www.rollinspark.net/floorPlans.php
congressional tower
http://www.congressionaltowers.net/
mira mont
http://www.southernmanagement.com/miramont/
https://www.southernmanagement.com/miramont/apply/

* 이민가방
http://www.brightonmall.co.kr/mall/index.php

* 인터넷 전화기 준비 (LG U+ 070, 기본 요금: 2200원)

[번역] Chrome 브라우져의 cache 영역을 ram으로

다음 문서는 Chrome의 cache영역을 ram disk(/dev/shm)밑으로 설정하고 전원이 꺼질때 유실되는 데이터를 하드 디스크로 복사하고 부팅시 복사된 하드 디스크의 데이터를 다시 ramdisk 밑으로 복사하는 과정을 거치는 노력을 하였다.

출처 : http://www.anders.bennehag.com/blog/2010/putting-chromes-cache-in-the-ram/
Chrome 웹 브라우져는 속도를 향상하는 방향으로 변화하고 있다. 그러나 지속적인 디스크 읽기와 쓰기로 내 Laptop 컴퓨터의 배터리와 하드드라이브를 소모하게된다.

다행이도 리눅스는 Ram으로 Mount 폴더를 가지고 있다. 이건 읽고 쓰는 작업이 하드 디스크에 영향을 미치지 않는다는 것을 의미한다. (실제로 내 Laptop의 디스크보다 2배정도 빠르다) 단점은 전원을 끄게되면 데이터가 사라지게 된다. 이 폴더는 통상 /dev/shm으로 불린다. 나는 이 폴더를 Chrome 브라우져의 cache로 사용하고자 한다.  그러나 나는 컴퓨터의 전원을 끌때 환경 설정, 확장 프로그램, 그리고 저장된 데이터의 잃어 버릴 준비가 되어 있지 않다. 그래서 나는 Ram으로 mount된 /dev/shm에 있는 폴더를 디스크로 복사하는 스크립트를 작성하였다. 그리고 이 스크립트는 Crome이 종료 될 때마다 실행된다.


이것은 Chrome의 cache를 Ram으로 설정하는 것이다.

# mkdir /dev/shm/.personal_synced # The folder in ram
# mkdir ~/.personal_synced # The mirrored folder on disk

매 시간마다 실행되는 간단한 스크립트를 작성하였다. (나는 좀더 쉬운 방식으로 작성되어 질 수 있다고 생각한다. 하지만 나는 아직 bash에 초보자 이다.)


#!/bin/bash
# Sync the ramdisk to harddrive

foldername=”.personal_synced”
ramdisk=”/dev/shm/”$foldername
harddisk_copy=”/home/anders/”
backup=”/home/anders/”$foldername”.old”

# Remove the old backup
echo “removing $backup”
rm -fr “$backup”
# Make a copy of the old one
echo “Copies the latest backup $harddisk_copy$foldername”
mv -f “$harddisk_copy$foldername” “$backup”
# Copy from ram
echo “Copies $ramdisk to harddrive, $harddisk_copy”
cp -R “$ramdisk” “$harddisk_copy”


나는 이 sync 스크립트가 Chrome이 종료 될때 실행되기를 원한다. 먼저 나는 나는 전원이 종료될때 실행되도록 시도하였다. 다음 스크립트는 Chrome이 종료될때 Ram 디스크를 동기화하는 것이고 난 그져 이 스크립트를 가지고 /usr/bin/google-chrome에 있는 symbolic link를 대체하였다.

#!/bin/bash
# Start Chrome with cache in the ram

/opt/google/chrome/google-chrome -user-data-dir=”/dev/shm/.personal_synced/google-chrome” “$@” && /home/anders/Scripts/syncRamdisk

소실된 모든 것들은 컴퓨터가 부팅될때 디스크 폴더의 것들을 복사하는 스크립트가 보상한다.

# The synced folder
cp -R /home/anders/.personal_synced /dev/shm/
chown -R anders /dev/shm/.personal_synced

# The chrome cache. I don’t want to sync this so it’s placed outside .personal_synced
mkdir /dev/shm/google-chrome
chown anders /dev/shm/google-chrome

그리고 단순히 시작 프로그램에 이 스크립트를 추가하였다.  System->Preferences에 해당하는 곳에 하면 된다.

Chrome의 cache를 우리의 자동 synced  폴더로 이동하자.

.config/google-chrome-folder를 synced 폴더로 이동하고 symbolic link로 대체함으로써 작업은 완벽해 졌다. (나는 또한 cache를 ramdisk로 옮겼으나 synced 폴더를 그렇게 하지 않았다. 나는 cache를 유지하는데 필요한 공간과 소비 시간에 아무런 변화점을 보지 못했다.)

# mv ~/.cache/google-chrome /dev/shm/google-chrome
# ln -s /dev/shm/google-chrome ~/.cache/google-chrome

# mv ~/.config/google-chrome /dev/shm/.personal_synced/
# ln -s /dev/shm/.personal_synced/google-chrome ~/.config/google-chrome

주의 사항들:

/dev/shm/는 모두에 의해서 읽기가 가능하다. 이 폴더에 어떤 것을 넣는 것은 매우 안전한 작업은 아니다.

추가작업: 나는 스크립트를 약간 수정하였다. root 소유의 폴더에서 문제점이 발생하였다.




2012년 2월 8일 수요일

/dev/shm 무엇에 쓰는 물건인가?

POSIX 기반의 공유 메모리를 위한 파일 시스템으로 응용프로그램들이 데이터 공유를 위해서 잠시 사용하기는 용도로 규정되어 있는 것으로 보인다. 문제는 이 파일 시스템이 메모리를 저장 공간으로 사용하기 때문에 저장및 읽기 속도는 빠르지만 hibernation상태로 진입하게 될때 처럼 전원이 차된되는 경우 데이터를 유실할 가능성이 있다. 그래서 swap영역을 사용하도록 규정되어 있다고 언급된다. 그레서 shm의 데이터는 hibernation상태로 진입할때 하드 디스크영역에 해당하는 swap영역에 데이터를 저장한다고 여겨진다.