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 write, whether it was a read/modify/write instruction like xor [0],0. Also, I had forgotten about the latches: there are modes where the actual byte that is read or written is irrelevant; when you read a byte from VGA memory, a 32-bit latch is read, one byte for every plane. Then this latch is used for the next write. That way, a "rep movsb" from VGA to VGA can move 4x the data, which was one of the advantages of Mode-X at the time. So I don't think there is simple approach. 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). Bart ------------------------------------------------------------------------------ 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