Windows7 Ubuntu UEFI방식으로 멀티부팅 설정

Posted in 개인/ㄴLinux by

LG zd360-GK60k를 구매하고 나서 듀얼부팅을 위해 windows7과 ubuntu를 파티션을 각각 나누어 설치하였다. 윈도우를 설치하고, ubuntu를 설치하면 grub로 들어가야 하는데 자동으로 윈도우 부팅만 되는 것이었다. 리눅스 mbr섹터를 복사하기 위해 라이브 우분투모드로 들어가 리눅스 파티션의 512k섹터를 읽어오고 이것을 bcdedit을 사용하여 ubuntu항목을 등록했지만, 부팅하면 커서만 깜빡이는 현상이 발생했다. 알고보니 바이오스가 UEFI방식으로 바뀌면서 이것에 맞게끔 설정을 해줘야 멀티부팅이 가능하다.


## 설정 순서
0. 바이오스 설정 advanced - UEFI Boot : Enabled, Legacy OS Boot : Disabled
1. Ubuntu USB로  Ubuntu 설치(Ubuntu12.04 LTS 지우고 다시 설치 항목 선택)
2. 그러면 UEFI방식으로 드라이버 잡고 gpt테이블로 구성해놓음
3. 다시 Ubuntu USB로 부팅하여 기타항목으로 들어가서 efi영역을 두고 ext4, swap 파티션을 삭제 후 재구성(이 때 사용할 용량으로 설정)
4. 재구성한 ext4파티션에 Ubuntu 재설치, 부트위치는 현재 하디드스크(sdaX가 아닌 sda)
5. Windows7 USB(UEFI방식)으로 생성 - fat32방식으로 해줘야 한다.(그러므로 xDark같은 이미지 파일은 사용할 수 없음)
6. UEFI Windows7 생성 방법은 아래 블로그 참조
7. Windows7 USB로 부팅하여 마지막 파티션에 윈도우를 설치해주자

UEFI방식의 USB로 윈도우를 먼저 설치한 후 우분투를 설치해도 상관없다.


## UEFI 방식으로 USB 디스크 생성
http://sungliky.blogspot.kr/2012/10/ubuntu-thinkpad-e320-1298-rk9-7-1.html


## XCopy 매개변수가 틀립니다 오류 시
xcopy f: h: /s /e     ->      xcopy f:* h: /s /e
위와 같은 식으로 *을 붙여서 해결하였다.


## Ubuntu USB 설치
http://deviantcj.tistory.com/473


## 윈도우 관리자를 이용한 듀얼부팅 설정
http://forlov3u.blog.me/20150375155


## 윈도우7 시스템 예약파티션 제거
http://snoopybox.co.kr/902
http://coolpunch.tistory.com/288



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()