From 8b657e5deaa03b989b0b36791fcf2aa6b2882656 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Tue, 1 Dec 2009 13:38:21 -0800 Subject: Fix a crash when using an 8MB SD Card image file. The minimum size is now 9MB. This appears to be a limitation of the emulated MMC hardware code and/or kernel device driver. --- CHANGES.TXT | 28 +++++++++++++++++++++++++++- android/android.h | 2 +- android/main.c | 7 +++++-- hw/goldfish_mmc.c | 8 ++++++-- 4 files changed, 39 insertions(+), 6 deletions(-) diff --git a/CHANGES.TXT b/CHANGES.TXT index a91d6d6..d84d195 100644 --- a/CHANGES.TXT +++ b/CHANGES.TXT @@ -15,7 +15,33 @@ 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) + 1.14 => current + +============================================================================== +Changes between 1.14 and 1.13 + +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/android/android.h b/android/android.h index 6d092fd..b19d8d3 100644 --- a/android/android.h +++ b/android/android.h @@ -13,7 +13,7 @@ #define _qemu_android_h #define ANDROID_VERSION_MAJOR 1 -#define ANDROID_VERSION_MINOR 12 +#define ANDROID_VERSION_MINOR 14 #define CONFIG_SHAPER 1 diff --git a/android/main.c b/android/main.c index 7b20919..45ea968 100644 --- a/android/main.c +++ b/android/main.c @@ -2478,8 +2478,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/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] -- cgit v1.1