Hi all,

I do a lot of my programming under DOSBox running the FreeCOM shell. This provides me with the most convenient development process.

However on occasion, FreeCOM would terminate and the simplest thing to do to get things back to normal would be restart DOSBox.

This is not a new issue. It's been happening for years.

Sometimes there would be some sort of error message. Most often no message.

I had no idea why this would happen. I just lived with the occasional nuisance.

Until now.

I figured out what causes that to happen. And it is creditably easy to reproduce with an 11 byte program.

Fire up DOSBox, run FreeCOM, compile and execute this NASM source:

    use16              ; 16-bit code cpu 8086           ; 8086 compatible org 0x100          ; COM file

WaitForKey: ; Label for wait loop mov ah,0x01        ; Check for keystroke function int 0x16           ; call the BIOS function jz  WaitForKey     ; if Zero Flag, then no keystroke, repeat

mov ax, 0x4c00     ; function to exit to dos, with no error int 0x21           ; call the DOS function


For those familiar with assembly, you can see it is very simple. The program just waits for a key to be pressed. Then terminates leaving the keystroke in the buffer.

Nothing odd or fancy.

But, leaving a keystroke in the buffer will cause the FreeCOM shell to terminate under DOSBox.

This can happen in any program when there is a delay in termination after the last keystroke was pulled from the buffer.

It was happening to me because I sometimes start typing before a build script (batch file) would completely finish.

I suspect it is not a bug in FreeCOM. But, it is  more likely a bug in DOSBox.

I have not seen it happen when running "Pure" FreeDOS inside a Virtual Machine or on real hardware.

I have seen it happen under several versions of DOSBox and DOSBox Staging with both Mac and Linux Hosts.

But, that's just a guess. The bug could be in either.

After all, running the test program again after FreeCOM shuts down, the key just shows up on the command line like it should.

So, IDK.

Unfortunately, I don't have the time to dive into it further.

:-)

Jerome



_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to