프로그램 사용/u-boot2009. 7. 18. 13:09
u-boot/tools/env 에 있는 README 파일 번역입니다.

이것은 U-boot의 환경 변수를 읽어오는 리눅스 명령행 프로그램의 적용예제 입니다.

run-time 유틸리티 설정을 위해서 다음의 줄을 주석처리 합니다.
fw_env.h 파일의
    #define CONFIG_FILE  "/etc/fw_env.config"

특정 타겟 보드를 위한 define들은 fw_env.confg 파일의 주석을  보시기 바랍니다.

화경설정은 fw_env.h 파일의 #define들을 통해 할 수 있습니다.
아래의 내용을 수정하시면 됩니다.

    #define HAVE_REDUND     /* 환경변수 영역이 2개일 경우 */
    #define DEVICE1_NAME    "/dev/mtd1"
    #define DEVICE2_NAME    "/dev/mtd2"
    #define DEVICE1_OFFSET    0x0000
    #define ENV1_SIZE         0x4000
    #define DEVICE1_ESIZE     0x4000
    #define DEVICE2_OFFSET    0x0000
    #define ENV2_SIZE         0x4000
    #define DEVICE2_ESIZE     0x4000

현재의 설정은 TRAB 보드에 맞추어져 있습니다.

백업용 환경변수 영역을 사용하지 않는다면 HAVE_REFUND를 주석처리합니다.
HAVE_REDUND 가 주석처리 되면 DEVICE2_NAME, ENV2_SIZE, DEVICE2_ESIZE 를 무시합니다.

DEVICEx_NAME 에는 환경변수가 저장되어 있는 MTD 캐릭터 디바이스를 지정합니다.
DEVICEx_OFFSET 에는 MTD 캐릭터 디바이스 범위 안의 환경변수의 offset을 지정합니다.
ENVx_SIZE 에는 (만약에 환경변수가 하나의 섹터크기 보다 적다면 플래시 섹터보다 작은 값을 지닐) 환경변수에 의해 사용되는 크기를 지정합니다.
DEVICEx_ESIZE 환경변수가 위치하는 플래시 파티션의 첫 섹터의 크기를 지정합니다.


Posted by 구차니
프로그램 사용/Putty2009. 7. 18. 09:35

언제부터 있는 기능인지는 모르겠지만
Connection - Data 에
Login detailsAuto-login username 이라는 항목이 존재한다.
이 항목에 어쩌다가 id가 들어가게 되었는지는 모르겠지만..
SSH / Telnet 에서는 자동 로그인이 지원된다. (테스트 서버 버전 : Fedora Core 6)


Posted by 구차니
프로그램 사용2009. 7. 15. 20:31
트위터는 불편하다.
일각에서는 30세 이상을 위한 서비스라는 소문이 있을 정도로
젊은(!) 나로서는 쓰기가 매우 버겁다.

아무튼 pbtweet라는것을 써보려다가 GG 치다가 한번 용기를 내서 해보았다.


Step 1. 파이어폭스의 부가기능에 Greasemonkey를 검색하여 설치

Step 2. pbtweet 에서 Firefox greasemonkey용을 클릭하여 설치한다.
v1.4.8 for Firefox
pbtweet.user.js for Firefox 3.0 (for GreaseMonkey script)
Firefox version does not run animation. and some layout is broken. I strongly recommend to use pbtweet on Safari or Google Chrome.


Step 3. 트위터를 사용한다.

Step 4. 위의 방법이 불편하여 사용하기 싫으면 아래의 원숭이를 클릭한다.


