Stas Sergeev <s...@list.ru> writes: > 10.11.2012 15:58, Eric W. Biederman пишет: >> >> First vgaemu is one of the most important parts of dosemu. > The problem is not vgaemu itself but rather all > the hooks it has in cpuemu and a signal handler. > cpuemu has to check every memory access to > see if it is vga mem or not, so you can imagine > the mess involved. And the signal handler uses > instremu.c - another CPU emulator. > Do you think there is no way to somehow make > this any cleaner? I'll trust your judgement on this, > at least until I rtfm'ed myself enough on the subject. :)
It has been a long time since I have looked at the code and I am not at all familiar with cpuemu. Originally we used to take a fault on any vga memory access that might need emulation and the go back into vm86 mode. With the enhancement of instremu to handle all of the instructions allowing us to run several instructions and if we were in a loop to avoid taking multiple faults at once the weird cga, ega, and vga modes went from unusable under X on a 700Mhz 486 to a something that worked. I also remember there was a lot of work put in to avoid having to fault in the pages. So I would be surprised if there were missing opportunities. I don't know how the code is structured today or how cpuemu works, but if I was to design it from scratch the way I would put the code together is: - A slowpath emulator that can handle all of the weird case and fill in where vm86 mode, running on the native cpu, or anything else falls off. - A fast path jit (cpuemu?) that would emulate instructions by converting them into native code, and would ensure there is an appropriate fault on unhandled cases so that the slowpath emulator could handle the issue. With that split it would be possible to just let the slowpath emulator handle the vgaemu case. It still might make sense to bring the optimization of weird memory accesses into a jit but it would not be required, as long as we had appropriate fault handling for reads and writes. But the property of avoiding page faults through emulating hundreds of instructions in a row in the slow path emulator still seems to be a very good idea. Eric ------------------------------------------------------------------------------ Everyone hates slow websites. So do we. Make your web apps faster with AppDynamics Download AppDynamics Lite for free today: http://p.sf.net/sfu/appdyn_d2d_nov _______________________________________________ Dosemu-devel mailing list Dosemu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/dosemu-devel