Possible to make EMM386 out of CWSDPMI ? Weird but promising...
Eric Auer <[email protected]>
| Newsgroups | gmane.os.freedos.devel,gmane.spam.detected |
|---|---|
| Message-ID | <[email protected]> |
Hi, I just had an idea... CWSDPMI, the DPMI host used by the dos extender that is active for DJGPP compiled programs, is itself written in 3240 lines of ASM and 4609 lines of C... it starts from real mode, EMS/VCPI mode or DPMI mode, manages the paging system if needed (if started from real mode) and can call DOS code. So the idea would be to extend the page management by some code to provide EMS, making sort of an emm386 out of cwsdpmi! If cwsdpmi would not have been able to start from real mode, this would be a chicken-egg situation, but I think it can work :-). You can use the TSR example of DJGPP to learn how to spawn DOS while leaving CWSDPMI active: ftp://ftp.rz.uni-wuerzburg.de/pub/pc/simtelnet/gnu/djgpp/v2misc/ has CWSDPMI ftp://ftp.rz.uni-wuerzburg.de/pub/pc/simtelnet/gnu/djgpp/v2tk/ has the TSR code The idea is to leave CWSDPMI compatible to DJGPP. But to add EMS services. Then you would compile the TSR example with the MODIFIED CWSDPMI and with the int8 handler of the example changed to do nothing. Then you run the TSR. You will have a do-nothing run in protected mode, return back to DOS, but the protected mode part will still be there. And because you have modified CWSDPMI, you will have EMS as a side-effect! I know this sounds weird, but I think it is worth thinking about it. CWSDPMI already contains lots of code to deal with lowlevel stuff of protected mode, so... Alternatively you can twist things a bit further by adding a "tunnel" to CWSDPMI that allows the TSR programm to access the page table directly. Then you could do most of the EMS handling in the TSR. Basically everything, as the TSR even shows you how to hook DOS interrupts ;-)). This would mean less changes to CWSDPMI and very much C-only programming for the EMS part. For more details on DJGPP programming and DOS interrupts, see: http://www.delorie.com/djgpp/doc/libc-2.02/ http://www.delorie.com/djgpp/v2faq/faq24.html No thoughts put in VCPI yet. VCPI support will have to be added in the cwsdpmi part of the "cwsdpmi-modified plus tsr-modified-with-ems-manager" duo mostly, while the EMS support can be done almost completely in the tsr-with-ems-manager part, as explained above, given the pagetable access backdoor gets added to cwsdpmi (should be relatively easy to add such a backdoor). Opinions? Greetings, Eric