Segment to Descriptor

Maps a real mode segment (paragraph) address onto an LDT
descriptor that can be used by a protected mode program to
access the same memory.

Call With:

AX = 0002H
BX = real mode segment address

Returns:

if function successful
Carry flag= clear
AX = selector for real mode segment

if function unsuccessful
Carry flag= set
AX = error code
8011H descriptor unavailable

Notes:

o The descriptor's limit will be set to 64 KB.
o Multiple calls to this function with the same segment
address will return the same selector.
o The intent of this function is to provide clients with
easy access to commonly used real mode segments such as
the BIOS data area at segment 0040H and the video refresh
buffers at segments A000H, B000H, and B800H. Clients
should not call this function to obtain descriptors to
private data areas.
o Descriptors created by this function can never be
modified or freed. For this reason, the function should
be used sparingly. Clients which need to examine various
real mode addresses using the same selector should
allocate a descriptor with Int 31H Fn 0000H and
change the base address in the descriptor as necessary,
using the Set Segment Base Address function (Int 31H
Function 0007H).

o Refer to the rules for descriptor usage in Appendix D.