embeded/AVR (ATmega,ATtiny)2008. 11. 18. 00:15

AVR Studio 에서는 상당 부분이 자동으로 생성된다. (source가 아니라 makefile)
AVR 프로그래밍 처음 단계는 아마도
#include <avr/io.h>가 아닐까 싶은데 이부분을 추적을 해 보았다.

makefile - 자동생성

MCU 에 AVR Studio에서 프로젝트 생성시 선택된 프로세서의 타입이 지정되고
아래의 COMMON 에 -mmcu=atmega128 로 확장이 된다. 일단 avr-gcc의 도움말을 보자면

Usage: avr-gcc [options] file...
Options:
  -pass-exit-codes         Exit with highest error code from a phase
  --help                   Display this information
  --target-help            Display target specific command line options
  --help={target|optimizers|warnings|undocumented|params}[,{[^]joined|[^]separate}]
                           Display specific types of command line options
  (Use '-v --help' to display command line options of sub-processes)
  -dumpspecs               Display all of the built in spec strings
  -dumpversion             Display the version of the compiler
  -dumpmachine             Display the compiler's target processor
  -print-search-dirs       Display the directories in the compiler's search path

  -print-libgcc-file-name  Display the name of the compiler's companion library
  -print-file-name=<lib>   Display the full path to library <lib>
  -print-prog-name=<prog>  Display the full path to compiler component <prog>
  -print-multi-directory   Display the root directory for versions of libgcc
  -print-multi-lib         Display the mapping between command line options and
                           multiple library search directories
  -print-multi-os-directory Display the relative path to OS libraries
  -print-sysroot-headers-suffix Display the sysroot suffix used to find headers
  -Wa,<options>            Pass comma-separated <options> on to the assembler
  -Wp,<options>            Pass comma-separated <options> on to the preprocessor

  -Wl,<options>            Pass comma-separated <options> on to the linker
  -Xassembler <arg>        Pass <arg> on to the assembler
  -Xpreprocessor <arg>     Pass <arg> on to the preprocessor
  -Xlinker <arg>           Pass <arg> on to the linker
  -combine                 Pass multiple source files to compiler at once
  -save-temps              Do not delete intermediate files
  -pipe                    Use pipes rather than intermediate files
  -time                    Time the execution of each subprocess
  -specs=<file>            Override built-in specs with the contents of <file>
  -std=<standard>          Assume that the input sources are for <standard>
  --sysroot=<directory>    Use <directory> as the root directory for headers
                           and libraries
  -B <directory>           Add <directory> to the compiler's search paths
  -b <machine>             Run gcc for target <machine>, if installed
  -V <version>             Run gcc version number <version>, if installed
  -v                       Display the programs invoked by the compiler
  -###                     Like -v but options quoted and commands not executed
  -E                       Preprocess only; do not compile, assemble or link
  -S                       Compile only; do not assemble or link
  -c                       Compile and assemble, but do not link
  -o <file>                Place the output into <file>
  -x <language>            Specify the language of the following input files
                           Permissible languages include: c c++ assembler none
                           'none' means revert to the default behavior of
                           guessing the language based on the file's extension

Options starting with -g, -f, -m, -O, -W, or --param are automatically
 passed on to the various sub-processes invoked by avr-gcc.  In order to pass
 other options on to these processes the -W<letter> options must be used.

For bug reporting instructions, please see:
<URL:http://sourceforge.net/tracker/?atid=520074&group_id=68108&func=browse>.

-m 의 경우 avr-gcc 에 의해서 생성된 하위 프로세서로 자동적으로 넘겨져서 처리가 된다고 한다.
아무튼 처음에 설정하는 <avr/io.h> 는 컴파일러의 include 디렉토리에 위치하는데
기본값으로 설치를 했다면 아래의 경로에 위치하게 된다.


이 파일들 중에서 우리가 보고 싶은것은 io.h 인데 이 파일을 열어 보면


와 같이 #if #elif 로 묶여 있고 그 중에 우리가 찾던
__AVR_ATmega128__ 이라는 선언이 존재 한다. 아마도 -mmcu=atmega128이 이런식으로 치환이 되는 듯 하다.


