Git Product home page Git Product logo

avmt's Introduction

avmt - android virtual machine touch
DavidSnooker ~ gmail * com

-- 1. Prerequisites --

Do steps 1-4 before git clone.
Step 5 is included in the source code. Skip it.

1. Android SDK
http://developer.android.com/sdk

2. Android Kernel
git clone git://android.git.kernel.org/kernel/common.git
// qemu kernel
// git clone git://android.git.kernel.org/kernel/qemu.git

3. ARM Compiler
http://www.codesourcery.com/sgpp/lite/arm

4. Goldfish
cd <KERNEL_ROOT_FOLDER>
git branch -a
git checkout remotes/origin/archive/android-gldfish-2.6.29
// qemu kernel
// git checkout remotes/origin/android-gldfish-2.6.29
cat arch/arm/configs/goldfish_defconfig

5. Config & Makefile
create and start an AVD

cd <KERNEL-ROOT-FOLDER>
adb pull /proc/config.gz
gunzip config.gz
mv config .config
// qemu kernel
CONFIG_MODULES=y

change 2 lines in Makefile:
ARCH ?= arm
CROSS_COMPILE ?= arm-none-linux-gnueabi-

6. Compile
make goldfish_defconfig
make

on sucess:
Kernel: arch/arm/boot/zImage is ready

7. Emulator
ae <AVD>

-- 2. .bashrc References --

# android sdk
export ANDROID_SDK=/usr/local/lib/android-sdk-linux_x86
export ANDROID_IMG=$ANDROID_SDK/platforms/android-10/images
export ARM_GNUEABI=~/dev/android/CodeSourcery/Sourcery_G++_Lite
PATH="$PATH:$ANDROID_SDK/tools:$ANDROID_SDK/platform-tools:$ARM_GNUEABI/bin"
export PATH

# android alias
alias make='make -j2'
alias ae="emulator -no-boot-anim -kernel arch/arm/boot/zImage -ramdisk $ANDROID_IMG/ramdisk.img -show-kernel -avd"
alias aes="emulator -no-boot-anim -shell -no-window -kernel arch/arm/boot/zImage -ramdisk $ANDROID_IMG/ramdisk.img -show-kernel -avd"
alias aboot="fastboot boot arch/arm/boot/zImage $ANDROID_IMG/ramdisk.img"
alias aflash="fastboot flash:raw boot arch/arm/boot/zImage $ANDROID_IMG/ramdisk.img"
alias aerase="fastboot erase boot"
alias agcc='arm-none-linux-gnueabi-gcc'

-- 3. Let 2 emulators talk --

Suppose the AVD for the host and guest OS are 'host' and 'guest' respectively.
The emulators are 5554 and 5556 respectively.

1. Run the host and guest OS
aes host
aes guest

2. Push TCP client and server
cd tcp
make
make install

3. TCP forwarding
adb -s emulator-5556 forward tcp:7000 tcp:7000

4. Sending from host OS (client) to guest OS (server)
adb -s emulator-5556 shell /data/server 
adb -s emulator-5554 shell /data/client msg

-- 4. Using avmt.sh --
The server is written into the ramdisk for guest OS and starts automatically from init.rc.
There's no need to push it to guest OS manually.
With the avmt shell script, part 3 becomes simpler.

1. Run the host and guest OS
./avmt host
./avmt guest

2. TCP forwarding, client compiling and pushing
./avmt setup

3. Sending from host OS (client) to guest OS (server)
./avmt send msg

4. Unzip and zip ramdisk
./avmt unzip-ramdisk
./avmt zip-ramdisk

Reference:
http://android-dls.com/wiki/index.php?title=HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images

avmt's People

Contributors

initrc avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.