android emulator基于qemu开发. 源码位于external/qemu目录下.
但从使用上看,看不出qemu的影子.但实现上emulator与qemu没有太大区别.
以命令行解析为例
使用 ./emulator -debug all 启动,可以看到类似下面的打印:
emulator: argv[00] = "./emulator"
emulator: argv[01] = "-kernel"
emulator: argv[02] = "/home/dybbuk/work/android_dev/mydroid/prebuilt/android-arm/kernel/kernel-qemu"
emulator: argv[03] = "-initrd"
emulator: argv[04] = "/home/dybbuk/work/android_dev/mydroid/out/target/product/generic//ramdisk.img"
emulator: argv[05] = "-nand"
emulator: argv[06] = "system,size=0x4200000,initfile=/home/dybbuk/work/android_dev/mydroid/out/target/product/generic//system.img"
emulator: argv[07] = "-nand"
emulator: argv[08] = "userdata,size=0x4200000,file=/tmp/android/emulator-YrPtDf"
emulator: argv[09] = "-nand"
emulator: argv[10] = "cache,size=0x4200000"
emulator: argv[11] = "-serial"
emulator: argv[12] = "android-kmsg"
emulator: argv[13] = "-serial"
emulator: argv[14] = "stdio"
emulator: argv[15] = "-serial"
emulator: argv[16] = "android-qemud"
emulator: argv[17] = "-append"
emulator: argv[18] = "qemu=1 console=ttyS0 androidboot.console=ttyS1 android.checkjni=1 android.qemud=ttyS2 android.ndns=3"
emulator: argv[19] = "-m"
emulator: argv[20] = "96"
emulator: argv[21] = "-clock"
emulator: argv[22] = "unix"
这些参数就是emulator调用qemu时所用的参数. 你如果用过qemu的话,会对部分参数有些印象.
所以从命令行参数来看,emulator 只不过是对qemu 作了封装, 使得易于使用.
以qemu的文档来分析各个参数的作用:
‘-kernel bzImage’
Use bzImage as kernel image.
‘-append cmdline’
Use cmdline as kernel command line
‘-initrd file’
Use file as initial ram disk.
‘-clock method’
Force the use of the given methods for timer alarm. To see what timers are available use -clock ?.
‘-m megs’
Set virtual RAM size to megs megabytes. Default is 128 MiB. Optionally, a suffix of “M” or “G” can be used to signify a value in megabytes or gigabytes respectively.
‘-serial dev’
Redirect the virtual serial port to host character device dev. The default device is vc in graphical mode and stdio in non graphical mode.
This option can be used several times to simulate up to 4 serial ports.
‘-nand’
这个应该是android版的qemu新增的参数.
emulator使用tip:
1. 以终端作为虚拟机的串口以及串口控制台.
添加: -show-kernel -shell 选项.
2. 使用其它的kernel image 文件:
/home/dybbuk/work/android_dev/mydroid/out/host/linux-x86/bin/emulator -sysdir /home/dybbuk/work/android_dev/mydroid/out/target/product/generic/ -system /home/dybbuk/work/android_dev/mydroid/out/target/product/generic/system.img -ramdisk /home/dybbuk/work/android_dev/mydroid/out/target/product/generic//ramdisk.img -kernel /home/dybbuk/work/android_dev/mydroid/kernel/arch/arm/boot/zImage
但从使用上看,看不出qemu的影子.但实现上emulator与qemu没有太大区别.
以命令行解析为例
使用 ./emulator -debug all 启动,可以看到类似下面的打印:
emulator: argv[00] = "./emulator"
emulator: argv[01] = "-kernel"
emulator: argv[02] = "/home/dybbuk/work/android_dev/mydroid/prebuilt/android-arm/kernel/kernel-qemu"
emulator: argv[03] = "-initrd"
emulator: argv[04] = "/home/dybbuk/work/android_dev/mydroid/out/target/product/generic//ramdisk.img"
emulator: argv[05] = "-nand"
emulator: argv[06] = "system,size=0x4200000,initfile=/home/dybbuk/work/android_dev/mydroid/out/target/product/generic//system.img"
emulator: argv[07] = "-nand"
emulator: argv[08] = "userdata,size=0x4200000,file=/tmp/android/emulator-YrPtDf"
emulator: argv[09] = "-nand"
emulator: argv[10] = "cache,size=0x4200000"
emulator: argv[11] = "-serial"
emulator: argv[12] = "android-kmsg"
emulator: argv[13] = "-serial"
emulator: argv[14] = "stdio"
emulator: argv[15] = "-serial"
emulator: argv[16] = "android-qemud"
emulator: argv[17] = "-append"
emulator: argv[18] = "qemu=1 console=ttyS0 androidboot.console=ttyS1 android.checkjni=1 android.qemud=ttyS2 android.ndns=3"
emulator: argv[19] = "-m"
emulator: argv[20] = "96"
emulator: argv[21] = "-clock"
emulator: argv[22] = "unix"
这些参数就是emulator调用qemu时所用的参数. 你如果用过qemu的话,会对部分参数有些印象.
所以从命令行参数来看,emulator 只不过是对qemu 作了封装, 使得易于使用.
以qemu的文档来分析各个参数的作用:
‘-kernel bzImage’
Use bzImage as kernel image.
‘-append cmdline’
Use cmdline as kernel command line
‘-initrd file’
Use file as initial ram disk.
‘-clock method’
Force the use of the given methods for timer alarm. To see what timers are available use -clock ?.
‘-m megs’
Set virtual RAM size to megs megabytes. Default is 128 MiB. Optionally, a suffix of “M” or “G” can be used to signify a value in megabytes or gigabytes respectively.
‘-serial dev’
Redirect the virtual serial port to host character device dev. The default device is vc in graphical mode and stdio in non graphical mode.
This option can be used several times to simulate up to 4 serial ports.
‘-nand’
这个应该是android版的qemu新增的参数.
emulator使用tip:
1. 以终端作为虚拟机的串口以及串口控制台.
添加: -show-kernel -shell 选项.
2. 使用其它的kernel image 文件:
/home/dybbuk/work/android_dev/mydroid/out/host/linux-x86/bin/emulator -sysdir /home/dybbuk/work/android_dev/mydroid/out/target/product/generic/ -system /home/dybbuk/work/android_dev/mydroid/out/target/product/generic/system.img -ramdisk /home/dybbuk/work/android_dev/mydroid/out/target/product/generic//ramdisk.img -kernel /home/dybbuk/work/android_dev/mydroid/kernel/arch/arm/boot/zImage
4 comments:
chenlina20150720
jordan 6
ray ban eyeglasses
hollister
www.louisvuitton.com
christian louboutin shoes
abercrombie store
celine
jordan 6s
mont blanc pens
michael kors outlet
michael kors outlet
gucci bags
chanel outlet
oakley sunglasses
longchamp handbags
chi flat iron
louis vuitton outlet
louis vuitton outlet
christian louboutin outlet
true religion jeans
abercrombie and fitch
abercrombie & fitch
air max 90
ray ban sungalss
jordan 8s
hollister clothing store
christian louboutin outlet
louis vuitton outlet
gucci outlet online
christian louboutin sale
louis vuitton outlet
louis vuitton
michael kors
coach factorty outlet
jordan 5
fendi
longchamp handbags
lululemon sale
jordan retro 4
abercrombie
naviguer vers ce site Web Chrome-Hearts Dolabuy site important réplique dolabuy étudiez ce site dolabuy louis vuitton
site web visit click resources click site this post this
supreme
bape clothing
kevin durant shoes
golden goose
goyard bag
palm angels
golden goose outlet
off white hoodie
pg 4
palm angels outlet
Post a Comment