Mail Archives: djgpp/1994/09/21/21:56:10
What is the proper usage of the _farsetsel() function ?
Initially, I thought I could just load a segment, i.e.,
main()
{
_farsetsel(0xb800);
/* .... */
}
but that generates a General Protection Fault. So then I
tried the following program:
#include <stdio.h>
#include <go32.h>
#include <sys/farptr.h>
int main()
{
unsigned long i;
_farsetsel(_go32_conventional_mem_selector());
for (i = 0xb8000; i < 0xa0000; i++)
_farnspokew(i, 0x0700 | 65);
}
I expected the text screen to be filled with the letter 'A'.
However, nothing happened, the program runs and finishes with no
discernible effect.
_farpeekb(0x40,0x4a) works just fine, returning the
screen width from the BIOS data area.
Any suggestions?
Gordon
- Raw text -