Hi... some new thoughts on the "EMM386 trashes 386-specific registers (and only such!) during init (but not during other activities)" problem: MS DOS _kernel_ was plain 8086 compatible, so even though you were supposed to preserve ALL registers, you could trash all THOSE registers which MS DOS would not use. For example RTSND even trashed SI and DI, and it looks like MS DOS just happens not no need those preserved over the device driver call anyway.
So we have two extremes: 1. drivers must never change any registers in their interrupt or strategy calls. That would be a safe assumption. 2. drivers cannot be expected to know that DOS would ever contain 386-specific opcodes in the kernel, therefore they can trash anything which is beyond 8086 registers. I would still vote for 1. ;-). Whatever. Only 386-specific drivers can cause this kind of trouble, and EMM386 is the only driver at all which is yet known to have this problem (or are there other drivers which break as soon as you use the 386- optimized kernel?), so I would say: Add push fs / push gs and pop fs / pop gs to EMM386 and be happy. In the vague hope that OpenWatcom ever becomes able to use 32bit registers, I would even say: Replace push ax / bx / ... and pop ax / bx / ... by push eax / push ebx ... and pop eax / pop ebx / ... in EMM386 as well, just to be safe. However, one of the annoying limitations of that is that it might blow the stack (too much stack footprint). Luckily there is a solution: Move the push/pop stuff to go_driver, which uses a LOCAL stack :-)). I mean: Remove most of the push/pop from go_driver_entry and instead add it to go_driver (and driver_exit). Annoying as in "MS really made some odd decisions about data structures and memory sizes when they defined DOS". Our EMM386 is not annoying at all, at least when you compare it to MS DOS 6 EMM386 :-). Whoops, better not think about that too much, or I will come up with optimization ideas again (page tables to simulate A20, using Pentium VME if present...) ;-). Eric ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Freedos-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freedos-devel
