Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Don't do this!!! 32bit pointers, GPFs and real mode (Developers)

posted by DOS386(R), 27.08.2010, 03:04

> So, I switched to setting gs=0 and addressing things with gs:[esi] which is
> significantly easier.

Don't do this. Real mode has a 64 KiB segment limit. Having (ESI+size)<=65535 will work but there is no point to do, just use plain SI.

> 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.

Removing 64 KiB segment limit needs at least 80386, sorry (so does GS).

> 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?

Someone (most likely BIOS or XMS host) left the unreal mode enabled.

> 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?

64 KiB segment limit, stored in the "hidden part" of segment registers.

> 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.

What does the code do ? To remove the 64 KiB segment limit, you MUST set up PM or unreal mode some way, sorry (and preferably check for 80386 before using any 8086-incompatible instruction). Relying on "someone" enabling the unreal mode for you is a very bad idea. Also ASS'uming "code 100% done" and then finding a horrible bug needing to rewrite 99% of the code to fix it is a "known issue". :-(

P.S. what about the updated sound stuff ? I never got any mail except one with very little text and no attach.

---
This is a LOGITECH mouse driver, but some software expect here
the following string:*** This is Copyright 1983 Microsoft ***

 

Complete thread:

Back to the forum
Board view  Mix view
15108 Postings in 1358 Threads, 246 registered users, 13 users online (0 registered, 13 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum