4 * Copyright 1998 Ove Kåven
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_DOSEXE_H
22 #define __WINE_DOSEXE_H
24 #include "wine/windef16.h"
25 #include "winbase.h" /* for LPSTARTUPINFO32A */
26 #include "winnt.h" /* for PCONTEXT */
27 #include "wincon.h" /* for MOUSE_EVENT_RECORD */
33 typedef void (*DOSRELAY)(CONTEXT86*,void*);
35 #define DOS_PRIORITY_REALTIME 0 /* IRQ0 */
36 #define DOS_PRIORITY_KEYBOARD 1 /* IRQ1 */
37 #define DOS_PRIORITY_VGA 2 /* IRQ9 */
38 #define DOS_PRIORITY_MOUSE 5 /* IRQ12 */
39 #define DOS_PRIORITY_SERIAL 10 /* IRQ4 */
41 extern WORD DOSVM_psp; /* psp of current DOS task */
42 extern WORD DOSVM_retval; /* return value of previous DOS task */
43 extern DWORD DOS_LOLSeg;
44 extern const struct DPMI_segments *DOSVM_dpmi_segments;
46 #if defined(linux) && defined(__i386__)
48 #endif /* linux-i386 */
50 #define V86_FLAG 0x00020000
52 #define BIOS_DATA ((void *)0x400)
54 extern void WINAPI MZ_LoadImage( LPCSTR filename, HANDLE hFile );
55 extern BOOL WINAPI MZ_Exec( CONTEXT86 *context, LPCSTR filename, BYTE func, LPVOID paramblk );
56 extern void WINAPI MZ_Exit( CONTEXT86 *context, BOOL cs_psp, WORD retval );
57 extern BOOL WINAPI MZ_Current( void );
58 extern void WINAPI MZ_AllocDPMITask( void );
59 extern void WINAPI MZ_RunInThread( PAPCFUNC proc, ULONG_PTR arg );
60 extern INT WINAPI DOSVM_Enter( CONTEXT86 *context );
61 extern void WINAPI DOSVM_Wait( INT read_pipe, HANDLE hObject );
62 extern DWORD WINAPI DOSVM_Loop( HANDLE hThread );
63 extern void WINAPI DOSVM_QueueEvent( INT irq, INT priority, DOSRELAY relay, LPVOID data );
64 extern void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val );
65 extern void WINAPI DOSVM_SetTimer( UINT ticks );
66 extern UINT WINAPI DOSVM_GetTimer( void );
67 extern FARPROC16 DOSVM_GetRMHandler( BYTE intnum );
68 extern void DOSVM_SetRMHandler( BYTE intnum, FARPROC16 handler );
69 extern void DOSVM_RealModeInterrupt( BYTE intnum, CONTEXT86 *context );
72 extern void DOSDEV_InstallDOSDevices(void);
73 extern DWORD DOSDEV_Console(void);
74 extern DWORD DOSDEV_FindCharDevice(char*name);
75 extern int DOSDEV_Peek(DWORD dev, BYTE*data);
76 extern int DOSDEV_Read(DWORD dev, DWORD buf, int buflen);
77 extern int DOSDEV_Write(DWORD dev, DWORD buf, int buflen, int verify);
78 extern int DOSDEV_IoctlRead(DWORD dev, DWORD buf, int buflen);
79 extern int DOSDEV_IoctlWrite(DWORD dev, DWORD buf, int buflen);
80 extern struct _DOS_LISTOFLISTS * DOSMEM_LOL();
83 extern int DMA_Transfer(int channel,int reqlength,void* buffer);
84 extern void DMA_ioport_out( WORD port, BYTE val );
85 extern BYTE DMA_ioport_in( WORD port );
88 extern void WINAPI DOSVM_Int09Handler(CONTEXT86*);
89 extern void WINAPI DOSVM_Int09SendScan(BYTE scan,BYTE ascii);
90 extern BYTE WINAPI DOSVM_Int09ReadScan(BYTE*ascii);
93 extern void WINAPI DOSVM_Int10Handler(CONTEXT86*);
94 extern void WINAPI DOSVM_PutChar(BYTE ascii);
97 extern void WINAPI DOSVM_Int16Handler(CONTEXT86*);
98 extern int WINAPI DOSVM_Int16ReadChar(BYTE*ascii,BYTE*scan,BOOL peek);
99 extern int WINAPI DOSVM_Int16AddChar(BYTE ascii,BYTE scan);
102 extern void WINAPI DOSVM_Int17Handler(CONTEXT86*);
105 extern void WINAPI DOSVM_Int19Handler(CONTEXT86*);
108 extern void WINAPI DOSVM_Int20Handler(CONTEXT86*);
111 extern void WINAPI DOSVM_Int21Handler(CONTEXT86*);
114 extern void WINAPI DOSVM_Int29Handler(CONTEXT86*);
117 extern void WINAPI DOSVM_Int31Handler(CONTEXT86*);
120 extern void WINAPI DOSVM_Int33Handler(CONTEXT86*);
121 extern void WINAPI DOSVM_Int33Message(UINT,WPARAM,LPARAM);
122 extern void WINAPI DOSVM_Int33Console(MOUSE_EVENT_RECORD*);
125 extern void WINAPI DOSVM_Int67Handler(CONTEXT86*);
126 extern void WINAPI EMS_Ioctl_Handler(CONTEXT86*);
129 extern void SB_ioport_out( WORD port, BYTE val );
130 extern BYTE SB_ioport_in( WORD port );
133 extern void WINAPI XMS_Handler(CONTEXT86*);
135 #endif /* __WINE_DOSEXE_H */