UART Arrow Key Code

Posted in 개인/ㄴFROMA by

http://www.termsys.demon.co.uk/vtansi.htm

http://electronics.stackexchange.com/questions/8874/is-it-possible-to-send-characters-through-serial-to-go-up-a-line-on-the-console


Use VT100 escape codes to control the cursor.

Eg.

puts("\033[2J");   // clear screen
puts("\033[0;0H"); // set cursor to 0,0
puts("\033[10B");  // move cursor down 10 lines
puts("\033[5A");  // move cursor up 5 lines


vim vundle 플러그인 및 환경설정

Posted in 개인/ㄴLinux by

## vim-pathogen ##
Reference: https://github.com/tpope/vim-pathogen

mkdir -p ~/.vim/autoload ~/.vim/bundle; \
curl -Sso ~/.vim/autoload/pathogen.vim \
    https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

Add this to your vimrc:

execute pathogen#infect()


## Vundle ##
Reference: http://kldp.org/node/125263
                https://github.com/gmarik/vundle

1. Setup Vundle:

 $ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle

2. Configure bundles:

    Sample .vimrc:

 set nocompatible               " be iMproved
 filetype off                   " required!

 set rtp+=~/.vim/bundle/vundle/
 call vundle#rc()

 " let Vundle manage Vundle
 " required! 
 Bundle 'gmarik/vundle'

 " My Bundles here:
 "
 " original repos on github
 Bundle 'tpope/vim-fugitive'
 Bundle 'Lokaltog/vim-easymotion'
 Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
 Bundle 'tpope/vim-rails.git'
 " vim-scripts repos
 Bundle 'L9'
 Bundle 'FuzzyFinder'
 " non github repos
 Bundle 'git://git.wincent.com/command-t.git'
 " git repos on your local machine (ie. when working on your own plugin)
 Bundle 'file:///Users/gmarik/path/to/plugin'
 " ...

 filetype plugin indent on     " required!
 "
 " Brief help
 " :BundleList          - list configured bundles
 " :BundleInstall(!)    - install(update) bundles
 " :BundleSearch(!) foo - search(or refresh cache first) for foo
 " :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
 "
 " see :h vundle for more details or wiki for FAQ
 " NOTE: comments after Bundle command are not allowed..

Source-Explorer-srcexpl.vim -> SrcExpl 변경
trinity.vim -> Trinity 변경


## ctags 자동검색 ##
Reference: http://kldp.org/node/115739

set tags=./tags;/


## cscope 자동검색 ##
Reference: http://vim.wikia.com/wiki/Autoloading_Cscope_Database

function! LoadCscope()
  let db = findfile("cscope.out", ".;")
  if (!empty(db))
    let path = strpart(db, 0, match(db, "/cscope.out$"))
    set nocscopeverbose " suppress 'duplicate connection' error
    exe "cs add " . db . " " . path
    set cscopeverbose
  endif
