aboutsummaryrefslogtreecommitdiffstats
path: root/vl-android.c
Commit message (Collapse)AuthorAgeFilesLines
* 64-bit emulatorAndrew Hsieh2012-03-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch to allow emulator searches for emulator64-${ARCH} first on 64-bit OS. If none is found, the original behavior which searchs for 32-bit emulator-${ARCH} is performed as usual. 64-bit emulator (which still emulates Android built in 32-bit) offers up to 20% speedup compared to its 32-bit counterpart. Details: android/main-emulator.c 1) search emulator64 based on the OS 2) dlopen lib64OpenglRender in 64-bit Makefile.* 1) Rules to build 64-bit executable emulator64-{x86,arm} and libraries emulator64-{libui,libqemu,target-i386,target-arm,libelff,common} 2) remove -Wa,-32 3) Changes prebuit toolchain path android-configure.h android/build/common.h 1) no longer force 32-bit build (because now prebuilts/tools/gcc-sdk/gcc can now handle 64-bit 2) set ANDROID_PREBUILTS to correctly locate ccache android/config/*/config-host.h 1) Detect HOST_X86_64 and HOST_X86_64/HOST_I386 Misc 64-bit porting clean-up 1) use %zx to print variable of type size_t in hex 2) use %zu to print variable of type size_t in dec 3) Initialize query_parm to NULL 4) use PRIu64 to replace PDUd64 5) use PRId64/PRIu64/PRIX64 to print 64-bit 6) drop PRUx64 because PRIx64 does the same 7) cast pointer arith to intptr_t before casting to int 8) fixed 1ULL<<63 Change-Id: Ife62a20063a6ec38d4a9b23977e840af1fce149a
* Multi-touch emulation supportVladimir Chtchetkine2012-03-051-0/+6
| | | | Change-Id: I311dc55fe10f41637775baa330a7c732ff317f51
* Check HAXM capability in QEMUJiang, Yunhong2012-02-231-0/+1
| | | | | | | | | | | | | | | Checking HAXM capability to check if emulator can use HAXM virtalization. Currently two possibility that HAXM not work. Firstly is VT/NX is not enabled in the system, seconly is HAXM have used up the memory quota. See code comemnts for the memry quota explaination. Checking the capability in advance can give user more information that why HAXM is not working and be more user friendly. Change-Id: I13f73734cf783398f485fabd19cce43364b571c3 Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com> Signed-off-by: Gao, Fengqian <fengqian.gao@intel.com> Signed-off-by: Jiang, Yunhong <yunhong.jiang@intel.com>
* Changes to existing files to add HAX supportJun Nakajima2012-01-171-0/+27
| | | | | | | | | | | | | | | HAX (Hardware-based Accelerated eXecution) employes hardware virtualization technology to boost performance of the Android emulator on Mac OS X or Windows hosts. This changeset includes the changes required to the existing files. To pass the compilation, hax.h is added, but CONFIG_HAX is disabled so that no real changes added. Change-Id: Ifa5777e8788e6698747c1ec4cd91315161c2ca0b Signed-off-by: Zhang, Xiantao <xiantao.zhang@intel.com> Signed-off-by: Xin, Xiaohui <xiaohui.xin@intel.com> Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com> Signed-off-by: Nakajima, Jun <jun.nakajima@intel.com>
* Respect HW configs when loading VM from snapshots.Vladimir Chtchetkine2012-01-131-3/+12
| | | | | | | | | | | | | | Changing HW configuration properties may cause emulator / guest system crash on condition that VM has been loaded from a snapshot. This CL addresses this issue in the following way: 1. Each time a snapshot is saved, a backup copy of HW config is saved with it. 2. Each time a snapshot is loaded, emulator finds an appropriate HW config backup, and compares current HW config with the one that was saved in the backup, and if configs are different, emulator exits with an appropriate error. Change-Id: I730bec0afbe166e88189fdcc4804b76e109e4422
* New AVD property to control presence of hw main keys.Xavier Ducrohet2011-10-041-0/+3
| | | | | | | | This allows injecting a new runtime property into the system running on the emulator to control whether to display the new software back/home keys. Change-Id: I2bf7cc5c291752090187463332219638e883d052
* Fix CPU architecture reported in HW configVladimir Chtchetkine2011-09-281-1/+1
| | | | Change-Id: I9221916514a39435d2710fa9dada92a87bdc4dab
* Add -webcam commandline option to control webcam emulationVladimir Chtchetkine2011-09-201-1/+8
| | | | | | -webcam name=<name>[,dir=<direction>] options controls web cameras to use for emulation. Change-Id: I961fd399c7e041541adda040dd24f194cc383cb9
* Add cmdline param to control fake camera emulationVladimir Chtchetkine2011-09-131-0/+7
| | | | | | | - Enable / Disable fake camera - Set fake camera facing direction: back, or front Change-Id: Iab741a694daf2bf752e91e23df566a83ac7a97e7
* Camera service skeletonVladimir Chtchetkine2011-09-071-0/+2
| | | | | | | | | | Skeleton that implements camera emulation service over QEMU pipe. More meat will be added as the guest camera emulation develops. This is a patch taken from approved AOSP commit that didn't go through because of a merge conflict. Change-Id: I6f0a2e42be4f5f0bd86d3dbf0c2a609e74b200c2
* Add hw.gpu.enabled hardware propertyDavid 'Digit' Turner2011-08-291-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new hardware property to enable GPU emulation (named hw.gpu.enabled). It is currently disabled by default. It also modifies the UI code to display the GL output properly inside the UI window. And sets the kernel parameter qemu.gles to either 0 or 1 to indicate to the guest system's GLES libraries whether to use GPU emulation or fallback to the software renderer. A future patch will also add auto-detection of desktop GL capabilities. For example, if the emulator is started on a headless server without an X11/GL display, hw.gpu.enabled will be forced to 'no', forcing the guest to use the software renderer. Another patch will allow to change the property from the command-line for debugging purpose. NOTE: If you want to test GPU emulation, change the default value of the property in android/avd/hardware-properties.ini from 'no' to 'yes'. You will need to run a ToT master AOSP tree with the following pending patches applied: https://review.source.android.com/25797 https://review.source.android.com/25154 https://review.source.android.com/25759 Change-Id: I1fa3512be24395244fd5068f2bf59ad54db5c7d5
* Fix -audio <name> and -no-audio processing.David 'Digit' Turner2011-06-271-3/+1
| | | | | | | | | Turns out that the string passed to putenv() must not be modified :-/ We provide our own win32 implementation for emulator-ui that doesn't embed the os-win32.c QEMU-specific file. Change-Id: I7260fbc37d23a5340dab589dfde577ef5eb10005
* trace.h: rename to trace-android.hDavid 'Digit' Turner2011-06-011-1/+1
| | | | | | | This is done to allow for future integration of the upstream auto-generated "trace.h" header file. Change-Id: I9d1bba3320d9e8acfd7359540d3ed6695773061e
* ramblocks: integrate upstream implementation (sophisticated)David 'Digit' Turner2011-06-011-311/+4
| | | | Change-Id: I49e96e2d5ae571849b0b6fef0a30b41ecdee8d23
* vl-android.c: move arch-specific functions to arch_init.cDavid 'Digit' Turner2011-06-011-200/+5
| | | | Change-Id: I4908006f3492aab199466c501dedff2bd835d647
* vl-android.c: move cpu functions to cpus.cDavid 'Digit' Turner2011-06-011-728/+5
| | | | Change-Id: Ib422f24224c2e75dd126689c67dbbb187d7c1670
* vl-android.c: use os-specific setup routinesDavid 'Digit' Turner2011-06-011-225/+11
| | | | | | Also fixes a bug in os-posix.c Change-Id: If2c6fb94d3e48d1db051aa9141dc2f69bdca35a8
* vl-android.c: Move code to iohandler.cDavid 'Digit' Turner2011-06-011-114/+8
| | | | Change-Id: I28d2025dfa1f7bfc1ab2318f5ff6c0fd56f4b658
* trace: simplify code and avoid conflictsDavid 'Digit' Turner2011-06-011-8/+0
| | | | Change-Id: I8f93e06038bd6e35a2972e3fef351046c247e4ee
* qemu-timer.c: rename qemu_timer_new_scale()David 'Digit' Turner2011-06-011-6/+6
| | | | | | | | | | | Get rid of qemu_timer_new() implementation, and update all callers to use qemu_timer_new_ms() or qemu_timer_new_ns() instead. Rename qemu_new_timer_scale() to qemu_new_timer() to follow upstream conventions. Change-Id: Id2c04f8597ec5026e02f87b3e2c5507920eb688e
* qemu-timer.c: upstream integrateDavid 'Digit' Turner2011-06-011-1/+1
| | | | Change-Id: I6856ded73b4dcd10fe4831697c8518f958aeffbb
* os-posix.c + os-win32.c and dependenciesDavid 'Digit' Turner2011-06-011-4/+12
| | | | | | + Generate qemu-options.def instead of qemu-options.h Change-Id: I043e6b0c1c58e5cc2e96d05465f39b42f9054b5a
* qemu-common.h: other intergratesDavid 'Digit' Turner2011-06-011-27/+0
| | | | Change-Id: Iaf5221814247d7686ec3d57abeab097b09c6a5dd
* vl-android.c: Fix PC Bios search order.David 'Digit' Turner2011-06-011-46/+30
| | | | | | | | This fixes the algorithm used to search the PC Bios files. Moreover, this makes standalone builds under external/qemu just work by looking under prebuilt/common/pc-bios Change-Id: I4619565d57dc5a5b75333f6459f5bfc32b81e918
* x86: kvm: fix KVM build + enable auto-detection.David 'Digit' Turner2011-05-261-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the build of KVM support in the x86 emulator by copying official Ubuntu Lucid KVM headers into android/config/linux-*/ This removes the need to rely on the build machine's versions of these headers, which caused various issues. Also, by default, the emulator will now probe the system to see if it can start in KVM mode automatically. See android-kvm.c for details. You can see the result of the probing with the -verbose option. IMPORTANT NOTE: It looks like there is a bug in the KVM code when the emulator is built as a 32-bit binary, running on a 64-bit kernel, so we explicitely disable KVM when we detect this case. It's hard to tell whether this is a bug in QEMU or some versions of the KVM driver. As such, KVM only works when building the emulator as a 64-bit program. For now, this is only possible with "android-configure.sh --try-64", not the Android build system. + Add a new QEMU option (-disable-kvm) to explicitely disable KVM if needed. This is an addition to -enable-kvm which already exists (and forces usage of KVM). Change-Id: I6a397cae29ab62b1c56fce95c1ee75a4664d6688
* fix audio backend handlingDavid 'Digit' Turner2011-05-211-0/+3
| | | | | | | | | | This patch fixes a small bug where the audio backend given with the -audio <name> option was ignored. The bug was introduced during a previous integration of upstream audio changes. The old code always used the same default backend (PulseAudio). Change-Id: I7bc68df3fd3025f8a8bd1f0fd868872b7eee2017
* Fix the pc-bios search path for build trees.David 'Digit' Turner2011-05-141-2/+2
| | | | | | | | | | | This patch fixes the routine that looks for the x86 BIOS file(s) when running from the build tree (i.e. typing 'emulator' just after building the full_x86-eng product). Turns out that the files are installed under out/host/<system>/usr/share/pc-bios by our build scripts. Change-Id: I51ae849d5cdf130558d05f2386c4175dfea1e054
* Fix SDCard speed issues too.David 'Digit' Turner2011-05-121-4/+8
| | | | | | | | | It looks like we also need to set the 'cache' property to 'unsafe' when initializing the SDCard block device. Otherwise it will be mounted as O_DIRECT, making all i/o operations on the SD Card extremely slow. Change-Id: Id1a72f926c73dc6981a568f005f19cfc50f724d5
* Correct fix for snapshot saving speedDavid 'Digit' Turner2011-05-041-2/+2
| | | | | | | | | | | | | | | QEMU is a weird animal. The "snapshot" property speeds-up snapshot saving but also redirect all stores to a temporary file which is deleted when the emulator exit. Use a different property to get the desired speed-up. Note that using "writeback" instead of "unsafe" forces the use of fdatasync() which will still be horribly slow. + Argument checking in avd snapshot commands in the console. (trying to load a name-less snapshot actually crashes the emulator). Change-Id: Ie61f110f037bbb3539c7f9892cb03bee8bfec6bd
* Fix snapshot save pathetic speed.David 'Digit' Turner2011-05-041-1/+6
| | | | | | | | | | | | | | It turns out that the 'snapshot' property must be turned on on the block device corresponding to the snapshot storage file. Otherwise, the file is mounted O_DIRECT, which on my speedy machine limits the operation to a max of about 2.5 MB/s. This explains why saving snapshots was so pathetic. With this change, the save throughput is up to 278 MB/s on the same machine! Change-Id: I77c792114171a4ecaf3e3f08f64d8b3a30709f23
* Document new QEMU pipe implementation.David 'Digit' Turner2011-05-041-2/+2
| | | | | | + Rename android/pipe-net.c to android/hw-pipe-net.c Change-Id: Ia2e2466c3bf3ea812f36639420fad7ce2e0cb61d
* Add 'emulator' launcher program.David 'Digit' Turner2011-05-021-0/+23
| | | | | | | | | | | | | | | | | | | | | | | This patch renames the current ARM-specific emulator binary to 'emulator-arm' and introduces a new tiny (less than 20KB) 'emulator' launcher program. The role of 'emulator' is to launch either 'emulator-arm' or 'emulator-x86' based on the target AVD or platform build being used. This program will be replaced in the future by what is currently known as 'emulator-ui', but is a good placeholder until this work is completed. + Move some utility functions from android/avd/info.[hc] to android/avd/util.[hc] so that 'emulator' can use them directly. IMPORTANT: For platform builds, the target architecture is detected automatically by parsing the build.prop file. For SDK AVDs however, there is no easy way to determine the target architecture, so the patch adds a new hw.cpu.arch property which can have value 'arm' or 'x86' Change-Id: I0084c196695a75c8b9230ba716b3cd2e12610ded
* New goldfish_pipe virtual device.David 'Digit' Turner2011-04-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds a new virtual hardware device named "goldfish_pipe" used to implement a very fast communication channel between the guest system and the emulator. IMPORTANT: This depends on a special kernel driver, see: https://review.source.android.com/#change,22496 Usage from the guest is simply the following: fd = open("/dev/qemu_pipe", O_RDWR); const char* pipename = "pipe:<name>"; ret = write(fd, pipename, strlen(pipename)+1); if (ret < 0) { /* could not connect to service named <name> */ } /* now you can read()/write()/close() as a normal * file descriptor to exchange data with the service. */ In addition, this implements the following pipe services in the emulator: tcp:<port> tcp:<hostname>:<port> unix:<path> opengles The 'tcp:' and 'unix:' services simply redirect to a TCP or Unix socket on the host with minimal The 'opengles' service simply connects to tcp:locahost:22468 for now. We may change this to be more configurable in the future, but that's the port number used by the current experimental OpenGL ES hardware emulation host libraries / programs. Benchmarking with a simple ping-pong program shows that the guest <-> emulator can achieve a roundtrip bandwidth of 192 MB/s (on a 2.7 Ghz Xeon PC). Using the tcp: service to talk to a ping-pong server listening on localhost reaches 102 MB/s on the same machine, using a Unix socket reaches 140 MB/s. By contrast, using standard sockets in the guest reaches only 3.8 MB/s on the same machine (and requires special privileges from the application anyway).
* Fix -qemu -vnc startup.David 'Digit' Turner2011-04-271-0/+2
| | | | | | | | | | | | Starting the emulator with something like "-qemu -vnc :1" didn't result in a valid boot sequence, due to the way our "hw-control" service is initialized. This patch fixes the issue. Note however that since a VNC client cannot send proper touch events, it can only be used as a viewer at the moment. Change-Id: Ib9b60ff7028892368547bff89b84f580344c2edd
* vl-android.c: Init opengles pipe on startupDavid 'Digit' Turner2011-04-111-0/+4
| | | | Change-Id: I14c03c193166c214ce406a3dc524b8dfa16fa733
* Set hw.keyboard.lid default value to false for API level >= 12David 'Digit' Turner2011-03-221-0/+3
| | | | | | | | | | | | | | | | | | | | | This patch modifies the emulator to extract the target API level for the AVD or the current platform release, and use it to set the default value of hw.keyboard.lid. This will *not* affect any existing AVD/platform that sets the value explicitely in its config.ini (for AVDs) or hardware.ini (for platform builds). The change is beneficial for platform builds targetting API level >= 12, because the input framework changed its the window orientation behaviour depending on the availability of a hardware lid. In short, this allows platform builds to be correctly oriented, even if they don't provide a custom hardware.ini. Fix for bug 4128604 Change-Id: I195135aae6f3c4cc11d2f01e1293f3cd6cad2f58
* Fix a crash that happened when the content directory didn't have a cache.img ↵David 'Digit' Turner2011-03-151-11/+21
| | | | | | | | | file. This only happened for fresh newly-created AVDs. Existing ones used for testing the emulator already had a cache.img and booted properly. Change-Id: I87901ea5fb1dc6aa7d2bb3dd191de58d972c386f
* Always prepend a space before kernel parameters.David 'Digit' Turner2011-03-081-0/+1
| | | | | | | It has been reported that in certain cases, qemud would think that the serial device is /dev/ttyS1android.checkjni=1. Change-Id: I977456ef23fb708b284cfe026da07ecce8d03bf1
* x86: Enable KVM mode for Android x86 emulator (update/rebase)Jun Nakajima2011-03-041-0/+2
| | | | | | | | | | This patch enables KVM mode on x86 Linux to boost performance of x86 emulaiton if the hardware-based virtualization feature is present on the host machine. Change-Id: I4b24474b3ec115a3b9a7bf017801f4f610253b09 Signed-off-by: Xiaohui Xin <xiaohui.xin@intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
* look for the pc-bios files in the SDK tools/lib/pc-bios directoryBruce Beare2011-03-021-11/+19
| | | | | Change-Id: I6d546f79617032dea0d72d8d38dab3016e6bd4a0 Signed-off-by: Bruce Beare <brucex.j.beare@intel.com>
* qemu logging extensionsrich cannings2011-03-011-2/+86
| | | | | | | | | (1) Clear the logs upon receiving a SIGUSR1 signal (2) Add logging timestamps for network connections (3) Extended TCP redirect logs to include local src ip/port and fixed byte-ordering in log files Change-Id: I51e7293c8eeb5979a92e67f52f1c6416400d83c6
* Move AVD name initialization to the core.David 'Digit' Turner2011-03-011-0/+8
| | | | | | | Use a hardware property to send the AVD name to the core. The -android-avdname core option is still supported though. Change-Id: I4daac5c9fb65ed5261b5c04c1e1a18daed057a3f
* Move some serial ports initialization to the core.David 'Digit' Turner2011-03-011-10/+66
| | | | | | | | | | | This moves the initialization of the ports used by qemud and the "kmsg" component to the core. + Gets rid of the -old-system option used to suppot pre-1.4 Android system. We don't officially support anything before 1.5 anyway. Change-Id: Ied7e284d952adfd3419d96c39a7c48761f1b3f5c
* Move data partition initialization to core.David 'Digit' Turner2011-03-011-0/+34
| | | | Change-Id: I3c2b4668593391026da028194503fc87246e44ba
* Move system image initialization to core.David 'Digit' Turner2011-03-011-0/+36
| | | | Change-Id: Ic8da3ccaed9bab7dbb44c0bb341b0dba20b90980
* Move snapshot storage initialization to the core.David 'Digit' Turner2011-03-011-0/+17
| | | | Change-Id: I2c2b782fe4711cc8c323433e7976222b878cf679
* Move the SD Card initialization to the core.David 'Digit' Turner2011-03-011-0/+18
| | | | Change-Id: I2c8fa2a7df3d79ed4222296a93b787994a8ee11d
* Move cache partition initialization to core.David 'Digit' Turner2011-03-011-0/+19
| | | | Change-Id: I1f887e6f8fc38e43b1fff3f7bab3814b52542762
* Move kernel/ramdisk initialization to the core.David 'Digit' Turner2011-03-011-0/+12
| | | | | | | The QEMU -kernel, -initrd and -append options are still supported for overriding the hardware configuration. Change-Id: I034d9e25d0a23341086aa052f449db5de50b2c8d
* Simplify kernel parameters processing.David 'Digit' Turner2011-03-011-46/+36
| | | | | | | This change simplifies the code that deals with kernel parameters in the core by using a stralloc_t (dynamic strings). Change-Id: I73cf2d1461a3cb1aa4511d74fd34249f0f8b58a2