summaryrefslogtreecommitdiffstats
path: root/private/mvdm/dpmi/dxoem.asm
blob: c671fe3acd6593dadc2826e5ca12d6953a1dc2cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
	PAGE	,132
	TITLE	DXOEM.ASM  -- Dos Extender OEM Interface

; Copyright (c) Microsoft Corporation 1988-1991. All Rights Reserved.

;***********************************************************************
;
;	DXOEM.ASM	- DOS Extender OEM Interface
;
;-----------------------------------------------------------------------
;
; This module contains the routines that may need to be modified by OEMs
; when adding new device/interface support to the Microsoft 286 DOS
; Extender portion of Windows/286.  There are four routines contained
; in this module:
;
;	InitializeOEM	- called during DOSX initialization
;
;	SuspendOEM	- called when the protected mode app is about
;			  to be suspended (currently when running a
;			  standard DOS 'old' app from Windows).
;
;	ResumeOEM	- called when the protected mode app is about
;			  to be resumed (currently when returning from
;			  a standard DOS 'old' app to Windows).
;
;	TerminateOEM	- called during DOSX termination
;
; Note: when this module refers to the 'OEM layer,' it is refering to
; the 286 DOS Extender device drivers, API mappers, etc., not the
; Windows OEM layer.
;
;-----------------------------------------------------------------------
;
;  06/28/89 jimmat  Original version.
;  11/29/90 amitc   Removed SuspendOEM/ResumeOEM - not required for 3.1
;  11/29/90 amitc   Moved call to 'InitLowHeap' from here to DXNETBIO.ASM
;
;***********************************************************************

	.286p

; -------------------------------------------------------
;           INCLUDE FILE DEFINITIONS
; -------------------------------------------------------

	.xlist
	.sall
include     segdefs.inc
include     gendefs.inc
include     pmdefs.inc
	.list

; -------------------------------------------------------
;           GENERAL SYMBOL DEFINITIONS
; -------------------------------------------------------


; -------------------------------------------------------
;           EXTERNAL SYMBOL DEFINITIONS
; -------------------------------------------------------

	extrn	InitNetMapper:NEAR
	extrn	TermNetMapper:NEAR
	extrn	ReleaseLowHeap:NEAR

; -------------------------------------------------------
;           DATA SEGMENT DEFINITIONS
; -------------------------------------------------------

DXDATA	segment

	extrn	NetHeapSize:WORD

DXDATA	ends


; -------------------------------------------------------
;           CODE SEGMENT VARIABLES
; -------------------------------------------------------

DXCODE  segment

DXCODE  ends

DXPMCODE    segment

DXPMCODE    ends

; -------------------------------------------------------
	subttl OEM Initialization Routine
        page
; -------------------------------------------------------
;	    OEM INITIALIZATION ROUTINE
; -------------------------------------------------------

DXPMCODE    segment
        assume  cs:DXPMCODE

;--------------------------------------------------------
;   InitializeOEM --  This routine is called during DOSX initialization
;	in order to initialize the OEM layer (device drivers, API
;	mappers, etc.).  It expectes to be called late enough in the
;	initialization process that other interrupt mapping functions
;	(like Int 21h) are available.
;
;	This routine is called in protected mode, and can enable/disable
;	interrupts if it so requires.
;
;   Input:  none
;   Output: none
;   Errors: none
;   Uses:   ax, all others preserved

	assume	ds:DGROUP,es:NOTHING,ss:NOTHING
	public	InitializeOEM

InitializeOEM	proc	near

; Initialize the NetBios mapper.

	mov	ax,NetHeapSize		;don't initialize if net heap
	or	ax,ax			;  size set to zero
	jz	@f

	call	InitNetMapper		;initialize the NetBIOS mapper--CY set
					;  if NetBIOS not installed
@@:
	ret

InitializeOEM	endp

; -------------------------------------------------------

DXPMCODE    ends

; -------------------------------------------------------
	subttl OEM Termination Routine
        page
; -------------------------------------------------------
;	       OEM TERMINATION ROUTINE
; -------------------------------------------------------

DXCODE	segment
	assume	cs:DXCODE

; -------------------------------------------------------
;   TerminateOEM --  This routine is called during DOSX termination
;	to disable the OEM layer.
;
;   Note:  This routine must is called in REAL MODE!  If some termination
;	code must run in protected mode, the routine must switch to
;	protected mode itself, and switch back to real mode before
;	returning.
;
;   Input:  none
;   Output: none
;   Errors: none
;   Uses:   ax,bx,cx,dx,si,di,es
;

	assume	ds:DGROUP,es:NOTHING,ss:NOTHING
	public	TerminateOEM

TerminateOEM	proc	near

	call	TermNetMapper		;terminate the NetBIOS mapper

	call	ReleaseLowHeap		;  and release the low net heap

	ret

TerminateOEM	endp

; -------------------------------------------------------

DXCODE	ends
;****************************************************************
        end