Re: [Qemu-devel] [PATCH] Remove bash-ism from configure
On Feb 12, 2007, at 2:41 AM, Anthony Liguori wrote: Johannes Schindelin wrote: Hi, On Sat, 10 Feb 2007, Anthony Liguori wrote: This is one I introduced in the gcc-3.x autodetect. It's against CVS from a little while ago so hopefully it's just fuzz. AFAICT which is not really portable, either. But then, I always have a bash, so I really don't care. On my system, which is an executable, not a shell command so it's outside the scope of bashism. It's also used elsewhere within configure. You should take a look at that executable. On most systems I know, / usr/bin/which is a csh script. It has to be because it also finds aliases. It may or may not be portable to use 'which', I'm not really sure, but it's not very efficient. Krister ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: CAP_NET_ADMIN (was Re: [Qemu-devel] Two quick requests.)
Have a look here with links and a description: http://www.friedhoff.org/fscaps.html http://www.friedhoff.org/fscaps.html#Qemu Serges patch is in the mm tree. Chris On Sat, 10 Feb 2007 15:11:00 + Paul Brook [EMAIL PROTECTED] wrote: Is there any way around this? I expected to be able to configure capabilities for executables in the filesystem, but it appears there are serious problems with that concept so the kernel doesn't support it. Use tunctl to create the device. Paul ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel Chris Friedhoff [EMAIL PROTECTED] ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Remove bash-ism from configure
On Monday, February 12, 2007, 9:55:25, Krister Joas wrote: You should take a look at that executable. On most systems I know, / usr/bin/which is a csh script. It has to be because it also finds aliases. It may or may not be portable to use 'which', I'm not really sure, but it's not very efficient. On my Linux boxes, which is either a sh script (on Debian), or a (compiled) program (on Gentoo and Slackware). On my firewall (based on FreeBSD), which is also a program (and also a /bin/sh builtin). -- Jernej Simončič http://deepthought.ena.si/ Matter will be damaged in direct proportion to its value. -- Murphy's Constant ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Help with gdb on Mac OS
On 12 févr. 07, at 07:54, Ilya Shar wrote: I am trying to step through i386-darwin-user/qemu-i386 Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x2115eaf5 helper_cmpxchg8b () at ../cpu-all.h:344 344 ((uint32_t *)ptr)[0] = x.p[0]; (gdb) The offending value of ptr is misalligned, can this indicate a problem? Reducing optimization or setting -g3 doesn't change this behavior. Strangely, the same example runs fine without gdb. qemu will handle the signal fine. Actually it is more a feature than a bug ;-) Unfortunately (gdb) handle EXC_BAD_ACCESS pass is kind of broken as EXC_BAD_ACCESS is not translated to the corresponding bsd signal, so qemu won't handle it. You should probably try to use the gdb interface provided by qemu if you wan't to debug the target program instead of qemu: # i386-darwin-user/qemu-i386 -g /bin/ls You can now connect to the gdb interface using: #gdb -arch i386 (gdb) target remote localhost:1234 (gdb) c Pierre. ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Remove bash-ism from configure
On Feb 12, 2007, at 6:17 PM, Jernej Simončič wrote: On Monday, February 12, 2007, 9:55:25, Krister Joas wrote: You should take a look at that executable. On most systems I know, / usr/bin/which is a csh script. It has to be because it also finds aliases. It may or may not be portable to use 'which', I'm not really sure, but it's not very efficient. On my Linux boxes, which is either a sh script (on Debian), or a (compiled) program (on Gentoo and Slackware). On my firewall (based on FreeBSD), which is also a program (and also a /bin/sh builtin). I stand corrected. NetBSD seems to have removed it completely and instead relies on shell built-in commands. On OpenBSD it's also a binary. My references were Solaris and Mac OS X, where it's unfortunately still a csh script. Krister ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] [PATCH] MIPS Malta-bootloader replacement
Hi! This patch replaces hardcoded MIPS Malta bootloader with soft version. This preserves ROM area clean. Also it initializes MIPS $sp register as YAMON does. The GPR values before execution: === less /tmp/qemu.log === pc=0x80294040 HI=0x LO=0x ds 0002 0 GPR00: r0 at v0 v1 GPR04: a0 0002 a1 80002000 a2 80002008 a3 0800 ... GPR28: gp sp 80003ff8 s8 ra CP0 Status 0x0044 Cause 0x0400 EPC0x Config0 0x8082 Config1 0x9e190c8b LLAddr 0x -- -=AV=- malta-bootloader.patch Description: Binary data ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Two quick requests.
If you really want to do this, do it properly. Make it an error to use a ro image if the user [implicitly] requests rw access. If there's no middle ground between silently misbehave and refuse to start if anything _might_ be wrong, then why does current qemu warn about the 1024 hz thing? Even at 1024Hz qemu still misbehaves, especially on heavily loaded hosts. 1024Hz is sufficient for most common operating systems most of the time, but many will run happily without it. e.g. many linux kernels only need 100 or 250Hz. Paul ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Two quick requests.
Rob Landley schrieb: On Friday 09 February 2007 6:06 pm, Paul Brook wrote: Sure, but there are plenty of other ways to accidentally mess up the permissions of a disk image file. A while back I had to strace qemu to figure out why file modifications were vanishing after rebooting the VM; the culprit turned out to be an unrelated script that had set the image file's mode to 444. If you really want to do this, do it properly. Make it an error to use a ro image if the user [implicitly] requests rw access. If there's no middle ground between silently misbehave and refuse to start if anything _might_ be wrong, then why does current qemu warn about the 1024 hz thing? Just curious. Refusing to start would have saved me a day's debugging time, just like the warning would have... Rob I think adding a simple (suppressable) warning on startup would be sufficient in case of a ro image. Jan ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] [PATCH] parport EPP support for Linux
On 2/5/07, Marko Kohtala [EMAIL PROTECTED] wrote: Fabrice Bellard: Marko Kohtala wrote: Hi. With the attached patch I am able to use Kodak Advantix FD 300 APS scanner from Win98 when hosted under Linux ix86. It adds EPP support and fixes some register bits to match real hw so port identification works better. I tried to separate the linux dependencies with #ifdef __linux__, but can not test this does not break compilation for other ports of qemu. I don't understand why you need a #ifdef __linux__ in parallel.c. Normally, the qemu character device should suffice to do the appropriate abstraction. ... I am too new with qemu to say how to develop the qemu character device abstraction for these requirements. Thanks for the offline tip, Fabrice. Here is a new patch for EPP support. This time all linux code is in ioctls. I hope you find it good enough. Marko diff --git a/hw/parallel.c b/hw/parallel.c index cba9561..8f3495a 100644 --- a/hw/parallel.c +++ b/hw/parallel.c @@ -2,6 +2,7 @@ * QEMU Parallel PORT emulation * * Copyright (c) 2003-2005 Fabrice Bellard + * Copyright (c) 2007 Marko Kohtala * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the Software), to deal @@ -25,6 +26,18 @@ //#define DEBUG_PARALLEL +#ifdef DEBUG_PARALLEL +#define pdebug(fmt, arg...) printf(pp: fmt, ##arg) +#else +#define pdebug(fmt, arg...) ((void)0) +#endif + +#define PARA_REG_DATA 0 +#define PARA_REG_STS 1 +#define PARA_REG_CTR 2 +#define PARA_REG_EPP_ADDR 3 +#define PARA_REG_EPP_DATA 4 + /* * These are the definitions for the Printer Status Register */ @@ -33,24 +46,31 @@ #define PARA_STS_PAPER 0x20 /* Out of paper */ #define PARA_STS_ONLINE 0x10 /* Online */ #define PARA_STS_ERROR 0x08 /* Error complement */ +#define PARA_STS_TMOUT 0x01 /* EPP timeout */ /* * These are the definitions for the Printer Control Register */ +#define PARA_CTR_DIR 0x20 /* Direction (1=read, 0=write) */ #define PARA_CTR_INTEN 0x10 /* IRQ Enable */ #define PARA_CTR_SELECT 0x08 /* Select In complement */ #define PARA_CTR_INIT 0x04 /* Initialize Printer complement */ #define PARA_CTR_AUTOLF 0x02 /* Auto linefeed complement */ #define PARA_CTR_STROBE 0x01 /* Strobe complement */ +#define PARA_CTR_SIGNAL (PARA_CTR_SELECT|PARA_CTR_INIT|PARA_CTR_AUTOLF|PARA_CTR_STROBE) + struct ParallelState { -uint8_t data; -uint8_t status; /* read only register */ +uint8_t dataw; +uint8_t datar; +uint8_t status; uint8_t control; int irq; int irq_pending; CharDriverState *chr; int hw_driver; +int epp_timeout; +uint32_t last_read_offset; /* For debugging */ }; static void parallel_update_irq(ParallelState *s) @@ -61,96 +81,322 @@ static void parallel_update_irq(ParallelState *s) pic_set_irq(s-irq, 0); } -static void parallel_ioport_write(void *opaque, uint32_t addr, uint32_t val) +static void +parallel_ioport_write_sw(void *opaque, uint32_t addr, uint32_t val) { ParallelState *s = opaque; +pdebug(write addr=0x%02x val=0x%02x\n, addr, val); + +addr = 7; +switch(addr) { +case PARA_REG_DATA: + s-dataw = val; + parallel_update_irq(s); +break; +case PARA_REG_CTR: + if ((val PARA_CTR_INIT) == 0 ) { + s-status = PARA_STS_BUSY; + s-status |= PARA_STS_ACK; + s-status |= PARA_STS_ONLINE; + s-status |= PARA_STS_ERROR; + } + else if (val PARA_CTR_SELECT) { + if (val PARA_CTR_STROBE) { + s-status = ~PARA_STS_BUSY; + if ((s-control PARA_CTR_STROBE) == 0) + qemu_chr_write(s-chr, s-dataw, 1); + } else { + if (s-control PARA_CTR_INTEN) { + s-irq_pending = 1; + } + } + } + parallel_update_irq(s); + s-control = val; +break; +} +} + +static void parallel_ioport_write_hw(void *opaque, uint32_t addr, uint32_t val) +{ +ParallelState *s = opaque; +uint8_t parm = val; + +/* Sometimes programs do several writes for timing purposes on old + HW. Take care not to waste time on writes that do nothing. */ + +s-last_read_offset = ~0U; + addr = 7; -#ifdef DEBUG_PARALLEL -printf(parallel: write addr=0x%02x val=0x%02x\n, addr, val); -#endif switch(addr) { -case 0: -if (s-hw_driver) { -s-data = val; -qemu_chr_ioctl(s-chr, CHR_IOCTL_PP_WRITE_DATA, s-data); -} else { -s-data = val; -parallel_update_irq(s); -} +case PARA_REG_DATA: +if (s-dataw == val) + return; + pdebug(wd%02x\n, val); + qemu_chr_ioctl(s-chr, CHR_IOCTL_PP_WRITE_DATA, parm); + s-dataw = val; break; -case 2: -if (s-hw_driver) { -s-control = val; -qemu_chr_ioctl(s-chr, CHR_IOCTL_PP_WRITE_CONTROL, s-control); -} else { -if ((val PARA_CTR_INIT) == 0 ) { -s-status = PARA_STS_BUSY; -s-status |=
[Qemu-devel] Can I run FC4 inside Qemu on Sparc?
hi, I am wondering if I can do this - running FC4 inside Qemu on Sparc. From opensolaris website, it seems that qemu 0.8.2 can be built but not sure if it can work correctly. http://www.opensolaris.org/os/project/qemu/ Your comments will be appreciated! Thanks, Neo -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] PATCH: updated solaris tap patch
This patch against current CVS is an update of the previously posted Solaris TAP patch. This small change fixes a large performance problem with inbound packets (scp, ftp). The author found that some packets were concatenated, which was the reason for the poor performance. This patch fixes the handling of inbound packets and the performance problem. Using the tap to the localhost, downloaded several 50MB files (1.6MB/sec-4.0MB/sec) and using the bridge, downloaded a 60MB file from an external host and got 649 KB/sec. Thanks again to Sittichai Palingsong for the quick fix. diff -ruN qemu-ORIG/vl.c qemu/vl.c --- qemu-ORIG/vl.c 2007-02-10 16:50:42.0 -0500 +++ qemu/vl.c 2007-02-12 14:25:35.211509000 -0500 @@ -55,6 +55,21 @@ #include malloc.h #include linux/rtc.h #include linux/ppdev.h +#else +#include sys/stat.h +#include sys/ethernet.h +#include sys/sockio.h +#include arpa/inet.h +#include netinet/arp.h +#include netinet/in.h +#include netinet/in_systm.h +#include netinet/ip.h +#include netinet/ip_icmp.h // must come after ip.h +#include netinet/udp.h +#include netinet/tcp.h +#include net/if.h +#include syslog.h +#include stropts.h #endif #endif #endif @@ -3199,7 +3214,15 @@ uint8_t buf[4096]; int size; +#ifdef __sun__ +struct strbuf sbuf; +int f = 0; +sbuf.maxlen = sizeof(buf); +sbuf.buf = buf; +size = getmsg(s-fd, NULL, sbuf, f) =0 ? sbuf.len : -1; +#else size = read(s-fd, buf, sizeof(buf)); +#endif if (size 0) { qemu_send_packet(s-vc, buf, size); } @@ -3242,10 +3265,135 @@ return fd; } #elif defined(__sun__) +#define TUNNEWPPA (('T'16) | 0x0001) +/* + * Allocate TAP device, returns opened fd. + * Stores dev name in the first arg(must be large enough). + */ +int tap_alloc(char *dev) +{ +int tap_fd, if_fd, ppa = -1; +static int ip_fd = 0; +char *ptr; + +static int arp_fd = 0; +int ip_muxid, arp_muxid; +struct strioctl strioc_if, strioc_ppa; +int link_type = I_PLINK;; +struct lifreq ifr; +char actual_name[32] = ; + +memset(ifr, 0x0, sizeof(ifr)); + +if( *dev ){ + ptr = dev; + while( *ptr !isdigit((int)*ptr) ) ptr++; + ppa = atoi(ptr); +} + +/* Check if IP device was opened */ +if( ip_fd ) + close(ip_fd); + +if( (ip_fd = open(/dev/udp, O_RDWR, 0)) 0){ + syslog(LOG_ERR, Can't open /dev/ip (actually /dev/udp)); + return -1; +} + +if( (tap_fd = open(/dev/tap, O_RDWR, 0)) 0){ + syslog(LOG_ERR, Can't open /dev/tap); + return -1; +} + +/* Assign a new PPA and get its unit number. */ +strioc_ppa.ic_cmd = TUNNEWPPA; +strioc_ppa.ic_timout = 0; +strioc_ppa.ic_len = sizeof(ppa); +strioc_ppa.ic_dp = (char *)ppa; +if ((ppa = ioctl (tap_fd, I_STR, strioc_ppa)) 0) + syslog (LOG_ERR, Can't assign new interface); + +if( (if_fd = open(/dev/tap, O_RDWR, 0)) 0){ + syslog(LOG_ERR, Can't open /dev/tap (2)); + return -1; +} +if(ioctl(if_fd, I_PUSH, ip) 0){ + syslog(LOG_ERR, Can't push IP module); + return -1; +} + +if (ioctl(if_fd, SIOCGLIFFLAGS, ifr) 0) + syslog(LOG_ERR, Can't get flags\n); + +snprintf (actual_name, 32, tap%d, ppa); +strncpy (ifr.lifr_name, actual_name, sizeof (ifr.lifr_name)); + +ifr.lifr_ppa = ppa; +/* Assign ppa according to the unit number returned by tun device */ + +if (ioctl (if_fd, SIOCSLIFNAME, ifr) 0) +syslog (LOG_ERR, Can't set PPA %d, ppa); +if (ioctl(if_fd, SIOCGLIFFLAGS, ifr) 0) +syslog (LOG_ERR, Can't get flags\n); +/* Push arp module to if_fd */ +if (ioctl (if_fd, I_PUSH, arp) 0) +syslog (LOG_ERR, Can't push ARP module (2)); + +/* Push arp module to ip_fd */ +if (ioctl (ip_fd, I_POP, NULL) 0) +syslog (LOG_ERR, I_POP failed\n); +if (ioctl (ip_fd, I_PUSH, arp) 0) +syslog (LOG_ERR, Can't push ARP module (3)\n); +/* Open arp_fd */ +if ((arp_fd = open (/dev/tap, O_RDWR, 0)) 0) + syslog (LOG_ERR, Can't open %s\n, /dev/tap); + +/* Set ifname to arp */ +strioc_if.ic_cmd = SIOCSLIFNAME; +strioc_if.ic_timout = 0; +strioc_if.ic_len = sizeof(ifr); +strioc_if.ic_dp = (char *)ifr; +if (ioctl(arp_fd, I_STR, strioc_if) 0){ +syslog (LOG_ERR, Can't set ifname to arp\n); +} + +if((ip_muxid = ioctl(ip_fd, I_LINK, if_fd)) 0){ + syslog(LOG_ERR, Can't link TAP device to IP); + return -1; +} + +if ((arp_muxid = ioctl (ip_fd, link_type, arp_fd)) 0) +syslog (LOG_ERR, Can't link TAP device to ARP); + +close (if_fd); + +memset(ifr, 0x0, sizeof(ifr)); +strncpy (ifr.lifr_name, actual_name, sizeof (ifr.lifr_name)); +ifr.lifr_ip_muxid = ip_muxid; +ifr.lifr_arp_muxid = arp_muxid; + +if (ioctl (ip_fd, SIOCSLIFMUXID, ifr) 0) +{ + ioctl (ip_fd, I_PUNLINK , arp_muxid); + ioctl (ip_fd, I_PUNLINK, ip_muxid); + syslog
[Qemu-devel] Re: [PATCH] MIPS Malta-bootloader replacement
Alexander Voropay a écrit : Hi! This patch replaces hardcoded MIPS Malta bootloader with soft version. This preserves ROM area clean. Also it initializes MIPS $sp register as YAMON does. Well this patch looks basically ok, except that - It's not possible anymore for an OS to jmp at 0x1f00 to reboot (is it really necessary to simulate that). - It's not possible anymore to add some code to initialize the GT64120 BARs the way YAMON does (and from our discussion on IRC, it looks like this is necessary). It is also possible to modify the GT64120 code directly, but that can mess a possible bootloader (when one is available). So I suggest to hold this patch, at least until we have solved the GT64120 BARs problem. -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' [EMAIL PROTECTED] | [EMAIL PROTECTED] `-people.debian.org/~aurel32 | www.aurel32.net ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Can I run FC4 inside Qemu on Sparc?
Neo Jia [EMAIL PROTECTED] wrote: hi, I am wondering if I can do this - running FC4 inside Qemu on Sparc. From opensolaris website, it seems that qemu 0.8.2 can be built but not sure if it can work correctly. http://www.opensolaris.org/os/project/qemu/ The current 0.9.0 CVS code plus the tap patch includes most of the patches in the opensolaris 0.8.2 port on the website. There are only a few minor patches which have not made it to CVS, and the current CVS code should build with no problems. If you're going to build it, you definitely want to get gcc3, and libsdl from blastwave.org, just to make it simpler. I know that my test systems when we did the original sparc work were Damn Small Linux, Win98SE and Solaris 10, so I'd be pretty comfortable saying it should run. Ben ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
Re: [Qemu-devel] Can I run FC4 inside Qemu on Sparc?
On 2/12/07, Ben Taylor [EMAIL PROTECTED] wrote: Neo Jia [EMAIL PROTECTED] wrote: hi, I am wondering if I can do this - running FC4 inside Qemu on Sparc. From opensolaris website, it seems that qemu 0.8.2 can be built but not sure if it can work correctly. http://www.opensolaris.org/os/project/qemu/ The current 0.9.0 CVS code plus the tap patch includes most of the patches in the opensolaris 0.8.2 port on the website. There are only a few minor patches which have not made it to CVS, and the current CVS code should build with no problems. If you're going to build it, you definitely want to get gcc3, and libsdl from blastwave.org, just to make it simpler. I know that my test systems when we did the original sparc work were Damn Small Linux, Win98SE and Solaris 10, so I'd be pretty comfortable saying it should run. Ben, Thanks for your messages. But if I would like stick on Solaris 9, is there any workaround for me? Thanks, Neo Ben -- I would remember that if researchers were not ambitious probably today we haven't the technology we are using! ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel
[Qemu-devel] QEMU and SMP Option on dual core processor
Hi all, I am running a Centrino Duo on Windows XP Home SP2. Here's the problem... I want to run the option -smp 2 with QEMU, but when I start it, it says it cannot find cpu1. When I look into task manager and the affinity, it's running on CPU0, but if I use imagecfg to set QEMU to run on CPU1, it STILL give me the same error. Does anyone know of this problem? Also, I tried to turn off one processor in BIOs, but there's no such option either, I'm using ASUS A8JM laptop. Regards, Danny ___ Qemu-devel mailing list Qemu-devel@nongnu.org http://lists.nongnu.org/mailman/listinfo/qemu-devel