X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=README.md;h=b3a41a1e2e394608b01c718de18a05340b331d35;hp=ec9721ffe1b7f3d968d3c3b318c81da521b9e704;hb=7cffbf057545fb303ad8f53e432ef42f7708e16d;hpb=68f89fa06ae5cfacde9cf8310e97220e5fc05260 diff --git a/README.md b/README.md index ec9721f..b3a41a1 100644 --- a/README.md +++ b/README.md @@ -129,3 +129,21 @@ U-only pairable instructions: - adc, sbb - shr, sar, shl, sal with immediate - ror, rol, rcr, rcl with immediate=1 + +Notes about DJGPP & CWSDPMI +--------------------------- +Can't use the `hlt` instruction for waiting for interrupts, because we're +running in ring3 by default. I surrounded all the `hlt` instructions with a +`USE_HLT` conditional, which is undefined when building with DJGPP. + +It's possible to arrange for our code to run on ring0 by changing the DPMI +provider from `cwsdpmi.exe` to `cwsdpr0.exe` by running: +`stubedit demo.exe dpmi=cwsdpr0.exe`, but I haven't tested under win9x to see if +it still works if we do that. + +Our fucking segments don't start at 0 ... to access arbitrary parts of physical +memory we need to call `__djgpp_nearptr_enable()` and use the following macros I +defined in `cdpmi.h`: + + #define virt_to_phys(v) ((v) + __djgpp_base_address) + #define phys_to_virt(p) ((p) - __djgpp_base_address)