Mail Archives: djgpp/1999/10/19/15:18:16
On Tue, 19 Oct 1999, Gisle Vanem wrote:
> Exiting due to signal SIGSEGV
> General Protection Fault at eip=00001dcc, error=01d4
If a program crashes with a GPF, and the crash message includes an error
code, then the error code is actually the value of a selector that your
program tried to load into one of the segment registered, and the
selector turned out to be invalid.
So in this case, you are trying to use a selector 0x1d4, which is indeed
invalid (it's not ring-3 selector).
The reason is probably that you didn't set correctly the descriptor for
the selector you created (the one that is the value of bios32.selector).
See the docs of the function __dpmi_set_descriptor_access_rights for more
details.
(It took me exactly 5 seconds to realize what the problem is, given the
crash dump. In contrast, your previous message required 15 minutes of
reading the code and looking for possible problems. See how much easier
it is?)
> Generating asm-output, the "lcall" looks okay. Unless 'bios32_api' is
> wrongly aligned. I didn't see that <dpmi.h> packs '__dpmi_paddr' in
> any way.
The alignment is okay: GCC takes care of that.
> Maybe I need to modify the selector for 'execute' ? (don't think so)
I think you do need that. In which case you will have to define two
selectors: one for data, another for code, with the same base address
and limit, but different descriptors. (DJGPP does exactly that for CS
and DS, btw.)
- Raw text -