Hi Kurt, >> to use djgpp, simply run hdpmi32; there is a way to remove the cwsdpmi and
> insert hdpmi32 in the djgpp header. > Christian, I already tried running hdpmi32 first, even using the '-r' > switch, which makes it go tsr, and still got the > page fault error from the djgpp program I remember that CWSDPMI and DOSEMU are "special" in their habit to have mostly 1:1 mapping of linear to physical RAM addresses. Other DPMI such as HDPMI can map differently, so if your program somehow implicitly assumes 1:1 mapping instead of using DJGPP helpers for that, you might get a page fault there but not with CWSDPMI... Some example code: #include <dpmi.h> /* DPMI things */ /* #include <pc.h> for things like inportb() */ #include <sys/farptr.h> /* things like _farpeekb() */ __dpmi_meminfo meminfo; meminfo.address = physical address eg of framebuffer to access... /* PHYSICAL address as input to __dpmi_physical_adddress_mapping */ meminfo.size = size of buffer to access, in bytes... if (__dpmi_physical_address_mapping(&meminfo) != 0) return GIVE-UP-here; __dpmi_lock_linear_region(&meminfo); int myselector = __dpmi_allocate_ldt_descriptor(1); __dpmi_set_segment_base_address(int, meminfo.address); /* NOTE that meminfo.access here can DIFFER from physical address! */ __dpmi_set_segment_limit(int, meminfo.size-1); #define pokeregion(x,c) _farpokeb(myselector,(x),(c)) By the way, for buffers in the first megabyte, you can simply use _farpokeb(_dos_ds, offset, byte) :-). Include the go32.h header to use _dos_ds. Another useful header is dos.h which gives you int86 and union REGS... :-). DJGPP is very helpful with int86: If you call a well known DOS or BIOS function, int86 and int86x already KNOW they have to translate pointers from protected mode style to DOS style and back. They even copy data to/from extra buffers if data is outside DOS memory. > It seems that HX will only work with files already 'PE', like, say, from > mingw. The HX docs seem to use the terms > 'PE' and' win32 console app' interchangeably; yet the djgpp exe, with it's > 'MZ' header, is also a win32 console > app--it will run in any windows dosbox-- and never throw a page fault error. There is HDPMI and there is HXRT, the latter helps you run Win32 apps. > Again, for djgpp, use wdosx, as it basically does everything > in one simple shot: removes the original dj header, with cwsdpmi, > and substitutes a header/dpmi which will allow the djgpp app to run > in dos; and automatically makes a backup copy of the original > exe; and preserves the 'MZ" , and will still run in the dosbox, > as before.there ya go. Thanks, Kurt Eric :-) ------------------------------------------------------------------------------ Enter the BlackBerry Developer Challenge This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge _______________________________________________ Freedos-user mailing list Freedos-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/freedos-user