Mail Archives: djgpp-workers/2002/02/08/12:09:04
> Hi! I recently ran CWSDPMI under BOCHS, an open-source CPU emulator,
Cool, that was on my long list of things to do :-)
> discovered a bug in CWSDPMI. The problem is in MSWITCH.ASM:
> test byte ptr _features,10h ;Page Size Extensions?
> As you can see, CWSDPMI thinks bit 4 of the EDX that is output by CPUID
> with an argument of 1 indicates whether or not the Page Size Extension
> (PSE) feature is available. This is not correct.
I can believe that ... This code was written before Intel was documenting
the bits and I never went back and confirmed it.
> Thus the above snippet should read:
> test byte ptr _features,08h ;Page Size Extensions?
I'll check into this and put it into r6
> Note that I don't know if CWSDPMI actually _uses_ 4MB pages. I hope it
> doesn't. If it does than that could explain why my program is still
> crashing in the emulator. Do you know if it does use 4MB pages?
An r6 work in progress test release on clio.rice.edu DOES use 4Mb pages,
but the plan was to carefully review how to implement it first. The
code in r5 is there to support the use of 4Mb pages - I pulled the
rest of the code out before releasing r5.
> In the mean time I'm going to make the fix I suggested above to the CWSDPMI
> source code, see if I can manage to assemble it somehow (I _might_ have
> TASM somewhere.. but it will be version 3.2 or whatever came with some old
> Borland product for DOS). (I'm also going to make a change to my local copy
> of the BOCHS source code. I'd like it to stop spewing about reads from cr4
> like it also does now).
I can build a fixed copy this weekend (maybe) if you can't collect all the
pieces.
> I suggest you make that fix too and incorporate it in the latest version. I
> would appreciate it if you'd increase the default value for CWSDPMI.EXE's
> maximum swap file size to 1GB.
You can do this yourself using CWSPARAM. Since increasing the swap size
increases the bitmap for usage, it increase the dos memory footprint.
Most people only need about 50Mb or so ...
> With modern PC's that's quite practical;
> it's twice the physical RAM my PC has (512MB) while a while ago perhaps the
> present default of 128MB was practical. Maybe even do 2GB. I had to run
> CWSPARAM and change it to 1GB to keep my program from crashing.
If you have 512Mb of physical memory you are right at the point were you
would be very interested in 4Mb pages :-)
I'd be very interested in seeing 4Mb page support in BOCHS.
- Raw text -