diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2010-01-12 15:18:33 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2010-01-12 15:18:33 -0800 |
commit | 17fc48cf35a27406185838916d1eb40c4eb83ebd (patch) | |
tree | 85d2b2156a9b556d969db954d29a7304a699e08c | |
parent | 9ef4f0907e2cf82108d85b96887e06e92d70204c (diff) | |
download | external_qemu-17fc48cf35a27406185838916d1eb40c4eb83ebd.zip external_qemu-17fc48cf35a27406185838916d1eb40c4eb83ebd.tar.gz external_qemu-17fc48cf35a27406185838916d1eb40c4eb83ebd.tar.bz2 |
android-2.1_r1 snapshot
-rw-r--r-- | CHANGES.TXT | 38 | ||||
-rw-r--r-- | Makefile.android | 11 | ||||
-rwxr-xr-x | android-configure.sh | 12 | ||||
-rw-r--r-- | android/android.h | 3 | ||||
-rw-r--r-- | android/avd/info.c | 2 | ||||
-rw-r--r-- | android/help.c | 2 | ||||
-rw-r--r-- | android/main.c | 13 | ||||
-rw-r--r-- | android/utils/ini.h | 32 | ||||
-rw-r--r-- | docs/ANDROID-CONFIG-FILES.TXT | 103 | ||||
-rw-r--r-- | docs/ANDROID-SKIN-FILES.TXT | 221 | ||||
-rw-r--r-- | hw/goldfish_mmc.c | 8 |
11 files changed, 403 insertions, 42 deletions
diff --git a/CHANGES.TXT b/CHANGES.TXT index a91d6d6..35a519b 100644 --- a/CHANGES.TXT +++ b/CHANGES.TXT @@ -15,7 +15,43 @@ Versions: 1.9 => SDK 1.5_r1 (and SDK 1.5_r2) 1.10 => SDK 1.5_r3 1.11 => SDK 1.6_r1 - 1.12 => current + 1.12 => SDK 2.0 + 1.13 => SDK 2.0.1 (but wrongly tagged 1.12) + 5.0 => current + +============================================================================== +Changes between 5.0 and 1.13 + +IMPORTANT CHANGES: + +- Starting from this release, the emulator's version number will match the + corresponding Android SDK Tools package revision number. The exact number + is extracted at build time from the Android source tree. + + The minor number will now be stuck to 0 since each official emulator + release is supposed to match a corresponding SDK Tools release. + + +OTHER: + +- Fixed a bug that crashed the emulator when the SD Card image size was exactly + 8 MB. Now, the minimum supported size is 9 MB, and the emulator will complain + with a human-friendly message if this is not the case, and ignore the SD Card + file. + +============================================================================== +Changes between 1.13 and 1.12 + +IMPORTANT BUG FIXES: + +- Fix D-Pad rotation issues in the skins. The problem being that switching + the emulator window to landscape mode resulted in incorrectly rotated + D-Pad events. The fix allows for a new 'dpad-rotation' field for each + layout. + +- Fixed a bug in Thumb2 emulation (not used by typical SDK images yet though) + that resulted incorrect behaviour / crashes, especially in single-stepping + mode. ============================================================================== Changes between 1.12 and 1.11 diff --git a/Makefile.android b/Makefile.android index e9a71c3..da06cc6 100644 --- a/Makefile.android +++ b/Makefile.android @@ -365,6 +365,17 @@ LOCAL_CFLAGS := $(MY_CFLAGS) $(LOCAL_CFLAGS) # add the build ID to the default macro definitions LOCAL_CFLAGS += -DANDROID_BUILD_ID="$(strip $(BUILD_ID))-$(strip $(BUILD_NUMBER))" +# For non-standalone builds, extract the major version number from the Android SDK +# tools revision number. +ifneq ($(BUILD_STANDALONE_EMULATOR),true) + ANDROID_SDK_TOOLS_REVISION := $(shell awk -F= '/Pkg.Revision/ { print $$2; }' sdk/files/tools_source.properties) +endif + +ANDROID_SDK_TOOLS_REVISION := $(strip $(ANDROID_SDK_TOOLS_REVISION)) +ifdef ANDROID_SDK_TOOLS_REVISION + LOCAL_CFLAGS += -DANDROID_SDK_TOOLS_REVISION=$(ANDROID_SDK_TOOLS_REVISION) +endif + # include the Zlib sources # LOCAL_SRC_FILES += $(ZLIB_SOURCES) diff --git a/android-configure.sh b/android-configure.sh index 84e4535..26ea251 100755 --- a/android-configure.sh +++ b/android-configure.sh @@ -149,6 +149,15 @@ if [ "$IN_ANDROID_BUILD" = "yes" ] ; then OPTION_TARGETS="$OPTION_TARGETS $HOST_BIN/emulator$EXE" log "Targets : TARGETS=$OPTION_TARGETS" fi + + # find the Android SDK Tools revision number + TOOLS_PROPS=$ANDROID_TOP/sdk/files/tools_source.properties + if [ -f $TOOLS_PROPS ] ; then + ANDROID_SDK_TOOLS_REVISION=`awk -F= '/Pkg.Revision/ { print $2; }' $TOOLS_PROPS 2> /dev/null` + log "Tools : Found tools revision number $ANDROID_SDK_TOOLS_REVISION" + else + log "Tools : Could not locate $TOOLS_PROPS !?" + fi fi # IN_ANDROID_BUILD = no @@ -377,6 +386,9 @@ echo "BUILD_STANDALONE_EMULATOR := true" >> $config_mk if [ $OPTION_DEBUG = yes ] ; then echo "BUILD_DEBUG_EMULATOR := true" >> $config_mk fi +if [ -n "$ANDROID_SDK_TOOLS_REVISION" ] ; then + echo "ANDROID_SDK_TOOLS_REVISION := $ANDROID_SDK_TOOLS_REVISION" >> $config_mk +fi # Build the config-host.h file # diff --git a/android/android.h b/android/android.h index 6d092fd..ca6cfaf 100644 --- a/android/android.h +++ b/android/android.h @@ -12,9 +12,6 @@ #ifndef _qemu_android_h #define _qemu_android_h -#define ANDROID_VERSION_MAJOR 1 -#define ANDROID_VERSION_MINOR 12 - #define CONFIG_SHAPER 1 #include <stdlib.h> diff --git a/android/avd/info.c b/android/avd/info.c index 10e2005..e738065 100644 --- a/android/avd/info.c +++ b/android/avd/info.c @@ -1279,7 +1279,7 @@ _getBuildSkin( AvdInfo* i, AvdInfoParams* params ) if (!skinDir) { -#define PREBUILT_SKINS_DIR "development/emulator/skins" +#define PREBUILT_SKINS_DIR "sdk/emulator/skins" do { /* try in <sysdir>/../skins first */ diff --git a/android/help.c b/android/help.c index 50c9d02..a142f9d 100644 --- a/android/help.c +++ b/android/help.c @@ -116,7 +116,7 @@ help_build_images( stralloc_t* out ) " If the kernel image is not found in the out directory, then it is searched\n" " in <build-root>/prebuilt/android-arm/kernel/.\n\n" - " Skins will be looked in <build-root>/development/emulator/skins/\n\n" + " Skins will be looked in <build-root>/sdk/emulator/skins/\n\n" " You can use the -sysdir, -system, -kernel, -ramdisk, -datadir, -data options\n" " to specify different search directories or specific image files. You can\n" diff --git a/android/main.c b/android/main.c index 7b20919..e791efe 100644 --- a/android/main.c +++ b/android/main.c @@ -76,7 +76,11 @@ AndroidRotation android_framebuffer_rotation; #define STRINGIFY(x) _STRINGIFY(x) #define _STRINGIFY(x) #x -#define VERSION_STRING STRINGIFY(ANDROID_VERSION_MAJOR)"."STRINGIFY(ANDROID_VERSION_MINOR) +#ifdef ANDROID_SDK_TOOLS_REVISION +# define VERSION_STRING STRINGIFY(ANDROID_SDK_TOOLS_REVISION)".0" +#else +# define VERSION_STRING "standalone" +#endif #define KEYSET_FILE "default.keyset" SkinKeyset* android_keyset; @@ -2478,8 +2482,11 @@ int main(int argc, char **argv) uint64_t size; if (path_get_size(opts->sdcard, &size) == 0) { /* see if we have an sdcard image. get its size if it exists */ - if (size < 8*1024*1024ULL) { - fprintf(stderr, "### WARNING: SD Card files must be at least 8 MB, ignoring '%s'\n", opts->sdcard); + /* due to what looks like limitations of the MMC protocol, one has + * to use an SD Card image that is equal or larger than 9 MB + */ + if (size < 9*1024*1024ULL) { + fprintf(stderr, "### WARNING: SD Card files must be at least 9MB, ignoring '%s'\n", opts->sdcard); } else { args[n++] = "-hda"; args[n++] = opts->sdcard; diff --git a/android/utils/ini.h b/android/utils/ini.h index a176bfe..83d2027 100644 --- a/android/utils/ini.h +++ b/android/utils/ini.h @@ -15,37 +15,7 @@ #include <stdint.h> /* the emulator supports a simple .ini file format for its configuration - * files. Here's the BNF for it: - * - * file := <line>* - * line := <comment> | <LF> | <assignment> - * comment := (';'|'#') <noLF>* <LF> - * assignment := <space>* <keyName> <space>* '=' <space>* <valueString> <space>* <LF> - * keyName := <keyNameStartChar> <keyNameChar>* - * keyNameStartChar := [A-Za-z_] - * keyNameChar := [A-Za-z0-9_.-] - * valueString := <noLF>* - * space := ' ' | '\t' - * LF := '\r\n' | '\n' | '\r' - * noLF := [^<LF>] - * - * Or, in English: - * - * - no support for sections - * - empty lines are ignored, as well as lines beginning with ';' or '#' - * - lines must be of the form: "<keyName> = <value>" - * - key names must start with a letter or an underscore - * - other key name characters can be letters, digits, underscores, dots or dashes - * - * - leading and trailing space are allowed and ignored before/after the key name - * and before/after the value - * - * - there is no restriction on the value, except that it can't contain - * leading/trailing space/tab characters or newline/charfeed characters - * - * - empty values are possible, and will be stored as an empty string. - * - any badly formatted line is discarded (and will print a warning) - * + * files. See docs/ANDROID-CONFIG-FILES.TXT for details. */ /* an opaque structure used to model an .ini configuration file */ diff --git a/docs/ANDROID-CONFIG-FILES.TXT b/docs/ANDROID-CONFIG-FILES.TXT new file mode 100644 index 0000000..633b57a --- /dev/null +++ b/docs/ANDROID-CONFIG-FILES.TXT @@ -0,0 +1,103 @@ +Android Emulator Config File Formats: +==================================== + +Introduction: +------------- + +The Android emulator supports several file formats for its configuration +files, depending on specific usage. This file documents them. + + +I. Android .ini configuration files: +------------------------------------ + +The code in android/utils/ini.[hc] is used to support a simple .ini file +format for some configuration files. Here's the BNF for it: + + file := <line>* + line := <comment> | <LF> | <assignment> + comment := (';'|'#') <noLF>* <LF> + assignment := <space>* <keyName> <space>* '=' <space>* <valueString> <space>* <LF> + keyName := <keyNameStartChar> <keyNameChar>* + keyNameStartChar := [A-Za-z_] + keyNameChar := [A-Za-z0-9_.-] + valueString := <noLF>* + space := ' ' | '\t' + LF := '\r\n' | '\n' | '\r' + noLF := [^<LF>] + +Or, in plain English: + + - No support for sections + - Empty lines are ignored, as well as lines beginning with ';' or '#' + - Lines must be of the form: "<keyName> = <value>" + - Key names must start with a letter or an underscore + - Other key name characters can be letters, digits, underscores, dots or + dashes + + - Leading and trailing space are allowed and ignored before/after the key + name and before/after the value + + - There is no restriction on the value, except that it can't contain + leading/trailing space/tab characters or newline/charfeed characters + + - Empty values are possible, and will be stored as an empty string. + - Any badly formatted line is discarded (and will print a warning) + + +II. Android 'aconfig' configuration files: +------------------------------------------ + +Alternatively, another configuration file format is supported by the code +in android/config.[hc]. Its purpose is to support each config file as a +tree of key/value pairs. More specifically: + + - Each key or value is a string + - Each key can be associated either to a value, or a sub-tree + - A (key,value) pair is written in the config file as: + + <keyname> <value> + + which means the key name, some spaces, then the value. + + - Dots can be used to separate keys in a tree path, as in: + + some.other.name value + + corresponding to a top-level key named 'some' with a single + sub-key 'other' which itself has a sub-key 'name' associated to + value 'value'. + + - As a consequence, key names *cannot* contain a dot. + + - Alternatively, braces can be used to group sub-keys, as in: + + some { + other { + name value + name2 other-value + } + } + + which defines a top-level 'some' key with two sub-keys 'name' and + 'name2' + + - Brace and dot notations are equivalent, so the above config file + can also be written as: + + some.other.name value + some.other.name2 other-value + + - If a key appears twice in the config file, it replaces any + assigned value, hence: + + some-key foo + some-key bar + + defines 'some-key' to 'bar' + + - If a sharp (#) appears whenever a key name is expected by the parser, + then it is considered a comment and will be ignored along anything that + follows on the current line. + + diff --git a/docs/ANDROID-SKIN-FILES.TXT b/docs/ANDROID-SKIN-FILES.TXT new file mode 100644 index 0000000..004f83d --- /dev/null +++ b/docs/ANDROID-SKIN-FILES.TXT @@ -0,0 +1,221 @@ +Android Emulator Skin File Specification: +========================================= + + Revision 2. Dated 2009-12-07 + + +Introduction: +------------- + +The Android emulator program is capable of displaying a window containing +an image of a fake handset and associated controls (e.g. D-Pad, trackball, +keyboard). + +The content of this window is dictated by a "skin", i.e. a collection of +images and configuration data that indicates how to populate the window. +Each skin can have several "layouts" (e.g. "landscape" and "portrait") +corresponding to different orientation / physical configurations of the +emulated handset. + +This document specifies how to generate a new skin for the emulator. + +General File Format: +-------------------- + +Each "skin" has a unique name and corresponds to a directory filled with +various files. All skins are located under a parent "skin-dir" directory. +You can use the '-skin-dir <path>' and '-skin <name>' options when starting +the emulator to specify them. This will instruct the program to look into + + <path>/<name>/ + +For skin-specific files. Without these options, the emulator will look for +skins in the SDK in a way described later in this document. + +The most important file in a skin must be named 'layout', as in: + + <path>/<name>/layout + +The format of this file must follow the "aconfig" specification, see +docs/ANDROID-CONFIG-FILES.TXT for details about it. + + +Layouts & Parts: +---------------- + +Each skin file must define a list of 'parts' and a list of 'layouts'. + +A 'skin part' correspond to a named item that can contain a set of +visual/control elements that can be of the following types: + + - 'background': A background image in PNG format. + + - 'display': An emulated LCD screen area. + + - 'buttons': A set of clickable control areas (e.g. for a D-Pad, or + a Keyboard) + +Each part can be independently positioned and/or rotated in a 'layout'. +A 'skin layout' is simply a specific arrangement of parts. A typical device +skin file contains two layouts: one for landscape mode, and another one for +portrait mode. More layouts can be used if needed. For example, one could +use portrait + landscape-with-keyboard-closed + landscape-with-keyboard-opened) + + +Skin Layouts: +------------- + +Each skin layout is a named sub-key of the top-level 'layouts' key in the +config file, for example: + + layouts { + portrait { + .... + } + landscape { + .... + } + } + +Defines two layouts named 'portrait' and 'landscape'. + +Each layout can have the following keys (and corresponding values): + +- 'width': The width of the emulator window in pixels, as an integer + +- 'height': The height of the emulator window in pixels, as an integer + +- 'color' : Background color to be used to fill the emulator window. + this is a 32-bit ARGB value, the 0x prefix can be used to + use hexadecimal notation. + +- 'event' : An optional specific Linux event code that is generated whenever + the emulator switches/initializes this layout. This is used to + emulate the 'keyboard-lid open/close' events when emulating + certain devices with a hardware keyboard. + + The value must be of the format: + + <type>:<code>:<value> + + Where the event type, code and value are numerical values or, + in certain cases string aliases for Linux input-subsystem event + codes. You can use the following emulator console commands to + print valid types and codes: + + event types -> prints all valid types + event codes <type> -> prints all valid codes for <type> + + The typical event to be used is EV_SW:0:1 for portrait mode + and EV_SW:0:0 for landscape ones. They corresponds to "keyboard + closed" and "keyboard opened" respectively, and would match a + device like the T-Mobile G1 or the Verizon Droid. + +- 'part<n>': Individual part references for the layout. They are named + in incremental numerical order, starting from 'part1', as in + 'part1', 'part2', 'part3', etc... + + Each such key must contain the following sub-keys: + + - 'name': The name of the corresponding part to be displayed + as defined in the rest of the configuration file + + - 'x': Horizontal offset where the part is displayed + - 'y': Vertical offset where the part is displayed + + - 'rotation': An optional sub-key which value is a integer + in the 0..3 range specifying the rotation + (in 90-degrees increment) to apply to the part + before display. + +- 'dpad-rotation': + An option integer in the 0..3 range indicating which + counter-rotation (in 90-degrees increments) to apply to the + D-Pad keys for proper usage. + + This is needed because the Android framework considers that + the DPad is in landscape mode when the device is in landscape + mode and will-auto-rotate the D-Pad value. This setting is used + to counter-effect this correction for certain skins which + do not rotate the DPad in landscape mode. + +Skin Parts: +----------- + +Each skin part is a sub-key of the top-level 'parts' key in the configuration +file. For example: + + parts { + foo { + ... + } + bar { + ... + } + zoo { + ... + } + } + +Defines three parts named 'foo', 'bar' and 'zoo'. + +Each part can have one or more elements of the following type/key name that +will determine its visual appearance: + +- 'background': + A background image in PNG format. This is a tree key that can + have the following sub-keys: + + - 'image': Name of the PNG image in the skin directory + - 'x' : Optional horizontal offset in pixels (integer) + - 'y' : Optional vertical offset in pixels (integer) + +- 'display': + An optional rectangular area that will appear on top of the + background image to display an emulated LCD screen. Valid sub-keys + are: + + - 'x' : Optional horizontal offset in pixels (integer) + - 'y' : Optional vertical offset in pixels (integer) + - 'width' : Width in pixels (integer) + - 'height' : Height in pixels (integer) + - 'rotation': Optional rotation value (0..3) in 90 degrees + increments. + +- 'buttons': + Used to define a list of rectangular clickable control areas with + an optional high-lighting image. Each sub-key must have a unique + name, and may contain the following sub-sub-keys: + + - 'x' : Horizontal offset in pixels (integer) + - 'y' : Vertical offset in pixels (integer) + - 'image' : PNG image of the high-lighting for the button + + Each highlight image will be drawn on top of the background are for + the button. A typical one has 50% opacity. The highlight will be drawn + twice to simulate 'clicked' state. + + The image's dimensions are used to determine the size of the control + area. + + The name of each button must correspond to the list of key symbols + defined in the _keyinfo_table array defined in android/skin/file.c. + +Other top-level keys: +--------------------- + +A few other top-level keys are supported for legacy reasons, but the +corresponding definition is best defined in the hardware properties/config +file instead: + +- 'keyboard.charmap': + Optional, must be the name of the charmap being used for this + skin. Currently unused so ignore this. + +- 'network.speed': + Default network speed for this skin. Values correspond to the + -netspeed <speed> emulator command-line option. + +- 'network.delay': + Default network latency for this skin. Values correspond to the + -netdelay <delay> emulator command-line option. diff --git a/hw/goldfish_mmc.c b/hw/goldfish_mmc.c index 2295d2d..3824db9 100644 --- a/hw/goldfish_mmc.c +++ b/hw/goldfish_mmc.c @@ -287,9 +287,13 @@ static void goldfish_mmc_do_command(struct goldfish_mmc_state *s, uint32_t cmd, capacity >>= 1; } capacity -= 1; + if (exponent < 2) { + cpu_abort(cpu_single_env, "SDCard too small, must be at least 9MB\n"); + } exponent -= 2; - if (exponent > 7) - cpu_abort(cpu_single_env, "exponent %d too big\n", exponent); + if (exponent > 7) { + cpu_abort(cpu_single_env, "SDCard too large.\n"); + } s->resp[2] |= (((uint32_t)capacity >> 2) & 0x3FF); // high 10 bits to bottom of resp[2] s->resp[1] |= (((uint32_t)capacity & 3) << 30); // low 2 bits to top of resp[1] |