Date: Tue, 7 Oct 1997 15:23:04 +0200 (IST) From: Eli Zaretskii To: Arthur Bredrick cc: djgpp AT delorie DOT com Subject: Re: three .externs whose purpose and origin I know not In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Precedence: bulk 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).