VOGONS


First post, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Re: DOSBox 0.74-2 has been released

I have been messing with that every now and then. I have tried a lot of different things, but I somehow seem to miss doing the right thing. (complicated by problem 2)

In order not to cloud any help/result, I will not include things that I tried. Nor any data that might be related to my setup.

2 different problems:

1) Windows 3.11 enhanced mode crashes when starting imgmount from the command prompt.

2) Windows 3.11 enhanced mode does not startup. (after a specific change)

Problem 1)
The troublesome instruction seems to be 0x8f (dyn_pop_ev). If you comment that out in src/cpu/core_dynrec/decoder.h (so the case, the instruction and the break),
then it works. (jmarsh wrote 2 potential fixes for that)

Problem 2)
2) In order to help with debugging, a common trick is to set the number of instructions per block to 1 (src/cpu/core_dynrec.cpp: around line 212 CreateCacheBlock). Change the 32 to 1.
However, now windows suddenly is unable to start at my PC. (it crashes back to the shell, but you can't see that because of a different videomode)
This can be avoided by commenting out instruction 0x6a in src/cpu/core_dynrec/decoder.h ( dyn_push_byte_imm, again the case, the instruction and the break)

Questions:
Can anybody confirm these 2 problems. Especially problem 2 as that one has not been confirmed yet by somebody else, which is bugging me a lot.

Water flows down the stream
How to ask questions the smart way!

Reply 1 of 13, by Ringding

User metadata
Rank Member
Rank
Member

I cannot, neither of them.

For 1., I don't get so far, because it crashes when I start the DOS prompt: Exit to error: DynrecCore: illegal option in dyn_mov_seg_ev

For 2., I don't see a difference, except that it does not crash anymore when I start the DOS prompt, but instead seems to exit Windows immediately (and sometimes eat any further keyboard input, depending on whether I'm in real DOS or DOSBox DOS).

The DOS prompt does work when I run it under a 32 bit build of DOSBox.

Reply 2 of 13, by Ringding

User metadata
Rank Member
Rank
Member

Uh, so you're talking about Windows 3.11, not Windows for Workgroups. Is that right? I used WfW.

I'll have to reinstall anyway, as I just removed my image accidentally with an incautious usage of git clean -dfx 😉. 🙁

Reply 5 of 13, by Ringding

User metadata
Rank Member
Rank
Member

What I don’t get: In the other thread you mentioned that just starting the DOS Prompt caused the dynrec error, same as for me. How come that you are reporting a different experience now?

Reply 6 of 13, by Ringding

User metadata
Rank Member
Rank
Member

The dynrec problem seems to be caused by the S3 video driver wanting to switch into text mode. It does not happen with:
- Standard VGA
- S3 driver with windowed DOS Prompt

Driver: S3 Trio64V 1.70.04 1024x768 64K C SF

I can imgmount an iso file without a problem.

Reply 7 of 13, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author
Ringding wrote:

I cannot, neither of them.

For 1., I don't get so far, because it crashes when I start the DOS prompt: Exit to error: DynrecCore: illegal option in dyn_mov_seg_ev

Is that fixed with commenting out the pop_ev instruction block ? As that was the bug I am trying to fix.

Number 2 is a different problem I ran into while trying to fix problem 1.

For 2., I don't see a difference, except that it does not crash anymore when I start the DOS prompt, but instead seems to exit Windows immediately (and sometimes eat any further keyboard input, depending on whether I'm in real DOS or DOSBox DOS).

So windows does boot if you set the instructions to 1 (and not apply the push_imm commenting) ?, exit windows happens at my place during startup, so I don't know how
it will behave when starting the command prompt, as I can't reach that.

The videodriver can influence things, but I am trying to get the 64 bit build working identical to the 32 bit one. (they use a different core in dynamic mode)

Water flows down the stream
How to ask questions the smart way!

Reply 8 of 13, by Ringding

User metadata
Rank Member
Rank
Member
Qbix wrote:

Is that fixed with commenting out the pop_ev instruction block ? As that was the bug I am trying to fix.

Yes. Then it works. Also imgmount.

So windows does boot if you set the instructions to 1 (and not apply the push_imm commenting) ?, exit windows happens at my place during startup, so I don't know how
it will behave when starting the command prompt, as I can't reach that.

Yes. Setting the translation block size to 1 does not make any difference. Not with and not without the pop_ev commented out.

Reply 9 of 13, by Ringding

User metadata
Rank Member
Rank
Member
Ringding wrote:

Yes. Setting the translation block size to 1 does not make any difference. Not with and not without the pop_ev commented out.

Rereading my own report from earlier, I have to correct this. It does make a difference with the pop_ev left alone. Then it exits Windows when I try to run the DOS Prompt.

Reply 10 of 13, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

thanks for trying it.

The 1 instruction thing is hard to reproduce it seems, but some progress was made on that.

Water flows down the stream
How to ask questions the smart way!

Reply 11 of 13, by Ringding

User metadata
Rank Member
Rank
Member

The problematic instruction is pop dword [eax+0x87], where [eax+0x87] points into a non-present page. The normal core handles this quite differently from the dynrec core by using mem_writed_inline which spawns a nested run loop via PAGING_PageFault to run the exception handler and then continues where it left of, which is a somewhat gross hack that seems to work somehow 😉. In contrast, the dynrec core uses mem_writed_checked_drc which jumps into DynRunException which sets up the CPU state like the real thing would and then continues its run loop. From here it becomes difficult to follow. In theory the guest handler should bring in the page and then retry the operation. Or should it? And while writing this it occurs to me that the problem is likely this: Execution is resumed at the faulting instruction, which bumps the stack pointer for the second time and makes a complete mess.

Reply 12 of 13, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yes Precisely!
Let me pm you something.

The 1 instruction problem, which has been plaguing me a lot, seems to be a problem with overwriting code, which is identical to the original code, except 16 bit instead of 32 bit. The cache detection doesn't detect this as new code and thus runs the wrong operand size.

Water flows down the stream
How to ask questions the smart way!