Mail Archives: djgpp/1996/11/21/13:02:49
I'm trying to add some 32-bit code on to the end of my code segment, and
wondered if this is the right way of doing it:
1) Get segment limit of code segment
2) Increase segment limit of code by about 4k
3) Get an alias selector for the selector in cs
4) Use __dpmi_get_descriptor to get descriptor, edit type field to
data/read-write
5) Use __dpmi_set_descriptor on alias to get writable data segment at
same addresses as the code segment.
6) Copy the code from the data segment (it's in a buffer) to the new
selector, which I've put in es.
Up until 6), nothing's complained, and I assumme it has worked - so, does this
sound reasonable?
It crashes just before beginning to copy with a general protection error,
but the error print-out gives ds and es as having the selector 0xA7, whereas mine
is 0x1A4 (or something). Does this mean that the selector hasn't loaded, or that
the exception code has replaced my selectors with it's own. (although the CS limit
has been changed)
PS this is for the protected mode interface of the VBE2 specification, if you
were wondering.
PPS do the asm constraints "esi" (foo), "edi" (bar) work? I seem to get errors
if I try and use them.
---
Richard Morgan
R DOT G DOT Morgan AT ncl DOT ac DOT uk
- Raw text -