2010年2月12日 星期五

清除舊的 grub 開機選單

最近在 Ubuntu update 完 kernel 後, 發現舊的也都還在 XD
然後 grub 開機選單就越來越長, 快要超過一頁了
如果要除掉舊的 kernel
假設是要刪除 2.6.31-14 kernel option

cd /boot
sudo rm -rf *2.6.31-14*
sudo update-grub2

2010年2月10日 星期三

ckermit to access serial port (gsm/gprs modem) in (embedded) linux

sudo apt-get install ckermit
cat ~/.kermrc

set modem type none ; There is no modem
set line /dev/ttyS0 ; Specify device name
set carrier-watch off ; If DTR CD are not cross‐connected
set speed 115200 ; Or other desired speed
set flow rts/cts ; If RTS and CTS are cross‐connected

; the following equivalent to kermit -8
set terminal bytesize 8
set command bytesize 8
set parity none ; (or "mark" or "space", if necessary)

set stop-bits 1 ; (rarely necessary)
set flow xon/xoff ; If you can't use RTS/CTS
connect ; Enter Connect (terminal) state

如果是要存取 gsm/gprs modem 的話,也可以試

set modem type user ; User defined
set modem name my-gsm ; gsm/gprs modem with AT commands
set modem capabilities at
set modem carrier-watch off
set modem kermit-spoof off
set modem flow-control none
set input echo on

set line /dev/ttyS0 ; Specify device name
set carrier-watch off ; If DTR CD are not cross connected
set speed 115200 ; Or other desired speed

; the following equivalent to kermit -8
set terminal bytesize 8
set command bytesize 8
set parity none ; (or "mark" or "space", if necessary)
set stop-bits 1 ; (rarely necessary)
set flow none
set local-echo on

; output AT\13 ; modem expect carriage return (13 in decimal or 0xD in hex)
lineout AT ; lineout would add carriage return for you
connect ; Enter Connect (terminal) state, you should see AT response OK

最後 sudo kermit 就可以 access

另外在 windows 上也可以用 putty 連線到 serial port, 選 serial 設定 baud rate 就可以 connect, 比一些 dummy terminal 好用一點, 至少有 copy/paste 可以用 :P

要 cross compile ckermit 時,需要先 build host 版本的 wuart, 把 wuart 保留一份 host build 的版本,在 cross compile target 中 failed 時手動換回 host 版本 wuart,再繼續 build 出 wermit, 要自己 rename 為 kermit :P