아무튼 치환될 iom128.h 파일을 열어 보면 우리가 사용하는 일반적인 용어(!) 인
PINA DDRA 등의 선언과 그 에 상응하는 주소를 볼 수 있다.
Posted by 구차니
프로그램 사용2008. 11. 17. 10:32
1. frhed [http://www.kibria.de/frhed.html]

hex edtior 입니다.
pc tools 시대를 사신분들은 익숙한 출력을 보실 수 있습니다.


장점으로는
1. Endian 에 따른 값 출력
아래 부분에 ANSI/OVR/L 부분에서 L을 클릭하면 Little Endian 과 Big Endian으로 변환된 값들을 출력하며
아래에서는 상태바 중앙의 "Unsigned : B:77,W:23117,,L:9460301" 부분이 현재 상태 Little Endian에 따른 값 입니다.
현재 클릭된 부분으로 부터 1,2,4 바이트를 잘라 각각의 값을 보여 주는데,
이 기종간 Endian이 다를 경우에는 상당히 유용한 기능입니다.

2. 완전 무료
홈페이지의 글 일부를 끌어 오자면 어떠한 상황에서도 무료로 사용할수 있다고 명시 되어 있습니다.

Using and distributing frhed

    Frhed may be freely used for any purpose. You may use it privately or in the course of your work; there is no fee, and no registration is required. You may distribute it to anyone, and you may place it on any archive or bulletin board system. You may not charge anyone for it other than a reasonable fee to cover your distribution costs. Normally, you should distribute frhed in the form as supplied by the author; however, you may repackage it to suit the conventions and needs of an archive or bulletin board system. Frhed may be distributed as part of any commercial product without a prior licence agreement, although no extra cost should be charged for inclusion of frhed. Frhed may be reviewed for any publication, whether in hard copy or electronic form, without the author's prior permission.




2. cutePDF writer [http://www.cutepdf.com/Products/CutePDF/writer.asp]
PDF로 변환할때, 정품인 Acrobat은 가격 부담이 되므로, 간단하게 pdf로 변환해서 사용하는데 유용한 프로그램입니다.
가상 프린터로 설치가 되며, 출력시 CutePDF Writer로 출력을 하면 아래와 같이 저장할 pdf 이름을 물어 보고,
이 이름으로 pdf 파일을 생성해 줍니다.



이 제품 역시 GPL로 상업적으로도 무료 사용이 가능합니다.
 Portable Document Format (PDF) is the de facto standard for the secure and reliable distribution and exchange of electronic documents and forms around the world.  CutePDF Writer (formerly CutePDF Printer) is the free version of commercial PDF creation software. CutePDF Writer installs itself as a "printer subsystem". This enables virtually any Windows applications (must be able to print) to create professional quality PDF documents - with just a push of a button!
 
FREE for commercial and non-commercial use!  No watermarks!  No Popup Web Ads!

약간의 단점으로는, 생성된 pdf 파일은 드래그 하여 복사 할경우 문장이 제대로 생성이 되지 않는 다는 문제가 있습니다.
단순하게 pdf 출력용으로만 쓰시기 바랍니다. 아래 사진을 보시면 아시겠지만, 타이틀을 드래그 했는데
엉뚱한 영역까지 선택이 된것을 보실 수 있습니다.

Posted by 구차니
프로그램 사용2008. 11. 16. 19:11
현재 노트북과 집에서 사용중인 국산 '완전무료' 프로그램 입니다.


1. 빵집 [http://www.bkyang.com/]


일단 기업 / 일반 사용자도 모두 무료로 사용할 수 있는 프로그램입니다.
개인적으로는 '새 폴더' 기능과 '알아서 풀기' 기능 두가지 때문에 사용하고 있습니다.
알 시리즈는 증오 하는 이유도 있지만, context-menu의 경우 알집에서는 모든 경로를 다 출력하기 때문에
지저분해 보이기 때문에 빵집의 깔끔한 '알아서 풀기'를 좋아합니다.


오른쪽 클릭시 나타나는 메뉴로 여기에 풀기 / 알아서 풀기가 있는데
알아서 풀기를 할경우, 압축이 디렉토리를 포함해서 하면 여기에 풀기로 풀리고,
위의 예처럼 디렉토리가 여러가지가 있으면, 파일 이름으로 디렉토리 생성 후 그 안에 풀게 됩니다.


2. Acroedit [http://www.acrosoft.pe.kr/]


국내 제작, 공개 소프트 웨어 입니다. 빵집과 같이 기업에서도 무료로 사용이 가능합니다.
프로그래머의 입장으로 이 프로그램의 장점은,
Araxis에 비하면 조금은 부족하지만 그래도 무료 Diff 프로그램이 내장 되어 있다는 점과
ASCII 표가 내장되어 있다는 점입니다. 부가적으로는 괄호 추적기능이 상당히 매력적입니다
(아래의 사진에서 괄호의 경우 자동으로 앞뒤를 추적합니다)
단축키도 마음대로 설정이 가능하며, ctags를 이용하여 함수 목록을 볼수 있고,
사용자 Syntax coloring을 지원하여 원하는 색상대로 설정이 가능합니다.

외부 프로그램 연결도 가능해서 자바 컴파일러나 다른 컴파일러와 연동하여 작업도 가능합니다.
윈도우 오른쪽 클릭시 'Acroedit으로 편집'을 지원하며 실행속도 역시 매우 빠른 편입니다.



Posted by 구차니

아랍어의 특징

아랍어는 오른쪽에서 왼쪽으로 씁니다. 획 역시 오른쪽 상단에서 좌측 하단으로 이어지게 됩니다.

한글의 초성/중성/종성과는 다르지만 이전 문자에 따라서 다음 문자의 모양이 달라지는 방식입니다.

그리고 삭제시에도 백스페이스와 delete키가 반대로 적용되는 듯하게 보입니다.

 

윈도우즈 폰트

Arial
Tahoma
Times New Roman
Courier New
Microsoft Sans Serif

에 아랍어 폰트가 내장 되어 있습니다.

[출처 : http://mwultong.blogspot.com/2006/08/arabic-fonts.html]

 

아랍어 조합방법



아랍어는 단독형 /  처음형 / 가운데형 / 말끝형 총 4가지의 자소로 구성되며 일부자소에는 단독형과 말끝형 만 존재합니다.

발음은 모르겠지만.. 아무튼 아랍어 글자 하나가 네가지 형태로 사용되는 것이고,

가장 위의 0x0635(0xFEB9)가 단독형

그 아래의 0xFEBA가 말끝형

그 아래의 0xFEBB가 처음형

그 아래의 0xFEBC가 가운데형 입니다.

모양을 보시면 아시겠지만,  처음형은 오른쪽 끝이 깔끔하고

중간형은 앞뒤로 이어지는 꼬리가 달렸고

말끝형은 오른족 앞에 꼬리가 달렸습니다.

4가지 형이 다 있는 문자가 아닌 경우에는

단순하게 처음형 / 가운데형만 존재하고,

처음형으로 처음형과, 단독형

가운데형으로 가운데형과, 말끝형에 사용합니다.


그리고 번지가 두개인 이유는 앞의 0x0600 번대의 데이터만 사용하고, 0xFE00대의 데이터는

실제로 전송되는것이 아니라 문자를 조합하는데 사용하기 위한 문자코드 입니다.

위에 표시된 부분에서는 단독형의 코드만 존재하고, 앞뒤로는 다른 문자입니다.

즉, 유니코드상으로 0x0600 대의 데이터를 받아서 내부적으로 0xFE00 의 데이터로 변환하여 출력을 해주시면 되겠습니다.

 

그리고 예외 사항으로 분리 문자라는 것이 존재 합니다.

ا

د

ذ

ر

ز

و

이전 문자가 2가지 형만 있는 자소일 경우 분리문자가 되며,

(이 부분은 확실하지 않습니다. 위의 6개만인지는 좀더 확인해보고 수정하겠습니다)

분리문자일 경우에는 이어지는 다음 문자가 가운데형을 쓰는대신 처음형을 써주어야 합니다.

 

다른 예외 사항으로

두가지 문자가 조합되어 생성되는 자소 뒤에도 가운데 형을 써야 하는 경우에도 처음형을 써주어야 합니다.

 

그 실례로

ل ا

가 있으며, 두녀석이 연달아서 나타나면

이 되는것이 아니라

لا

이 됩니다.

 

 

[참고서적  : 알기쉬운 아랍어 입문 /김종도 감수/ 명지출판사, 실용아랍어 / 황의갑,한덕규 지음 / 혜안]

'모종의 음모 > 아랍어 오토마타' 카테고리의 다른 글

유니코드 아랍어 오토마타  (8) 2009.03.05
Posted by 구차니
프로그램 사용2008. 11. 12. 17:35
2003을 사랑하는 나로서는.. 2007의 새로운 인터페이스는 상당히 난해한데..
일단 이미지를 투명하게 하는 기능을 한참을 찾게 만드는 인터페이스는 인터페이스로서 실격이라고 생각이 된다.




예전에는 별도의 툴바나 이미지 툴바에서 아이콘이 있었는데 2007은 다시 칠하기에 숨겨져 있다.
Posted by 구차니
Linux2008. 11. 10. 15:11
리눅스에서 파일을 완전 소거 하는 방법이 필요 해서 검색을 해봤더니
sourceforge project로 SRM이라는 것이 발견 되었다.

rpm 버전이 있는지는 모르겠고,
make install로 설치를 하도록 되어 있다.

 srm(1)                                                                  srm(1)

NAME
       srm - securely remove files or directories

SYNOPSIS
       srm [OPTION]... FILE...

DESCRIPTION
       srm  removes each specified file by overwriting, renaming, and truncat-
       ing it before unlinking. This prevents other people from undeleting  or
       recovering  any  information  about  the file from the command line. By
       default srm uses 35 passes to overwrite the file?셲  contents.  If  this
       seems  overkill  you  can  use  use  the --dod or --openbsd or --simple
       option which use less passes.

       srm, like every program that uses the  getopt  function  to  parse  its
       arguments,  lets  you  use the -- option to indicate that all following
       arguments are non-options.  To remove a file called ??f??in the current
       directory, you could type either
              rm -- -f
       or
              rm ./-f

OPTIONS
       Remove (unlink) the FILE(s).

       -d, --directory
              ignored (for compatability with rm(1))

       -f, --force
              ignore nonexistent files, never prompt

       -i, --interactive
              prompt before any removal

       -r, -R, --recursive
              remove the contents of directories recursively

       -s, --simple
              only overwrite the file with a single pass of random data

       -P, --openbsd
              OpenBSD  compatible  rm. Overwrite regular files before deleting
              them.  Files are overwritten three times, first  with  the  byte
              pattern  0xff,  then  0x00, and then 0xff again, before they are
              deleted.  Files with multiple links will  be  unlinked  but  not
              overwritten.

       -D, --dod
              Dod compliant 7-pass overwrite.

       -v, --verbose
              explain what is being done

       -h, --help
              display this help and exit

       -V, --version
              output version information and exit

NOTES
       srm can not remove write protected files owned by another user, regard-
       less of the permissions on the directory containing the file.

       Development and discussion of srm  is  carried  out  at
       http://source-forge.net/project/?group_id=3297   which   is   also   accessible   via
       http://srm.sourceforge.net.

SEE ALSO
       rm(1)

Matt Gauthier                        1.2.9                              srm(1)


윈도우용 완전 소거 프로그램과 비슷하게
소거 알고리즘에 의해서 7pass / 35pass으로 삭제 하며, 기본값은 35pass 라고 되어 있다.

[주소 : http://srm.sourceforge.net/]

----
2011.10.24 추가
우분투에서는 secure-delete 패키지로 존재한다. 
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2008. 11. 10. 00:21
요즘에는 대부분의 메인보드에 USB만 있을뿐 LPT(패러럴)나 COM(시리얼)이 없는 경우도 상당히 많다.
하지만 AVR을 프로그래밍 하려면 롬 라이터가 있어야 하는데,
이 장비의 경우 고가인데다가, 칩의 핀수에 맞는 커넥터를 구매 하여야 한다.

그런 이유로 현실적인 대안은 USB 시리얼/패러럴이나
시리얼 / 패러럴이 달린 구형 메인보드, 혹은 최상급의 메인보드를 구매 해야 한다.

그렇다고 하기에는 이래저래 돈이 많이 드는 관계로 조금이라도 덜 들고 편한쪽을 택하라면
USB ISP를 구매 하는게 좋을듯 하다.

유니텍의 경우 패러럴 포트를 내부에 26핀으로 별도로 꺼내서 유니텍에서 별도 판매 하는
패러럴 포트를 구매 하면 되지만, 이래저래 가격 부담도 크고, 유니텍스럽게 택배비는 착불이라서 기분도 나쁘고
그냥 USB ISP를 사는게 가장 효율적인 방안으로 생각이 된다.


---
나머지는 구매 후 적도록 ^^;
STK-500 이라는 것과 호환이 되고, USB-ISP 역시 일종의 USB 시리얼로 COM포트로 인식하고
(보드는 USB 시리얼 + STK500 제어용 칩으로 구성) 시리얼로 프로그램을 전송한다.
데이터 시트 상으로는 시리얼 프로그래밍에 관한 항목이 있으므로 이부분을 좀더 읽어 봐야 할 듯 하다.
Posted by 구차니
개소리 왈왈2008. 11. 9. 23:20
내가 컴퓨터라면
아주 드물게 발생하는 Kernel Panic이 이런 느낌일까? 라는 생각을 해본다.
그냥 머리가 백지가 되는 느낌.
아무런 것도 하고 싶지 않고
아무런 것도 손에 잡히지 않는 그런 상태.

커널 패닉은 완전 죽어 버리니까 다른 문제일지도 모르지만,
인간이란게 컴퓨터보다는 100만배 똑똑해서 해결 못하고 죽지 않을뿐
비슷한건 아닐까 생각이 든다.

지금 11:20분 자전거를 타고 머리를 식히는게 나을까 머가 나을까 후우..
Posted by 구차니
embeded/AVR (ATmega,ATtiny)2008. 11. 7. 23:05
결론 : 실패
원인 : 아직 모름..

일단 Ponyprog에서 포트 자동 탐지를 끄라고 한다.
  • PonyProg2000 (Freeware programmer esp. for PIC, ATmega, serial EEPROMs)
    • The INI file must be modified to get PonyProg to work: change „AutoDetectPorts=NO“!

[출처 : http://www-user.tu-chemnitz.de/~heha/bastelecke/Rund%20um%20den%20PC/USB2LPT/liste.htm.en]

일단 ponyprog.ini의 내용은 아래와 같다.



그리고 나서 해보니 먼가 되는듯한데.. 여전히 -16오류, 장치를 발견하지 못한다고 한다.
그래서 계속 검색을 해보니.. 그런 이유로 USB ISP가 나온거라는 식으로 되어 있어서 좌절 OTL

USB LPT / 도킹 전부 임베디드 장비에서 패러럴이 아닌 프린트 포트로 인식을 해서 안된대나..
일부 외국산 장비중에는 인식하는것도 있지만 강원전자꺼는 드라이버 문제인지 안된다고 한다.

[링크 : http://kldp.org/node/46808]
Posted by 구차니
Linux/Fedora Core2008. 11. 7. 12:15
생각을 해보니.. 회사 서버랑은 Fedora Core 8 이었는데..
일단 조금은더 Ubuntu 스러워졌다.(욕아님)

일단 보안 강화를 위해서 Gnome 자체에서 권한을 상당히 자주 물어 보게 되고,
X-windows 로그인시 Root로 로그인을 할 수 없다.(LiveCD에서 이미 겪었었지만..
실제 Live가 아닌 것에도 적용이 될줄이야 ㄱ-)

결정적으로 SCIM이 없다(다국어 입력기). 한글로 설정하면 한글은 잘나오는데 입력할 방법이 없다 ㄱ-

검색을 해보니 SCIM으로는 linux 네이트온 한글 입력이 안된다고 하는데
nabi 라는 녀석을 추천해 주던데 이녀석은 libhangul.so 종속성 땜시 이것저것 요청해서 귀차니즘.



결론 : 리눅스는 역시.. gcc 없으면 단팥없는 호빵.. 프로그램 설치를 위해서라도 반드시 gcc가 필요 하다
결론2 : 그러니까 오늘 다시 포맷 OTL 덤으로 윈도우로 파티션 조정? ㅠ.ㅠ
Posted by 구차니