[Qemu-devel] [PATCH] OSX x86_64 host support v2

2008-01-12 Thread Alexander Graf

Hi,

this is an updated version of the very same patch which fixes a major  
issue that kept interrupts from working and updated to apply to  
current CVS.

Using this patch Leopard is capable of running qemu really fast.

While at it x86_64 Linux gcc4 support should be fixed with this as  
well, as Mac OS X x86_64 requires gcc4.


Please apply,

Alex


qemu-osx.patch
Description: Binary data




On Dec 7, 2007, at 1:42 PM, Alexander Graf wrote:


Hi,

this patch enables qemu to run on x86_64. I tested it with gcc-4.2  
from the apple opensource page and OSX 10.5.1 on a Care2Duo based  
Macbook.


Parts of the Mach-O parsing code is based on the i386 parser from  
the Q project. Thank you.


Right now there is no graphical output available except for VNC, as  
the cocoa output depends on deprecated APIs that are no longer  
available in 64-bit mode and SDL does not compile on x86_64 Darwin  
yet.


Please review this patch if it breaks anything. I tried to ifdef  
every change I did.
Furthermore, what does tb_jump_reset do? It always sets the jump  
target to tb+0x, as the offset variable is never set to any  
value other than 0x. I'm pretty sure someone is quite broken  
there and I'm currently jumping to TBs that are invalidated.  
Comments on this are really welcome.


PS: 64-Bit capable Macs are always at least Core2Duo, so do an "-- 
enable-cflags=-march=core2". Should we enable this by default?


Cheers,

Alexander Graf




Re: [Qemu-devel] [PATCH 9/9] Bochsbios patch

2008-01-12 Thread Alexander Graf


On Jan 8, 2008, at 5:06 PM, Thiemo Seufer wrote:


Alexander Graf wrote:
Several ACPI entries were missing from the bios and the new  
controllers

need to be initialized properly.
Furthermore COM2 is not being emulated, so Mac OS X broke trying to
initialize it.
The HPET ACPI table parts are optional.

This patch is against the bochsbios. Should this rather be sent to  
the

bochs ML?


