Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HlssO-0000WP-6v for qemu-devel@nongnu.org; Wed, 09 May 2007 16:35:08 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HlssM-0000W3-M6 for qemu-devel@nongnu.org; Wed, 09 May 2007 16:35:07 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HlssM-0000W0-Iu for qemu-devel@nongnu.org; Wed, 09 May 2007 16:35:06 -0400 Received: from kagate.punkt.de ([217.29.33.131]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Hlsl7-0002u1-EF for qemu-devel@nongnu.org; Wed, 09 May 2007 16:27:37 -0400 Received: from hugo10.ka.punkt.de (hugo10.ka.punkt.de [10.0.0.110]) by kagate1.punkt.de with ESMTP id l49JnKTK005594 for ; Wed, 9 May 2007 21:49:20 +0200 (CEST) Received: from hugo10.ka.punkt.de (localhost [127.0.0.1]) by hugo10.ka.punkt.de (8.12.10/8.12.10) with ESMTP id l49JnKZT050721 for ; Wed, 9 May 2007 21:49:20 +0200 (CEST) (envelope-from ry93@hugo10.ka.punkt.de) Received: (from ry93@localhost) by hugo10.ka.punkt.de (8.12.10/8.12.10/Submit) id l49JnKcL050720 for qemu-devel@nongnu.org; Wed, 9 May 2007 21:49:20 +0200 (CEST) (envelope-from ry93) Date: Wed, 9 May 2007 21:49:20 +0200 From: "Patrick M. Hausen" Message-ID: <20070509194920.GA50127@hugo10.ka.punkt.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] All the world's a VAX! - reloaded Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hello! Those of you who are old enough will remember that certain kinds of implicit assumptions in programming used to raise the outcry: All the world's a VAX! E.g. taking for granted that a pointer will always fit into an integer and vice versa. After trying Qemu for the first time and a long debugging session last weekend I'd like to suggest a new phrase for the current millennium: If it ain't Windows, it must be Linux! Please don't get me wrong, this is definitely not meant to be an insult, but I got quite frustrated short of banging my head against something. So, what happened? I have an old license of Windows 98 SE lying around and I was seeking a free way to run that on my old Powerbook G4. Luckily I own a fast Intel iMac as well that I could use for setup and later compiling, but the system was to run on the PowerPC CPU. Reason was a single Windows application that I need. It talks to my GPS receiver that I carry while paragliding via a serial port. I first tried Bochs. While a appreciate the effort and even used Bochs a couple of years ago to run Minix, it's far from usable for any real work in Windows. Next try: Qemu. Boy, was I surprised! Installing Windows 98 SE from CD took less than two hours, perceived speed about a 486 or Pentium I, quite usable. This was on the Intel iMac. Then I copied the finished Windows installation to the G4. Still good. Really good. I love the product. OK, documentation says, to setup COM1 to be passed to a serial port of the host system, add "-serial /dev/ttyXY". That was /dev/cu.KeySerial1 for my Keyspan USB serial adapter. This produced nothing but an error message like "could not open /dev/cu.KeySerial1". This is when the debugging session started. It ended to no avail. I'll spare you amount of times I looked at the access bits of the device, tried if I could open it with minicom and stuff like that, the workarounds with Unix domain sockets instead of the tty and socat, ... the true reason hit me like a hammer when I looked at the source of vl.c: #if defined(__linux__) /* all the code that deals with ttys */ #endif Wiiiiiiiiilmaaaaaaaaa! Boys and girls, this code should run without modification on _any_ sufficiently recent variant of Unix. _Unix_. That's a whole class of operating systems adhering to certain API standards. It even includes Linux, now, ain't that great? And of course I proved it to run on Mac OS X in no time. Da, zeerial port beink workink now. So, please, please, please, don't make things that work perfectly almost everywhere depend on Linux. Why would you? End rant. Please don't take the tone too seriously. Now that I can use the serial port without a hitch, I really like Qmemu. All this was just so unnecessary. Kind regards, Patrick P.S. No, I don't have a patch, because what I did locally does not fix the problem. Once we change #if defined(__linux__) to #if defined(__linux__) || defined(__DARWIN__) we will in no time have to add || defined(__FreeBSD__) ... ... ad nauseam. --=20 punkt.de GmbH * Vorholzstr. 25 * 76137 Karlsruhe Tel. 0721 9109 0 * Fax 0721 9109 100 info@punkt.de http://www.punkt.de Gf: J=FCrgen Egeling AG Mannheim 108285