endfunction
au BufEnter /* call LoadCscope()


## cscope 명령어 ##
Reference: http://kldp.org/node/115739

:cs find c 함수명 => 함수를 호출하는 곳을 찾을 때
:cs find g 함수명 => 함수가 정의된 곳을 찾을 때
:cs find s 함수명 => 함수명과 일치하는 심볼을 모두 찾아낼 때
:cs find d 함수명 => 지정된 함수가 그 안에서 부르는 함수 찾기
:cs find e 정규표현식 => 정규표현식 패턴으로 찾기
:cs find f 파일명 => 파일 찾기
:cs find i 헤더파일 => 헤더파일 찾기

vim용 키맵 플러그인: http://cscope.sourceforge.net/cscope_maps.vim


## 현재 사용중인 .vimrc ##


"-----------------------------------------------------------------------"
" Vundle 환경설정
"-----------------------------------------------------------------------"
set nocompatible               " be iMproved
filetype off                   " required!

	set rtp+=~/.vim/bundle/vundle/
call vundle#rc()

	" let Vundle manage Vundle
	" required! 
	Bundle 'gmarik/vundle'

	" My Bundles here:
	Bundle 'The-NERD-tree'
	Bundle 'The-NERD-Commenter'
	"Bundle 'Source-Explorer-srcexpl.vim'
	Bundle 'SrcExpl'
	Bundle 'cscope.vim'
	Bundle 'taglist-plus'
	"Bundle 'trinity.vim'
	Bundle 'Trinity'

	" original repos on github
	Bundle 'tpope/vim-fugitive'
	Bundle 'Lokaltog/vim-easymotion'
	Bundle 'rstacruz/sparkup', {'rtp': 'vim/'}
	Bundle 'tpope/vim-rails.git'
	" vim-scripts repos
	Bundle 'L9'
	Bundle 'FuzzyFinder'
	" non github repos
	Bundle 'git://git.wincent.com/command-t.git'
	" ...

	filetype plugin indent on     " required!
	"
	" Brief help
	" :BundleList          - list configured bundles
	" :BundleInstall(!)    - install(update) bundles
	" :BundleSearch(!) foo - search(or refresh cache first) for foo
	" :BundleClean(!)      - confirm(or auto-approve) removal of unused bundles
	"
	" see :h vundle for more details or wiki for FAQ
	" NOTE: comments after Bundle command are not allowed..

"-----------------------------------------------------------------------"
"vim 환경설정
"-----------------------------------------------------------------------"
	scripte utf-8
	" vim:set fenc=utf-8 tw=0:
	" Vim setting for sirini

	" Vim 전용 기능 사용
	set nocp

	" 옵션 복원
	set all&

	" 명령어 기록 갯수
	set hi=100

	" 백스페이스 사용
	set bs=indent,eol,start

	" 인코딩 설정
	"let &tenc=&enc
	"set enc=utf-8
	set fenc=utf-8
	set fencs=utf-8,cp949,cp932,euc-jp,shift-jis,big5,ucs-2le,latin1

	" 커서 위치 항상 보이기
	set ru

	" 완성중인 명령을 표시
	set sc

	" 줄번호 표시
	set nu

	" 줄 번호 표시 너비 설정
	set nuw=5

	" 탭 크기 설정
	set ts=2
	set sw=2

	" 탭 >> 공백 변환 사용안함
	set noet
	set sts=0

	" 자동 줄바꿈 안함
	set nowrap

	" 자동 들여쓰기
	set autoindent

	" C프로그래밍 자동 들여쓰기
	set cindent

	" magic 기능 사용
	set magic

	" 이동 동작시 줄의 시작으로 자동 이동
	set sol

	" 비쥬얼 모드 동작 설정
	set sel=exclusive

	" 괄호짝 찾기에서 <> 도 찾도록 추가
	set mps+=<:>

	" 새로 추가된 괄호 짝 보여주기
	"set sm

	" 검색어 강조
	set hls

	" 검색시 파일 끝에서 되돌리기 안함
	set nows

	" 검색시 대소문자 구별 안함
	set ic

	" 스마트한 대소문자 구별 기능 사용
	set scs

	" 항상 status 라인을 표시
	set ls=2

	" 커스텀 확장자들에게 파일 형식 설정
	"au BufRead,BufNewFile *.dic setl ft=php

	"파일 형식에 따른 신택스 하이라이팅 켜기
	sy enable

"-----------------------------------------------------------------------"
" ctags database path 설정 
"-----------------------------------------------------------------------"
	set tag=./tags;/

"-----------------------------------------------------------------------"
" cscope database path 설정 
"-----------------------------------------------------------------------"
	function! LoadCscope()
		let db = findfile("cscope.out", ".;")
		if (!empty(db))
			let path = strpart(db, 0, match(db, "/cscope.out$"))
			set nocscopeverbose " suppress 'duplicate connection' error
			exe "cs add " . db . " " . path
			set cscopeverbose
		endif
	endfunction
	au BufEnter /* call LoadCscope()

"-----------------------------------------------------------------------"
" Tag List 환경설정 
"-----------------------------------------------------------------------"
	filetype on				" vim filetype on
	nmap  :TlistToggle			" F7 key = Tag List Toggle
	let Tlist_Ctags_Cmd = "/usr/bin/ctags"	" ctags 프로그램 위치
	let Tlist_Inc_Winwidth = 0		" window width change off
	let Tlist_Exit_OnlyWindow = 0		" tag/file 선택 완료 시 taglist
						" window close = off
	let Tlist_Auto_Open = 0			" vim 시작 시 window open
	let Tlist_Use_Right_Window = 1		" vim 시작 시 window open

"-----------------------------------------------------------------------"
" Source Explorer 환경설정
"-----------------------------------------------------------------------"
	nmap  :SrcExplToggle			" F8 key = SrcExpl TOggle
	nmap  h					" 왼쪽 창으로 이동
	nmap  j					" 하단(preview) 창으로 이동
	nmap  k					" 상단 창으로 이동
	nmap  l					" 오른쪽 창으로 이동

	let g:SrcExpl_winHeight = 8		" SrcExpl 윈도우 높이 지정
	let g:SrcExpl_refreshTime = 100		" refreshing time = 100ms
	let g:SrcExpl_jumpKey = ""		" 해당 definition으로 jump
	let g:SrcExpl_gobackKey = ""		" back
	let g:SrcExpl_isUpdateTags = 0		" tag file update = off

"-----------------------------------------------------------------------"
" NERD Tree 환경설정
"-----------------------------------------------------------------------"
	let NERDTreeWinPos = "left"		" NERD Tree위치 = 왼쪽
	nmap  :NERDTreeToggle			" F9 Key = NERD Tree Toggle

"-----------------------------------------------------------------------"
" Runtime Path Manipulation
"-----------------------------------------------------------------------"
	execute pathogen#infect()


FROMA UART Debug Code

Posted in 개인/ㄴFROMA by

FROMA 개발 시 디버깅 목적을 위한 코드

## ASM : 특정 문자열 출력 ##

UART_SEND:
  ldr   r1,=0x48020014  // UART3 LSR
  ldr   r2,[r1]
  and   r2,r2,#0x20
  cmp   r2,#0x00
  beq   UART_SEND
  ldr   r1,=0x48020000
  mov   r2,#0x61    //r3
  str   r2,[r1]


## C : 특정 문자열 출력 ##

while((((*(volatile unsigned int *)(0x48020014))&0x20)>>5)==0);
(*(volatile unsigned int *)(0x48020000)) = 0x61;


## C : 입력한 키 값을 +1하여 반환 ##

#define REG32(addr) (*(volatile unsigned int *)(addr))

unsigned int reg=0x00;

while(1){
  while(REG32(0x48020014)&0x01==0);
  reg = REG32(0x48020000);
  
  if(reg>0){
    while((REG32(0x48020014)&0x20)>>5)==0);
    REG32(0x48020000) = reg + 1;
}


U-boot Reference URL

Posted in 개인/ㄴOS by

## U-boot 관련 ###

U-boot Doc

http://www.denx.de/wiki/DULG/Manual


u-boot 분석 참고자료 IAMROOT

http://www.iamroot.org/xe/Kernel_9_ARM/78389


[펌][S5PV210] Booting Sequence of S5PV210( S5PV210의 부팅 순서 )

http://myje.tistory.com/entry/%ED%8E%8CS5PV210-Booting-Sequence-of-S5PV210-S5PV210%EC%9D%98-%EB%B6%80%ED%8C%85-%EC%88%9C%EC%84%9C


U-Boot 분석(1)~(5)

http://blog.naver.com/idrukawa/100054094629


U-boot (Universal Boot Loader, #1)

http://flylhs83.tistory.com/entry/U-boot-Universal-Boot-Loader-1


부트로더 동작원리 분석

http://embedded.dankook.ac.kr/~baeksj/course/2009_Project2/LN_2_Bootloader.pdf


[Uboot] u-boot.lds 파일 분석 -이솝사이트 펌- 

http://blog.naver.com/rainofsoul81/130109949043



## 리눅스 부팅 관련 ###

리눅스 부팅 프로세스 연구 2

http://blog.naver.com/dicecorp/73064579


리눅스 SMP부팅 

http://blog.naver.com/snowgoddess/106184187


## Pandaboard 관련 ###

Pandaboard Omap Bootloader Project

http://www.omappedia.com/wiki/Bootloader_Project


u boot와 x loader의 관계

http://sol2man2diary.wordpress.com/2012/11/21/u-boot%EC%99%80-x-loader%EC%9D%98-%EA%B4%80%EA%B3%84/


U-Boot SPL framework becomes generic

http://www.emlinews.net/2012/10/u-boot-spl-framework-becomes-generic/


Virtualbox Ubuntu에서 adb devices 안잡힐 때

Posted in 개인/ㄴAndroid by

Virtualbox는 USB 2.0를 사용하기 위해선 Virtualbox Extension Pack을 설치해줘야한다.


https://www.virtualbox.org/wiki/Downloads

위 사이트에서 Oracle VM VirtualBox Extension Pack을 다운받는다.

Virtualbox 관리자를 실행시키고 파일-환경설정-확장에서 패키지 추가를 통해 다운받은 파일을 추가해준다.

그리고 해당 가상머신에서 설정-USB-USB 2.0 EHCI 컨트롤러 사용하기를 선택한 후 사용할 USB장치를 추가시켜주면 된다.


Install groc for Ubuntu

Posted in 개인/ㄴLinux by

우분투에서 소스코드 문서화 도구인 groc를 설치해보자


# 필요 : Node.js, Pygments


1. Node.js 설치

  A. http://www.nodejs.org/ 에서 다운로드 후 압축해제

  B. $ ./configure

  C. $ make

  D. $ sudo make install


2. Pygments 설치

  $ sudo apt-get install python-pygments


3. groc 설치

  $ npm install -g groc


참고사이트 : 

http://mobicon.tistory.com/231

http://blog.outsider.ne.kr/907

Prize 한글 CSS

Posted in Information by

'NanumMyeongjoOTFExtraBold.swf' - Body

'AritaB.swf' - Head

'NanumGothicBold.swf' - Strong

리눅스 하드 추가하기

Posted in 개인/ㄴLinux by

# 새로 추가된 하드가 sdb라고 가정


1. 새로운 하드가 올바르게 추가 되었는지 확인

  $ sudo fdisk -l


2. 파티션 할당하기

  $ sudo fdisk /dev/sdb

  Command (m for help) : n <새 파티션 추가>

  Partition number (1-4): 1 <1번 파티션>

  First sylinder, List cylinder : ENTER를 두번 눌러준다 <둘다 DEFAULT로 설정>

  Command (m for help) : w <파티션 테이블 저장>


3. 파티션 포맷

  $ sudo mkfs.ext4 /dev/sdb1


4. 자동 마운트 설정

 UUID 확인 : $ - ls -l /dev/disk/by-uuid/

  $ sudo vi /etc/fstab

  입력 : UUID=[위 하드의 UUID입력] [마운트 할 폴더] ext4 defaults 0 0


5. REBOOT


6. 새로추가된 하드에 일반계정 쓰기권한을 추가

  $ sudo chown -R [계정] [마운트 한 폴더]

  $ chmod +w [마운트 한 폴더]

Windows7 Internet Explorer 32bit 실행 안될 때

Posted in 카테고리 없음 by

어느날 부터인가 윈도우7에서 32비트 인터넷 익스플로러가 실행이 안됐습니다.

원인을 찾아보니 알약, V3로 안찾아지던 Malware 때문에 그랬더군요



다운로드 : http://windows.microsoft.com/ko-KR/windows/security-essentials-download

에서 마이크로소프트 시큐리티 에센셜을 다운받아 빠른검사로 Malware 제거 후 재부팅

재부팅 후 32비트 인터넷 익스플로러가 정상실행되는 것을 확인할 수 있습니다


Android JellyBean 4.2 Source Build

Posted in 개인/ㄴAndroid by

안드로이드 젤리빈 4.2 소스 빌드 컴파일 


소스 검색 및 빌드에 필요한 소프트웨어의 설치
$ sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z-dev libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown libxml2-utils python-software-properties xsltproc libx11-dev:i386 gcc-4.5 g++-4.5 gcc-4.5-multilib g++-4.5-multilib


libGL.so 심볼릭 링크 만들기
Emulator 용 빌드를 할 경우 필요합니다.
$ sudo ln -s libGL.so.1 /usr/lib/i386-linux-gnu/mesa/libGL.so
$ sudo ln -s mesa/libGL.so /usr/lib/i386-linux-gnu/libGL.so

JDK6 설치
$ sudo add-apt-repository ppa:webupd8team/java
$ sudo apt-get update
$ sudo apt-get install oracle-java6-installer (oracle-java7-installer)

USB 설정
# Android 단말과 PC를 연결하기 위한 설정
$ sudo vi /etc/udev/rules.d/51-android.rules

# 51-android.rules에 아래 내용을 기입
SUBSYSTEM=="usb", ATTRS{idVendor}=="####:####", SYMLINK+="android_adb", MODE="0666" GROUP="plugdev"
TEST=="/var/run/ConsoleKit/database", RUN+="udev-acl --action=$env{action} --device=$env{DEVNAME}"

# udev를 다시 실행한다
sudo /etc/init.d/udev restart

repo 설정
$ mkdir ~/bin
$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo > ~/bin/repo
$ chmod a+x ~/bin/repo

#repo 경로설정
$ vi ~/.bashrc
export PATH=$PATH:~/bin < - 기입
$ source ~/.bashrc

AOSP에서 Android 소스 코드 다운로드
# 작업 폴더 만들기
$ mkdir ~/jellyBean
$ export ANDROID_ROOT=~/jellyBean

# android-4.2.1_r1의 소스를 다운로드
$ cd $ANDROID_ROOT
$ repo init -u https://android.googlesource.com/platform/manifest android-4.2.1_r1
$ repo sync -j4

Android 소스 코드 빌드
$ cd $ANDROID_ROOT 
$ source build/envsetup.sh 
$ lunch full-eng
$ make -j4