|
|
1.1 root 1: ###############
2:
3: Additional Device Helpers Routines
4:
5: The following describe additional device helper routines that
6: are not documented in the MS OS/2 Device Drivers Guide Update.
7: There are the following additional routines:
8:
9: AllocateGDTSelector 2DH
10: PhysToGDTSelector 2EH
11: RealToProt 2FH
12: ProtToReal 30H
13:
14: Also note that the correct call code for the VerifyAccess
15: routine is 27H, not 29H as previously listed.
16:
17: AllocateGDTSelector - Allocate GDT Selectors
18:
19:
20: Purpose
21:
22: The AllocateGDTSelector routines allocates one or more GDT selectors,
23: copying them to the specified array.
24:
25: Calling Sequence:
26:
27:
28: MOV ES, SelectorArrayHigh ; Pointer to array
29: MOV DI, SelectorArrayLow ;
30: MOV CX, Selectors ;Number of selectors
31: MOV DL, DEVHLP_ALLOCATEGDT
32: CALL [Device_Help]
33:
34: where:
35:
36:
37: SelectorArrayHigh and SelectorArrayLow are the high- and low-order words of
38: the address of an array to recieve the allocated selectors.
39:
40:
41: Selectors specifies the number of selectors to allocate.
42:
43: Returns:
44:
45: C - set if error.
46:
47:
48: AX = Error code:
49: o Invalid address
50:
51:
52: o Zero selectors requested
53:
54:
55: o Not enough selectors available
56:
57: C -cleared if successful.
58:
59: See Also:
60:
61: PhysToGDTSelector
62:
63:
64:
65:
66: PhysToGDTSelector - Convert Physical Address to GDT Selector
67:
68:
69: Purpose:
70:
71: The PhysToGDTSelector routine converts a physical memory address to a
72: designated GDT selector. The indicated segment must be locked (either long
73: or short term) before issuing this request.
74:
75:
76: Once this call has been issued for a particular selector, that
77: addressability will remain valid until the device driver changes its
78: content via a subsequent PhysToGDTSelector request referencing the same GDT
79: selector. This call can be made in protect mode only.
80:
81: Calling Sequence:
82:
83:
84: MOV AX, AddressHigh ; 32-bit physical address
85: MOV BX, AddressLow ;
86: MOV CX, Size
87: MOV SI, Selector
88: MOV DL, DEVHLP_PHYSTOGDT
89: CALL [Device_Helper]
90:
91: where:
92:
93: AddressHigh and AddressLow are the high- and low-order words of the
94: current 32-bit physical address.
95:
96: Size is the 16-bit segment size, not the limit. It is converted to a limit
97: before editing descriptors. A value of zero indicates 65536 bytes.
98:
99:
100: Selector identifies the descriptor to be setup.
101:
102: Returns:
103:
104: C - set if error.
105:
106:
107: AX = Error codes:
108:
109: o Invalid address
110: o Invalid selector
111:
112:
113: C -cleared if successful.
114:
115: See Also:
116:
117:
118:
119:
120: RealToProt
121:
122: RealToProt - Switch from Real to Protect Mode
123:
124:
125: Purpose:
126:
127: The RealToProt routine changes the machine's execution mode from Real to
128: Protected. This call is used by a device driver which has received control
129: in Real mode but which has GDT selectors filled in by a PhysToGDTSelector
130: request it must access. Callable only at interrupt time.
131:
132:
133: This routine performs the necessary operations required to switch the
134: processor from Real to Protect mode. The ES register will contain zero
135: upon exit. The SS register will point to the interrupt stack.
136:
137: Calling Sequence:
138:
139:
140: MOV DS, HeaderHigh ; Device header
141: MOV SI, HeaderLow ;
142: MOV DH, DEVHLP_REALTOPROT
143: CALL [Device_Helper]
144:
145: where:
146:
147:
148: HeaderHigh and HeaderLow are the high- and low-order words of the address
149: of the device header of requesting device driver.
150:
151: Returns:
152:
153: C -set if processor is already in Protect Mode.
154:
155:
156: C -cleared if successful. ES set to 0 on success.
157:
158:
159: CS set to caller's protect mode CS on success.
160:
161:
162: DS set to caller's protect mode DS on success.
163:
164:
165: SS set to the interrupt stack on success.
166:
167: See Also:
168:
169: ProtToReal
170:
171:
172:
173: ProtToReal - Switch from Protect to Real Mode
174:
175:
176: Purpose:
177:
178: The ProtToReal routine changes the machine's execution mode from Protected
179: back to Real. This call is used following device driver processing which
180: was done in Protected mode as a result of an earlier RealToProt request.
181: Callable only at interrupt time.
182:
183:
184: This routine performs the necessary operations required to switch the
185: processor from Protect to Real mode. This routine should only be called
186: when the processor is in protect mode.
187:
188: Calling Sequence:
189:
190:
191: MOV DS, HeaderHigh ;Device header
192: MOV SI, HeaderLow ;
193: MOV DH, DEVHLP_PROTTOREAL
194: CALL [Device_Helper]
195:
196: where:
197:
198:
199: HeaderHigh and HeaderLow are the high- and low-order words of the address
200: of the device header of requesting device driver.
201:
202: Returns:
203:
204: C -set if processor is already in Real Mode.
205:
206:
207: C -cleared if successful. ES set to caller's real mode DS on success.
208:
209:
210: CS set to caller's real mode CS on success.
211:
212:
213: DS set to caller's real mode DS on success.
214:
215:
216: SS set to the interrupt stack on success.
217:
218: See Also:
219:
220: RealToProt
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.