Dynrec (x86_64 linux) problems with win3.11

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Dynrec (x86_64 linux) problems with win3.11

Postby Qbix » 2019-4-03 @ 15:02

viewtopic.php?p=695745#p695745

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10807
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-03 @ 21:34

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.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-03 @ 21:41

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 ;). :(
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-03 @ 22:18

No, also not with Win 3.11.

1. imgmount works (at least, does not crash)
2. Windows starts and seems to run normally.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-03 @ 22:30

Last update: I missed the part about this being about 0.74-2. I used the trunk version previously, but it makes absolutely no difference.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-04 @ 09:45

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?
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-04 @ 20:06

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.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Qbix » 2019-4-05 @ 06:49

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10807
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-05 @ 17:50

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.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-05 @ 17:57

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.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Qbix » 2019-4-05 @ 18:26

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10807
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Ringding » 2019-4-15 @ 16:18

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.
Ringding
Newbie
 
Posts: 31
Joined: 2016-1-05 @ 21:02

Re: Dynrec (x86_64 linux) problems with win3.11

Postby Qbix » 2019-4-15 @ 16:29

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!
User avatar
Qbix
DOSBox Author
 
Posts: 10807
Joined: 2002-11-27 @ 14:50
Location: Fryslan

Re: Dynrec (x86_64 linux) problems with win3.11

Postby jmarsh » 2019-4-15 @ 17:53

Qbix: I've been away from home/IRC most of the time lately but I'll try and get on tomorrow...
jmarsh
Newbie
 
Posts: 91
Joined: 2014-1-04 @ 09:17


Return to DOSBox Development

Who is online

Users browsing this forum: digger and 2 guests