www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/16/13:53:17

Mime-Version: 1.0
To: "Dark Angel" <mop45440 AT mail DOT telepac DOT pt>, djgpp AT delorie DOT com
From: Nate Eldredge <nate AT cartsys DOT com>
Subject: Re: Using the fonts stored in the ROM
Date: Sat, 16 May 1998 09:56:30 -0700
Message-ID: <19980516165612.AAJ29559@ppp105.cartsys.com>

At 01:12  5/15/1998 GMT, Dark Angel wrote:
>I am trying to use the text fonts stored in the ROM of the EGA/VGA, but i
>am having some trouble.
>
>
>I am using the function 1130h of the interrupt 10h to get the segment and
>offset of the font. I already know the addressing in protected mode is
>different, so i used _dmpi_segment_to_descriptor to get a descriptor for
>the segment returned by the function call. 
>Then i used _farpeekb(selector, offset) to get the bytes from the memory: i
>got a segmentation fault!
>I tryed another way: _farpeekb(_dos_ds, segment*16+offset): i still got a
>segmentation fault!

That should work.

>I have tryed this in real mode and it worked. I know the segment (ffffh)
>and offset(e67c) returned by the funtion call are correct.

That seems really unlikely. As you say, that is above 1MB. So either
somebody is using the HMA to store the font, or that address is wrong. I
would expect a ROM font to be located somewhere in the C000 segment, since
that's where the video BIOS typically lives. Are you using UniVBE, or some
other such video driver?

>Am i doing the things the right way?
>Are these fonts stored above the 1st Mb, and that's why i got the error
>message?

>Another thing. When i make a call to dos prompt from windows 95, and then
>compile the program, it works alright.
>But when i make a shutdown to dos and run CWSDPMI i get the segmentation
>fault error.

Ah. This is normally caused when your program has a bug with a NULL pointer
dereference. Windows is too stupid to catch it (it's a long story), but
CWSDPMI can.

Nate Eldredge
nate AT cartsys DOT com



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019