$ find ~/myspace/git/opencore -type f -name "*.[ch] -o -name "*.cpp" -exec grep -I "equalizer" {} \; -print
find/grep command
The following command searches C/C++ source code to find the content of "equalizer".
ubuntu 8.04 - wireless network setup
I spent less than 9 hours to setup my wireless card on ubuntu. When use "lspci" command, I get the name of my wireless card, which is "AR2413 802.11bg".
Here is the brief.
I also installed wpa_supplicant but it does not seem to be needed.
After I reboot the OS, I found the system could not find ath0, so what I did is "sudo modprobe wlan_scan_sta" and reboot again, this time ath0 appears.
Here is the brief.
1. disable the Atheros proprietary drivers from "system->adminstrator->hardware drivers"
2. unplug the wired ethernet line
3. extract ndiswrapper-1.55.tar.gz, and make & sudo make install
4. extract madwifi-hal-0.10.5.6-r3835-20080801.tar.gz, make & sudo make install
5. extract Wireless_Atheros.zip, use ndisgtk to install the net5211.inf
or
$ sudo ndiswrapper -a XXXX:YYYY ath0 (here XXXX:YYYY is get from lspci -n for Atheros card)
6. setup
add ndiswrapper at the end of /etc/modprobe.d/blacklist
add ath_pci at the end of /etc/modules
$ sudo iwconfig
$ sudo lshw -C network
$ iwlist scan (to find my wireless network)
$ sudo network-admin (which should setup wireless network)
check the following configuration at /etc/network/interfaces
=======================
iface ath0 inet dhcp
wireless-key XXXX
wireless-essid fade
auto ath0
=======================
Here XXXX is my wep password.
call "/etc/init.d/networking restart" to restart
I also installed wpa_supplicant but it does not seem to be needed.
After I reboot the OS, I found the system could not find ath0, so what I did is "sudo modprobe wlan_scan_sta" and reboot again, this time ath0 appears.
fedora 10 - setup i686 environment for android (1)
0. install git ($ sudo yum install git)
1. Download JDK 5.0 (jdk-1_5_0_19-linux-i586-rpm.bin) from sun
2 Play with curl
1. Download JDK 5.0 (jdk-1_5_0_19-linux-i586-rpm.bin) from sun
$ cd /usr/local
$ /tmp/jdk-1_5_0_19-linux-i586.bin
$ sudo updatedb
$ locate javac | grep bin
/usr/local/jdk1.5.0_19/bin/javac (the result)
$ sudo /usr/sbin/alternatives --install /usr/bin/java java /usr/local/jdk1.5.0_19/bin/java 100
$ sudo /usr/sbin/alternatives --install /usr/bin/jar jar /usr/local/jdk1.5.0_19/bin/jar 100
$ sudo /usr/sbin/alternatives --install /usr/bin/javac javac /usr/local/jdk1.5.0_19/bin/javac 100
$ sudo /usr/sbin/alternatives --config java
2 Play with curl
$ cd ~/bin (make sure ~/bin is in $PATH)
$ curl http:/android.git.kernel.org/repo > ~/bin/repo
$ chmod a+x ~/bin/repo
$ cd ~/myspace/mydroid
$ repo init -u git://android.git.kernel.org/platform/manifest.git -b cupcake
$ repo sync
mips - the next example
This example access an array which is a block of buffer.
Here the use of $8 is not the best, because the move the array element is by $4, soe the $8 is not most necessary, because $4 can be used to check the range for the loop.
/* bar initialize input (or 3 to each element)
*/
int bar(int* in, int n)
{
int ret;
__asm__(
".set push \n" // save assembler option
".set noreorder\n" // suppress reordering
"lw $9, %2 \n" // $9 = n (counter end)
"li $8, 0 \n" // $8 = 0
"li $12, 0 \n" // $12 = 0
"move $4, %1\n" // $4 = in
"loop: \n"
"lw $11, ($4) \n" // $11 = *in
"ori $11, $11, 3 \n" // $11 = $11 || 3
"sw $11, ($4) \n" // *in = $11
"addi $4, $4, 4 \n" // in++ (move to next addess)
"addi $8, $8, 1 \n" // move to next sample
"bne $8, $9, loop \n" // loop
"sw $11, %0 \n" // save $12 to ret
".set pop \n" // restore assembler option
: "=m" (ret) // to return
: "r" (in),"m" (n) // the input
);
return ret;
}
Here the use of $8 is not the best, because the move the array element is by $4, soe the $8 is not most necessary, because $4 can be used to check the range for the loop.
mips - a first example
In the following sample, it shows how to send the input (val) and the output (ret) to assembly block.
The real code by dump is:
/* foo returns (val | 3)
*/
int foo(int val)
{
int ret;
__asm__(
".set push\n" // save assembler option
".set noreorder\n" // suppress reordering
"ori $2, %1, %2\n"
"sw $2, %0\n" // save $2 to ret
".set pop\n" // pop assembler option
: "=m" (ret) // ret: memory
: "r" (val), "n" (3) // val: read-only register, n: number
);
return ret;
}
The real code by dump is:
08804554:
8804554: 27bdffd0 addiu sp,sp,-48
8804558: afbe0020 sw s8,32(sp)
880455c: 03a0f021 move s8,sp
8804560: afc40010 sw a0,16(s8)
8804564: 8fc20010 lw v0,16(s8)
8804568: 34420003 ori v0,v0,0x3
880456c: afc20000 sw v0,0(s8)
8804570: 8fc20000 lw v0,0(s8)
8804574: 03c0e821 move sp,s8
8804578: 8fbe0020 lw s8,32(sp)
880457c: 27bd0030 addiu sp,sp,48
8804580: 03e00008 jr ra
8804584: 00000000 nop
android notes - the process of development
0 installation and setup
1 create a project
2 edit source code ~/myspace/demo/src/example/demo/demo.java
3 compile with ant
4 run emulator with a script
5 install the application we have build
That's on java side, on the android side,
1 setup
2 build the project in android
then you can go back to run emulator with parameters specified in the script.
1 create a project
$ android create project --target 1 --path ./demo --activity demo --package com.example.demo
2 edit source code ~/myspace/demo/src/example/demo/demo.java
3 compile with ant
$ ant -debug -verbose
4 run emulator with a script
#! /bin/sh
out/host/linux-x86/bin/emulator -verbose \
-kernel prebuild/android-arm/kernel/kernel-qemu \
-ramdisk out/target/product/generic/ramdisk.img \
-system out/target/product/generic/system.img \
-init-data out/target/product/generic/userdata.img \
-avd myavd -sdcard ./sdcard.img -no-skin -no-boot-anim
5 install the application we have build
$ cd ~/myspace/demo
$ adb install bin/demo-debug.apk
$ adb install -r bin/demo-debug.apk (for reinstall)
$ adb shell
# logcat
# ps a (to get process id to kill)
# kill -9
That's on java side, on the android side,
1 setup
$ cd ~/myspace/mydroid
$ source ./build/envsetup.sh
$ lunch 1
2 build the project in android
$ cd ./frames/base/media/libmediaplayerservice
$ mm (it builds libmediaplayerservice library as an example)
$ cd ~/myspace/mydroid (go back to the root)
$ make snod (build the system image
then you can go back to run emulator with parameters specified in the script.