:TRICK-MAN:™ FOREVER, Since 2007  
Front Page
Tag | Location | Media | Guestbook | Admin   
 
'임베디드'에 해당하는 글(4)
2014.10.13   우분투에서 uboot용 mkimage 설치하기
2011.02.17   BCM(Broadcom) SDK를 보다가...
2009.11.26   개발자를 위한 나눔고딕코딩 글꼴
2007.11.15   Real-Time Embedded Systems


우분투에서 uboot용 mkimage 설치하기

리눅스 커널 컴파일 후에 uboot용 이미지를 만들때 mkimage가 필요한데

우분투에서는 컴파일하지 않고 간단한게 설치할 수 있다.

명령은 아래와 같다. 

$ sudo apt-get install uboot-mkimage

[sudo] password for user: 

Reading package lists... Done

Building dependency tree       

Reading state information... Done

The following packages were automatically installed and are no longer required:

  linux-headers-2.6.35-22 linux-headers-2.6.35-22-generic

Use 'apt-get autoremove' to remove them.

The following NEW packages will be installed:

  uboot-mkimage

0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.

Need to get 9,876B of archives.

After this operation, 57.3kB of additional disk space will be used.

WARNING: The following packages cannot be authenticated!

  uboot-mkimage

Install these packages without verification [y/N]? y

Get:1 http://old-releases.ubuntu.com/ubuntu/ maverick/main uboot-mkimage i386 0.4build1 [9,876B]

Fetched 9,876B in 1s (7,158B/s)  

Selecting previously deselected package uboot-mkimage.

(Reading database ... 175719 files and directories currently installed.)

Unpacking uboot-mkimage (from .../uboot-mkimage_0.4build1_i386.deb) ...

Setting up uboot-mkimage (0.4build1) ...


테스트

$ mkimage

Usage: mkimage -l image

          -l ==> list image header information

       mkimage [-x] -A arch -O os -T type -C comp -a addr -e ep -n name -d data_file[:data_file...] image

          -A ==> set architecture to 'arch'

          -O ==> set operating system to 'os'

          -T ==> set image type to 'type'

          -C ==> set compression type 'comp'

          -a ==> set load address to 'addr' (hex)

          -e ==> set entry point to 'ep' (hex)

          -n ==> set image name to 'name'

          -d ==> use image data from 'datafile'

          -x ==> set XIP (execute in place)










BCM(Broadcom) SDK를 보다가...
bcm api를 보다가 갑자기 소스가 이해가 되질 않았다..특히 BCM_DLIST_ENTRY...
$BCM_HOME/bcm/src/dispatch.c 파일에서 분명히 호츨을 하는 것 같긴 한데...
그 다음이 이해가 되질 않았다..그냥 넘어갈 수도 있었지만 나름대로 해석을 해야 할 것
같아서 소스를 간추렸다..

----------------8<--- Cut Here --->8-------------------
$ more abc.c
#include <stdio.h>

#define BCM_DLIST_ENTRY(_dtype) \
        extern int bcm_##_dtype##_add(int i, int j);
#include "dlist.h"

#define BCM_DLIST_ENTRY(_dtype) \
bcm_##_dtype##_add,
static int (*_port_add_dispatch[])(
        int i,
        int j ) =
{
#include "dlist.h"
0
};

int
bcm_port_add(int i, int j)              <- application에서 이 함수를 호출했다 치고..
{
    _port_add_dispatch[0](i, j);         <- 요기부터 이해가 안되었다...
                                 위의 파란색을 보면 분명히 BCM_DLIST_ENTRY가 2개나 보이는데
                                 duplication에러도 없고 도데체 어떻게 해석이 되는지 알 수가 없었다.
}
----------------8<--- Cut Here --->8-------------------
$ more dlist.h
#ifdef BCM_DLIST_ENTRY

BCM_DLIST_ENTRY(esw)

#undef BCM_DLIST_ENTRY

#endif
----------------8<--- Cut Here --->8-------------------
$ more add.c
#include <stdio.h>

int
bcm_esw_add(int i, int j)
{
    printf("F=[%s] arg1=[%d],arg2=[%d]\n", __FUNCTION__, i, j);
}
----------------8<--- Cut Here --->8-------------------

