'rangeley'에 해당되는 글 2건

환경

  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

# /boot/grub/grub.cfg. # For full documentation of the options in this file, see: # info -f grub -n 'Simple configuration' GRUB_DEFAULT=0 #GRUB_HIDDEN_TIMEOUT=0 GRUB_HIDDEN_TIMEOUT_QUIET=true GRUB_TIMEOUT=2 GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` GRUB_CMDLINE_LINUX_DEFAULT="console=ttyS1,115200n8" GRUB_CMDLINE_LINUX="" # Uncomment to enable BadRAM filtering, modify to suit your needs # This works with Linux (no patch required) and with any kernel that obtains # the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...) #GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef" # Uncomment to disable graphical terminal (grub-pc only) ## Serial console GRUB_TERMINAL=serial GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1" # The resolution used on graphical terminal # note that you can use only modes which your graphic card supports via VBE # you can see them in real GRUB with the command `vbeinfo' #GRUB_GFXMODE=640x480 # Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux #GRUB_DISABLE_LINUX_UUID=true # Uncomment to disable generation of recovery mode menu entries #GRUB_DISABLE_RECOVERY="true" # Uncomment to get a beep at grub start #GRUB_INIT_TUNE="480 440 1"



$ > sudo grub-mkconfig -o /boot/grub/grub.cfg



로그인 쉘을 시리얼로 보려면 

/etc/init/ttyS1.conf 를 추가한다.


$ > vi /etc/init/ttyS1.conf


# ttyS1 - getty # # This service maintains a getty on tty6 from the point the system is # started until it is shut down again. start on runlevel [12345] and not-container stop on runlevel [!12345] respawn exec /sbin/getty -L 115200 ttyS1 vt102



$ > sudo start ttyS1 => 바로 동작됨

$ > reboot => 재부팅후 자동 동작됨




'development' 카테고리의 다른 글

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

김유석0

,

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

,