qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Antony T Curtis <antony.t.curtis@ntlworld.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QEmu 0.6.0 and FreeDOS on XP Host get 100% CPU usage
Date: Wed, 14 Jul 2004 11:00:18 +0100	[thread overview]
Message-ID: <1089799218.34181.8.camel@pcgem.rdg.cyberkinetica.com> (raw)
In-Reply-To: <40F4FC21.8050000@xplantechnology.com>

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 <antony.t.curtis@ntlworld.com>

  reply	other threads:[~2004-07-14 10:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-13 21:33 [Qemu-devel] QEmu 0.6.0 and FreeDOS on XP Host get 100% CPU usage Info
2004-07-14  1:50 ` Natalia Portillo
2004-07-14  9:25   ` Luke Deller
2004-07-14 10:00     ` Antony T Curtis [this message]
2004-07-14 12:40   ` Info
2004-07-14 12:20 ` PeteD
2004-07-14 12:45   ` Info
2004-07-14 13:53     ` Adrian Smarzewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1089799218.34181.8.camel@pcgem.rdg.cyberkinetica.com \
    --to=antony.t.curtis@ntlworld.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).