+ Added dxeload and emu387

This commit is contained in:
michael 2000-07-03 14:43:53 +00:00
parent 74f131b173
commit 2bc4761214
4 changed files with 131 additions and 1 deletions

60
docs/dxeload.tex Normal file
View File

@ -0,0 +1,60 @@
%
% $Id$
% This file is part of the FPC documentation.
% Copyright (C) 1997, by Michael Van Canneyt
%
% The FPC documentation is free text; you can redistribute it and/or
% modify it under the terms of the GNU Library General Public License as
% published by the Free Software Foundation; either version 2 of the
% License, or (at your option) any later version.
%
% The FPC Documentation is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% Library General Public License for more details.
%
% You should have received a copy of the GNU Library General Public
% License along with the FPC documentation; see the file COPYING.LIB. If not,
% write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
%
\chapter{The DXELOAD unit}
\section{Introduction}
The \file{dxeload} unit was implemented by Pierre M\"uller for \dos,
it allows to load a DXE file (an object file with 1 entry point)
into memory and return a pointer to the entry point.
It exists only for \dos.
\section{Constants, types and variables}
\subsection{Constants}
The following constant is the magic number, found in the header of a DXE
file.
\begin{verbatim}
DXE_MAGIC = $31455844;
\end{verbatim}
\subsection{Types}
The following record describes the header of a DXE file. It is used to
determine the magic number of the DXE file and number of relocations that
must be done when the object file i sloaded in memory.
\begin{verbatim}
dxe_header = record
magic,
symbol_offset,
element_size,
nrelocs : longint;
end;
\end{verbatim}
\section{Functions and Procedures}
\begin{functionl}{dxe\_load}{dxeload}
\Declaration
function dxe\_load(filename : string) : pointer;
\Description
\var{dxe\_load} loads the contents of the file \var{filename} into memory.
It performs the necessary relocations in the object code, and returns then
a pointer to the entry point of the code.
\Errors
If an error occurs during the load or relocations, \var{Nil} is returned.
\end{functionl}
For an example, see the \file{emu387} unit in the RTL.

62
docs/emu387.tex Normal file
View File

@ -0,0 +1,62 @@
%
% $Id$
% This file is part of the FPC documentation.
% Copyright (C) 1997, by Michael Van Canneyt
%
% The FPC documentation is free text; you can redistribute it and/or
% modify it under the terms of the GNU Library General Public License as
% published by the Free Software Foundation; either version 2 of the
% License, or (at your option) any later version.
%
% The FPC Documentation is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
% Library General Public License for more details.
%
% You should have received a copy of the GNU Library General Public
% License along with the FPC documentation; see the file COPYING.LIB. If not,
% write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
% Boston, MA 02111-1307, USA.
%
\chapter{The EMU387 unit}
The \file{emu387} unit was written by Pierre M\"uller for \dos. It
sets up the coprocessor emulation for FPC under \dos. It is not necessary to
use this unit on other OS platforms because they either simply do not run on
a machine without coprocessor, or they provide the coprocessor emulation
themselves.
It shouldn't be necessary to use the function in this unit, it should be
enough to place this unit in the \var{uses} clause of your program to
enable the coprocessor emulation under \dos. The unit initialization
code will try and load the coprocessor emulation code and initialize it.
\section{Functions and procedures}
\begin{function}{npxsetup}
\Declaration
procedure npxsetup(prog\_name : string);
\Description
\var{npxsetup} checks whether a coprocessor is found. If not, it loads the
file \file{wmemu387.dxe} into memory and initializes the code in it.
If the environment variable \var{387} is set to \var{N}, then the emulation
will be loaded, even if there is a coprocessor present. If the variable
doesn't exist, or is set to any other value, the unit will try to detect
the presence of a coprocessor unit.
The function searches the file \file{wmemu387.dxe} in the following way:
\begin{enumerate}
\item If the environment variable \var{EMU387} is set, then it is assumed
to point at the \file{wmemu387.dxe} file.
\item if the environment variable \var{EMU387} does not exist, then the
function will take the path part of \var{prog\_name} and look in that
directory for the file \file{wmemu387.dxe}.
\end{enumerate}
It should never be necessary to call this function, because the
initialization code of the unit contains a call to the function with
as an argument \var{paramstr(0)}. This means that you should deliver the
file \var{wmemu387.dxe} together with your program.
\Errors
If there is an error, an error message is printed to standard error, and
the program is halted, since any floating-point code is bound to fail anyhow.
\end{function}

View File

@ -28,9 +28,11 @@
\begin{document}
%\input{crt.tex}
%\input{dos.tex}
%\input{dxeload}
\input{emu387}
%\input{getopts.tex}
%\input{go32.tex}
\input{gpm.tex}
%\input{gpm.tex}
%\input{graph.tex}
%\input{heaptrc.tex}
%\input{ipc.tex}

View File

@ -114,6 +114,10 @@ lookup.
\input{crt.tex}
% The Dos unit
\input{dos.tex}
% The DXELoad unit
\input{dxeload.tex}
% The emu387 unit
\input{emu387.tex}
% The getopts unit
\input{getopts.tex}
% The GPM unit
@ -134,6 +138,8 @@ lookup.
\input{mouse.tex}
% the objects unit
\input{objects.tex}
% the ports unit
\input{ports.tex}
% the printer unit
\input{printer.tex}
% the sockets unit