[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
DosMapRealSeg() Convert real mode paragraph value into protected mode selector.
------------------------------------------------------------------------------
Function : Convert a real mode paragraph value into a protected mode
selector.
Syntax : USHORT BLXAPI DosMapRealSeg( USHORT paragraph,
ULONG size, PSEL selector);
paragraph A real mode segment address, e.g. to map address B800:0000 for
the colour screen use 0xB800.
size The size of the memory region to be mapped in bytes, which may be
larger than 64 Kb.
selector Pointer to an integer to receive the selector.
Return : A selector which has the same base address as the real mode
segment.
DosMapRealSeg() is used to map real mode segments onto protected mode
selectors in order to make real mode addresses accessible from protected
mode. (For example the real mode video buffer at segment 0xB800).
If you need to access the low-memory BIOS data area at real mode segment
0x0040 in protected mode, use DosGetBIOSSeg() to obtain a selector in
preference to this function.
DosMapRealSeg() does NOT allocate memory, if you need to allocate real mode
memory use DosAllocRealSeg().
Example:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <blx286.h>
#define VID_BUF 0xB800
#define VID_SIZE 0x8000l
void main (void)
{
SEL video_buffer;
/* Get a selector that corresponds to the screen buffer */
if (DosMapRealSeg(VID_BUF,VID_SIZE,&video_buffer) != 0)
{
printf("Unable to map screen segment\n");
exit(255);
}
printf("Selector for video buffer %04X\n",video_buffer);
}
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson