qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] QEmu 0.6.0 and FreeDOS on XP Host get 100% CPU usage


From: Antony T Curtis
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

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 <address@hidden>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]