Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Memory Address Conversions

BretBret Member Posts: 114
At a command prompt under Windows (DPMI environment), is there a way to convert back and forth between the Segment:Offset format of the V86 command prompt and a 32-bit Physical Address?

Also, in the same environment (under Windows/DPMI with paging enabled), is there a way to convert back and forth between Linear and Physical Addresses?

Comments

  • PrattarattPrattaratt Member Posts: 2
    : At a command prompt under Windows (DPMI environment), is there a way
    : to convert back and forth between the Segment:Offset format of the
    : V86 command prompt and a 32-bit Physical Address?
    :
    This is taking me back a ways, but IIRC, you take the segment value, shift it left 4 bits , then add the segment value to it for a 20 bit value, right guys?

    : Also, in the same environment (under Windows/DPMI with paging
    : enabled), is there a way to convert back and forth between Linear
    : and Physical Addresses?

    Can't help you here as I have not done much protected mode programming in ASM.
  • BretBret Member Posts: 114
    : : At a command prompt under Windows (DPMI environment), is there a way
    : : to convert back and forth between the Segment:Offset format of the
    : : V86 command prompt and a 32-bit Physical Address?
    : :
    : This is taking me back a ways, but IIRC, you take the segment
    : value, shift it left 4 bits , then add the segment value to it for a
    : 20 bit value, right guys?
    :
    : : Also, in the same environment (under Windows/DPMI with paging
    : : enabled), is there a way to convert back and forth between Linear
    : : and Physical Addresses?
    :
    : Can't help you here as I have not done much protected mode
    : programming in ASM.

    That only works when you're in real mode. In protected mode (even in DOS with something as "simple" as EMM386 loaded) that method doesn't work for anything in upper memory or high memory. Under DPMI, it generally doesn't work for any Segment:Offset addresses at all, even the ones that appear to be in low memory (because they may not really be in physical low memory). When paging gets turned on, it REALLY gets ugly to try and figure out what the physical address is.

    I haven't had anybody be able to tell me how to do it. The only way I can imagine even approaching it is to "break into" the paging tables and other tables that the CPU is using and figure out what's happening. I'm not going to go down that road.

    I think there should be some sort of DPMI call that will do this for you, but there doesn't seem to be one. There is a call under VCPI (the predecessor to DPMI) that does it.
Sign In or Register to comment.