'2016/01'에 해당되는 글 3건

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

  Homepage : http://www.intel.com/content/www/us/en/intelligent-systems/intel-firmware-support-package/intel-fsp-overview.html


  홈페이지에 접속하여 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>.se 


2.          Run the following command to extract the contents of the *.se file 

  

             ./<filename>.se 


3.          Page through the license using the space bar. At the end enter 'y' 

             and press ENTER to accept the license. 


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).


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




'development' 카테고리의 다른 글

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
블로그 이미지

김유석0

,

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


'development' 카테고리의 다른 글

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
블로그 이미지

김유석0

,

- 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;

  }

'development' 카테고리의 다른 글

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
블로그 이미지

김유석0

,