Linux2010. 1. 7. 14:07

허전해서 붙이긴 했지만. 안드로메다 언어라 이해는 못하고.. (먼산)
이른대로 Filesystem을 Userspace에서 구현을 한다는 것이다.

일단, ntfs-3g 라는 ntfs 드라이버가 이 녀석을 사용하고,
그로 인해서 kernel에서 Filesystem in userspace support 를 켜주어야 했다.

[링크 : http://fuse.sourceforge.net/]
[링크 : http://en.wikipedia.org/wiki/Filesystem_in_Userspace]
Posted by 구차니
서울시의 제설장비/인원이 부족해서 시민들에게
눈을 치우도록 책임을 떠밀어 놓고는 안하면 벌금이라..


웃기지 않아?


그럼 치우면 상금을 주던가.
아니면 세금 면제를 해주던가.

그것도 아니면 그냥 벌금이라고 하지말고, 동참하는 분위기만 만들던가


[링크 : http://media.daum.net/society/view.html?cateid=1067&newsid=20100107115124763&p=nocut]

'개소리 왈왈 > 정치관련 신세한탄' 카테고리의 다른 글

출근일기 - 20100127  (4) 2010.01.27
공인인증서 하드에 저장 못하게 하면?  (0) 2010.01.15
12월 12일  (0) 2009.12.12
통신사 낙시질!  (2) 2009.12.07
기차표가 달라졌어요!  (4) 2009.12.06
Posted by 구차니
타이머는 처음인데.. 머가 먼지 모르겠다 ㅠ.ㅠ
#include "stdio.h"
#include "avr/io.h"
#include "avr/interrupt.h"
#include "util/delay.h"

static int uart_putchar(char c, FILE *stream);
static FILE mystdout = FDEV_SETUP_STREAM(uart_putchar, NULL, _FDEV_SETUP_WRITE);

static int uart_putchar(char c, FILE *stream)
{
  if (c == '\n') uart_putchar('\r', stream);
  loop_until_bit_is_set(UCSR0A, UDRE);
  UDR0 = c;

  return 0;
}

#define OVERFLOW 256
#define TICKS_PER_SEC 1000
#define Prescaler 64

volatile unsigned int tic_time;

ISR(TIMER0_OVF_vect)
{
	tic_time++;
	TCNT0 = OVERFLOW - (F_CPU / TICKS_PER_SEC / Prescaler);
}

int main(void)
{
	/* for USART */
	UBRR0H = 0;
	UBRR0L = 8; // 115k with U2X = 0
	UCSR0A = 0x00; // U2X = 0;
	UCSR0B = 0xD8;
	UCSR0C = 0x06; //Asyncronous - no parity - 1bits(stop) - 8bits(data)

	DDRD = 0x00;

	stdout = &mystdout;

	TCCR0 = 0x04;     // Prescaler 설정
	TCNT0 = OVERFLOW - (F_CPU / TICKS_PER_SEC / Prescaler);// 오버플로우에 사용될 초기값
	TIMSK = 0x01;     // 오버플로우 인터럽트 허용
	sei();

	int count = 0;
	for(;;)
	{
		if(tic_time == 1000)
		{
			tic_time = 0;
			printf("c %d\n",count++);
		}
	}
    return 0;
}
일단 사용법을 몰라서. 구글 검색하다 나온 rcan 님의 블로그 내용을 일단 복사해서 붙여넣었다.
[링크 : http://rcan.net/560]


기본적인 내용은 printf() 사용하는 것들이고, F_CPU는 cpu 클럭에 관한 선언문으로
AVRStudio wizard 사용시 클럭을 넣어주면 생성되는 변수이다.

타이머 관련 내용은 다음과 같다.

ISR(TIMER0_OVF_vect) // 8bit Timer0 에 대한 인터럽트 루틴
TCCR0;             // 타이머 프리스케일러
TCNT0;             // 타이머/타운터용 초기값
TIMSK;              // 타이머 오버플로우시 인터럽트 발생

일단 TCCR0를 보자면


타이머/카운터 제어용 레지스터로서,

Bit 7 – FOC0: Force Output Compare
Bit 6, 3 – WGM01:0: Waveform Generation Mode
Bit 5:4 – COM01:0: Compare Match Output Mode
Bit 2:0 – CS02:0: Clock Select

에 대한 설정을 하게 된다.

TCCR0 = 0x04 에서 0은 WGM01:0=0 으로 아래의 테이블을 보면(엄밀하게는 0x48 값의 위치이다)
Timer/Counter Mode of OperationNormal로 되어있다.

이 모드에서는 0에서 부터 255까지(8bit 타이머) 증가하며,
별도의 카운터 값 리셋은 하지 않으나 오버플로우 된상태로 계속 더하므로,
실질적으로 255다음에 0부터 계속 증가하게 된다. (TCNT0는 수정하는 즉시 그 값부터 증가하게 됨)


TCCR0 = 0x04 에서 4는 CS02=1로 아래의 테이블을 보면
clkT0S/64 (From prescaler) 라고 되어있다. 즉, 입력 클럭을 64로 나누어서 느긋하게 증가시킨다.




그리고 TCNT0
카운트를 위한 변수이고, 8bit timer/counter 이므로 0x00 에서 0xFF 즉, 0 에서 255 값을 가지며
255가 되면 overflow interrupt를 발생시킨후 0부터 다시 숫자를 증가시킨다. (normal mode)

그런데 이 변수에 복잡한 수식으로 값을 넣는 이유는 정확한 시간을 발생하기 위해서이다.
클럭마다 다르겠지만, 일단 클럭을 위에서 1/64로 주므로 64 clock 마다 1씩 증가된다.
16Mhz 에서 64clock 마다 인터럽트를 생성하면(F_CPU / Prescaler) 1초에 250,000 번 발생하게 되고
이 오버플로우 갯수를 세어 1000번을 묶으면 (tic_time == 1000 그리고 F_CPU / TICKS_PER_SEC / Prescaler)
1초에 250번의 오버플로우가 발생하게 된다.
그런데 오버플로우 값은 255 까지(총 256) 이므로, 0부터 증가해서 255까지 timer를 증가시키면
1초가 맞지 않게 되므로, TCNT0의 값을 OVERFLOW - 250 으로 하여 초기값을 맞춰주게 된다.
결과적으로 TCNT0의 값은 6이 된다.
(음.. OVERFLOW가 255여야 하지 않을려나..)



그리고 TIMSK는 이름대로 타이머 인터럽트 마스크 레지스터로,

Bit 1 – OCIE0: Timer/Counter0 Output Compare Match Interrupt Enable
Bit 0 – TOIE0: Timer/Counter0 Overflow Interrupt Enable

오버플로우시에 인터럽트를 발생시키거나
OCR0(Output Compare Register) 값과 TCNT0의 값이 동일할때 인터럽트를 발생시키도록 설정한다.

TIMSK = 0x01; 이므로 TOIE0가 설정되었고, 이 값은 overflow 시에만 인터럽트를 발생시키도록 한다.


Posted by 구차니
파일방2010. 1. 6. 22:03

좋다기 보다는.. 내가 워낙 정리 안하고 산걸지도..

[링크 : http://www.ccleaner.com/]
[링크 : http://www.ccleaner.com/download/downloading] << 다운로드
Posted by 구차니
임베디드 개발하다보면, 크로스 컴파일은 밥먹듯 하는데..
가끔 황당한 오류가 바로 ld 관련 오류이다.

ntfs_3g_usermap-usermap.o: could not read symbols: File in wrong format
collect2: ld returned 1 exit status
make[2]: *** [ntfs-3g.usermap] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

이녀석은 ntfs-3g 라는 녀석인데, 크로스 컴파일을 하려니 이러한 오류가 발생했다.
조금은 뜬금없기도 하고, 옵션도 문제가 없는데 왜 이러냐면은..


원인 : 크로스 컴파일 이전에 컴파일 되는지 확인하기 위해 호스트에서(i686-linux) 컴파일을 이미 했기 때문!
해결 : 머. make clean 한번 하고 ./configure 다시 해주고..

결론 : 잊지말자 make clean!



사족 : File in wrong format 인건, 당연히 링커가 아키텍쳐가 다른 파일을 조작하려 하니 포맷을 알리가 ㅋㅋ
         이런 경우에는 갸우뚱 하지 말고 make clean 하고 다시 컴파일 하는게 상책이다.

'프로그램 사용 > 실패기' 카테고리의 다른 글

svn+ssh 사용하도록 설정 실패  (0) 2009.05.10
xgprof - gnome based gprof GUI frontend  (0) 2009.04.27
ponyprog FC9에서 실행 실패 / avrdude 실패  (0) 2009.04.20
kscope OTL  (0) 2009.04.20
Posted by 구차니
Linux2010. 1. 6. 13:54
음.. NTFS 드라이버라는데
신기하게(?)도 리부팅 없이, FC6 에서 바로 사용이 가능하다.

특이하게(?)도 FS는 mount 후에 fuseblk로 인식한다.

# mount -t ntfs-3g /dev/sda1 /mnt/old
# mount
/dev/hda5 on / type ext3 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
/dev/hda1 on /boot type ext3 (rw)
tmpfs on /dev/shm type tmpfs (rw)
/dev/hda3 on /var type ext3 (rw)
/dev/hdb on /home/samba type ext3 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
/dev/sda1 on /mnt/old type fuseblk (rw,allow_other,blksize=4096)

Stable Source Release 2009.11.14 << 소스 다운로드

[링크 : http://www.tuxera.com/community/ntfs-3g-download/]


Can I use NTFS-3G on Linux 2.4 kernels?

Yes. You need to use NTFS-3G 1.2506 or later and the FUSE kernel module from the FUSE 2.5.3 package. Please see more details in the FUSE README file.

[링크 : http://www.tuxera.com/community/ntfs-3g-faq/#kernel24]

Posted by 구차니
분류가 모호한 글2010. 1. 6. 11:43
Adaptive Multi-Rate (AMR)
Filename extension .amr
Internet media type audio/amr, audio/3gpp, audio/3gpp2
Type of format

확장자는 gpp, 3gpp 등으로, 유튜브의 모바일 페이지를 열어보면
3gp라고 나오며 samr 코덱을 사용한다.

[링크 : http://en.wikipedia.org/wiki/Adaptive_Multi-Rate_audio_codec]

IMT-2000 / W-CDMA 에서 채택한 음성코덱, Adpative Multi Rate audio codec의 약자로
일종의 VBR과 비슷한 방식으로 음질을 향상시키는 것으로 보인다.

[링크 : http://k.daum.net/qna/openknowledge/view.html?qid=3Hhab]

'분류가 모호한 글' 카테고리의 다른 글

로케일(Locale)  (0) 2010.03.15
amr codec  (0) 2010.01.13
고편평도 타이어  (2) 2010.01.04
과냉각 / 유리  (0) 2010.01.03
아랍의 공휴일(일요일)  (6) 2009.12.11
Posted by 구차니
프로그램 사용/VLC2010. 1. 6. 11:26

http://m.youtube.com/ 에서 임의의 파일을 재생하려 하면
일단 rtsp 프로토콜에 연결된 프로그램이 없다고 오류가 발생한다.


그래서 VLC에서 재생하면 될 줄 알았더니..
오디오 코덱이 없어서 재생할수 없다고 오류를 발생한다.


[링크 : http://wiki.videolan.org/VLC_Features_Formats]

아무튼 VLC에 이 코덱이 없는건 아니지만, 법적인 문제로 이 코덱을 포함하지 못했으므로
소스를 받아 컴파일을 해서 써야 한다고 한다.
[링크 : http://forum.videolan.org/viewtopic.php?f=7&t=22318]

검색하다 보니 QuickTime 에서도 된다고 하는데,
rtsp 주소를 복사하는 바람에 안되는건지, 아무튼 최신버전을 깔아도 안된다.



20100113 추가
[링크 : http://ubuntuforums.org/showthread.php?t=178455]

'프로그램 사용 > VLC' 카테고리의 다른 글

VLC configure --help  (0) 2010.01.13
VLC로 웹캠 녹화하기  (4) 2010.01.12
VLC 웹 인터페이스 원격지에서 안될경우  (2) 2009.12.08
VLC를 이용한 웹캠보기  (0) 2009.12.02
VLC 네트워크 플레이 옵션  (4) 2009.11.25
Posted by 구차니
Programming/C Win32 MFC2010. 1. 6. 09:57
expat 글 보다가 무슨 말인지 몰라서 검색은 해봤는데 점점더 미궁으로 빠져드는 느낌이다 ㄱ-
일단은 call stack 관련 선언문이라는것 외에는 이해를 전혀 못하겠다 ㅠ.ㅠ

cdecl
    On the Intel 386, the cdecl attribute causes the compiler to assume that the calling function will pop off the stack space used to pass arguments. This is useful to override the effects of the -mrtd switch.
   
stdcall
    On the Intel 386, the stdcall attribute causes the compiler to assume that the called function will pop off the stack space used to pass arguments, unless it takes a variable number of arguments.
   
fastcall
    On the Intel 386, the fastcall attribute causes the compiler to pass the first two arguments in the registers ECX and EDX. Subsequent arguments are passed on the stack. The called function will pop the arguments off the stack. If the number of arguments is variable all arguments are pushed on the stack.

[링크 : http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html]

콜링 컨벤션(Calling convention)
MS방식은 5가지

__cdecl
__stdcall
__fastcall
thiscall
naked

[링크 : http://codesafe.tistory.com/94]

All arguments are widened to 32 bits when they are passed. Return values are also widened to 32 bits and returned in the EAX register, except for 8-byte structures, which are returned in the EDX:EAX register pair. Larger structures are returned in the EAX register as pointers to hidden return structures. Parameters are pushed onto the stack from right to left.

The compiler generates prolog and epilog code to save and restore the ESI, EDI, EBX, and EBP registers, if they are used in the function.

Note   When a struct, union, or class is returned from a function by value, all definitions of the type need to be the same, else the program may fail at runtime.

For information on how to define your own function prolog and epilog code, see Naked Function Calls.

The following calling conventions are supported by the Visual C/C++ compiler.

Keyword Stack cleanup Parameter passing
__cdecl Caller Pushes parameters on the stack, in reverse order (right to left)
__stdcall Callee Pushes parameters on the stack, in reverse order (right to left)
__fastcall Callee Stored in registers, then pushed on stack
thiscall
(not a keyword)
Callee Pushed on stack; this pointer stored in ECX

[링크 : http://msdn.microsoft.com/en-us/library/984x0h58%28VS.71%29.aspx]

[링크 : http://en.wikipedia.org/wiki/X86_calling_conventions]
Posted by 구차니
프로그램 사용2010. 1. 5. 10:58
웹브라우저에서 모든 영상과 이미지를 video wall 형식으로 보여주는 녀석이다.
윈도우용 Firefox와 IE를 지원한다.(크롬은 베타)

단점 : 한글지원 미흡 / 오프라인 사용불가 / 지원되는 홈페이지가 많지 않음 / 브라우저 지원폭이 좁음



아무튼 cooliris에 빠져 봅시다~!

^ 요녀석
Firefox 에서는 설치하면 검색탭 오른쪽에 런쳐 아이콘이 추가된다.
일단 이 아이콘을 눌러준다 쿡!


휠로 밀어서(위로) 줌아웃/ 휠로 땡겨서(아래) 줌인하면
위와 같이 미리보기 식으로 사용할수도 있다.


그중 하나의 이미지나 동영상을 더블 클릭하면 전체화면이나 동영상 재생이 시작된다.


왼쪽의 My Computer 탭을 이용하면 로컬 컴퓨터에 저장된
동영상/이미지를 wall 형식으로 볼 수 있다.(오프라인에서 사용불가)


좌우로 드래그 하거나 아래의 파란색 스크롤 바를 좌우로 움직이면
이런식으로 애니메이션 되어 연속적으로 볼수 있다.


파워 블로거들의 대세를 따라(?) 위의 검색을 youtube로 바꾸고 '소녀시대'로 검색한 화면
한글지원에 문제가 있는지, 한글이 보이지는 않지만 검색은 되어나온다.
(술은 먹었지만 운주운전은 아닌것과 같은 느낌 -ㅁ-)



cooliris.com 으로 IE에서 접속하니 IE에서도 사용 가능하단다!!


[링크 : https://addons.mozilla.org/ko/firefox/addon/5579] <- 파폭 유저
[링크 : http://www.cooliris.com/static/releases/cooliris-win-iefull-release-1.11.6.31225.en-US.msi] <- IE7,8 유저

[링크 : http://www.cooliris.com/product/?ref=start]
Posted by 구차니