Re: [Qemu-devel] [PATCH] fix possible NULL pointer use in hw/ptimer.c
Am 05.01.2008 um 03:47 schrieb Rob Landley: You can disable overcommit and give the system an egregious amount of swap space, but then your pathological case is the system going into swap thrashing la-la land and essentially freezing (advancing at 0.1% of its normal rate, if that, for _hours_) instead of killing some runaway processes (or rebooting) and recovering. Quite obviously, we have very different expectations on what executables should do. I expect code to be as reliable as possible, to be careful when aquiring resources and if a process would ever happen to make my computer spontanuously reboot, I'd throw that binary as far away as possible and warn everybody else not to even touch this thing. One of the major reasons to run emulators is to protect against such sloppy code, btw. Markus - - - - - - - - - - - - - - - - - - - Dipl. Ing. Markus Hitter http://www.jump-ing.de/
Re: [Qemu-devel] [RESEND] [PATCH] ide: fix GET_CONFIGURATION DVD-ROM support
On Fri, Jan 04, 2008 at 09:53:09PM -0600, Rob Landley wrote: Except that according to http://en.wikipedia.org/wiki/CD-ROM it's actually 703 and 1/8 binary megabytes (360,000 sectors *2048 bytes), which would be 144. Apparently that value comes from 75 sectors per second * 80 minutes... 75*80*60 = 36, and of course, 36*2048/512 = 144, although it actually seems that it should be one sector less than 80 minutes, which is 35 2048-byte sectors or 1439996 512-byte chunks. BTW, there are/were also 90 and 99 minute 'CD-Rs' -- Wikipedia's page on CD-Rs describes them, but they were never very popular, and a lot of drives can't read the discs. -- Stuart Brady
[Qemu-devel] qemu Changelog
CVSROOT:/sources/qemu Module name:qemu Changes by: Andrzej Zaborowski balrog 08/01/05 18:53:35 Modified files: . : Changelog Log message: Update Changelog with new Xscale platforms and vmsvga. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/Changelog?cvsroot=qemur1=1.148r2=1.149
[Qemu-devel] qemu Changelog hw/mainstone.c
CVSROOT:/sources/qemu Module name:qemu Changes by: Andrzej Zaborowski balrog 08/01/05 19:29:17 Modified files: . : Changelog hw : mainstone.c Log message: Fix memory allocation on mainstone2 and convert to qemu_ram_alloc. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/Changelog?cvsroot=qemur1=1.149r2=1.150 http://cvs.savannah.gnu.org/viewcvs/qemu/hw/mainstone.c?cvsroot=qemur1=1.8r2=1.9
[Qemu-devel] [PATCH] hw/sun4m.c make error messages consistent
Make these 3 error messages consistent with the other 20 in the same file. diff -p -u -r1.79 sun4m.c --- hw/sun4m.c 1 Jan 2008 20:57:25 - 1.79 +++ hw/sun4m.c 5 Jan 2008 22:26:07 - @@ -385,7 +385,7 @@ static void sun4m_hw_init(const struct h for(i = 0; i smp_cpus; i++) { env = cpu_init(cpu_model); if (!env) { -fprintf(stderr, Unable to find Sparc CPU definition\n); +fprintf(stderr, qemu: Unable to find Sparc CPU definition\n); exit(1); } cpu_sparc_set_id(env, i); @@ -554,7 +554,7 @@ static void sun4c_hw_init(const struct h env = cpu_init(cpu_model); if (!env) { -fprintf(stderr, Unable to find Sparc CPU definition\n); +fprintf(stderr, qemu: Unable to find Sparc CPU definition\n); exit(1); } @@ -1041,7 +1041,7 @@ static void sun4d_hw_init(const struct s for (i = 0; i smp_cpus; i++) { env = cpu_init(cpu_model); if (!env) { -fprintf(stderr, Unable to find Sparc CPU definition\n); +fprintf(stderr, qemu: Unable to find Sparc CPU definition\n); exit(1); } cpu_sparc_set_id(env, i);
Re: [Qemu-devel] [RESEND] [PATCH] ide: fix GET_CONFIGURATION DVD-ROM support
On Sat, Jan 05, 2008 at 10:28:34AM +, Stuart Brady wrote: On Fri, Jan 04, 2008 at 09:53:09PM -0600, Rob Landley wrote: Except that according to http://en.wikipedia.org/wiki/CD-ROM it's actually 703 and 1/8 binary megabytes (360,000 sectors *2048 bytes), which would be 144. Apparently that value comes from 75 sectors per second * 80 minutes... 75*80*60 = 36, and of course, 36*2048/512 = 144, although it actually seems that it should be one sector less than 80 minutes, which is 35 2048-byte sectors or 1439996 512-byte chunks. BTW, there are/were also 90 and 99 minute 'CD-Rs' -- Wikipedia's page on CD-Rs describes them, but they were never very popular, and a lot of drives can't read the discs. the exact number of sectors is really not that relevant, as the whole point here is to try to detect if it is a CD (700MB) or a DVD (4.7GB) and the logic is just assuming that if it has more sectors than you should normally expect in a CD, then it is a DVD. attached the program I used in the guests (only works on Linux) to poke the emulated drive (or a physical drive if you feel like) and compare the responses (you will need to take a look at the SPEC tables to interpret the data though) for my own tests (using a linux guest with -cdrom /dev/cdrom in my linux host that has a DVD-+RW drive) : 700MB CD-R = 1374880 (with FreeSBIE 2.0.1) 4.7GB DVD-R = 6939520 (with SXDE 9/07) feel free to report back with the value to use then if you happen to have a CD that is completely full but I had already enough problems trying to get this merged without trying to change the code that much to try to guess a better magic number than the one was originally used (I like 144 though) Carlo /* ide-atapi Copyright (c) 2007 Carlo Marcelo Arenas Belon ide-atapi is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. */ #include sys/ioctl.h #include linux/cdrom.h #include sys/types.h #include sys/stat.h #include fcntl.h #include string.h #include stdio.h #include unistd.h int main (int argc, char *argv[]) { struct cdrom_generic_command cgc; struct request_sense sense; unsigned char buf[250]; int i; if (argc 2) { printf(Usage: %s device\n, argv[0]); printf(\n); printf( device: where the commands are send\n); printf(\n); return 1; } memset (cgc, 0, sizeof(struct cdrom_generic_command)); memset (sense, 0, sizeof(struct request_sense)); memset (buf, 0, sizeof(buf)); int fd = open (argv[1], O_RDONLY | O_NONBLOCK); if (fd 0) { printf(couldn't open device %s\n, argv[1]); return 1; } cgc.cmd[0] = GPCMD_GET_CONFIGURATION; cgc.cmd[1] = 0x00; cgc.cmd[8] = sizeof(buf); cgc.timeout = 100; cgc.buffer = buf; cgc.buflen = sizeof(buf); cgc.data_direction = CGC_DATA_READ; cgc.sense = sense; cgc.quiet = 0; i = ioctl (fd, CDROM_SEND_PACKET, cgc); if (i 0) { printf(command failed\n); close (fd); return 1; } printf(Response raw dump:\n); for (i = 0; isizeof(buf); i++) { if (i % 16 == 0) printf(\n); printf(%02x , buf[i]); } printf(\n); close (fd); return 0; }
[FIXED] Re: [Qemu-devel] Multiple Ethernet interfaces for Gumstix connex (NetDUO-mmc)
Andrzej, Thanks for the tip, but it ended up that the IRQ was being properly allocated by the kernel, but I did not tell qemu the correct mapping between the IRQ and the GPIO line. Example: eth0 uses IRQ 59 which maps to GPIO line 36 eth1 uses IRQ 50 which maps to GPIO line 27 The mapping between IRQ's and GPIO's can be easily determined with a simple kernel module (running on real hardware) that makes calls to gpio_to_irq() I have included a patch that seems to safely patch against the latest CVS snapshot (qemu-snapshot-2008-01-06_05.tar.bz2), I hope you guys consider merging it into the main branch/trunk. wget http://qemu-forum.ipi.fi/qemu-snapshots/qemu-snapshot-2008-01-06_05.tar.bz2 tar -xjvf qemu-snapshot-2008-01-06_05.tar.bz2 cd qemu-snapshot-2008-01-06-05 patch -p1 ~/qemu-connex-2008-01-03-05-add_eth1.patch ./configure --target-list=arm-softmmu --host-cc=gcc-3.4 --cc=gcc-3.4 --disable-sdl --disable-gfx-check make #Example: #Invoke one interface ./arm-softmmu/qemu-system-arm -M connex -pflash ~/qemu/flash -net nic,vlan=0 -nographic #Invoke two interface ./arm-softmmu/qemu-system-arm -M connex -pflash ~/qemu/flash -net nic,vlan=0 -net nic,vlan=1 -nographic #Hooking eth0 and eth1 to tap interfaces: ./arm-softmmu/qemu-system-arm -M connex -pflash ~/qemu/flash -net nic,vlan=0 -net tap,vlan=0,ifname=tap0,script=no -net nic,vlan=1 -net tap,vlan=1,ifname=tap1,script=no -nographic Thanks!! -J Hi, On 04/01/2008, John W [EMAIL PROTECTED] wrote: 3. gpio line 37, I took a stab in the dark. With this change, eth0 seemed to continue to work perfectly. As for Eth1: 1. The Linux Kernel seemed to ALSO recognize eth1. (example: ifconfig eth1 seemed to work fine) 2. Sending packets out the eth1 interface seemed okay, since I could run tcpdump on the tap1 host interface and see packets coming from the virtualized Connex eth1. 3. Unfortunately, the eth1 device seems to have problems receiving packets due to some Interrupt conflict. I seem to get a number of the following errors: NETDEV WATCHDOG: eth1: transmit timed out I was wondering if: 1. Anyone else out there was working on adding support for another Ethernet interface for the Gumstix connex (or Gumstix verdex) OR 2. Anyone could suggest some information on trying to add in another Ethernet interface. cat /proc/interrupts may yield some information on which pin the second NIC is connected to. The distance between the interrupt numbers for eth0 and eth1 should be the same as between eth0 GPIO and eth1 GPIO. In particular they may be using the same GPIO with the two signals being ORed or ANDed, or other combination, this can be done in qemu too. Regards Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now. http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ --- qemu-snapshot-2008-01-03_05/hw/gumstix.c 2008-01-02 19:11:15.0 -0800 +++ qemu-snapshot-2008-01-03_05.mod/hw/gumstix.c 2008-01-05 21:46:30.0 -0800 @@ -76,9 +76,15 @@ cpu-env-regs[15] = 0x; -/* Interrupt line of NIC is connected to GPIO line 36 */ +/* Interrupt of eth0 is 59, which is connected to GPIO line 36 */ smc91c111_init(nd_table[0], 0x04000300, pxa2xx_gpio_in_get(cpu-gpio)[36]); +/* Interrupt of eth1 is 50, which is connected to GPIO line 27 */ +if(nd_table[1].vlan) + { + smc91c111_init(nd_table[1], 0x08000300, +pxa2xx_gpio_in_get(cpu-gpio)[27]); + } } static void verdex_init(int ram_size, int vga_ram_size,
[Qemu-devel] qemu/hw sun4m.c
CVSROOT:/cvsroot/qemu Module name:qemu Changes by: Blue Swirl blueswir1 08/01/06 07:50:39 Modified files: hw : sun4m.c Log message: Make error messages consistent (Robert Reif) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/qemu/hw/sun4m.c?cvsroot=qemur1=1.79r2=1.80