'linux' 카테고리의 다른 글
virtualbox 사용법 (0) | 2013.03.07 |
---|---|
cpu clock(속도) 조절 (2) | 2013.03.04 |
opensource 정보 (0) | 2012.05.18 |
IPv4 packet forwarding (0) | 2012.05.03 |
리눅스 콘솔내용을 시리얼로 출력해서 보려면 (0) | 2012.04.03 |
virtualbox 사용법 (0) | 2013.03.07 |
---|---|
cpu clock(속도) 조절 (2) | 2013.03.04 |
opensource 정보 (0) | 2012.05.18 |
IPv4 packet forwarding (0) | 2012.05.03 |
리눅스 콘솔내용을 시리얼로 출력해서 보려면 (0) | 2012.04.03 |
Coreboot
바로 빌드 가능하도록 팩키지로 만들었습니다.
Let free use.
rangeley_coreboot_build.tar.bz2
ENV
platform : Atom C2000 rangeley
EVB : Mohon peak CRB
필요 팩키지
1. Intel FSP package
Intel 에서 배포하는 펌웨어 팩키지입니다.
FSP 는 Firmware Support Package 의 약자입니다.
FSP 는 x86 cpu 를 초기화 하는 펌웨어 바이너리와 microcode 가 헤더 형태로 제공 됩니다. coreboot 같은 bios 용 SW 들은 빌드 단계에서 microcode 를 참조하고 링크 단계에서 펌웨어를 가져다 사용하기 때문에 반드시 필요합니다.
2. coreboot source
HomePage : https://www.coreboot.org/
WIKI : https://ko.wikipedia.org/wiki/%EC%BD%94%EC%96%B4%EB%B6%80%ED%8A%B8
BUILD HOW-TO : https://www.coreboot.org/Build_HOWTO
Coreboot 는 x86 에서 BIOS 를 대신할 수 있는 opensource 프로젝트입니다.
Worklog
1. Intel FSP
다운로드 사이트에 들어가 보면, intel 에서 판매하는 여러 cpu 들의 목록이 나옵니다. 이 중에서 원하는 cpu 의 링크를 따라 가면 됩니다.
제가 사용할 플랫폼은 atom rangeley 여서 관련 FSP 를 다운로드 받았습니다.
fsp(333407_RANGELEY_POSTGOLD_4_001US.tgz) 를 다 받았으면 아래와 같이 압축을 풀어 줍니다.
poplinux@raw FSP $ > ls 333407_RANGELEY_POSTGOLD_4_001US.tgz poplinux@raw FSP $> tar zxvf 333407_RANGELEY_POSTGOLD_4_001US.tgz RANGELEY_POSTGOLD_4.se Readme_Extract.txt poplinux@raw FSP $ > ls 333407_RANGELEY_POSTGOLD_4_001US.tgz RANGELEY_POSTGOLD_4.se Readme_Extract.txt |
압축을 풀고 난 후, 아래와 같이 ./RANGELEY_POSTGOLD_4.se 를 실행하면 압축이 추가로 풀리면서 필요한 파일을 얻을 수 있습니다.
자세한 내용은 ./Readme_Extract.txt 를 읽어 보면 됩니다.
poplinux@raw FSP $ > cat Readme_Extract.txt Readme Notes on how to extract the contents of the *.se file in Linux: 1. Run the following command to make the *.se file executable chmod +x 4. The contents of the *.se file will be extracted into a directory with the same name as the *.se file (without the .se extension).
|
압축 해제를 완료하면 몇가지 파일과 디렉토리가 생성되는데, ./FSP 와 ./Microcode 가 가장 중요합니다.
./FSP/RANGELEY_POSTGOLD4_FSP_004_20150924.fd => 펌웨어
./Microcode/microcode-m01406d000e.h => 마이크로 코드
./Microcode/microcode-m01406d8128.h => 마이크로 코드
펌웨어와 마이크로 코드들은 coreboot 에서 직접 가져다 사용하게 됩니다.
2. coreboot
2-1. 소스 준비
빌드 준비는 아래와 같이 진행합니다.
# 빌드 환경 준비 poplinux@raw work $ > sudo aptitude install gnat-4.8 libncurses5-dev m4 bison flex iasl build-essential zlib1g-dev libftdi-dev pciutils-dev libusb-dev libpci-dev # git 소스 다운로드 poplinux@raw work $ > git clone http://review.coreboot.org/coreboot.git ./coreboot # 추가 모듈 다운로드 poplinux@raw work $ > cd coreboot poplinux@raw work $ > git submodule update --init --checkout Submodule 'arm-trusted-firmware' (http://review.coreboot.org/arm-trusted-firmware.git) registered for path '3rdparty/arm-trusted-firmware' Submodule '3rdparty' (http://review.coreboot.org/blobs.git) registered for path '3rdparty/blobs' Submodule 'vboot' (http://review.coreboot.org/vboot.git) registered for path '3rdparty/vboot' Submodule 'util/nvidia-cbootimage' (http://review.coreboot.org/nvidia-cbootimage.git) registered for path 'util/nvidia/cbootimage' |
2.2 컴파일러 준비
컴파일러는 아래와 같이 준비 합니다. 빌드 시간은 한참 걸립니다.
poplinux@raw coreboot $ > make crossgcc-i386 Welcome to the coreboot cross toolchain builder v1.39 (April 16th, 2016) Target architecture is now i386-elf Downloading tarballs ... * gmp-6.1.0.tar.xz (cached) |
2.3 설정
아래와 같이 rangeley 를 위한 설정을 합니다.
poplinux@ raw coreboot $ > make menuconfig Mainboard ---> Mainboard vendor (Intel) ---> Mainboard model (Mohon Peak CRB) ---> [*] Configure defaults for the Intel FSP package ROM chip size (2048 KB (2 MB)) ---> Chipset ---> Include CPU microcode in CBFS (Include external microcode header files) ---> (../intel/cpu/rangeley/microcode/microcode-m01406d000e.h ../intel/cpu/rangeley/microcode/microcode-m01406d8128.h) -*- Use Intel Firmware Support Package (../intel/fsp/rangeley/FvFsp.bin) Intel FSP binary path and filename (NEW) Generic Drivers ---> -*- Use Intel Firmware Support Package (../intel/fsp/rangeley/FvFsp.bin) Intel FSP binary path and filename (NEW) |
Mainboard --->
Mainboard vendor (Intel) : Intel 로 설정함
Mainboard model (Mohon Peak CRB) : Intel EVB 이름이 "Mohon Peak CRB" 임
[*] Configure defaults for the Intel FSP package : Intel FSP 사용하는 것으로 설정함.
ROM chip size (2048 KB (2 MB)) : 최종 이미지 사이즈를 결정하는 것인데, 이 설정이 잘못되어서 부팅이 안되는 경우가 있습니다.
다른 Embedded 제품들은 flash memory 0x00 번지부터 BIOS(or bootloader) 코드가 위치하는 것을 기본으로 하고 있는데 x86 은 flash memory 의 마지막 부분에 BIOS(or bootloader) 가 존재하는 것을 기반으로 하고 있습니다.
예를 들어, flash memory 16MByte 크기이고 coreboot 를 2MB 사이즈로 빌드했아며 coreboot 는 0x00 이 아니라 0xE00000(14Mbyte) 에 write 해야 합니다.
Chipset --->
Include CPU microcode in CBFS (Include external microcode header files) : intel FSP 중에서 microcode 의 위치를 지정해 줍니다.
-*- Use Intel Firmware Support Package : intel FSP 중에서 firmware 의 위치를 지정해 줍니다. intel FSP 압축을 풀면 "RANGELEY_POSTGOLD_4/FSP/RANGELEY_POSTGOLD4_FSP_004_20150924.fd" 가 생기는데 이 경로를 상대 경로로 지정해 주면 됩니다.
Generic Drivers --->
-*- Use Intel Firmware Support Package : intel FSP 중에서 firmware 의 위치를 지정해 줍니다. intel FSP 압축을 풀면 "RANGELEY_POSTGOLD_4/FSP/RANGELEY_POSTGOLD4_FSP_004_20150924.fd" 가 생기는데 이 경로를 상대 경로로 지정해 주면 됩니다.
2.4 빌드
아래와 같이 빌드를 진행합니다.
poplinux@ raw coreboot $ > make Performing operation on 'COREBOOT' region... Name Offset Type Size cbfs master header 0x0 cbfs header 32 fallback/romstage 0x80 stage 24348 config 0x6000 raw 452 revision 0x6200 raw 570 cmos_layout.bin 0x6480 cmos_layout 1316 fallback/dsdt.aml 0x6a00 raw 8074 payload_config 0x8a00 raw 1574 payload_revision 0x9080 raw 244 (empty) 0x91c0 null 27864 mrc.cache 0xfec0 mrc_cache 65536 cpu_microcode_blob.bin 0x1ff00 microcode 167936 fallback/ramstage 0x48f80 stage 48158 fallback/payload 0x54c00 payload 61326 (empty) 0x63c00 null 1163928 fsp.bin 0x17fec0 fsp 389120 (empty) 0x1def00 null 133528 bootblock 0x1ff8c0 bootblock 1528 HOSTCC cbfstool/rmodtool.o HOSTCC cbfstool/rmodtool (link) Built intel/mohonpeak (Mohon Peak CRB) poplinux@ raw coreboot $ > ls -lah build/coreboot.rom -rw-r--r-- 1 poplinux develp 2.0M 5월 13 14:03 build/coreboot.rom |
최종 생성 이미지는 build/coreboot.rom 입니다.
How to use serial console on Intel rangeley platform (0) | 2016.03.18 |
---|---|
How to install ubuntu to rangeley (1) | 2016.01.21 |
[gcc] -march, -mtune 옵션 (0) | 2016.01.08 |
[gcc] __attribute__((......)) 키워드 (0) | 2016.01.06 |
openwrt (0) | 2015.02.24 |
환경
Platform : Intel Rangeley
Board : Mohon Peak CRB Alpha 3
OS : ubuntu 14.04.3 LTS
serial port 를 콘솔 포트로 사용하려면 총 3 군데에 설정을 해야 합니다.
1. GRUB 동작시 시리얼 포트로 출력하게
2. 커널 로딩시 시리얼 포트로 출력하게
3. 커널 로딩 완료후 로그인 쉘을 시리얼 포트로 출력하게
x86 플랫폼에서는, 첫번째 시리얼 포트가 ttyS0 가 아니라 ttyS1 인 경우가 많습니다.
웹에 올라와 있는 설명들은 ttyS0 가 첫번째 시리얼이라고 가정하고 작성된 문서가 많습니다.
GRUB 설정 & 커널 설정
GRUB 화면을 시리얼로 보려면 아래와 같은 설정 추가가 필요하다.
GRUB_TERMINAL=serial
GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
커널 로그를 시리얼로 보려면(kernel cmdline 으로 전달됨) 아래와 같은 설정 추가가 필요하다.
GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS1,115200n8"
$ > sudo vi /etc/default/grub # If you change this file, run 'update-grub' afterwards to update
|
로그인 쉘을 시리얼로 보려면
/etc/init/ttyS1.conf 를 추가한다.
$ > vi /etc/init/ttyS1.conf
|
coreboot (2) | 2016.05.13 |
---|---|
How to install ubuntu to rangeley (1) | 2016.01.21 |
[gcc] -march, -mtune 옵션 (0) | 2016.01.08 |
[gcc] __attribute__((......)) 키워드 (0) | 2016.01.06 |
openwrt (0) | 2015.02.24 |
How to install ubuntu to rangeley
UEFI?
UEFI(Unified Extensible Firmware Interface)는 BIOS(기본 입출력 시스템)를 대체하도록 고안된 PC용 표준 펌웨어 인터페이스입니다. 이 표준은 Microsoft를 비롯하여 UEFI 컨소시엄에 가입된 140개 이상의 기술 기업에 의해 제정되었습니다. => from MS homepage
EFI?
1990 년대 중반에 인텔에서 아이테이엄 플랫폼을 위해 개발한 것으로써, 기존 BIOS 의 단점을 극복하기 위해 개발하였다.
EFI 사용법 : http://www.rodsbooks.com/efi-bootloaders/index.html
EFI 부팅이 완료되면 아래와 같이 EFI shell 이 실행된다.
EFI Shell version 2.31 [1.0] Current running mode 1.1.2 Device mapping table fs0 :Removable HardDisk - Alias hd32b0e0b blk0 PciRoot(0x0)/Pci(0x16,0x0)/USB(0x1,0x0)/USB(0x4,0x0)/HD(1,MBR,0x00000000,0x20,0xEE8BE0) blk0 :Removable HardDisk - Alias hd32b0e0b fs0 PciRoot(0x0)/Pci(0x16,0x0)/USB(0x1,0x0)/USB(0x4,0x0)/HD(1,MBR,0x00000000,0x20,0xEE8BE0) blk1 :Removable BlockDevice - Alias (null) PciRoot(0x0)/Pci(0x16,0x0)/USB(0x1,0x0)/USB(0x4,0x0) Press ESC in 1 seconds to skip startup.nsh, any other key to continue. Shell> |
start.nsh 를 작성하면, grub 이나 syslinux 같은 부트로더를 자동 실행 시킬 수 있다.
GRUB 실행법
EFI Shell version 2.31 [1.0] Current running mode 1.1.2 Device mapping table fs0 :Removable HardDisk - Alias hd32b0e0b blk0 PciRoot(0x0)/Pci(0x16,0x0)/USB(0x1,0x0)/USB(0x4,0x0)/HD(1,MBR,0x00000000,0x20,0xEE8BE0) blk0 :Removable HardDisk - Alias hd32b0e0b fs0 PciRoot(0x0)/Pci(0x16,0x0)/USB(0x1,0x0)/USB(0x4,0x0)/HD(1,MBR,0x00000000,0x20,0xEE8BE0) blk1 :Removable BlockDevice - Alias (null) PciRoot(0x0)/Pci(0x16,0x0)/USB(0x1,0x0)/USB(0x4,0x0) Press ESC in 1 seconds to skip startup.nsh, any other key to continue. Shell> fs0: fs0: \> cd EFI fs0: \EFI> cd BOOT fs0: \EFI\BOOT> BOOTx64.EFI GNU GRUB version 2.02~beta2-9ubuntu1.3 /----------------------------------------------------------------------------\ |*Install Ubuntu Server | | BABO | | OEM install (for manufacturers) | | Multiple server install with MAAS | | Check disc for defects | | Rescue a broken system | | | | | | | | | | | | | \----------------------------------------------------------------------------/ Use the ^ and v keys to select which entry is highlighted. Press enter to boot the selected OS, `e' to edit the commands before booting or `c' for a command-line. ESC to return previous menu. |
Intel FSF
홈페이지에 접속하여 FSP 를 다운 로드 받은 후 아래와 같이 압축을 해제하면 2개의 파일을 얻을 수 있다.
poplinux@raw FSP $ > ls 333407_RANGELEY_POSTGOLD_4_001US.tgz poplinux@raw FSP $> tar zxvf 333407_RANGELEY_POSTGOLD_4_001US.tgz RANGELEY_POSTGOLD_4.se Readme_Extract.txt poplinux@raw FSP $ > ls 333407_RANGELEY_POSTGOLD_4_001US.tgz RANGELEY_POSTGOLD_4.se Readme_Extract.txt |
압축을 풀고 난 후, 아래와 같이 ./RANGELEY_POSTGOLD_4.se 를 실행하면 압축이 추가로 풀리면서 필요한 파일을 얻을 수 있다. 자세한 내용은 ./Readme_Extract.txt 를 읽어 보면 된다.
poplinux@raw FSP $ > cat Readme Notes on how to extract the contents of the *.se file in Linux: 1. Run the following command to make the *.se file executable chmod +x <filename> poplinux@raw FSP $> chmod 777 RANGELEY_POSTGOLD_4.se poplinux@raw FSP $ > ./RANGELEY_POSTGOLD_4.se poplinux@raw FSP $ > ls 333407_RANGELEY_POSTGOLD_4_001US.tgz ./RANGELEY_POSTGOLD_4 RANGELEY_POSTGOLD_4.se Readme_Extract.txt poplinux@raw FSP $ > cd RANGELEY_POSTGOLD_4 poplinux@raw FSP $ > ls ./DOCUMENTATION ./FSP FSP Kit Production RULAC click-through License.pdf ./Microcode ReadMe.pdf |
CoreBOOT
HomePage : https://www.coreboot.org/
WIKI : https://ko.wikipedia.org/wiki/%EC%BD%94%EC%96%B4%EB%B6%80%ED%8A%B8
BUILD HOW-TO : https://www.coreboot.org/Build_HOWTO
HOST PC 준비 사항
아래와 같이 필수 팩키지를 설치해야 한다.
sudo aptitude install gnat-4.8 libncurses5-dev m4 bison flex iasl build-essential zlib1g-dev libftdi-dev pciutils-dev libusb-dev libpci-dev |
소스 다운로드
poplinux@raw work $ > git clone http://review.coreboot.org/coreboot.git ./ |
추가 모듈 다운로드
정상적인 빌드를 위해서는 추가 모듈을 다운로드 받아야 한다.
poplinux@raw work $ > cd coreboot poplinux@raw coreboot $ > git submodule update --init --checkout Submodule 'arm-trusted-firmware' (http://review.coreboot.org/arm-trusted-firmware.git) registered for path '3rdparty/arm-trusted-firmware' Submodule '3rdparty' (http://review.coreboot.org/blobs.git) registered for path '3rdparty/blobs' Submodule 'vboot' (http://review.coreboot.org/vboot.git) registered for path '3rdparty/vboot' Submodule 'util/nvidia-cbootimage' (http://review.coreboot.org/nvidia-cbootimage.git) registered for path 'util/nvidia/cbootimage' |
추가 모듈을 다운로드 받지 않으면, make 도중 "이 파일이 없습니다" 등등의 메시지를 보게 된다.
컴파일러 빌드
빌드에 사용할 컴파일러를 빌드해야 한다. 모든 플랫폼용을 전부 빌드하는 구조여서 시간이 오래 걸린다.
poplinux@raw coreboot $ > make crossgcc Welcome to the coreboot cross toolchain builder v1.33 (November 25th, 2015) Target architecture is now i386-elf Downloading tar balls ... |
설정
준비가 완료되었다면 아래와 같이 설정을 진행하자.
poplinux@raw coreboot $ > make menuconfig |
빌드
모든 준비가 완료되었다면 빌드를 진행하자.
poplinux@raw coreboot $ > make |
빌드 환경 검사
coreboot 는 타겟 시스템을 빌드할 수 있는 환경이 준비되어 있는지를 검사해 주는 기능이 들어가 있다.
HomePage : https://www.coreboot.org/Abuild
intel mohonpeak 플랫폼을 사용할 예정이므로 아래와 같이 검사를 진행해 보자. 빌드 환경을 준비하지 않았다면 아래와 같이 에러가 발생함을 알 수 있다.
poplinux@raw coreboot $ > util/abuild/abuild -t intel/mohonpeak Building INTEL_MOHONPEAK Creating config file for INTEL_MOHONPEAK... INTEL_MOHONPEAK (default configuration) INTEL_MOHONPEAK config created. Compiling INTEL_MOHONPEAK image... INTEL_MOHONPEAK build FAILED after 1s! Log excerpt: toolchain.inc:205: toolchain.inc:207: To try to use any toolchain in your path, run 'make menuconfig', then select toolchain.inc:209: the config option: 'General setup', and 'Allow building with any toolchain' toolchain.inc:211: Note that this is NOT supported. Using it means you're on your own. toolchain.inc:213: toolchain.inc:215: *** Halting the build. 멈춤. |
Fusing
flashrom : http://www.flashrom.org/Flashrom
How to use : http://www.flashrom.org/Documentation
How to read the manual
flashrom 에서 제공하는 메뉴얼의 확장자는 ".tmpl" 입니다. 이 문서를 읽으려면 아래와 같이 준비해야 합니다.
poplinux@raw coreboot $ > sudo aptitude install docbook-utils poplinux@raw coreboot $ > sudo aptitude install xmlto poplinux@raw coreboot $ > docbook2html [tmplfile].tmpl |
=> man page 로 만들다가 에러 발생했음.
How to get flashrom
Get the source code and build
poplinux@raw coreboot $ > svn co svn://flashrom.org/flashrom/trunk flashrom poplinux@raw coreboot $ > cd flashrom poplinux@raw coreboot $ > make poplinux@raw coreboot $ > sudo make install |
Get the pre-builded package
poplinux@raw coreboot $ > sudo aptitude install flashrom |
How to use the flashrom
dump
poplinux@raw $ > sudo flashrom -p internal:laptop=this_is_not_a_laptop -r BIOS1_org.bin |
Write
coreboot (2) | 2016.05.13 |
---|---|
How to use serial console on Intel rangeley platform (0) | 2016.03.18 |
[gcc] -march, -mtune 옵션 (0) | 2016.01.08 |
[gcc] __attribute__((......)) 키워드 (0) | 2016.01.06 |
openwrt (0) | 2015.02.24 |
ARM cpu 는 아키텍쳐 버전과 해당 아키텍쳐에 해당하는 모델명으로 구분이 가능합니다.
예를 들어, armv7-a, armv7-r, armv7-m 은 아키텍커 버전이고 cortex-a5, cortex-a7, cortex-a9, cortex-a11 은 armv7 에 속하는 모델로 볼 수 있습니다.
각 아키텍쳐와 모델은 각각의 특징을 가지고 있습니다. 각각의 특징은 arm 홈페이지에 가서 확인해 보시면 됩니다.
각 아키텍쳐는 하위 호환성을 가지고 있기 때문에 별다른 옵션을 주지 않고 컴파일해도 무방합니다.
아키텍쳐를 정확히 지정하여 컴파일 할 경우 아래와 같이 차이가 나는 것을 확인 할 수 있다.
arm-none-linux-gnueabi-gcc -march=armv7-a -mtune=cortex-a5 -S test.c |
arm-none-linux-gnueabi-gcc -S test.c |
.arch armv7-a .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 2 .eabi_attribute 30, 6 .eabi_attribute 34, 1 .eabi_attribute 18, 4 .file "test.c" .section .rodata .align 2 .LC0: .ascii "babo\000" .text .align 2 .global main .type main, %function main: .fnstart @ args = 0, pretend = 0, frame = 8 @ frame_needed = 1, uses_anonymous_args = 0 stmfd sp!, {fp, lr} .save {fp, lr} .setfp fp, sp, #4 add fp, sp, #4 .pad #8 sub sp, sp, #8 str r0, [fp, #-8] str r1, [fp, #-12] movw r0, #:lower16:.LC0 movt r0, #:upper16:.LC0 bl puts mov r3, #0 mov r0, r3 sub sp, fp, #4 @ sp needed ldmfd sp!, {fp, pc} .fnend .size main, .-main .ident "GCC: (Sourcery CodeBench Lite 2014.05-29) 4.8.3 20140320 (prerelease)" .section .note.GNU-stack,"",%progbits |
.arch armv5te .fpu softvfp .eabi_attribute 20, 1 .eabi_attribute 21, 1 .eabi_attribute 23, 3 .eabi_attribute 24, 1 .eabi_attribute 25, 1 .eabi_attribute 26, 2 .eabi_attribute 30, 6 .eabi_attribute 34, 0 .eabi_attribute 18, 4 .file "test.c" .section .rodata .align 2 .LC0: .ascii "babo\000" .text .align 2 .global main .type main, %function main: .fnstart @ args = 0, pretend = 0, frame = 8 @ frame_needed = 1, uses_anonymous_args = 0 stmfd sp!, {fp, lr} .save {fp, lr} .setfp fp, sp, #4 add fp, sp, #4 .pad #8 sub sp, sp, #8 str r0, [fp, #-8] str r1, [fp, #-12] ldr r0, .L3 bl puts mov r3, #0 mov r0, r3 sub sp, fp, #4 @ sp needed ldmfd sp!, {fp, pc} .L4: .align 2 .L3: .word .LC0 .fnend .size main, .-main .ident "GCC: (Sourcery CodeBench Lite 2014.05-29) 4.8.3 20140320 (prerelease)" .section .note.GNU-stack,"",%progbits |
How to use serial console on Intel rangeley platform (0) | 2016.03.18 |
---|---|
How to install ubuntu to rangeley (1) | 2016.01.21 |
[gcc] __attribute__((......)) 키워드 (0) | 2016.01.06 |
openwrt (0) | 2015.02.24 |
[network] nat 설정법 (0) | 2015.01.15 |
- unused variable
int foo(void)
{
int i __attribute__((unused));
return 0;
}
- unused function
static int foor(void) __attribute__((unused));
static int foo(void)
{
int i;
return 0;
}
- unused label
#define HAVE_CHECK
int foo(int mode)
{
#ifdef HAVE_TYPE
if (mode == TYPE) goto LABEL_TYPE;
#endif
#ifdef HAVE_CHECK
if (mode == CHECK) goto LABEL_CHECK;
#endif
LABEL_TYPE:
__attribute__((cold, unused));
return 0;
LABEL_CHECK:
__attribute__((cold, unused));
return -1;
return 0;
}
How to install ubuntu to rangeley (1) | 2016.01.21 |
---|---|
[gcc] -march, -mtune 옵션 (0) | 2016.01.08 |
openwrt (0) | 2015.02.24 |
[network] nat 설정법 (0) | 2015.01.15 |
[linux] debug fs 사용법 (0) | 2015.01.07 |
안녕하세요.
MAF 센서를 청소하였습니다. Mass Air Flow Sensor 는 유입되는 공기량을 측정하는 센서로써, 연료와의 혼합비를 결정하는 중요한 센서입니다.
상태가 안 좋으면 연비도 안 좋아지고, 힘도 안 좋아지고 차체 떨림도 발생하게 됩니다.
준비물
1. airflow sensor cleaner
꼭 MAF 전용 클리너를 사용해야 합니다. 용기 있는분 WD40 으로 도전해 보세요. 지옥을 보게 될 겁니다.
2. 십자 드라이버
작업 순서
1. 십자 드라이버를 사용해서 MAF 센서를 분리합니다.
제 MAF 센서인데, 촛점이 나가긴 했지만 그래도 시커멓게 때가 꼈다는 게 한눈에 보이죠?
2. 청소하기
클리너를 5초정도 뿌려 줍니다. 잠시 마르기를 기다렸다가 다시 뿌려주기를 5번 정도 해 주면 아래와 같이 깨끗하게 청소 됩니다.
3. 분해의 역순으로 조립하면 됩니다. .
청소후에는 확실히 힘이 좋아졌네요.
How to create the AUX on LS430 (0) | 2015.11.23 |
---|---|
[카메이트] 무스원 사용기 (0) | 2015.02.22 |
[소낙스] 브릴리언트 샤인 디테일러 (0) | 2014.10.19 |
[글로스브로] 버블밤 후기 (0) | 2014.10.19 |
놀러 가는거 (0) | 2014.08.12 |
Hi everyone.
I'm have a luxury sedan that model is a LS430.
LS430 is very nice car to me. Very silence and smooth riding.
But LS430 have a one bad thing. It is a not support MP3, Bluetooth and AUX input.
So, Many owner are try to find that How to create the AUX or install the MP3 or Bluetooth.
Some vendors are recommended the one way. This way is install mp3 device on LS430.
The mp3 device is such as Yatour and etc.
So, I was bough the Yatour and install to my LS430. But not Satisfied. Because this device not support the title and lyrics.
Anyway, a few month past, I'm try to find the solution for create the AUX on my LS430.
This time. I'm get a service manual for head-unit. model name is a Pioneer FX-MG9106ZT/EW.
The service manual are include the schematic of head-unit and description of pin's.
My JOB is a programmer and have a hardware skills.
Last week I'm try to modified the my head-unit and finally successfully create a AUX input using the Tape DECK audio path.
I'm expect to help for you by my post.
1. Introduce
This head-unit are have a 3 audio path.
First. Path of Tape Deck
Second. Path of CD
Third. Radio
I'm choice the path of Tape DECK. Because I'm not use this media.
2. How to create aux
It is very simple.
Tape audio line and CD audio line are mixed in the NJM2068MD AMP IC.
So, My goal is a cut the TAPE DECK audio path before the NJM2068MD.
And connect the AUX audio path to this point.
See below schematic.
R341 is Left Channel of TAPE DECK
R342 is Right Channel of TAPE DECK
Step 1. You must de-soldering Left side(Tape deck, Right side is mixer) of R341, R342.
Step 2. connect the AUX L,R into desolded R341 and R342.
Step 3. connect the AUX ground into the common ground of head-unit.
Step 4. Enjoy.
Additional, You must insert the TAPE to deck. every time.
Because if not insert the TAPE to DECK. head-unit are not enable the TAPE deck.
If you want to without TAPE media, need a more step. But It is such a hassle for me.
Enjoy.
How to clean-up MAF Sensor of LS430 (0) | 2015.12.31 |
---|---|
[카메이트] 무스원 사용기 (0) | 2015.02.22 |
[소낙스] 브릴리언트 샤인 디테일러 (0) | 2014.10.19 |
[글로스브로] 버블밤 후기 (0) | 2014.10.19 |
놀러 가는거 (0) | 2014.08.12 |
openwrt
소스 다운로드
Trunk
git clone git://git.openwrt.org/openwrt.git openwrt
14.07 branch (Barrier Breaker)
git clone git://git.openwrt.org/14.07/openwrt.git
필요 유틸들
gcc
binutils
bzip2
flex
python
perl
make
find
grep
diff
unzip
gawk
getopt
subversion
libz-dev
libc-headers
Configure
$ > make menuconfig $ > make kernel_menuconfig => initramdisk 를 사용할 수 있도록 커널 설정을 변경한다. |
build
$ > make |
결과물
$ > ls bin/at91 md5sums openwrt-at91-AT91SAM9G25EK-rootfs.tar.gz openwrt-at91-root.jffs2-128k openwrt-at91-root.squashfs openwrt-at91-vmlinux-initramfs.elf packages/ uImage openwrt-at91-9g25ek-uImage openwrt-at91-root.ext4 openwrt-at91-root.jffs2-64k openwrt-at91-rootfs.cpio.gz u-boot.2010.06.bin |
결과물에서 사용할 것은,
uImge => kernel image
openwrt-at91rootfs.cpio.gz => rootfs image
at91sam9x25ek.dtb => fdt file(이건 하위 디렉토리 검색해서 찾아보면 됨)
인데, 아래와 같이 적당히 가공을 해 주어야 한다.
cp uImge openwrt.kernel
cp at91sam9x25ek.dtb 3.10.dtb
mkimage -n "Ramdisk Image" -A arm -O linux -T ramdisk -C gzip -d openwrt-at91-rootfs.cpio.gz openwrt.rootfs
부팅
U-boot > tftp 0x21000000 poplinux/3.10.dtb U-boot > tftp 0x22000000 poplinux/openwrt.kernel U-boot > tftp 0x23000000 poplinux/openwrt.rootfs U-boot > bootm 0x22000000 0x23000000 0x21000000 ## Booting kernel from Legacy Image at 22000000 ... Image Name: linux-2.6 Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 7163428 Bytes = 6.8 MiB Load Address: 20008000 Entry Point: 20008000 Entry Point: 20008000 Verifying Checksum ... OK ## Loading init Ramdisk from Legacy Image at 23000000 ... Image Name: Ramdisk Image Image Type: ARM Linux RAMDisk Image (gzip compressed) Data Size: 1542835 Bytes = 1.5 MiB Load Address: 00000000 Entry Point: 00000000 Verifying Checksum ... OK ## Flattened Device Tree blob at 21000000 Booting using the fdt blob at 0x21000000 Loading Kernel Image ... OK Loading Ramdisk to 27c6b000, end 27de3ab3 ... OK Loading Device Tree to 27c63000, end 27c6aa3a ... OK Starting kernel ... [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 3.10.49 (poplinux@raw) (gcc version 4.8.3 (OpenWrt/Linaro GCC 4.8-2014.04 r4445 [ 0.000000] CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177 BusyBox v1.22.1 (2015-02-24 12:13:29 KST) built-in shell (ash) Enter 'help' for a list of built-in commands. _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M ----------------------------------------------------- BARRIER BREAKER (Barrier Breaker, r44441) ----------------------------------------------------- * 1/2 oz Galliano Pour all ingredients into * 4 oz cold Coffee an irish coffee mug filled * 1 1/2 oz Dark Rum with crushed ice. Stir. * 2 tsp. Creme de Cacao ----------------------------------------------------- root@OpenWrt:/# |
Buildroot
외부 컴파일러 사용
외부 컴파일러를 사용하는 목적은 크게 두가지입니다.
1. 여러 개발자들이 개발환경을 동일하게 사용하기 위해서.
2. 컴파일러를 빌드하는 시간을 아끼기 위해서.
우선, openWRT 를 full-build 합시다. full-build 를 하게 되면 staging_dir 디렉토리 밑에 tool-chain 이 생성됩니다.
생성된 tool-chain 을 아래와 같이 원하는 디렉토리로 복사합니다.
$ openWRT > cp -arf staging_dir/toolchain-arm_arm926ej-s_gcc-4.8-linaro_uClibc-0.9.33.2_eabi /usr/local/sdk/atmel/sdk/
tool-chain 복사가 끝났다면, 아래와 같이 설정을 잡아 줍니다.
$ openWRT > make menuconfig
[*] Advanced configuration options (for developers) --->
[*] Use external toolchain --->
[ ] Use host's toolchain
(arm-openwrt-linux-uclibcgnueabi) Target name
(arm-openwrt-linux-uclibcgnueabi-) Toolchain prefix
(/usr/local/sdk/atmel/sdk/toolchain-arm_arm926ej-s_gcc-4.8-linaro_uClibc-0.9.33.2_eabi) Toolchain root
(uclibc) Toolchain libc
(./usr/bin ./bin) Toolchain program path
(./usr/include ./include) Toolchain include path
(./usr/lib ./lib) Toolchain library path
새로운 팩키지 추가 방법
참조 사이트 : http://wiki.openwrt.org/doc/devel/packages
디렉토리 생성
$ openWRT > mkdir package/hello |
Makefile
# rules.mk 를 최상단에 무조건 삽입해야 한다. include $(TOPDIR)/rules.mk # 패키지에 대한 기본 정보를 설정한다. PKG_NAME:=hello PKG_VERSION:=1.0 PKG_RELEASE:=1 # 팩키지를 어느 디렉토리에서 빌드할 것인지 지정한다. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME) # 팩키지의 소스가 어디인지를 지정한다. PKG_SRC_DIR:=$(TOPDIR)/package/hello/src # tmp/.config-package.in 을 자동 생성하는데 사용된다. # help 항목으로 저장됨. PKG_MAINTAINER:=kay.kim # package.mk 를 반드시 삽입해야 한다. include $(INCLUDE_DIR)/package.mk ################################################################################################### ################################################################################################### ################################################################################################### # For create "tmp/.config-package.in" # 아래 정보는, tmp/.config-package.in 을 자동 생성하는데 사용된다. # SECTION : 별 의미 없는 것으로 보임. # CATEGORY : "test" 라는 상위 메뉴에 소속됨을 알림. => menu "test" 로 변환됨 # TITLE : "................................... hello example" 로 변환됨 # URL : help 항목으로 저장됨. define Package/hello/Default SECTION:=test CATEGORY:=test TITLE:=hello example URL:=test.net endef # tmp/.config-package.in 을 자동 생성하는데 사용된다. # help 항목으로 저장됨. define Package/hello/Default/description This is just sample for "How to add new project to buildroot" endef # tmp/.config-package.in 생성과정에서 필요한 정보를 정의한 "Package/hello/Default" 를 호출해준다. define Package/hello $(call Package/hello/Default) endef # tmp/.config-package.in 생성과정에서 필요한 정보를 정의한 "Package/hello/Default" 를 호출해준다. define Package/hello/description $(call Package/hello/Default/description) endef ################################################################################################### ################################################################################################### ################################################################################################### # 실제 빌드에 관련된 동작을 관장하는 부분입니다. # 소스 설치등의 컴파일 이전에 필요한 내용을 준비합니다. define Build/Prepare @echo "[S]==========================================" @echo "[package/hello] : Build/Prepare" $(TOPDIR)/scripts/src_link.sh $(TOPDIR) $(BUILD_DIR) $(PKG_SRC_DIR) $(PKG_NAME) package @echo "[E] Build/Prepare====================" endef # ./configure 를 지원하는 소스일 경우엔, 아래 부분에서 진행하게 됩니다. # 이 예제에서는 사용하지 않습니다. define Build/Configure @echo "[S]==========================================" @echo "[package/hello] : Build/Configure" endef # 빌드시 사용할 추가 설정등을 지정합니다. TARGET_CFLAGS += \ -I$(STAGING_DIR)/usr/include MAKE_FLAGS += \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ -j4 # 아래 섹션을 사용할 경우엔, 컴파일 방법을 원하는 대로 설정할 수 있습니다. #define Build/Compile # @echo "[S]==========================================" # @echo "[package/hello] : Build/Compile" # @echo "[E] Build/Compile============================" #endef # 컴파일이 끝난후, rootfs 나 staging dir 에 설치하는 방법을 지정하는 곳입니다. define Package/hello/install @echo "[S]==========================================" @echo "[package/hello] : Package/hello/install" $(INSTALL_DIR) $(1)/usr/bin $(INSTALL_BIN) $(PKG_BUILD_DIR)/hello $(1)/usr/bin/hello @echo "[E] Package/hello/install====================" endef # 위에서 설정한 모든 내용은, 아래의 BuildPackage 함수를 호출해야 동작되며, # ARG 로 프로젝트의 이름(디렉토리 이름) 을 전달해 주어야 합니다. # 여기서 전달된 이름은 tmp/.config-package.in 에서 "config PACKAGE_hello" 로 변환됩니다. $(eval $(call BuildPackage,hello))
새로운 팩키지 적용
make menuconfig 실행시, 출력되는 메뉴는 tmp/.config-package.in 파일을 참조해서 만들어 지게 되는데,
.config-package.in 파일은 최초 make menuconfig 실행시에 자동으로 생성된다.
만약 중간에 새로운 팩키지를 추가했다면, 아래와 같이 tmp/.config-package.in 파일을 새로 생성해 주어야 한다.
$ openWRT > make prepare-tmpinfo $ openWRT > make menuconfig |
[gcc] -march, -mtune 옵션 (0) | 2016.01.08 |
---|---|
[gcc] __attribute__((......)) 키워드 (0) | 2016.01.06 |
[network] nat 설정법 (0) | 2015.01.15 |
[linux] debug fs 사용법 (0) | 2015.01.07 |
[driver] ipTime N150UA-4dBi (8) | 2014.09.16 |
네이버 퍼펙트 샤인 카페를 통해 카메이트의 무스원이라는 제품을 사용해 보게 되었습니다.
요렇게 생긴 제품입니다.
지하 주차장이 없는 관계로, 먼지가 이렇게 많이 쌓였더군요.
워터리스 세차가 가능한 제품이라고 들었기에 도전해 보았습니다.
결과는,
워터리스 세차용으로는 좀 아닌것 같습니다.
결국, 세차장으로 달려 갔습니다.
제가 보기엔, 외장 세차용으로는 비추이며 엔진룸 청소에는 유용할 것으로 예상됩니다.
How to clean-up MAF Sensor of LS430 (0) | 2015.12.31 |
---|---|
How to create the AUX on LS430 (0) | 2015.11.23 |
[소낙스] 브릴리언트 샤인 디테일러 (0) | 2014.10.19 |
[글로스브로] 버블밤 후기 (0) | 2014.10.19 |
놀러 가는거 (0) | 2014.08.12 |