[pbtweet : http://web.me.com/t_trace/pbtweet.html#install]
[Greasemonkey : https://addons.mozilla.org/ko/firefox/addon/748]
Posted by 구차니
프로그램 사용/libjpeg2009. 7. 14. 17:34
jpeg는 grayscale일 경우에는 무조건 흑백인 듯 하다.
(조금 더 확실하게 검색필요)

그런 이유로, 8bit color일 경우에는 팔레트가 NULL인지 아닌지 확인하고
NULL일 경우에는 팔레트를 만들어주면 된다.

wrbmp.c 파일을 참고 하자면
LOCAL(void)
write_colormap (j_decompress_ptr cinfo, bmp_dest_ptr dest,
		int map_colors, int map_entry_size)
{
  JSAMPARRAY colormap = cinfo->colormap;
  int num_colors = cinfo->actual_number_of_colors;
  FILE * outfile = dest->pub.output_file;
  int i;

  if (colormap != NULL) {
    if (cinfo->out_color_components == 3) {
      /* Normal case with RGB colormap */
      for (i = 0; i < num_colors; i++) {
	putc(GETJSAMPLE(colormap[2][i]), outfile);
	putc(GETJSAMPLE(colormap[1][i]), outfile);
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	if (map_entry_size == 4)
	  putc(0, outfile);
      }
    } else {
      /* Grayscale colormap (only happens with grayscale quantization) */
      for (i = 0; i < num_colors; i++) {
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	putc(GETJSAMPLE(colormap[0][i]), outfile);
	if (map_entry_size == 4)
	  putc(0, outfile);
      }
    }
  } else {
    /* If no colormap, must be grayscale data.  Generate a linear "map". */
    for (i = 0; i < 256; i++) {
      putc(i, outfile);
      putc(i, outfile);
      putc(i, outfile);
      if (map_entry_size == 4)
	putc(0, outfile);
    }
  }
  /* Pad colormap with zeros to ensure specified number of colormap entries */ 
  if (i > map_colors)
    ERREXIT1(cinfo, JERR_TOO_MANY_COLORS, i);
for (; i < map_colors; i++) { putc(0, outfile); putc(0, outfile); putc(0, outfile); if (map_entry_size == 4) putc(0, outfile);
}
}

이런식으로 0에서 255 까지 팔레트를 생성하면 되고,
256color(=8bit) 일 경우에는 팔레트는 RGBQUAD 로 4바이트 구조이므로,
마지막 바이트는 reserve(혹은 alpha) 값으로 0x00(stfae에서는0x80) 을 해주면 된다.
Posted by 구차니
혹시나 하는 마음에
Eclipse IDE for C/C++ Developers (79 MB)
를 받고 실행했는데, 역시나 eclipse는 JRE나 JDK가 있어야 실행이 된다.

그래서 봤더니.. 자바 버전이 JDK6 update 14까지 나왔다 -ㅁ-!
아무튼 사랑하는 netbeans 포함 버전을 선택(그러고 보니.. JRE 외에는 전부 통합버전이다)
다운로드를 받고 설치 하려니 요구용량이 500M에 근접한다. ㄱ-

그리고 나서 실행했는데 이 먼가 허전한 느낌..
c와 c++ 프로젝트는 생성이 되는데, MFC 라던가 이런건 아무래도 무리인 듯..

그래서 검색을 해봤더니, class wizard나 project wizard 없이 사용하는건 실질적으로 불가능하다는 이야기가 나왔다.
[링크 : http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg01844.html]

Migrate Visual Studio C and C++ projects to Eclipse CDT
[링크 : http://www.ibm.com/developerworks/library/os-ecl-vscdt/]


솔찍히.. wizard없이 손으로 일일이 직접 mfc 코드들을 작성하기란 쉬운일은 아니다.
머.. 그래서 잠시 Visual studio express버전을 검색했는데..

일단 VB와 VC++은 존재한다.
마음에 걸리는건.. 2008 버전! ㄱ-
혹시.. .net을 강요하는건 아니겠지? 나중에 다른 pc에 설치나 해봐야겠다 쩝...

'프로그램 사용 > eclipse CDT & minGW' 카테고리의 다른 글

eclipse CDT plugin 설치하기  (2) 2012.01.29
eclipse에서 archive (*.a) 링크하기  (0) 2012.01.18
eclipse CDT 에서 include 경로 추가하기  (0) 2012.01.17
MinGW  (0) 2010.09.07
Eclipse IDE for C/C++ Developers  (0) 2009.07.06
Posted by 구차니
프로그램 사용/libjpeg2009. 7. 10. 17:34
일단 해보니..
struct jpeg_decompress_struct 에
quantize_colors 항목을 TRUE로 설정해주면
colormap 에 팔레트가 생성이되고,
actual_number_of_colors 에는 실제 사용한 색상수 출력이 된다고 하는데..

팔레트가 어떻게 되는지 libjpeg.doc에 제대로 나와있지 않다..
아래의 링크를 조금은 유심히 보고 수정요망

After this call, the final output image dimensions, including any requested
scaling, are available in the JPEG object; so is the selected colormap, if
colormapped output has been requested.  Useful fields include

    output_width        image width and height, as scaled
    output_height
    out_color_components    # of color components in out_color_space
    output_components    # of color components returned per pixel
    colormap        the selected colormap, if any
    actual_number_of_colors        number of entries in colormap

output_components is 1 (a colormap index) when quantizing colors; otherwise it
equals out_color_components.  It is the number of JSAMPLE values that will be
emitted per pixel in the output arrays.

Typically you will need to allocate data buffers to hold the incoming image.
You will need output_width * output_components JSAMPLEs per scanline in your
output buffer, and a total of output_height scanlines will be returned.

Note: if you are using the JPEG library's internal memory manager to allocate
data buffers (as djpeg does), then the manager's protocol requires that you
request large buffers *before* calling jpeg_start_decompress().  This is a
little tricky since the output_XXX fields are not normally valid then.  You
can make them valid by calling jpeg_calc_output_dimensions() after setting the
relevant parameters (scaling, output color space, and quantization flag).

...

The decompression parameters that determine the basic properties of the
returned image are:

J_COLOR_SPACE out_color_space
    Output color space.  jpeg_read_header() sets an appropriate default
    based on jpeg_color_space; typically it will be RGB or grayscale.
    The application can change this field to request output in a different
    colorspace.  For example, set it to JCS_GRAYSCALE to get grayscale
    output from a color file.  (This is useful for previewing: grayscale
    output is faster than full color since the color components need not
    be processed.)  Note that not all possible color space transforms are
    currently implemented; you may need to extend jdcolor.c if you want an
    unusual conversion.

...

boolean quantize_colors
    If set TRUE, colormapped output will be delivered.  Default is FALSE,
    meaning that full-color output will be delivered.

...

When quantize_colors is TRUE, the target color map is described by the next
two fields.  colormap is set to NULL by jpeg_read_header().  The application
can supply a color map by setting colormap non-NULL and setting
actual_number_of_colors to the map size.  Otherwise, jpeg_start_decompress()
selects a suitable color map and sets these two fields itself.
[Implementation restriction: at present, an externally supplied colormap is
only accepted for 3-component output color spaces.]

JSAMPARRAY colormap
    The color map, represented as a 2-D pixel array of out_color_components
    rows and actual_number_of_colors columns.  Ignored if not quantizing.
    CAUTION: if the JPEG library creates its own colormap, the storage
    pointed to by this field is released by jpeg_finish_decompress().
    Copy the colormap somewhere else first, if you want to save it.

int actual_number_of_colors
    The number of colors in the color map.

...

int out_color_components    Number of color components in out_color_space.
int output_components        Number of color components returned.

[출처 : libjpeg.doc]





[링크 : http://svn.neurostechnology.com/filedetails.php]
[링크 : http://www.koders.com/c/fid95CCE6190079AB3FDDE3C71309BA75EB5BA943FC.aspx]
Posted by 구차니
프로그램 사용2009. 7. 10. 11:02

방문"기록" 저장안함이 "지록" 으로 오타가 났다.
흠.. 어느 경로를 통해서 알려줘야 하나?

흐음.. 이미 5월에 포스팅 된 내용이군..
[링크 : http://forums.mozilla.or.kr/viewtopic.php?f=2&t=11525&sid=1e8b2575b8473a2e6ca57f4af9c2dc1c#p39600]


그리고 3.5가 구동이 어~~~~~엄청 느린 문제가 요근래에 있었는데
C:\Documents and Settings\[userid]\Local Settings
아래의 History / Temp / Temporary Internet Files
디렉토리의 내용을 비워주면 날아다닌다. 경이로울 정도의 구동속도!!!

Posted by 구차니

[링크 : http://www.eclipse.org/downloads/]

간만에 이클립스 홈페이지를 가니, C/C++ 용 Eclipse 란게 보였다.
오홍~ 이제 공식적으로 지원하나 보다~ 라고 생각하고 구글신에게 경배를 조금 드렸더니
아래와 같은 IBM의 문서가 나왔다.

내부적으로는
cygwin(혹은 minGW) 과 eclipse + CDT(C/C++ Development Toolkit) 를 이용하여 개발환경을 구축하며.
이러한 구축방법에 대해서 상세히 기술되어 있다.

[링크 : http://www.ibm.com/developerworks/kr/library/os-ecc/]


'프로그램 사용 > eclipse CDT & minGW' 카테고리의 다른 글

eclipse CDT plugin 설치하기  (2) 2012.01.29
eclipse에서 archive (*.a) 링크하기  (0) 2012.01.18
eclipse CDT 에서 include 경로 추가하기  (0) 2012.01.17
MinGW  (0) 2010.09.07
eclipse CDT  (0) 2009.07.13
Posted by 구차니
아직 확실하게 쓸줄은 모르지만..
아무튼 이더리얼에서 가장 중요한 것은 필터링을 하는 방법이라고 생각이 된다.

수 많은 패킷중에 원하는 내용을 골라내야 하므로 필터링 방법이 복잡해 질 수 밖에 없고,
그로 인해서 wireshark에서 필터는 매우 어려운 편이다.


위에 보면 filter 라는 부분이 있는데, 이 부분이 display filter 부분이다.
이와는 별개로 capture filter 라는 부분도 있는데,
필터사용 방법은 동일하나,
네트워크 데이터 량이 너무 많을 경우에는 capture 필터로 한번 걸러내고
display filter로 두 번 걸러내는 것이 좋지 않을까 생각을 한다.


capture 필터는, 캡쳐시에 걸러내주는 역활을 한다.



display filter와 capture filter를 클릭했을때 나오는 다이얼로그 윈도우로
사용하는 문법과 내용은 동일하다.


아무튼 중요한 것은 아래의 filter string이다.

예를들어 위에 나온 내용처럼
특정 프로토콜만 보고 싶거나, 특정 프로토콜을 제외하고 다른 것을 보고 싶을 경우,
필터를 사용하게 되는데,
"프로토콜은 소문자" 로 적어주고
보고 싶으면 프로토콜 이름만 (예, arp)
보고 싶지않으면 not 프로토콜 이름으로 적어주면 된다. (예, not arp)

그리고 조건을 붙일때는 or , and 로 조건을 붙여주면 된다.

'프로그램 사용 > wireshark(ethereal)' 카테고리의 다른 글

linux cooked capture  (0) 2023.09.04
wireshark에서 DHCP 캡쳐하기  (0) 2011.10.05
ubuntu에 ethereal(wireshark) 설치하기  (0) 2009.07.04
ethereal -> wireshark  (0) 2009.07.04
Posted by 구차니
$ sudo apt-get install ethereal
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
ethereal 패키지를 사용할 수 없습니다.  하지만 다른 패키지가 참조하고 있습니다.
해당 패키지가 누락되었거나 지워졌다는 뜻입니다. 아니면 또 다른 곳에서
패키지를 받아와야 하는 경우일 수도 있습니다.
하지만 다음 패키지가 대체합니다:
  wireshark
E: ethereal 패키지는 설치할 수 있는 후보가 없습니다

2009/07/04 - [프로그램 사용] - ethereal -> wireshark

상표권 문제로 ethereal은 wireshark로 대체 되었고, 그런 이유로 우분투에서 설치하기 위해서는
시냅틱 패키지에서 ethereal로 찾아도 나오지 않는다.

ethereal을 설치하기 위해서는 아래와 같이 입력한다.
 $ sudo apt-get install wireshark

그리고 실행시에는 wireshark (as root)로 실행을 해야지 장치목록이 제대로 뜬다.
이러한 장치는 root 권한이 없으면 접근할 수 없기 때문에, root로 구동을 해야한다.
Posted by 구차니