환경

  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

,