Re: Segfault reading memory address > 0xFFFFF000



"James" <countingtoten@xxxxxxxxx> wrote in message
news:c76e39a6-8268-4d92-9ed7-f4a8eaf568f6@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
When I try to read a memory address higher than 0xFFFFF000 directly
using DJGPP in DOS the program seg faults, but if I step up to that
address by reading the addresses before it, the program works fine.
Why does stepping up to the address work but not reading the address
directly and is there a fix to just read the address directly?


Have you found the problem or a solution?

After adding includes, a main(), and the declaration for selector:
unsigned short selector;

I was able to get it to compile. I wasn't seeing the SIGSEGV in MS-DOS. I
was able to get it to fault in a Windows 98 SE dos console. I also changed
x to an unsigned long and checked all the dpmi calls for -1 error...

Of course, when the app is run in Windows it's not using CWSDPMI, but
Windows' internal DPMI... Unfortunately, my machine seems to SIGSEGV for
any address over 1Mb + 144k (wierd...), not just those around 0xFFFFF000. I
don't have time to look at it further for a while. I'm assuming it's some
other protection related mechanism to prevent access to Windows code or non
existant memory. Maybe the memory just needs to be mapped into Windows
paging tables somehow...

However, I did come across something else that was interesting. When I
added a call to __dpmi_set_descriptor_access_rights(), and it didn't fix the
problem, I decided to see what values where actually being set for the
selector (my own trusted assembly, not DJGPP). It turns out the way you
have the dpmi calls ordered, that Windows doesn't set the requested base
address. It kept setting the upper three nybbles of the base address to
0xC4_ (forget the third) instead 0xfff. The only way I could get Windows 98
SE to set the base address of the selector to the value passed to
__dpmi_set_segment_base_address(), was to reorder the dpmi calls like so:

__dpmi_allocate_ldt_descriptors()
__dpmi_set_descriptor_access_rights()
__dpmi_set_segment_base_address()
__dpmi_set_segment_limit()
__dpmi_physical_address_mapping()


Rod Pemberton

.



Relevant Pages

  • Re: Got Vista or Win7? Worry.
    ... Do you really think people will switch to Ubuntu because of cries of worry with Vista and Windows 7? ... If you do insist on staying in all the time, try some reading instead of planting your nose, inside your computer, all of your life. ... Also knowing quite a few MVP's and other REAL EXPERTS in the industry helps. ... There input is invaluable and as I said before, I have heard nothing but good reports about it. ...
    (microsoft.public.windows.vista.general)
  • RE: File Transfer Wizard Problem
    ... Started reading your post and thought it was mine, ... Windows SE computer right here next to the new big one. ... Tried direct cable connection and could see the ... > Thanks, Ron ...
    (microsoft.public.windowsxp.general)
  • Re: Beware of Acronis Hanging Up Your Computer
    ... maria, the hackneyed proctologist, orated: ... Startup Manager and the OS Selector. ... disallowing you from loading Windows. ... "Please specify the Acronis Secure Zone size. ...
    (alt.os.windows-xp)
  • Re: Beware of Acronis Hanging Up Your Computer
    ... Startup Manager and the OS Selector. ... disallowing you from loading Windows. ... get a choice of drives where you would like to install it. ... "Please specify the Acronis Secure Zone size. ...
    (alt.os.windows-xp)
  • Re: Beware of Acronis Hanging Up Your Computer
    ... Startup Manager and the OS Selector. ... your Windows if you have removed the drive that contains the Acronis ... get a choice of drives where you would like to install it. ... "Please specify the Acronis Secure Zone size. ...
    (alt.os.windows-xp)