20.11.2012 17:37, Bart Oldeman пишет:
> On 14 November 2012 07:34, Stas Sergeev wrote:
>> 12.11.2012 07:04, Bart Oldeman пишет:
>>> Sorry, but PROT_WRITE implies PROT_READ on x86, so that cannot work.
>> OK, but there might still be the workaround.
>> How about this:
>> 1. Write-protect video mem
>> 2. On PF save CR2, remove protection, set TF and return
>> 3. On SIGTRAP use saved CR2 to perform the write handling.
>> 4. Clear TF and goto 1
>> I guess its going to be horribly slow on "rep movsb"...
>> So the trivial implementation seems still possible, but the
>> performance would be far from perfection, for sure.
> And you still have to figure out whether it was a byte, word or dword
That might still work if you, after a SIGTRAP, compare the new
content with backed-up old one. You'll see how many bytes were
changed.

> write, whether it was a read/modify/write instruction like xor [0],0.
That might still work if you prepare the read area in advance.

> Also, I had forgotten about the latches: there are modes where the
Probably you can set PROT_NONE and get the read addr.
Then use PROT_READ and set TF, and from that either get the
write addr on PF, or SIGTRAP if it writes not to vid mem.
In this case some insns will take even 3 faults. :(

> So I don't think there is simple approach.
I think it is, but the speed will suck.

> That said, we do have an
> overkill of CPU simulators; instremu.c and codegen-sim.c could be
> merged, and also the simulation of JIT generated code is indeed
> not necessary (the original code can be interpreted instead).
That would be fine, but I think not taking a fault is still faster,
i.e. when jit links the needed hooks in. But that's exactly where
vgaemu starts to populate itself into cpuemu.

------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
Dosemu-devel mailing list
Dosemu-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dosemu-devel

Reply via email to