나름대로 이해를 하기 위해서 헤더파일을 소스 파일에 넣었다...
그랬더니 조금 이해하기가 쉬웠다...

----------------8<--- Cut Here --->8-------------------
#define BCM_DLIST_ENTRY(_dtype) \       <- BCM_DLIST_ENTRY define한다.
    extern int bcm_##_dtype##_add(int i, int j);
#ifdef BCM_DLIST_ENTRY                  <- define되어 있으므로 아래를 아래 문장을 interpret 해라
BCM_DLIST_ENTRY(esw)                    <- extern int ... 라인을 interpret
#undef BCM_DLIST_ENTRY                  <- 다시 undef
#endif

#define BCM_DLIST_ENTRY(_dtype) \       <- 다시 define
bcm_##_dtype##_add,                
static int (*_port_add_dispatch[])(     <- 아래 bcm_port_add 함수안에서 사용하는 함수포인터의 
    int i,                                 진짜 함수(extern)를 지정하기 위해서
    int j ) =
{
#ifdef BCM_DLIST_ENTRY                  <- 방금 위에서 define했으므로 아래 문자을 interpret
BCM_DLIST_ENTRY(esw)                    <- bcm_..._add 가 여기에 들어간다.
#undef BCM_DLIST_ENTRY                  <- 그리고 다시 undef
#endif
0
};

int
bcm_port_add(int i, int j)
{
    _port_add_dispatch[0](i, j);        <- 0번째 함수를 call 해라
}
----------------8<--- Cut Here --->8-------------------

그리고 마지막으로 정리를 하니까...이렇게 간단하게 정리가 되었다...
----------------8<--- Cut Here --->8-------------------
extern int bcm_esw_add(int i, int j);

static int (*_port_add_dispatch[])(
        int i,
        int j ) =
{
        bcm_esw_add,
        0
};

int
bcm_port_add(int i, int j)
{
        _port_add_dispatch[0](i, j);
}
----------------8<--- Cut Here --->8-------------------




개발자를 위한 나눔고딕코딩 글꼴
나는 zterm 이용하여 Solaris에서 주로 작업을 한다. Zterm에서 사용하는 FixedSys는 가독성은 좋지만
글자가 너무 크다는 느낌이 들고 여러 개의 창을 띄우면 공간을 많이 차지 한다. 그래서 Courier나
Courier New, 고딕체 등의 고정글꼴들을 여러개 사용해 보았지만 딱히 마음에 들지는 않았다...
오늘 인터넷을 서핑하다가 네이버에서 코딩용 글꼴을 배포하는 것을 보고 너무 기뻤다.
바로 내가 찾던 그런 글꼴이었다...

다운로드 페이지는 http://dev.naver.com/projects/nanumfont 이고 나의 스샷은 아래에...




Real-Time Embedded Systems
임베디드 시스템에 대한 일반적인 내용과 RTOS인 VxWorks 위주로
System call들 위주로 설명하고 있다.

o To manage system resource through
    system calls -- issued by tasks
    interrupts -- timer and external events
o Typical requirements
    Support for scheduling of real-time tasks and interrupt handlers
    Inter-process communication
    I/O support -- driver
    User control of system resource -- memory and file system
o Thread or process for task execution:
   smallest execution units that can be scheduled
    lives in a virtual, insulated environment
    uses or owns system resources





BLOG main image
jskwak[@]gmail.com 또는 ♬♬♬ jskwak[@]trickman.net, ▷◁▷◁ http://about.me/jskwak
 Notice
반/갑/습/니/다
곽/자/섭 입니다...
 Category
분류 전체보기 (151)
전송기술 (53)
이더넷 (3)
시스코자격증 (7)
임베디드 (4)
책읽기 (8)
주절주절 (70)
MAC OS X Life (1)
 TAGS
OSX T-SDN CRT CISCO Linux BLSR 구글 모공 CCNA 구름 SONET ITU-T 메모 OTN SDH 절체 toc 1588 Telecom Profile FRT ip CCNP 대립해소도 코드검색 아이팟 CDP UPSR
 Calendar
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
 Recent Entries
 Recent Comments
 Archive
 Link Site
[01] 지원,지민 놀이터
 Visitor Statistics
Total :
Today :
Yesterday :
rss