32bit pointers, GPFs and real mode (Developers)
hi gang.
I've got a real mode DOS app that I'm writing (x86 assembly) that needs to manipulate some data in 256k chunks. Since the data is larger than 64k segments, it's a bit of a pain to have to use normal ds/es segments and work on everything using 16 bit pointers.
So, I switched to setting gs=0 and addressing things with gs:[esi] which is significantly easier.
I'm not using memory above 1mb, and I don't really want to switch into unreal mode at the top of my program to be compatible on the most machines.
The machine I first developed this code on had absolutely no problems doing all the work it needed to do, so I thought I was done. I run the program on a different machine, and I get a general protection fault (GPF) every time I try and access any 32bit pointer.
I am admittedly *very* protected mode dumb, so my question are:
1) why does this work on some machines and not others? Are they already in unreal mode, left that way by the BIOS?
2) what is causing the GPF? I mean, is there a CPU register bit set or something in some GDT that is detecting this and causing it?
3) any other ways to do 32bit pointers? I don't want to use any libraries or extenders to do this work-the code is already 100% done, it just doesn't work the same on every platform.
thanks!
Complete thread:
- 32bit pointers, GPFs and real mode - DOSferatu, 27.08.2010, 00:57 (Developers)
- Don't do this!!! 32bit pointers, GPFs and real mode - DOS386, 27.08.2010, 03:04
- Don't do this!!! 32bit pointers, GPFs and real mode - DOSferatu, 27.08.2010, 19:27
- Don't do this!!! 32bit pointers, GPFs and real mode - DOS386, 28.08.2010, 01:09
- Don't do this!!! 32bit pointers, GPFs and real mode - DOSferatu, 27.08.2010, 19:27
- 32bit pointers, GPFs and real mode - bretjohn, 29.08.2010, 17:59
- Don't do this!!! 32bit pointers, GPFs and real mode - DOS386, 27.08.2010, 03:04