2011年10月4日 星期二

U-Boot-( 可修改的 ) The hardware dependent configuration and supported hardware model

=============================
SPI Flash support list 在這裡看到可支援的spi flash 型號

Location:
$U-boot_DIR/ include/ spi_type.h
Define:
spi_info[]={ ... };

=============================
U-Boot version (see at booting message) 可以修改開機訊息顯示的版本別

Location:
$U-Boot_DIR/ lib_$ARCH/ board.c
Define:
const char version_string[] = $VERSION;

show message:
U-Boot 1.3.0 (Jan 20 2011 - 09:06:50)

****checksum is effected.****

=============================
U-Boot TEXT_BASE

FILE Location:
$U-Boot_DIR/ board/ $VENDOR/ $BOARD/config.mk

Code:
# RAM version
TEXT_BASE = 0xa000000

u-boot 存放在memory的位置

=============================
U-Boot Hardware dep. Setting Declare.

***宣告要包 哪種 Hardware的設定值
File Location:
$U-Boot_DIR/ include/config.h

Code:
#include _ configs/$BOARD.h _



***硬體相關名稱 ( mk檔多會用到,(if)define亦是 )
File Location:
$U-Boot_DIR/ include/config.mk

Code:
ARCH = $ARCH
CPU = $CPU
BOARD = $BOARD
VENDOR = $VENDOR


***define HW 週邊設定、宣告,時脈、I2C、SPI、bootargs、USB‧‧‧等
File Location:
$U-Boot_DIR/ include/ configs/ $BOARD.h

Code: (部分代碼)
...
#define CONFIG_BAUDRATE 115200
...
#define CONFIG_LOADADDR 0xa0000000 /* default load address */
...



2011年8月30日 星期二

Andriod - adb


<< Source Code >>
**** system/core/adb/adb.c Line: 921

<< target side >>

$> stop adbd
$> set service.adb.tcp.port 5032
$> start adbd

ps.
可將上面三行加入init.rc 執行adbd 之前,就可透過 tcp/ip 傳輸


<< host side >>

$> adb kill-server // 確保連接成功

$> adb connect $TARGET_IP: // 透過tcp/ip 連到android

$> adb devices // 確認連上的設備

$> adb shell $CMD
之後進入另一提示字元,輸入 su即以root權限工作

$> adb disconnect $TARGET_IP:$PORT_NUM // 斷開連接

ps.
adb shell 之後提示字元為
"#" 表示是以 root權限 ;
"$" 表示是以shell權限


2011年8月23日 星期二

Eclipse - Android Emulator invoke Error



[ ISSUE ] 出現以下錯誤訊息,導致模擬器不能執行:

[2011-08-23 15:01:22 - Emulator] invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
[2011-08-23 15:01:22 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-08-23 15:01:22 - Emulator] please use -help for more information


[ 2 Solutions ]

1. 安裝 android SDK 到 沒有空格的目錄 (ex: C:\Android)

原本 assign 的路徑為 C:\PROGRAM FILES\Android\android-sdk
^ 因為空格(space) 導致設定錯誤

2. 在Eclipse 下重新設置路徑

Window > Preference > Android > SDK Location

變成新的路徑 C:\PROGRA~1\Android\android-sdk


2011年8月9日 星期二

linux - Seagate SpinDown Aware



取消隨身硬碟進入睡眠模式不能喚醒問題,將這行指令上去就可以了

echo 1 > /sys/class/scsi_disk/$scsi_disk/allow_restart





資料來源


2011年8月7日 星期日

linux - tr, ^M deletion


去除 行尾的 ^M 字元

cmd> cat $(old_filename) | tr -d '\r' > $(new_filename)



2011年8月3日 星期三

linux - diff


不加入比對的目錄
$> diff -x 'exclude directory' directoryA directoryB

不加入比對的檔案
$> diff -X 'exclude file' directoryA directoryB

2011年7月17日 星期日

linux - diff and patch kernel


以內核(kernel)為例:


--test
|
kernel-new \ (directory)
|
kernel-old \ (directory)
|
patch-update (patched-file)


製作patch file如果有兩個kernel目錄,一個較新一個較舊,利用diff指令比較差異後再重導向某一檔案


#diff -Nru kernel-old kernel-new > patch-update



--test
|
kernel-new \
|
patch-update

使用patch file拿到patch file後update到目錄裡


#> cd kernel-old

update

#> patch -p1 < patch-update



#> cat patch-update | patch -p1


( --dry-run is good param. if not sure -pX value is )
patch file是壓縮檔或是打包形式


#> bzcat patch-update.bz2 | patch -p1


#> zcat patch-update.gz | patch -p1
恢復patch前

#> patch -p1 -R < patch-update

2011年7月7日 星期四

linux - u-boot ( 1st boot msg.)

u-boot 初次開機,出現訊息

*** Warning - bad CRC, using default environment

未初始化環境變數,設定環境變數後即可 ( ex: set macaddr ff:ff:ff:ff:ff:ff )

*** Warning - bad CRC, using default environment

linux - grep, find

找出所有 檔名為readme 且 內含字串 "help"

#> grep help $(find . -name readme)