_BuildDescriptorDWORDs


include vmm.inc

VMMcall _BuildDescriptorDWORDs, <DESCBase, DESCLimit, DESCType, DESCSize, flags>

mov     [DescDWORD1], edx       ; high doubleword of descriptor
mov     [DescDWORD2], eax       ; low doubleword of descriptor

Builds the descriptor parameter used in calls to the _Allocate_GDT_Selector and _Allocate_LDT_Selector services. Uses EAX, ECX, EDX, and Flags.

DESCBase

32-bit value specifying the segment's linear base address.

DESCLimit

20-bit value specifying the segment limit.

DESCType

Present bit, DPL, and type fields for the descriptor (bits 8–15 of the high doubleword). All bits except bits 0 – 7 of this parameter must be zero.

DESCSize

Granularity and big/default fields for the descriptor (bits 20–23 of the high doubleword). All bits except bits 4 – 7 of this parameter must be zero.

flags

Operation flags. Can be zero or the following value:

Value

Meaning

BDDExplicitDPL

Uses the DPL bits in the DESCType parameters. If this value is not given, the service sets the DPL bits to be equal to the RPL bits for protected-mode applications.


All other values are reserved.

Virtual devices must not rely on the privilege level at which protected-mode applications run. When creating selectors for protected-mode applications, a virtual device should not specify the BDDExplicitDPL value. This provides a convenient way to build descriptors without knowing the protection level for protected-mode applications.

See also _Allocate_GDT_Selector, _Allocate_LDT_Selector