v86 icon indicating copy to clipboard operation
v86 copied to clipboard

Windows 98/95 DOS prompt - cursor jumps around

Open ErnWong opened this issue 6 years ago • 2 comments

I saw this interesting bug a while ago but I didn't know how to reproduce it reliably until now.

Open DOS prompt on Windows 98/95. If you give your keystrokes enough delay, the cursor loves jumping backwards and does interesting things. What could this be?

Here's a little gif demo. Grab some popcorn.

win9x-console

I'll just dump a couple more observations...

You can see that when the glitch occurs, the previous command / stdin is partially reused:

win9x-console-careful

On Windows 95, reading from console stdin (via type con) illustrates this:

win95-typecon

On Windows 98, reading from console stdin (via type con) closes abruptly with random artifects:

image

Notice how the garbage text jumped back into the previous line. It's supposed to look like this: (typing the exact same thing in VirtualBox)

image

ErnWong avatar Feb 15 '18 07:02 ErnWong

Interesting find. This is probably a CPU bug, so I'd set a breakpoint in the keyboard interrupt trigger and in the cycle function and then step through it, inspect registers using cpu.debug.dump_regs and load a memory dump in IDA to get an idea of what the code is doing and where it goes wrong.

It seems like it could be related to the handling of carriage returns, since the cursor jumps to the beginning of the line.

copy avatar Feb 15 '18 15:02 copy

Sorry I couldn't offer much help at the moment. I'm pretty inexperienced with assembly, so I had difficulty locating the code of interest starting from the keyboard handler routine. This sounds fun though, so I might give it a more persevering attempt when I have time later this year - if it's not fixed by then.

ErnWong avatar Feb 18 '18 09:02 ErnWong