www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/01/23/05:18:11

Date: Tue, 23 Jan 2001 12:14:56 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Darryl Gates <gatesjd AT cadvision DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Need help loading BIOS fonts...
In-Reply-To: <U%_a6.21321$K8.1029143@news1.rdc1.ab.home.com>
Message-ID: <Pine.SUN.3.91.1010123121435.9288D-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Mon, 22 Jan 2001, Darryl Gates wrote:

>     // So we need to set up a descriptor in the LDT
>     font_descriptor = __dpmi_allocate_ldt_descriptors(1);

You don't check if __dpmi_allocate_ldt_descriptors failed: error no.1.

>     // Now we have to set the base address for the segment that has
>     // the fonts. We use the font_address.
>     __dpmi_set_segment_base_address(font_descriptor,font_address);

`font_address' is 0xffa6e, which doesn't have its low 12 bits zeroed,
which might cause __dpmi_set_segment_base_address to fail: error
no.2.  You don't check if it did fail: error no.3.

>     // Now we set the segment limit so that we don't grab stuff that's
>     // outside of the ROM fonts. This is just the number of bytes that
>     // the fonts take up in memory (256*8 or 256<<3)
>     __dpmi_set_segment_limit(font_descriptor,(256<<3));

The segment limit should be 1 less than the size (i.e. 256*8 - 1):
error no.4.  You didn't check if __dpmi_set_segment_limit failed:
error no.5.

>     // Now we want to just go through the list of ROM fonts in memory
>     // and copy that exactly into our array. This is the easy bit!
>     for(i; i<(256<<3); i++)
>     {
>         character_set[i]=_farpeekb(_dos_ds,16*(i+0xffa6e));
>   //character_set[i]=_farpeekb(font_descriptor,i);
> /* This won't work.

What does it mean ``won't work''?  Does it crash?  If so, post the
crash message.

>   _farpeekb needs to be called with _dos_ds as its
>    first argument, and 16*segment+offset (i.e. 0x449) as its second.

That's not true: _farpeekb can be called with *any* selector, not just
with _dos_ds.

- Raw text -


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