1 /****************************************************************************
3 * BIOS emulator and interface
4 * to Realmode X86 Emulator Library
6 * Copyright (C) 1996-1999 SciTech Software, Inc.
8 * ========================================================================
10 * Permission to use, copy, modify, distribute, and sell this software and
11 * its documentation for any purpose is hereby granted without fee,
12 * provided that the above copyright notice appear in all copies and that
13 * both that copyright notice and this permission notice appear in
14 * supporting documentation, and that the name of the authors not be used
15 * in advertising or publicity pertaining to distribution of the software
16 * without specific, written prior permission. The authors makes no
17 * representations about the suitability of this software for any purpose.
18 * It is provided "as is" without express or implied warranty.
20 * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
21 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
22 * EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
23 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
24 * USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
25 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
26 * PERFORMANCE OF THIS SOFTWARE.
28 * ========================================================================
32 * Developer: Kendall Bennett
34 * Description: Header file for the real mode x86 BIOS emulator, which is
35 * used to warmboot any number of VGA compatible PCI/AGP
36 * controllers under any OS, on any processor family that
37 * supports PCI. We also allow the user application to call
38 * real mode BIOS functions and Int 10h functions (including
41 ****************************************************************************/
50 /*---------------------- Macros and type definitions ----------------------*/
54 /****************************************************************************
56 Data structure used to describe the details specific to a particular VGA
57 controller. This information is used to allow the VGA controller to be
58 swapped on the fly within the BIOS emulator.
64 pciInfo - PCI device information block for the controller
65 BIOSImage - Pointer to a read/write copy of the BIOS image
66 BIOSImageLen - Length of the BIOS image
67 LowMem - Copy of key low memory areas
68 ****************************************************************************/
70 PCIDeviceInfo *pciInfo;
76 /****************************************************************************
78 Data structure used to describe the details for the BIOS emulator system
79 environment as used by the X86 emulator library.
85 vgaInfo - VGA BIOS information structure
86 biosmem_base - Base of the BIOS image
87 biosmem_limit - Limit of the BIOS image
88 busmem_base - Base of the VGA bus memory
89 ****************************************************************************/
97 /****************************************************************************
99 Structure defining all the BIOS Emulator API functions as exported from
100 the Binary Portable DLL.
102 ****************************************************************************/
105 ibool (PMAPIP BE_init)(u32 debugFlags,int memSize,BE_VGAInfo *info);
106 void (PMAPIP BE_setVGA)(BE_VGAInfo *info);
107 void (PMAPIP BE_getVGA)(BE_VGAInfo *info);
108 void * (PMAPIP BE_mapRealPointer)(uint r_seg,uint r_off);
109 void * (PMAPIP BE_getVESABuf)(uint *len,uint *rseg,uint *roff);
110 void (PMAPIP BE_callRealMode)(uint seg,uint off,RMREGS *regs,RMSREGS *sregs);
111 int (PMAPIP BE_int86)(int intno,RMREGS *in,RMREGS *out);
112 int (PMAPIP BE_int86x)(int intno,RMREGS *in,RMREGS *out,RMSREGS *sregs);
114 void (PMAPIP BE_exit)(void);
117 /****************************************************************************
119 Function pointer type for the Binary Portable DLL initialisation entry point.
121 ****************************************************************************/
122 typedef BE_exports * (PMAPIP BE_initLibrary_t)(PM_imports *PMImp);
126 /*---------------------------- Global variables ---------------------------*/
129 extern "C" { /* Use "C" linkage when in C++ mode */
132 /* {secret} Global BIOS emulator system environment */
133 extern BE_sysEnv _BE_env;
135 /*-------------------------- Function Prototypes --------------------------*/
137 /* BIOS emulator library entry points */
139 ibool PMAPI BE_init(u32 debugFlags,int memSize,BE_VGAInfo *info);
140 void PMAPI BE_setVGA(BE_VGAInfo *info);
141 void PMAPI BE_getVGA(BE_VGAInfo *info);
142 void PMAPI BE_setDebugFlags(u32 debugFlags);
143 void * PMAPI BE_mapRealPointer(uint r_seg,uint r_off);
144 void * PMAPI BE_getVESABuf(uint *len,uint *rseg,uint *roff);
145 void PMAPI BE_callRealMode(uint seg,uint off,RMREGS *regs,RMSREGS *sregs);
146 int PMAPI BE_int86(int intno,RMREGS *in,RMREGS *out);
147 int PMAPI BE_int86x(int intno,RMREGS *in,RMREGS *out,RMSREGS *sregs);
148 void PMAPI BE_exit(void);
151 } /* End of "C" linkage for C++ */
154 #endif /* __BIOSEMU_H */