Yes please. (Maybe you want to keep this list Cc'ed.)


Thiemo




I put this on the official Bochs Patch Tracker.

Alex





[Qemu-devel] OSX host snapshot broken

2008-01-12 Thread Alexander Graf

Hi,

is anyone else experiencing this? On Leopard x86_64 host -snapshot  
breaks the image support completely (the guest sees only garbage).


Does this happen on PPC as well? Is this new to Leopard? Is this an  
x86_64 issue?


Alex




[Qemu-devel] Re: [PATCH] USB serial device

2008-01-12 Thread Samuel Thibault
Hello,

Samuel Thibault, le Fri 11 Jan 2008 11:09:23 +, a écrit :
> Samuel Thibault, le Fri 11 Jan 2008 00:23:12 +, a écrit :
> > I would like to implement support for braille devices, and for this I'd
> > need to first implement a USB serial device (FTDI chip).  Has anybody
> > worked on that already?
> 
> Ok, was easier than expected, Here is a patch. The serial support is
> incomplete however because qemu still lacks support for flow control and
> modem lines.
> 
> You will notice in tty_serial_init that I made the baud values more
> relaxed. This is because with divisor/baud conversions, things never get
> exact, so we need to be laxist with the value. For instance here with
> FTDI, the base divisor is 4800/2, so for 57600 bps the guest needs
> to choose between divisors 416 and 417, which bring to either 57692bps
> or 57553bps but not exactly 57600bps. It happens that Linux chooses
> divisor 416, hence 57692bps. Of course, the higher the speed, the worse
> things get. The 1.1 factor is the smallest factor I could find between
> usual bps values, notably B110, B134 and B150.

Here is an updated version, that takes parameters, so as to be able to
notably provide the product ID.

Samuel
? .vl.c.swp
? stvJqKpr
Index: Makefile
===
RCS file: /sources/qemu/qemu/Makefile,v
retrieving revision 1.140
diff -u -p -r1.140 Makefile
--- Makefile6 Jan 2008 18:27:12 -   1.140
+++ Makefile13 Jan 2008 01:54:17 -
@@ -57,7 +57,7 @@ OBJS+=i2c.o smbus.o smbus_eeprom.o max73
 OBJS+=ssd0303.o ssd0323.o ads7846.o stellaris_input.o
 OBJS+=scsi-disk.o cdrom.o
 OBJS+=scsi-generic.o
-OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o
+OBJS+=usb.o usb-hub.o usb-linux.o usb-hid.o usb-msd.o usb-wacom.o usb-serial.o
 OBJS+=sd.o ssi-sd.o
 
 ifdef CONFIG_WIN32
Index: vl.c
===
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.395
diff -u -p -r1.395 vl.c
--- vl.c8 Jan 2008 19:32:16 -   1.395
+++ vl.c13 Jan 2008 01:54:21 -
@@ -2237,45 +2237,33 @@ static void tty_serial_init(int fd, int 
 #endif
 tcgetattr (fd, &tty);
 
-switch(speed) {
-case 50:
+#define MARGIN 1.1
+if (speed <= 50 * MARGIN)
 spd = B50;
-break;
-case 75:
+else if (speed <= 75 * MARGIN)
 spd = B75;
-break;
-case 300:
+else if (speed <= 300 * MARGIN)
 spd = B300;
-break;
-case 600:
+else if (speed <= 600 * MARGIN)
 spd = B600;
-break;
-case 1200:
+else if (speed <= 1200 * MARGIN)
 spd = B1200;
-break;
-case 2400:
+else if (speed <= 2400 * MARGIN)
 spd = B2400;
-break;
-case 4800:
+else if (speed <= 4800 * MARGIN)
 spd = B4800;
-break;
-case 9600:
+else if (speed <= 9600 * MARGIN)
 spd = B9600;
-break;
-case 19200:
+else if (speed <= 19200 * MARGIN)
 spd = B19200;
-break;
-case 38400:
+else if (speed <= 38400 * MARGIN)
 spd = B38400;
-break;
-case 57600:
+else if (speed <= 57600 * MARGIN)
 spd = B57600;
-break;
-default:
-case 115200:
+else if (speed <= 115200 * MARGIN)
+spd = B115200;
+else
 spd = B115200;
-break;
-}
 
 cfsetispeed(&tty, spd);
 cfsetospeed(&tty, spd);
@@ -5196,6 +5184,8 @@ static int usb_device_add(const char *de
 dev = usb_msd_init(p);
 } else if (!strcmp(devname, "wacom-tablet")) {
 dev = usb_wacom_init();
+} else if (strstart(devname, "serial:", &p)) {
+   dev = usb_serial_init(p);
 } else {
 return -1;
 }
Index: hw/usb-serial.c
===
RCS file: hw/usb-serial.c
diff -N hw/usb-serial.c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ hw/usb-serial.c 13 Jan 2008 01:54:21 -
@@ -0,0 +1,549 @@
+/*
+ * FTDI FT232BM Device emulation
+ *
+ * Copyright (c) 2006 CodeSourcery.
+ * Copyright (c) 2008 Samuel Thibault <[EMAIL PROTECTED]>
+ * Written by Paul Brook, reused for FTDI by Samuel Thibault
+ *
+ * This code is licenced under the LGPL.
+ */
+
+#include "qemu-common.h"
+#include "usb.h"
+#include "qemu-char.h"
+
+//#define DEBUG_Serial
+
+#ifdef DEBUG_Serial
+#define DPRINTF(fmt, args...) \
+do { printf("usb-serial: " fmt , ##args); } while (0)
+#else
+#define DPRINTF(fmt, args...) do {} while(0)
+#endif
+
+#define RECV_BUF 384
+#define SEND_BUF 128// Not used for now
+
+/* Commands */
+#define FTDI_RESET 0
+#define FTDI_SET_MDM_CTRL  1
+#define FTDI_SET_FLOW_CTRL 2
+#define FTDI_SET_BAUD  3
+#define FTDI_SET_DATA  4
+#define FTDI_GET_MDM_ST5
+#define FTDI_SET_EVENT_CHR 6
+#define FTDI_SET_ERROR_CHR 7
+#define FTDI_SET_LATENCY   9
+#define FTDI_GET_LATENCY   

Re: [Qemu-devel] [PATCH 0/9] Intel Mac target support

2008-01-12 Thread Alexey Eremenko
On Jan 11, 2008 12:26 PM, Alexander Graf <[EMAIL PROTECTED]> wrote:
>
> On Jan 11, 2008, at 9:01 AM, Alexey Eremenko wrote:
>
> > Alexander Graf:
> >
> > Thank you VERY much for providing us with "intel mac" emulation.
> >
>
> I'm really having a hard time understanding if this is irony or not ;-).
>
>
>
>

Well, no, it's not an irony, and I'm really happy with such
advancement and I'm looking forward at trying that, with both Qemu,
KQemu and KVM.

-- 
-Alexey Eremenko "Technologov", 13.1.2008.