티스토리 뷰

목차

    u-boot 명령어 모음, 임베디드 프로그래밍에 필요 (uboot)


    u-boot는 부트로더 중에서도 우리나라에선 가장 유명할 겁니다. 이래저래 쓸 일이 많으니 명령어 알아두는 게 좋아요.


    u-boot 명령어 - Download Commands


    u-boot 명령어 모음[u-boot 명령어, 임베디드 프로그래밍]


    bootp - boot image via network using TFTP protocol

    BLOB의 bootp 명령어와 동일.


    dhcp - invoke DHCP client to obtain IP/boot params

    잘 모름.


    loadb - load binary file over serial line (kermit mode)

    시리얼 라인을 통해서 이진 데이터를 로드. (kermit을 사용해야 한다)


    loads - load S-Record file over serial line

    시리얼 라인을 통해서 S-Record 파일을 로드. (잘 모르겠다!)

    rarpboot- boot image via network using TFTP protocol

    역시 모름.


    tftpboot- boot image via network using TFTP protocol

    tftp를 통해 파일을 로드.


    u-boot 명령어 - Environment Variables Commands


    printenv- print environment variables

    uboot의 환경 변수를 출력. (이걸 보면 어떤 환경을 지정할 수 있도록 했는지 알 수 있다.)


    saveenv - save environment variables to persistent storage

    uboot의 환경 변수를 플래쉬 등의 비휘발성 메모리에 저장.


    u-boot 명령어 모음, 임베디드 프로그래밍[u-boot 명령어, 임베디드 프로그래밍]


    setenv - set environment variables

    uboot의 환경 변수 값을 지정.


    run - run commands in an environment variable

    uboot의 환경 변수를 반영.


    bootd - boot default, i.e., run 'bootcmd' (boot)

    디폴트로 지정한 boot 명령을 실행.


    u-boot 명령어 - Special Commands


    i2c - I2C sub-system

    I2C를 제어는 다양한 서브 명령이 존재.


    ide - IDE sub-system

    IDE를 제어는 다양한 서브 명령이 존재.


    diskboot- boot from IDE device

    IDE 장치를 통해 부팅.


    u-boot 명령어 - Miscellaneous Commands


    date - get/set/reset date & time

    날짜/시간을 출력하거나 지정.


    echo - echo args to console

    지정한 문자열을 출력.


    u-boot 명령어 모음[u-boot 명령어, 임베디드 프로그래밍]


    reset - Perform RESET of the CPU

    리셋.


    sleep - delay execution for some time

    명령어 실행 전후에 지정한 시간만큼 delay 시킨다. (ex: date ; sleep 5 ; date -> date 후 5초 지연)


    version - print monitor version

    부트로더의 버전을 출력.


    ? - alias for 'help'

    도움말 출력. (BLOB와 같은 방식)


    - boot에는 다양한 환경 변수가 존재, 이러한 환경 변수는 부트로더의 실행은 물론, 명령어를 처리하는데에도 영향을 미침.


    - BLOB에서 ramdisk, kernel 같은 문자로 메모리 영역을 지정할 수 있듯이, uboot에서도 $(kernel_addr) 같은 표현으로 지정할 수 있음.


    또한, 환경 변수 값을 통해, 이런 식으로 표현되는 메모리 주소 값을 바꿀 수 있음.


    - 몇몇 명령에서 접미사처럼 .l .w. b라는 표현을 쓸 수 있음. 각각 4바이트 2바이트 1바이트 단위로 처리하라는 의미.


    예를 들어 md라는 메모리 출력 명령을 쓸 때, md.b로 쓰면, 바이트 단위(hex 값 두 개)로 출력해 주는 식.

    이는 명령어의 카운터값에도 영향을 미친다. 예를 들어, .l로 표현된 명령어에 카운터값을 8로 주면 총 4*8바이트를 .b로 표현된 명령어에서는 총 8바이트를 처리한다.


    u-boot 명령어 모음, 임베디드 프로그래밍에 필요 (uboot)