From ebb2745fffa9fd3b9ab04f847143991f639446e6 Mon Sep 17 00:00:00 2001 From: Michel Pollet Date: Thu, 5 Mar 2009 13:55:55 +0000 Subject: [PATCH] [MINI2440] Updated start script Removed the SD 'optional' code, but passes the script arguments verbatim to qemu so you can pass your own -sd Added support for a snapshot block device to save/restore the VM --- hw/eeprom24c0x.c | 20 ++++++++++---------- mini2440/mini2440_start.sh | 23 +++++++++++------------ 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/hw/eeprom24c0x.c b/hw/eeprom24c0x.c index 2cb6ffd8..90779b1f 100644 --- a/hw/eeprom24c0x.c +++ b/hw/eeprom24c0x.c @@ -35,7 +35,7 @@ * Typical device names include Microchip 24C02SC or SGS Thomson ST24C02. */ -//~ #define DEBUG +#define DEBUG #if defined(DEBUG) # define logout(fmt, args...) fprintf(stderr, "24C\t%-24s" fmt, __func__, ##args) @@ -45,15 +45,15 @@ struct _eeprom24c0x_t { uint8_t kind; - uint8_t tick; - uint8_t address; - uint8_t command; - uint8_t ack; - uint8_t scl; - uint8_t sda; - uint8_t data; - //~ uint16_t size; - uint8_t contents[1024]; + uint8_t tick; + uint8_t address; + uint8_t command; + uint8_t ack; + uint8_t scl; + uint8_t sda; + uint8_t data; + //~ uint16_t size; + uint8_t contents[1024]; }; //typedef struct _eeprom24c0x_t eeprom24c0x_t; diff --git a/mini2440/mini2440_start.sh b/mini2440/mini2440_start.sh index ab773ab6..c3eb9273 100755 --- a/mini2440/mini2440_start.sh +++ b/mini2440/mini2440_start.sh @@ -5,34 +5,33 @@ base=$(dirname $0) echo Starting in $base name_nand="$base/mini2440_nand.bin" -name_sd="$base/mini2440_sd.img" +name_snapshots="$base/mini2440_snapshots.img" if [ ! -f "$name_nand" ]; then echo $0 : creating NAND empty image : "$name_nand" dd if=/dev/zero of="$name_nand" bs=528 count=131072 fi - -if [ -f /dev/sdd ]; then - # use a real SD card - optional="$optional -sd /dev/sdd" -elif [ -f "$name_sd" ]; then - optional="$optional -sd $name_sd" - optional="" +if [ ! -f "$name_snapshots" ]; then + echo $0 : creating empty snapshot image : "$name_snapshots" + qemu-img create "$name_snapshots" 100MB fi + # remove old socket rm -rf .mini2440_monitor cmd="$base/../arm-softmmu/qemu-system-arm \ -M mini2440 $* \ - -semihosting \ + -drive file=$name_snapshots,snapshot=on \ -serial stdio \ -kernel /tftpboot/uImage \ -mtdblock "$name_nand" \ - $optional \ - -show-cursor -usb -usbdevice keyboard \ + -show-cursor \ + -usb -usbdevice keyboard -usbdevice mouse \ -net nic,vlan=0 \ -net tap,vlan=0,ifname=tap0 \ - -monitor unix:.mini2440_monitor,server,nowait" + -monitor telnet::5555,server,nowait" + +# -monitor unix:.mini2440_monitor,server,nowait" echo $cmd $cmd -- 2.11.4.GIT