delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/07/09:24:10

Date: Tue, 7 Oct 1997 15:23:04 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Arthur Bredrick <sammy AT blast DOT net>
cc: djgpp AT delorie DOT com
Subject: Re: three .externs whose purpose and origin I know not
In-Reply-To: <EHG2yv.AnA@nonexistent.com>
Message-ID: <Pine.SUN.3.91.971007152235.25685U-100000@is>
MIME-Version: 1.0

On Thu, 2 Oct 1997, Arthur Bredrick wrote:

> I have seen the following declared in Martynas Kunigelis' keyboard interrupt
> handler (the assembly file keyboard.s):
> 
>   .extern ___djgpp_base_address
>   .extern ___djgpp_ds_alias
>   .extern ___djgpp_dos_sel
>
[snip]
>
> I am very new to protected mode programming, DJGPP, and assembly in general.
> Where do these externals come from and what are they being used for?  Thanks
> for any help.

You need to take a look at crt0.S, exceptn.S and dpmiexcp.c from the
library sources (v2/djlsr201.zip from the same place you get DJGPP).
If you have specific questions after you look there, ask them here.

In short, ___djgpp_base_address is the base address of the segment
loaded into the DS register while DJGPP program runs; ___djgpp_dos_sel
is the same as _dos_ds (documented in the library reference, see
`_go32_info_block' in libc.inf); and ___djgpp_ds_alias is an alias
selector for the DJGPP data segment (the usual DS selector is made
invalid when a signal, such as SIGINT, is pending, while the alias
selector is *always* valid, and should therefore be used by interrupt
handlers).

- Raw text -


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