News for hackers. Stuff that matters.
Re:PCjs Machines by wila on Monday March 04, 2019 @05:21AM (#19300152)
Still amazing.

What is also awesome is that after it boots DOS on that page that the CPU utilisation by my browser is pretty much zero.

Re:PCjs Machines by jdsully on Monday March 04, 2019 @10:40AM (#19302057)
Must be a patch. DOS didn’t use HLT until version 6 - it just spun instead.

https://blogs.msdn.microsoft.com/virtual_pc_guy/2004/12/20/w...

Re:PCjs Machines by chrisseaton on Monday March 04, 2019 @07:22AM (#19300678)
> after it boots DOS on that page that the CPU utilisation by my browser is pretty much zero

Presumably the processor is waiting for an interrupt, so there’s nothing for the emulator to do, so nothing for the browser to do.

That’s normal for an operating system, an emulator, and JavaScript.

Re:PCjs Machines by userbinator on Monday March 04, 2019 @07:41AM (#19300776)
I'm guessing (didn't try) it could be a slightly patched version that does actually halt the CPU when it has nothing to do, since DOS is well known for using up all the host CPU when run in a VM even when idle and leading to people writing utilities like this:

http://maribu.home.xs4all.nl/zeurkous/download/mirror/dosidl...

I also found this (somewhat amusing) page discussing the problem:

http://wiki.freedos.org/wiki/index.php/VirtualBox_-_Heat

The "Running the CPU at 100 percent for too long can damage your computer." message is probably legal ass-covering, since any system that can't 100% CPU usage 24/7 is defective. Indeed, back when DOS was common, that's what it did to the CPUs of the time, as did other applications which used a polling loop instead of waiting for interrupts.

Re:PCjs Machines by orbital-decay on Monday March 04, 2019 @08:04AM (#19300890)
That's normal for a full-featured OS, not for a single-tasking OS like MS-DOS. Additionally, x86 HLT instruction was quite obscure before the 80486 (IIRC).
Re:PCjs Machines by wila on Monday March 04, 2019 @01:19PM (#19303691)
Ah.. it sounds logical yes. But not for DOS where the CPU was not waiting, but instead just burning CPU cycles.

Try running DOS in any VM and you'll be shocked by the CPU usage. A constant 100% until you install a little program called DOSIDLE that properly runs a HLT instruction when the CPU is waiting.

Re:PCjs Machines by coldtea on Monday March 04, 2019 @07:43AM (#19300785)
>That’s normal for an operating system, an emulator, and JavaScript.

But apparently not for Electron apps...