UBoot>tftp a1100000 uImage
UBoot>protect off 100000 47FFFF
UBoot>erase 100000 47FFFF
UBoot>cp.b a1100000 100000 200000
--
UBoot>tftp a1480000 rootfs.jffs2
UBoot>protect off 480000 137FFFF
UBoot>erase 480000 137FFFF
UBoot>cp.b a1480000 480000 F00000
--
setenv bootcmd run linux
setenv bootdelay 1
--
run linux
--
vi /etc/init.d/rcS
/d2mced & #刪掉
window #刪掉
--
vi /etc/profile
rm -f /task_id_0/*
rm -f /task_id_1/*
/d2mced &
window
--
mkdir 0album
tftp host -g get -r filename
tftp 192.168.0.10 -g get -r img001.jpg
tftp 192.168.0.10 -g get -r img002.jpg
tftp 192.168.0.10 -g get -r img003.jpg
tftp 192.168.0.10 -g get -r img004.jpg
tftp 192.168.0.10 -g get -r img005.jpg
tftp 192.168.0.10 -g get -r img006.jpg
tftp 192.168.0.10 -g get -r img007.jpg
tftp 192.168.0.10 -g get -r img008.jpg
tftp 192.168.0.10 -g get -r img009.jpg
tftp 192.168.0.10 -g get -r img010.jpg
tftp 192.168.0.10 -g get -r img011.jpg
tftp 192.168.0.10 -g get -r img012.jpg
tftp 192.168.0.10 -g get -r img013.jpg
tftp 192.168.0.10 -g get -r img014.jpg
tftp 192.168.0.10 -g get -r img015.jpg
tftp 192.168.0.10 -g get -r img016.jpg
tftp 192.168.0.10 -g get -r img017.jpg
tftp 192.168.0.10 -g get -r img018.jpg
tftp 192.168.0.10 -g get -r pic001.jpg
tftp 192.168.0.10 -g get -r pic002.jpg
tftp 192.168.0.10 -g get -r pic003.jpg
tftp 192.168.0.10 -g get -r pic004.jpg
tftp 192.168.0.10 -g get -r pic005.jpg
tftp 192.168.0.10 -g get -r pic006.jpg
tftp 192.168.0.10 -g get -r pic007.jpg
tftp 192.168.0.10 -g get -r pic008.jpg
--
bootargs=root=/dev/mtdblock3 rw rootfstype=jffs2 console=ttyS0,9600n8 mem=64M ip=192.168.0.101:192.168.0.10:192.168.0.1:255.255.255.0::eth0:off ether=00:16:08:40:13:72
bootargs=root=/dev/mtdblock3 rw rootfstype=jffs2 console=ttyS0,9600n8 mem=64M ip=192.168.0.102:192.168.0.10:192.168.0.1:255.255.255.0::eth0:off ether=00:11:22:33:44:55
bootargs=root=/dev/mtdblock3 rw rootfstype=jffs2 console=ttyS0,9600n8 mem=64M ip=192.168.0.101:192.168.0.10:192.168.0.1:255.255.255.0::eth0:off ether=00:16:f8:40:18:35
2011年1月21日 星期五
2010年11月21日 星期日
framework
在完成Android系統上函式庫層的D2MCE原生碼實作之後,我們將於框架層將設計出方便應用程式開發所用的Java元件。該元件對上提供方便使用的類別與介面及方法,對下則透過JNI與函式庫層的原生碼整合。以下是預計提供的介面類別的宣告與使用方式。
Android D2MCE Java 套件:
import com.eps.d2mce;
說明:Android應用程式引入此套件方可使用D2MCE服務與元件
Android D2MCE執行時期服務取得:
D2MCEManager mD2Mgr = D2MCE.getService("group_name");
說明:若應用程式需使用D2MCE的服務,則透過D2MCE的靜態方法getService()將可加入一名為"group_name"的運算群組。該方法將傳回一D2MCE管理者物件。
Android D2MCE 共享物件宣告與配置
D2MCESharedData mSharedData =
new D2MCESharedData(mD2Mgr, "data_name");
說明:D2MCE將提供一泛形(generic)共享物件類別,在配置共享物件時指定所共享的資料形態(SomeType),建構子中指定D2MCE管理者(代表D2MCE運算群組)與共享資料名稱即可完成配置。(資料大小由SomeType型別決定。)
Android D2MCE 共享物件內容存取
SomeType value = mySharedData.getValue();
mySharedData.setValue(value);
說明:D2MCESharedData類別將提供getValue與setValue方法,用來存取實際型態為SomeType的共享資料內容值。
Android D2MCE 共享物件存取同步方法
mySharedData.lock();
mySharedData.unlock();
說明:D2MCESharedData類別將提供lock與unlock方法,用來實現分散式共享資料存取所需的同步與臨界區間(critical section)運作。(這部分無法使用Java的Synchronized方法與程式區塊的方式實現,而須另行提供,因為我們所面對的環境是分散式的環境,而非單一機器的多執行緒環境。)
以上為Android D2MCE實作應該提供的基本的元件類別。除此之外,我們也應該允許程式開發者透過繼承D2MCESharedData類別的方式來定義自己的共享物件類別;而在資料存取的同步問題,亦可在子類別中定義專用的存取方法,將lock與unlock的同步機制包含於實作中,方便使用。
Android D2MCE Java 套件:
import com.eps.d2mce;
說明:Android應用程式引入此套件方可使用D2MCE服務與元件
Android D2MCE執行時期服務取得:
D2MCEManager mD2Mgr = D2MCE.getService("group_name");
說明:若應用程式需使用D2MCE的服務,則透過D2MCE的靜態方法getService()將可加入一名為"group_name"的運算群組。該方法將傳回一D2MCE管理者物件。
Android D2MCE 共享物件宣告與配置
D2MCESharedData
new D2MCESharedData
說明:D2MCE將提供一泛形(generic)共享物件類別,在配置共享物件時指定所共享的資料形態(SomeType),建構子中指定D2MCE管理者(代表D2MCE運算群組)與共享資料名稱即可完成配置。(資料大小由SomeType型別決定。)
Android D2MCE 共享物件內容存取
SomeType value = mySharedData.getValue();
mySharedData.setValue(value);
說明:D2MCESharedData類別將提供getValue與setValue方法,用來存取實際型態為SomeType的共享資料內容值。
Android D2MCE 共享物件存取同步方法
mySharedData.lock();
mySharedData.unlock();
說明:D2MCESharedData類別將提供lock與unlock方法,用來實現分散式共享資料存取所需的同步與臨界區間(critical section)運作。(這部分無法使用Java的Synchronized方法與程式區塊的方式實現,而須另行提供,因為我們所面對的環境是分散式的環境,而非單一機器的多執行緒環境。)
以上為Android D2MCE實作應該提供的基本的元件類別。除此之外,我們也應該允許程式開發者透過繼承D2MCESharedData
2010年9月27日 星期一
2010年9月12日 星期日
d2mce_mutex_rw
d2mce_mutex_rw(&mutex, 4, A, "rw", B, "rw", initialized, "rw", schedule_index, "rw");
這是幹嘛用的
其實就是
d2mce_mutex_lock( &mutex);
d2mce_load ( A );
d2mce_load ( initialized);
d2mce_load ( schedule_index );
d2mce_mutex_lock( &mutex);
d2mce_load ( A );
d2mce_load ( initialized);
d2mce_load ( schedule_index );
的合起來
再問一個d2mce_mutex_rw(&mutex, 1,initialized,"r");
這個是什麼組合?
d2mce_mutex_rw(&mutex, 1,initialized,"r");
裡面的 &mutex 是指 mutex_lock 的變數
裡面的 &mutex 是指 mutex_lock 的變數
1 是指 後面有一個 共享變數
那個共享變數叫 initialized
然後 只可以 "r" = load
rw 就是 可以 load 也可以 store
2010年8月9日 星期一
D2MCE 簡易實作步驟
https://pms.eps.csie.ntut.edu.tw/trac/d2mce/wiki/Reference
https://pms.eps.csie.ntut.edu.tw/svn/d2mce/
d2mce在64bit機器上會壞掉
只能在32bit上執行
首先利用svn下載至電腦上
#apt-get install subversion
#svn co https://pms.eps.csie.ntut.edu.tw/svn/d2mce/
編譯D2MCE
#cd /d2mce/trunk
#./configure --prefix=/opt/d2mce
#make
#make install
要先在home目錄底下mkdir一個.d2mce_conf且裡面要有d2mce.conf
#~/.d2mce_conf/d2mce.conf
這個檔案用來設定用哪一個port哪一個網卡
若沒有這個檔案執行檔案時會出現
root@nisun:/d2mce/trunk/examples/matrix-d2mce-dynamic# ./matrix
can't not open /root/.d2mce_conf/d2mce.conf
Error: read_config() failed.
d2mce init failured
#vim d2mce.conf
編輯內容
network_device eth0
port 55660
若有error while loading shared libraries: libd2mce.so.0: cannot open shared object file: No such file or directory
需要先在/sbin裡
打ldconfig /opt/d2mce/lib/
https://pms.eps.csie.ntut.edu.tw/svn/d2mce/
d2mce在64bit機器上會壞掉
只能在32bit上執行
首先利用svn下載至電腦上
#apt-get install subversion
#svn co https://pms.eps.csie.ntut.edu.tw/svn/d2mce/
編譯D2MCE
#cd /d2mce/trunk
#./configure --prefix=/opt/d2mce
#make
#make install
要先在home目錄底下mkdir一個.d2mce_conf且裡面要有d2mce.conf
#~/.d2mce_conf/d2mce.conf
這個檔案用來設定用哪一個port哪一個網卡
若沒有這個檔案執行檔案時會出現
root@nisun:/d2mce/trunk/examples/matrix-d2mce-dynamic# ./matrix
can't not open /root/.d2mce_conf/d2mce.conf
Error: read_config() failed.
d2mce init failured
所以要先做
#cd ~
#mkdir .d2mce_conf
#cd .d2mce_conf
#vim d2mce.conf
編輯內容
network_device eth0
port 55660
然後:wq
port最好大於1024
接下來還要再開一個程式
在/opt/d2mce/bin內的d2mced
這是一個daemon用來控制整個group
所以必須先開daemon
#/opt/d2mce/bin/d2mced
接下來就可以執行程式了
我們執行一個example
#cd /d2mce/trunk/examples/matrix-d2mce-dynamic
#make
#./matrix
可以看到結果
Vector Size:512
Matrix size:262144
Processing time:1.956712
msg count:184
msg byte :5474
daemon exit ok!!
若有error while loading shared libraries: libd2mce.so.0: cannot open shared object file: No such file or directory
需要先在/sbin裡
打ldconfig /opt/d2mce/lib/
2010年2月11日 星期四
2010年2月9日 星期二
Android Activity Life Cycle Demo
public class LifeCycleTest extends Activity {
private static final String TAG = "ActivityLifeTest";
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Log.v(TAG, "onCreate");
Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
}
public void onStart() {
super.onStart();
Log.v(TAG, "onStart");
}
public void onResume() {
super.onResume();
Log.v(TAG, "onResume");
}
public void onPause() {
super.onPause();
Log.v(TAG, "onPause");
}
public void onStop() {
super.onStop();
Log.v(TAG, "onStop");
}
public void onRestart() {
super.onRestart();
Log.v(TAG, "onReStart");
}
public void onDestroy() {
super.onDestroy();
Log.v(TAG, "onDestroy");
}
}
First, new a project with Google APIs.
Then, Run it.
We can see that Log:ActivityLifeTest is onPause now. It means the Intent start another Activity.
If we press “BACK”, Activity:LifeCycleTest will resume again.
Now, restart the Activity, and press “Maps”.
We can find out that Activity:LifeCycleTest is stopped. It means Activity:LifeCycleTest is no longer visible.
Finally, press “BACK” to the Activity:LifeCycleTest, and Activity:LifeCycleTest will restart.
If we leave the Activity:LifeCycleTest, Activity:LifeCycleTest will be destroyed.
Reference:
http://stenlyho.blogspot.com/search/label/Android
http://code.google.com/p/androidbmi/wiki/LifeCycle
http://developer.android.com/intl/zh-TW/guide/topics/fundamentals.html
üW
üWe
2010年2月8日 星期一
2010年2月4日 星期四
Run linux kernel on PXA270
After the connection between host and hardware devices, we install the driver so that we can use host's COM to connect the device.
go http://www.squarechair.net/arkmicro/ first,
then go to http://www.cpu.com.tw/kh/comp/usb/usb4.html download drivers.
Install both, and you can see one more COM at 裝置管理員
We need shared folders between Windows and VirtualBox.
Fisrt,
Turn on the Virtual Box.
Right click at the red block of following picture.
Logout and login
Then type sudo mount.vboxsf "windows shared folder name" "linux shared folder path"
Copy file to the shared folders.
\critical\research_Embedded\Creator PXA270 v107\Linux\bin\arm-linux-toolchain-bin.4.0.2.tar.gz
\critical\research_Embedded\Creator PXA270 v107\Linux\src\linux-2.6.15.3-creator-pxa270.patch
\critical\research_Embedded\Creator PXA270 v107\Linux\src\mt-linux-2.6.15.3.tar.gz
look at linux..
Then we need install tool chain first.
PDF at \critical\research_Embedded\Creator PXA270 v107\Linux\Doc
\Linux for Creator-XScale-PXA270 User Guide.pdf
see chapter 2-1-3
Turn on the Linux Terminal
Type:
$cp
$cd /
$tar -zxvf arm-linux-toolchain-bin.4.0.2.tar.gz
$vim /etc/bash.bashrc
Add the following text at the end of bash.bashrc
PATH=/opt/microtime/pro/devkit/arm/pxa270/gcc-4.0.2-glibc-2.3.3/arm-unknown-linux-gnu/bin:$PATH
export PATH
Turn off the terminal, and restart it.
Test by typing arm- [tab] [tab]
you will see
Now, install Creator-XSale-PXA270 kernel source and file patch
see the Linux for Creator-XScale-PXA270 User Guide.pdf chapter 3
We can ignore 3-2-2: set root filesystem.
Turn on 超級終端機 on windows.
Turn on the PXA270.
set pxa270 ip and server(windows) ip.(at 超級終端機)
$setenv ipaddr xxx.xxx.xxx.www
$setenv serverip yyy.yyy.yyy.zzz
note: xxx.xxx.xxx must be the same as yyy.yyy.yyy
$saveenv
We need tftp to push uImage in pxa270.
So, download tftp server at http://tftpd32.jounin.net/
and we put uImage at tftp shared folder.
note: uImage at linux /usr/src/microtime/build-linux/output/flash_boot/uImage
Type command at 超級終端機:
$tftp 0xa1000000 uImage
$bootm 0xa1000000
Done!
Result:
2010年2月3日 星期三
JBox2D Demo on Eclipse
- Download
- jbox2d-2.0.1-library-only.jar
- core.jar
- Pendulum_src.zip
- at
- http://sourceforge.jp/projects/matereal/svn/view/connector/trunk/lib/jbox2d/jbox2d-2.0.1-library-only.jar?view=log&root=matereal&pathrev=60
- http://code.google.com/p/bsim-bccs/downloads/detail?name=core.jar&can=2&q=
- http://www.jbox2d.org/
- In Eclipse:
- Open New->Java project->create project from existing source
- Type project name and browse the file which is extracted from Pendulum_src.zip => finish
- Create a folder /lib/ at project
- Right Click on /lib, select Import
- Select General / File System
- Choose the directory of
- jbox2d-2.0.1-library-only.jar
- core.jar
- Import the file jbox2d.jar
- Right click on the project and select "Properties"
- Click on "Java Build Path" and select the "Libraries" tab
- Click on "Add JARs..." and pick the file
- jbox2d-2.0.1-library-only.jar
- core.jar
OR
just download at http://www.jbox2d.org/v2demos/
And open a java project with Eclipse
Then Run Java Application at package org.jbox2d.testbed TestbedMain.java
Reference:
http://www.jbox2d.org/
http://sourceforge.jp/projects/matereal/svn/view/connector/trunk/lib/jbox2d/jbox2d-2.0.1-library-only.jar?view=log&root=matereal&pathrev=60
http://code.google.com/p/bsim-bccs/downloads/detail?name=core.jar&can=2&q=
http://www.anddev.org/how-to_2d_physics_with_box2d-t5099.html
http://kinozem1.hit.ac.jp/~hachiya/pukiwiki/index.php?JBox2D
http://www.jbox2d.org/v2demos/
just download at http://www.jbox2d.org/v2demos/
And open a java project with Eclipse
Then Run Java Application at package org.jbox2d.testbed TestbedMain.java
Reference:
http://www.jbox2d.org/
http://sourceforge.jp/projects/matereal/svn/view/connector/trunk/lib/jbox2d/jbox2d-2.0.1-library-only.jar?view=log&root=matereal&pathrev=60
http://code.google.com/p/bsim-bccs/downloads/detail?name=core.jar&can=2&q=
http://www.anddev.org/how-to_2d_physics_with_box2d-t5099.html
http://kinozem1.hit.ac.jp/~hachiya/pukiwiki/index.php?JBox2D
http://www.jbox2d.org/v2demos/
訂閱:
文章 (Atom)