From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1BkgcI-0000Zb-TS for qemu-devel@nongnu.org; Wed, 14 Jul 2004 06:04:00 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1BkgcC-0000ZO-L5 for qemu-devel@nongnu.org; Wed, 14 Jul 2004 06:03:55 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1BkgcC-0000ZK-8Q for qemu-devel@nongnu.org; Wed, 14 Jul 2004 06:03:52 -0400 Received: from [62.253.162.47] (helo=mta07-svc.ntlworld.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BkgZg-0008R8-ET for qemu-devel@nongnu.org; Wed, 14 Jul 2004 06:01:16 -0400 Received: from [10.10.10.100] ([81.107.87.144]) by mta07-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040714100051.VZTP19321.mta07-svc.ntlworld.com@[10.10.10.100]> for ; Wed, 14 Jul 2004 11:00:51 +0100 Subject: Re: [Qemu-devel] QEmu 0.6.0 and FreeDOS on XP Host get 100% CPU usage From: Antony T Curtis In-Reply-To: <40F4FC21.8050000@xplantechnology.com> References: <40F4FC21.8050000@xplantechnology.com> Content-Type: text/plain Message-Id: <1089799218.34181.8.camel@pcgem.rdg.cyberkinetica.com> Mime-Version: 1.0 Date: Wed, 14 Jul 2004 11:00:18 +0100 Content-Transfer-Encoding: 7bit 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 On Wed, 2004-07-14 at 10:25, Luke Deller wrote: > Natalia Portillo wrote: > > In qemu isn't implemented idle. > > > > So when the emulated cpu is idle, the emulation is not. > > That's the reason. > > I don't think that is true, because when I run Windows XP as a guest in > qemu, the qemu process doesn't use 100% CPU unless something is actually > running in Windows. > > I suspect that Andreas gets 100% CPU usage with a FreeDOS guest because > FreeDOS doesn't do CPU idle... that's not how DOS works. It's not much > of an operating system at all, really. DOS programming frequently involves polling the keyboard... For those familiar with programming with Turbo Pascal... repeat until KeyPressed(); ch := ReadKey(); The above code is typical of DOS programming... note the furious loop. Some more sophisticated programs hooked the keyboard interrupt for keyboard processing ... some used a mix of the two. The reason many applications polled the hardware directly was to get access to all the scancodes - so additional Alt etc sequences can be handled by the program. IIRC, The EDIT program shipped with MSDOS 6 used a mix... it used interrupt for most ... but when you pulled down a menu, it polled the keyboard. A popular "Intel suggested" way to heat-burn a CPU was to run EDIT and pull down the file menu... and leave the PC alone. Back on to topic... I think the last time I looked at the BIOS source, the get character service routine polls the keyboard, perhaps if this is made nicer, and if FreeDOS uses the BIOS for keyboard reads, it would behave better... -- Antony T Curtis