~ubuntu-branches/ubuntu/dapper/fpc/dapper

« back to all changes in this revision

Viewing changes to docs/go32.xml

  • Committer: Bazaar Package Importer
  • Author(s): Carlos Laviola
  • Date: 2005-05-30 11:59:10 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20050530115910-x5pbzm4qqta4i94h
Tags: 2.0.0-2
debian/fp-compiler.postinst.in: forgot to reapply the patch that
correctly creates the slave link to pc(1).  (Closes: #310907)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="ISO8859-1"?>
 
2
<fpdoc-descriptions>
 
3
<!--  
 
4
 
 
5
   $Id: go32.xml,v 1.2 2005/04/30 22:08:57 michael Exp $ 
 
6
   This file is part of the FPC documentation. 
 
7
   Copyright (C) 1997, by Michael Van Canneyt 
 
8
 
 
9
   The FPC documentation is free text; you can redistribute it and/or 
 
10
   modify it under the terms of the GNU Library General Public License as 
 
11
   published by the Free Software Foundation; either version 2 of the 
 
12
   License, or (at your option) any later version. 
 
13
 
 
14
   The FPC Documentation is distributed in the hope that it will be useful, 
 
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of 
 
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
 
17
   Library General Public License for more details. 
 
18
 
 
19
   You should have received a copy of the GNU Library General Public 
 
20
   License along with the FPC documentation; see the file COPYING.LIB.  If not, 
 
21
   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 
 
22
   Boston, MA 02111-1307, USA. 
 
23
 -->
 
24
<package name="rtl">
 
25
<module name="go32">
 
26
<short>GO32 - acces to the 32-bit DOS extender</short>
 
27
<!-- \FPCexampledir{go32ex} -->
 
28
<descr>
 
29
<p>
 
30
This document describes the GO32 unit for the Free Pascal
 
31
compiler under dos. It was donated by Thomas Schatzl
 
32
(tom_at_work@geocities.com), for which my thanks.
 
33
This unit was first written for dos by Florian Klaempfl.
 
34
</p>
 
35
<p>
 
36
Only the GO32V2 DPMI
 
37
mode is discussed by me here due to the fact that new applications shouldn't
 
38
be created with the older GO32V1 model. The go32v2 version is much more advanced and
 
39
better. Additionally a lot of functions only work in DPMI mode anyway.
 
40
I hope the following explanations and introductions aren't too confusing at
 
41
all. If you notice an error or bug send it to the FPC mailing list or
 
42
directly to me.
 
43
So let's get started and happy and error free coding I wish you....
 
44
Thomas Schatzl, 25. August 1998
 
45
</p>
 
46
</descr>
 
47
 
 
48
<topic name="DPMI">
 
49
<short>What is DPMI</short>
 
50
<descr>
 
51
The dos Protected Mode Interface helps you with various aspects of protected
 
52
mode programming. These are roughly divided into descriptor handling, access
 
53
to dos memory, management of interrupts and exceptions, calls to real mode
 
54
functions and other stuff. Additionally it automatically provides swapping
 
55
to disk for memory intensive applications.
 
56
A DPMI host (either a Windows dos box or CWSDPMI.EXE) provides these
 
57
functions for your programs.
 
58
</descr>
 
59
</topic>
 
60
 
 
61
<topic name="SelectorsDescriptors">
 
62
<short>Selectors and descriptors</short>
 
63
<descr>
 
64
Descriptors are a bit like real mode segments; they describe (as the name
 
65
implies) a memory area in protected mode. A descriptor contains information
 
66
about segment length, its base address and the attributes of it (i.e. type,
 
67
access rights, ...).
 
68
These descriptors are stored internally in a so-called descriptor table,
 
69
which is basically an array of such descriptors.
 
70
Selectors are roughly an index into this table.
 
71
Because these 'segments' can be up to 4 GB in size, 32 bits aren't
 
72
sufficient anymore to describe a single memory location like in real mode.
 
73
48 bits are now needed to do this, a 32 bit address and a 16 bit sized
 
74
selector. The GO32 unit provides the tseginfo record to store such a
 
75
pointer.
 
76
But due to the fact that most of the time data is stored and accessed in the
 
77
%ds selector, FPC assumes that all pointers point to a memory location of
 
78
this selector. So a single pointer is still only 32 bits in size. This value
 
79
represents the offset from the data segment base address to this memory
 
80
location.
 
81
</descr>
 
82
</topic>
 
83
 
 
84
<topic name="FPCspecs">
 
85
<short>FPC specialities</short>
 
86
<descr>
 
87
<p>
 
88
The %ds and %es selector MUST always contain the same value or some system
 
89
routines may crash when called. The %fs selector is preloaded with the
 
90
DOSMEMSELECTOR variable at startup, and it MUST be restored after use,
 
91
because again FPC relys on this for some functions. Luckily we asm
 
92
programmers can still use the %gs selector for our own purposes, but for how
 
93
long ?
 
94
</p>
 
95
</descr>
 
96
<seealso>
 
97
 <link id="get_cs"/>
 
98
 <link id="get_ds"/>
 
99
 <link id="get_ss"/> 
 
100
 <link id="allocate_ldt_descriptors"/>
 
101
 <link id="free_ldt_descriptor"/>
 
102
 <link id="segment_to_descriptor"/>
 
103
 <link id="get_next_selector_increment_value"/>
 
104
 <link id="get_segment_base_address"/>
 
105
 <link id="set_segment_base_address"/>
 
106
 <link id="set_segment_limit"/>
 
107
 <link id="create_code_segment_alias_descriptor"/>
 
108
</seealso>
 
109
</topic>
 
110
 
 
111
<topic name="DosMemory">
 
112
<short>dos memory access</short>
 
113
<descr>
 
114
Dos memory is accessed by the predefined <var>dosmemselector</var> selector; 
 
115
the GO32 unit additionally provides some functions to help you with standard tasks,
 
116
like copying memory from heap to dos memory and the likes. Because of this
 
117
it is strongly recommened to use them, but you are still free to use the
 
118
provided standard memory accessing functions which use 48 bit pointers. The
 
119
third, but only thought for compatibility purposes, is using the
 
120
<var>mem[]</var>-arrays. These arrays map the whole 1 Mb dos space. They shouldn't be
 
121
used within new programs.
 
122
To convert a segment:offset real mode address to a protected mode linear
 
123
address you have to multiply the segment by 16 and add its offset. This
 
124
linear address can be used in combination with the DOSMEMSELECTOR variable.
 
125
</descr>
 
126
<seealso>
 
127
<link id="dosmemget"/>
 
128
<link id="dosmemput"/>
 
129
<link id="dosmemmove"/>
 
130
<link id="dosmemfillchar"/>
 
131
<link id="dosmemfillword"/>
 
132
<link id="seg_move"/>
 
133
<link id="seg_fillchar"/>
 
134
<link id="seg_fillword"/>
 
135
</seealso>
 
136
</topic>
 
137
 
 
138
<topic name="IOPorts">
 
139
<short>I/O port access</short>
 
140
<descr>
 
141
The I/O port access is done via the various <link id="inportb"/>,
 
142
<link id="outportb"/>
 
143
functions which are available. Additionally Free Pascal supports the Turbo Pascal
 
144
PORT[]-arrays but it is by no means recommened to use them, because they're
 
145
only for compatibility purposes.
 
146
</descr>
 
147
<seealso>
 
148
<link id="outportb"/>
 
149
<link id="inportb"/>
 
150
</seealso>
 
151
</topic>
 
152
 
 
153
<topic name="ProcessorAccess">
 
154
<short>Processor access</short>
 
155
<descr>
 
156
These are some functions to access various segment registers (%cs, %ds, %ss)
 
157
which makes your work a bit easier.
 
158
</descr>
 
159
<seealso>
 
160
<link id="get_cs"/>
 
161
<link id="get_ds"/>
 
162
<link id="get_ss"/> 
 
163
</seealso>
 
164
</topic>
 
165
 
 
166
<topic name="InterruptHandling">
 
167
<short>Interrupt redirection</short>
 
168
<descr>
 
169
Interrupts are program interruption requests, which in one or another way
 
170
get to the processor; there's a distinction between software and hardware
 
171
interrupts. The former are explicitely called by an 'int' instruction and
 
172
are a bit comparable to normal functions. Hardware interrupts come from
 
173
external devices like the keyboard or mouse. Functions that handle hardware
 
174
interrupts are called handlers.
 
175
</descr>
 
176
</topic>
 
177
 
 
178
<topic name="DPMIInterrupts">
 
179
<short>Handling interrupts with DPMI</short>
 
180
<descr>
 
181
The interrupt functions are real-mode procedures; they normally can't be
 
182
called in protected mode without the risk of an protection fault. So the
 
183
DPMI host creates an interrupt descriptor table for the application.
 
184
Initially all software interrupts (except for int 31h, 2Fh and 21h function
 
185
4Ch) or external hardware interrupts are simply directed to a handler that
 
186
reflects the interrupt in real-mode, i.e. the DPMI host's default handlers
 
187
switch the CPU to real-mode, issue the interrupt and switch back to
 
188
protected mode. The contents of general registers and flags are passed to
 
189
the real mode handler and the modified registers and flags are returned to
 
190
the protected mode handler. Segment registers and stack pointer are not
 
191
passed between modes.
 
192
</descr>
 
193
</topic>
 
194
 
 
195
<topic name="DPMIvsProtectedInterrupts">
 
196
<short>Protected mode interrupts vs. Real mode interrupts</short>
 
197
<descr>
 
198
As mentioned before, there's a distinction between real mode interrupts and
 
199
protected mode interrupts; the latter are protected mode programs, while the
 
200
former must be real mode programs. To call a protected mode interrupt
 
201
handler, an assembly 'int' call must be issued, while the other is called
 
202
via the realintr() or intr() function. Consequently, a real mode interrupt
 
203
then must either reside in dos memory (&lt;1MB) or the application must
 
204
allocate a real mode callback address via the get_rm_callback() function.
 
205
</descr>
 
206
</topic>
 
207
 
 
208
<topic name="CreatingInterruptHandlers">
 
209
<short>Creating your own interrupt handlers</short>
 
210
<descr>
 
211
Interrupt redirection with FPC pascal is done via the set_pm_interrupt() for
 
212
protected mode interrupts or via the set_rm_interrupt() for real mode
 
213
interrupts.
 
214
</descr>
 
215
</topic>
 
216
 
 
217
<topic name="DisablingInterrupts">
 
218
<short>Disabling interrupts</short>
 
219
<descr>
 
220
The GO32 unit provides the two procedures disable() and enable() to disable
 
221
and enable all interrupts.
 
222
</descr>
 
223
</topic>
 
224
 
 
225
<topic name="HardwareInterrupts">
 
226
<short>Hardware interrupts</short>
 
227
<descr>
 
228
Hardware interrupts are generated by hardware devices when something unusual
 
229
happens; this could be a keypress or a mouse move or any other action. This
 
230
is done to minimize CPU time, else the CPU would have to check all installed
 
231
hardware for data in a big loop (this method is called 'polling') and this
 
232
would take much time.
 
233
A standard IBM-PC has two interrupt controllers, that are responsible for
 
234
these hardware interrupts: both allow up to 8 different interrupt sources
 
235
(IRQs, interrupt requests). The second controller is connected to the first
 
236
through IRQ 2 for compatibility reasons, e.g. if controller 1 gets an IRQ 2,
 
237
he hands the IRQ over to controller 2. Because of this up to 15 different
 
238
hardware interrupt sources can be handled.
 
239
IRQ 0 through IRQ 7 are mapped to interrupts 8h to Fh and the second
 
240
controller (IRQ 8 to 15) is mapped to interrupt 70h to 77h.
 
241
All of the code and data touched by these handlers MUST be locked (via the
 
242
various locking functions) to avoid page faults at interrupt time. Because
 
243
hardware interrupts are called (as in real mode) with interrupts disabled,
 
244
the handler has to enable them before it returns to normal program
 
245
execution. Additionally a hardware interrupt must send an EOI (end of
 
246
interrupt) command to the responsible controller; this is acomplished by
 
247
sending the value 20h to port 20h (for the first controller) or A0h (for the
 
248
second controller).
 
249
The following example shows how to redirect the keyboard interrupt.
 
250
</descr>
 
251
<example file="go32ex/keyclick"/>
 
252
</topic>
 
253
 
 
254
<topic name="SoftwareInterrupts">
 
255
<short>Software interrupts</short>
 
256
<descr>
 
257
<p>
 
258
Ordinarily, a handler installed with
 
259
<link id="set_pm_interrupt"/> only services software
 
260
interrupts that are executed in protected mode; real mode software
 
261
interrupts can be redirected by <link id="set_rm_interrupt"/>.
 
262
</p>
 
263
</descr>
 
264
<seealso>
 
265
<link id="set_rm_interrupt"/>
 
266
<link id="get_rm_interrupt"/>
 
267
<link id="set_pm_interrupt"/>
 
268
<link id="get_pm_interrupt"/> 
 
269
<link id="lock_data"/> 
 
270
<link id="lock_code"/> 
 
271
<link id="enable"/>
 
272
<link id="disable"/>
 
273
<link id="outportb"/> 
 
274
</seealso>
 
275
</topic>
 
276
 
 
277
<topic name="ExecutingInterrupts">
 
278
<short>Executing software interrupts</short>
 
279
<descr>
 
280
Simply execute a realintr() call with the desired interrupt number and the
 
281
supplied register data structure.
 
282
But some of these interrupts require you to supply them a pointer to a
 
283
buffer where they can store data to or obtain data from in memory. These
 
284
interrupts are real mode functions and so they only can access the first Mb
 
285
of linear address space, not FPC's data segment.
 
286
For this reason FPC supplies a pre-initialized dos memory location within
 
287
the GO32 unit. This buffer is internally used for dos functions too and so
 
288
it's contents may change when calling other procedures. It's size can be
 
289
obtained with <link id="tb_size"/> and it's linear address via 
 
290
<link id="transfer_buffer"/>.
 
291
Another way is to allocate a completely new dos memory area via the
 
292
<link id="global_dos_alloc"/> function for your use and 
 
293
supply its real mode address.
 
294
</descr>
 
295
<seealso>
 
296
<link id="tb_size"/>
 
297
<link id="transfer_buffer"/>
 
298
<link id="global_dos_alloc"/>
 
299
<link id="global_dos_free"/>
 
300
<link id="realintr"/>
 
301
</seealso>
 
302
<example file="go32ex/softint"/>
 
303
<example file="go32ex/rmpmint"/>
 
304
</topic>
 
305
 
 
306
<topic name="RealModeCallBacks">
 
307
<short>Real mode callbacks</short>
 
308
<descr>
 
309
<p>
 
310
The callback mechanism can be thought of as the converse of calling a real
 
311
mode procedure (i.e. interrupt), which allows your program to pass
 
312
information to a real mode program, or obtain services from it in a manner
 
313
that's transparent to the real mode program.
 
314
In order to make a real mode callback available, you must first get the real
 
315
mode callback address of your procedure and the selector and offset of a
 
316
register data structure. This real mode callback address (this is a
 
317
segment:offset address) can be passed to a real mode program via a software
 
318
interrupt, a dos memory block or any other convenient mechanism.
 
319
When the real mode program calls the callback (via a far call), the DPMI
 
320
host saves the registers contents in the supplied register data structure,
 
321
switches into protected mode, and enters the callback routine with the
 
322
following settings:
 
323
</p>
 
324
<ul>
 
325
<li> interrupts disabled</li>
 
326
<li> <var>%CS:%EIP</var> = 48 bit pointer specified in the original call to 
 
327
<link id="get_rm_callback"/></li>
 
328
<li> <var>%DS:%ESI</var> = 48 bit pointer to to real mode <var>SS:SP</var></li>
 
329
<li> <var>%ES:%EDI</var> = 48 bit pointer of real mode register data
 
330
structure. </li>
 
331
<li> <var>%SS:%ESP</var> = locked protected mode stack</li>
 
332
<li>  All other registers undefined</li>
 
333
</ul>
 
334
<p>
 
335
The callback procedure can then extract its parameters from the real mode
 
336
register data structure and/or copy parameters from the real mode stack to
 
337
the protected mode stack. Recall that the segment register fields of the
 
338
real mode register data structure contain segment or paragraph addresses
 
339
that are not valid in protected mode. Far pointers passed in the real mode
 
340
register data structure must be translated to virtual addresses before they
 
341
can be used with a protected mode program.
 
342
The callback procedure exits by executing an IRET with the address of the
 
343
real mode register data structure in <var>%ES:%EDI</var>, passing information back to
 
344
the real mode caller by modifying the contents of the real mode register
 
345
data structure and/or manipulating the contents of the real mode stack. The
 
346
callback procedure is responsible for setting the proper address for
 
347
resumption of real mode execution into the real mode register data
 
348
structure; typically, this is accomplished by extracting the return address
 
349
from the real mode stack and placing it into the <var>%CS:%EIP</var> fields of the real
 
350
mode register data structure. After the IRET, the DPMI host switches the CPU
 
351
back into real mode, loads ALL registers with the contents of the real mode
 
352
register data structure, and finally returns control to the real mode
 
353
program.
 
354
All variables and code touched by the callback procedure MUST be locked to
 
355
prevent page faults.
 
356
</p>
 
357
</descr>
 
358
<seealso>
 
359
<link id="get_rm_callback"/>
 
360
<link id="free_rm_callback"/>
 
361
<link id="lock_code"/>
 
362
<link id="lock_data"/>
 
363
</seealso>
 
364
</topic>
 
365
 
 
366
<element name="rm_unknown">
 
367
<short><link id="get_run_mode"/> return value: Unknown runmode</short>
 
368
</element>
 
369
<element name="rm_raw">
 
370
<short><link id="get_run_mode"/> return value: raw (without HIMEM)</short>
 
371
</element>
 
372
<element name="rm_xms">
 
373
<short><link id="get_run_mode"/> return value: XMS (with HIMEM, without EMM386)</short>
 
374
</element>
 
375
<element name="rm_vcpi">
 
376
<short><link id="get_run_mode"/> return value: VCPI (with HIMEM and EMM386)</short>
 
377
</element>
 
378
<element name="rm_dpmi">
 
379
<short><link id="get_run_mode"/> return value: DPMI (e.g. dos box or 386Max)</short>
 
380
</element>
 
381
 
 
382
<element name="carryflag">
 
383
<short>Check for carry flag in <link id="trealregs"/></short>
 
384
</element>
 
385
<element name="parityflag">
 
386
<short>Check for parity flag in <link id="trealregs"/></short>
 
387
</element>
 
388
<element name="auxcarryflag">
 
389
<short>Check for auxiliary carry flag in <link id="trealregs"/></short>
 
390
</element>
 
391
<element name="zeroflag">
 
392
<short>Check for zero flag in <link id="trealregs"/></short>
 
393
</element>
 
394
<element name="signflag">
 
395
<short>Check for sign flag in <link id="trealregs"/></short>
 
396
</element>
 
397
<element name="trapflag">
 
398
<short>Check for trap flag in <link id="trealregs"/></short>
 
399
</element>
 
400
<element name="interruptflag">
 
401
<short>Check for interrupt flag in <link id="trealregs"/></short>
 
402
</element>
 
403
<element name="directionflag">
 
404
<short>Check for direction flag in <link id="trealregs"/></short>
 
405
</element>
 
406
<element name="overflowflag">
 
407
<short>Check for overflow flag in <link id="trealregs"/></short>
 
408
</element>
 
409
 
 
410
<element name="tmeminfo">
 
411
<short>Memory information record</short>
 
412
<descr>
 
413
<p>
 
414
<var>tmeminfo</var> Holds information about the memory allocation, etc.
 
415
</p>
 
416
<p>
 
417
<em>NOTE:</em> The value of a field is -1 (0ffffffffh) if the value is unknown, it's
 
418
only guaranteed, that <var>available_memory</var> contains a valid value.
 
419
The size of the pages can be determined by the get_page_size() function.
 
420
</p>
 
421
</descr>
 
422
</element>
 
423
<element name="TMemInfo.available_memory">
 
424
<short>Largest available free block in bytes. </short>
 
425
</element>
 
426
<element name="TMemInfo.available_pages">
 
427
<short>Maximum unlocked page allocation in pages </short>
 
428
</element>
 
429
<element name="TMemInfo.available_lockable_pages">
 
430
<short>Maximum locked page allocation in pages. </short>
 
431
</element>
 
432
<element name="TMemInfo.linear_space">
 
433
<short>Linear address space size in pages. </short>
 
434
</element>
 
435
<element name="TMemInfo.unlocked_pages">
 
436
<short>Total number of unlocked pages. </short>
 
437
</element>
 
438
<element name="TMemInfo.available_physical_pages">
 
439
<short>Total number of free pages.</short>
 
440
</element>
 
441
<element name="TMemInfo.total_physical_pages">
 
442
<short>Total number of physical pages. </short>
 
443
</element>
 
444
<element name="TMemInfo.free_linear_space">
 
445
<short>Free linear address space in pages.</short>
 
446
</element>
 
447
<element name="TMemInfo.max_pages_in_paging_file">
 
448
<short> Size of paging file/partition in pages</short>
 
449
</element>
 
450
 
 
451
<element name="trealregs">
 
452
<short>Record describing all processor registers</short>
 
453
<descr>
 
454
The <var>trealregs</var> type contains the data structure to pass register values to a
 
455
interrupt handler or real mode callback.
 
456
</descr>
 
457
</element>
 
458
 
 
459
<element name="registers">
 
460
<short>Alias for <link id="trealregs"/></short>
 
461
</element>
 
462
 
 
463
<element name="tseginfo">
 
464
<short>Record to store 48-bits pointer</short>
 
465
<descr>
 
466
<p>
 
467
This record is used to store a full 48-bit pointer. This may be either a
 
468
protected mode selector:offset address or in real mode a segment:offset
 
469
address, depending on application.
 
470
</p>
 
471
<p>
 
472
See also: Selectors and descriptors, dos memory access, Interrupt
 
473
redirection
 
474
</p>
 
475
</descr>
 
476
</element>
 
477
 
 
478
<element name="tseginfo.offset">
 
479
<short>Offset in segment</short>
 
480
</element>
 
481
<element name="tseginfo.Segment">
 
482
<short>Segment</short>
 
483
</element>
 
484
 
 
485
<element name="dosmemselector">
 
486
<short>Selector to DOS memory</short>
 
487
<descr>
 
488
Selector to the dos memory. The whole dos memory is automatically mapped to
 
489
this single descriptor at startup. This selector is the recommened way to
 
490
access dos memory.
 
491
</descr>
 
492
</element>
 
493
 
 
494
<element name="int31error">
 
495
<short>DPMI interrupt call result</short>
 
496
<descr>
 
497
This variable holds the result of a DPMI interrupt call. Any nonzero value
 
498
must be treated as a critical failure.
 
499
</descr>
 
500
</element>
 
501
 
 
502
<element name="allocate_ldt_descriptors">
 
503
<short>Allocate a number of descriptors</short>
 
504
<descr>
 
505
<p>
 
506
Allocates a number of new descriptors.
 
507
</p>
 
508
<p>
 
509
Parameters: 
 
510
</p>
 
511
<dl>
 
512
<dt>count:\ </dt><dd> specifies the number of requested unique descriptors.</dd>
 
513
</dl>
 
514
<p>
 
515
Return value: The base selector.
 
516
</p>
 
517
<remark>
 
518
Notes: The descriptors allocated must be initialized by the application with
 
519
other function calls. This function returns descriptors with a limit and
 
520
size value set to zero. If more than one descriptor was requested, the
 
521
function returns a base selector referencing the first of a contiguous array
 
522
of descriptors. The selector values for subsequent descriptors in the array
 
523
can be calculated by adding the value returned by the
 
524
<link id="get_next_selector_increment_value"/> 
 
525
function.
 
526
</remark>
 
527
</descr>
 
528
<errors>
 
529
Check the <link id="int31error"/> variable. 
 
530
</errors>
 
531
<seealso>
 
532
<link id="free_ldt_descriptor"/>
 
533
<link id="get_next_selector_increment_value"/>
 
534
<link id="segment_to_descriptor"/>
 
535
<link id="create_code_segment_alias_descriptor"/>
 
536
<link id="set_segment_limit"/>
 
537
<link id="set_segment_base_address"/> 
 
538
</seealso>
 
539
<example file="go32ex/seldes"/>
 
540
</element>
 
541
 
 
542
<element name="allocate_memory_block">
 
543
<short>Allocate a block of linear memory</short>
 
544
<descr>
 
545
<p>
 
546
Allocates a block of linear memory.
 
547
</p>
 
548
<p>
 
549
Parameters: 
 
550
</p>
 
551
<dl>
 
552
<dt>size:</dt><dd> Size of requested linear memory block in bytes.</dd>
 
553
</dl>
 
554
<p>
 
555
Returned values: blockhandle - the memory handle to this memory block. Linear
 
556
address of the requested memory.
 
557
</p>
 
558
<remark>
 
559
<em>warning</em> According to my DPMI docs this function is not implemented
 
560
correctly. Normally you should also get a blockhandle to this block after
 
561
successful operation. This handle can then be used to free the memory block
 
562
afterwards or use this handle for other purposes. Since the function isn't
 
563
implemented correctly, and doesn't return a blockhandle, the block can't be
 
564
deallocated and is hence unusuable !
 
565
This function doesn't allocate any descriptors for this block, it's the
 
566
applications resposibility to allocate and initialize for accessing this
 
567
memory.
 
568
</remark>
 
569
</descr>
 
570
<errors>
 
571
Check the <link id="int31error"/> variable.
 
572
</errors>
 
573
<seealso>
 
574
<link id="free_memory_block"/> 
 
575
</seealso>
 
576
</element>
 
577
 
 
578
<element name="copyfromdos">
 
579
<short>Copy data from DOS to to heap</short>
 
580
<descr>
 
581
<p>
 
582
Copies data from the pre-allocated dos memory transfer buffer to the heap.
 
583
</p>
 
584
<p>
 
585
Parameters:
 
586
</p>
 
587
<dl>
 
588
<dt>addr</dt><dd>data to copy to.</dd>
 
589
<dt>len</dt><dd>number of bytes to copy to heap.</dd>
 
590
</dl>
 
591
<p>
 
592
Notes:
 
593
Can only be used in conjunction with the dos memory transfer buffer.
 
594
</p>
 
595
</descr>
 
596
<errors>
 
597
Check the <link id="int31error"/> variable.
 
598
</errors>
 
599
<seealso>
 
600
<link id="tb_size"/>
 
601
<link id="transfer_buffer"/> 
 
602
<link id="copytodos"/>
 
603
</seealso>
 
604
</element>
 
605
 
 
606
 
 
607
<element name="copytodos">
 
608
<short>Copy data from heap to DOS memory</short>
 
609
<descr>
 
610
<p>
 
611
Copies data from heap to the pre-allocated dos memory buffer.
 
612
</p>
 
613
<p>
 
614
Parameters:
 
615
</p>
 
616
<dl>
 
617
<dt>addr</dt><dd> data to copy from.</dd>
 
618
<dt>len</dt><dd> number of bytes to copy to dos memory buffer.</dd>
 
619
</dl>
 
620
<p>
 
621
Notes: This function fails if you try to copy more bytes than the transfer
 
622
buffer is in size. It can only be used in conjunction with the transfer
 
623
buffer.
 
624
</p>
 
625
</descr>
 
626
<errors>
 
627
Check the <link id="int31error"/> variable.
 
628
</errors>
 
629
<seealso>
 
630
<link id="tb_size"/>
 
631
<link id="transfer_buffer"/> 
 
632
<link id="copyfromdos"/>
 
633
</seealso>
 
634
</element>
 
635
 
 
636
<element name="create_code_segment_alias_descriptor">
 
637
<short>Create new descriptor from existing descriptor</short>
 
638
<descr>
 
639
<p>
 
640
Creates a new descriptor that has the same base and limit as the specified
 
641
descriptor.
 
642
</p>
 
643
<p>
 
644
Parameters: 
 
645
</p>
 
646
<dl>
 
647
<dt>seg</dt><dd> Descriptor.</dd>
 
648
</dl>
 
649
<p>
 
650
Return values: The data selector (alias).
 
651
</p>
 
652
<p>
 
653
Notes: In effect, the function returns a copy of the descriptor. The
 
654
descriptor alias returned by this function will not track changes to the
 
655
original descriptor. In other words, if an alias is created with this
 
656
function, and the base or limit of the original segment is then changed, the
 
657
two descriptors will no longer map the same memory.
 
658
</p>
 
659
</descr>
 
660
<errors>
 
661
Check the <link id="int31error"/> variable.
 
662
</errors>
 
663
<seealso>
 
664
<link id="allocate_ldt_descriptors"/>
 
665
<link id="set_segment_limit"/> 
 
666
<link id="set_segment_base_address"/> 
 
667
</seealso>
 
668
</element>
 
669
 
 
670
<element name="disable">
 
671
<short>Disable hardware interrupts</short>
 
672
<descr>
 
673
<p>
 
674
Disables all hardware interrupts by execution a CLI instruction.
 
675
</p>
 
676
</descr>
 
677
<errors>
 
678
None.
 
679
</errors>
 
680
<seealso>
 
681
<link id="enable"/>
 
682
</seealso>
 
683
</element>
 
684
 
 
685
<element name="dosmemfillchar">
 
686
<short>Fill a region of DOS memory with a specific byte-sized value</short>
 
687
<descr>
 
688
<p>
 
689
Sets a region of dos memory to a specific byte value.
 
690
</p>
 
691
<p>
 
692
Parameters:
 
693
</p>
 
694
<dl>
 
695
<dt>seg</dt><dd> real mode segment.</dd>
 
696
<dt>ofs</dt><dd> real mode offset.</dd>
 
697
<dt>count</dt><dd> number of bytes to set.</dd>
 
698
<dt>c</dt><dd> value to set memory to.</dd>
 
699
</dl>
 
700
<p>
 
701
Notes: No range check is performed.
 
702
</p>
 
703
</descr>
 
704
<errors>
 
705
None.
 
706
</errors>
 
707
<seealso>
 
708
<link id="dosmemput"/>
 
709
<link id="dosmemget"/>
 
710
<link id="dosmemmove"/>
 
711
<link id="dosmemfillword"/> 
 
712
<link id="seg_move"/>
 
713
<link id="seg_fillchar"/>
 
714
<link id="seg_fillword"/> 
 
715
</seealso>
 
716
<example file="go32ex/textmess"/>
 
717
</element>
 
718
 
 
719
<element name="dosmemfillword">
 
720
<short>Fill a region of DOS memory with a specific word-sized value</short>
 
721
<descr>
 
722
<p>
 
723
Sets a region of dos memory to a specific word value.
 
724
</p>
 
725
<p>
 
726
Parameters: 
 
727
</p>
 
728
<dl>
 
729
<dt>seg</dt><dd> real mode segment.</dd>
 
730
<dt>ofs</dt><dd> real mode offset. </dd>
 
731
<dt>count</dt><dd> number of words to set.</dd>
 
732
<dt>w</dt><dd> value to set memory to.</dd>
 
733
</dl>
 
734
<p>
 
735
Notes: No range check is performed.
 
736
</p>
 
737
</descr>
 
738
<errors>
 
739
None.
 
740
</errors>
 
741
<seealso>
 
742
<link id="dosmemput"/>
 
743
<link id="dosmemget"/>
 
744
<link id="dosmemmove"/>
 
745
<link id="dosmemfillchar"/>
 
746
<link id="seg_move"/> 
 
747
<link id="seg_fillchar"/>
 
748
<link id="seg_fillword"/> 
 
749
</seealso>
 
750
</element>
 
751
 
 
752
<element name="dosmemget">
 
753
<short>Copy data from DOS memory to the heap.</short>
 
754
<descr>
 
755
<p>
 
756
Copies data from the dos memory onto the heap.
 
757
</p>
 
758
<p>
 
759
Parameters:
 
760
</p>
 
761
<dl>
 
762
<dt>seg</dt><dd> source real mode segment.</dd>
 
763
<dt>ofs</dt><dd> source real mode offset.</dd>
 
764
<dt>data</dt><dd> destination. </dd>
 
765
<dt>count</dt><dd> number of bytes to copy.</dd>
 
766
</dl>
 
767
<p>
 
768
Notes: No range checking is performed.
 
769
</p>
 
770
<p>
 
771
For an example, see <link id="global_dos_alloc"/>.
 
772
</p>
 
773
</descr>
 
774
<errors>
 
775
 None. 
 
776
</errors>
 
777
<seealso>
 
778
<link id="dosmemput"/>
 
779
<link id="dosmemmove"/>
 
780
<link id="dosmemfillchar"/>
 
781
<link id="dosmemfillword"/>
 
782
<link id="seg_move"/>
 
783
<link id="seg_fillchar"/> 
 
784
<link id="seg_fillword"/>  
 
785
</seealso>
 
786
</element>
 
787
 
 
788
<element name="dosmemmove">
 
789
<short>Move data between 2 DOS real mode memory locations</short>
 
790
<descr>
 
791
<p>
 
792
Copies count bytes of data between two dos real mode memory locations.
 
793
</p>
 
794
<p>
 
795
Parameters:
 
796
</p>
 
797
<dl>
 
798
<dt>sseg</dt><dd> source real mode segment.</dd>
 
799
<dt>sofs</dt><dd> source real mode offset.</dd>
 
800
<dt>dseg</dt><dd> destination real mode segment. </dd>
 
801
<dt>dofs</dt><dd> destination real mode offset.</dd>
 
802
<dt>count</dt><dd> number of bytes to copy.</dd>
 
803
</dl>
 
804
<p>
 
805
Notes: No range check is performed in any way.
 
806
</p>
 
807
</descr>
 
808
<errors>
 
809
 None.
 
810
</errors>
 
811
<seealso>
 
812
<link id="dosmemput"/>, 
 
813
<link id="dosmemget"/>
 
814
<link id="dosmemfillchar"/>, 
 
815
<link id="dosmemfillword"/>
 
816
<link id="seg_move"/> 
 
817
<link id="seg_fillchar"/>
 
818
<link id="seg_fillword"/> 
 
819
</seealso>
 
820
</element>
 
821
For an example, see <link id="seg_fillchar"/>.
 
822
 
 
823
<element name="dosmemput">
 
824
<short>Copy data from the heap to DOS real mode memory</short>
 
825
<descr>
 
826
<p>
 
827
Copies heap data to dos real mode memory.
 
828
</p>
 
829
<p>
 
830
Parameters:
 
831
</p>
 
832
<dl>
 
833
<dt>seg</dt><dd>destination real mode segment.</dd>
 
834
<dt>ofs</dt><dd>destination real mode offset. </dd>
 
835
<dt>data</dt><dd>source.</dd>
 
836
<dt>count</dt><dd> number of bytes to copy.</dd>
 
837
</dl>
 
838
<p>
 
839
Notes: No range checking is performed.
 
840
</p>
 
841
<p>
 
842
For an example, see <link id="global_dos_alloc"/>.
 
843
</p>
 
844
</descr>
 
845
<errors>
 
846
None. 
 
847
</errors>
 
848
<seealso>
 
849
<link id="dosmemget"/>, 
 
850
<link id="dosmemmove"/>
 
851
<link id="dosmemfillchar"/>
 
852
<link id="dosmemfillword"/>
 
853
<link id="seg_move"/>
 
854
<link id="seg_fillchar"/>
 
855
<link id="seg_fillword"/> 
 
856
</seealso>
 
857
</element>
 
858
 
 
859
<element name="enable">
 
860
<short>Enable hardware interrupts</short>
 
861
<descr>
 
862
Enables all hardware interrupts by executing a STI instruction.
 
863
</descr>
 
864
<errors>
 
865
None.
 
866
</errors>
 
867
<seealso>
 
868
<link id="disable"/> 
 
869
</seealso>
 
870
</element>
 
871
 
 
872
<element name="free_ldt_descriptor">
 
873
<short>Free a descriptor</short>
 
874
<descr>
 
875
<p>
 
876
Frees a previously allocated descriptor.
 
877
</p>
 
878
<p>
 
879
Parameters:
 
880
</p>
 
881
<dl>
 
882
<dt>des</dt><dd> The descriptor to be freed.</dd>
 
883
</dl>
 
884
<p>
 
885
Return value: <var>True</var> if successful, <var>False</var> otherwise.
 
886
Notes: After this call this selector is invalid and must not be used for any
 
887
memory operations anymore. Each descriptor allocated with
 
888
<link id="allocate_ldt_descriptors"/> must be freed 
 
889
individually with this function,
 
890
even if it was previously allocated as a part of a contiguous array of
 
891
descriptors.
 
892
</p>
 
893
<p>
 
894
For an example, see <link id="allocate_ldt_descriptors"/>.
 
895
</p>
 
896
</descr>
 
897
<errors>
 
898
Check the <link id="int31error"/> variable.
 
899
</errors>
 
900
<seealso>
 
901
<link id="allocate_ldt_descriptors"/>
 
902
<link id="get_next_selector_increment_value"/> 
 
903
</seealso>
 
904
</element>
 
905
 
 
906
<element name="free_memory_block">
 
907
<short>Free allocated memory block</short>
 
908
<descr>
 
909
<p>
 
910
Frees a previously allocated memory block.
 
911
</p>
 
912
<p>
 
913
Parameters: 
 
914
</p>
 
915
<dl>
 
916
<dt>blockhandle</dt><dd> the handle to the memory area to free.</dd>
 
917
</dl>
 
918
<p>
 
919
Return value: <var>True</var> if successful, <var>false</var> otherwise.
 
920
Notes: Frees memory that was previously allocated with
 
921
<link id="allocate_memory_block"/> . 
 
922
This function doesn't free any descriptors mapped to this block, 
 
923
it's the application's responsibility.
 
924
</p>
 
925
</descr>
 
926
<errors>
 
927
Check <link id="int31error"/> variable.
 
928
</errors>
 
929
<seealso>
 
930
<link id="allocate_memory_block"/> 
 
931
</seealso>
 
932
</element>
 
933
 
 
934
<element name="free_rm_callback">
 
935
<short>Release real mode callback.</short>
 
936
<descr>
 
937
<p>
 
938
Releases a real mode callback address that was previously allocated with the
 
939
<link id="get_rm_callback"/>  function.
 
940
</p>
 
941
<p>
 
942
Parameters: 
 
943
</p>
 
944
<dl>
 
945
<dt>intaddr</dt><dd> real mode address buffer returned by <link id="get_rm_callback"/> .
 
946
</dd>
 
947
</dl>
 
948
<p>
 
949
Return values: <var>True</var> if successful, <var>False</var> if not
 
950
</p>
 
951
<p>
 
952
For an example, see <link id="get_rm_callback"/>.
 
953
</p>
 
954
</descr>
 
955
<errors>
 
956
Check the <link id="int31error"/> variable.
 
957
</errors>
 
958
<seealso>
 
959
<link id="set_rm_interrupt"/>
 
960
<link id="get_rm_callback"/>
 
961
</seealso>
 
962
</element>
 
963
 
 
964
<element name="get_cs">
 
965
<short>Get CS selector</short>
 
966
<descr>
 
967
<p>
 
968
Returns the cs selector.
 
969
</p>
 
970
<p>
 
971
Return value: The content of the cs segment register.
 
972
</p>
 
973
<p>
 
974
For an example, see <link id="set_pm_interrupt"/>.
 
975
</p>
 
976
</descr>
 
977
<errors>
 
978
None.
 
979
</errors>
 
980
<seealso>
 
981
<link id="get_ds"/>
 
982
<link id="get_ss"/>
 
983
</seealso>
 
984
</element>
 
985
 
 
986
<element name="get_descriptor_access_right">
 
987
<short>Get descriptor's access rights</short>
 
988
<descr>
 
989
<p>
 
990
Gets the access rights of a descriptor.
 
991
</p>
 
992
<p>
 
993
Parameters: 
 
994
</p>
 
995
<dl>
 
996
<dt>d</dt><dd> selector to descriptor.</dd>
 
997
</dl>
 
998
<p>
 
999
Return value: Access rights bit field.
 
1000
</p>
 
1001
</descr>
 
1002
<errors>
 
1003
Check the <link id="int31error"/> variable.
 
1004
</errors>
 
1005
<seealso>
 
1006
<link id="set_descriptor_access_right"/>
 
1007
</seealso>
 
1008
</element>
 
1009
 
 
1010
<element name="get_ds">
 
1011
<short>Get DS Selector</short>
 
1012
<descr>
 
1013
<p>
 
1014
Returns the ds selector.
 
1015
</p>
 
1016
<p>
 
1017
Return values: The content of the ds segment register.
 
1018
</p>
 
1019
</descr>
 
1020
<errors>
 
1021
 None.
 
1022
</errors>
 
1023
<seealso>
 
1024
<link id="get_cs"/>
 
1025
<link id="get_ss"/>
 
1026
</seealso>
 
1027
</element>
 
1028
 
 
1029
<element name="get_linear_addr">
 
1030
<short>Convert physical to linear address</short>
 
1031
<descr>
 
1032
<p>
 
1033
Converts a physical address into a linear address.
 
1034
</p>
 
1035
<p>
 
1036
Parameters: 
 
1037
</p>
 
1038
<dl>
 
1039
<dt>phys_addr</dt><dd>physical address of device.</dd>
 
1040
<dt>size</dt><dd>Size of region to map in bytes.</dd>
 
1041
</dl>
 
1042
<p>
 
1043
Return value: Linear address that can be used to access the physical memory.
 
1044
Notes: It's the applications resposibility to allocate and set up a
 
1045
descriptor for access to the memory. This function shouldn't be used to map
 
1046
real mode addresses.
 
1047
</p>
 
1048
</descr>
 
1049
<errors>
 
1050
Check the <link id="int31error"/> variable.
 
1051
</errors>
 
1052
<seealso>
 
1053
<link id="allocate_ldt_descriptors"/>
 
1054
<link id="set_segment_limit"/>
 
1055
<link id="set_segment_base_address"/> 
 
1056
</seealso>
 
1057
</element>
 
1058
 
 
1059
<element name="get_meminfo">
 
1060
<short>Return information on the available memory</short>
 
1061
<descr>
 
1062
<p>
 
1063
Returns information about the amount of available physical memory, linear
 
1064
address space, and disk space for page swapping.
 
1065
</p>
 
1066
<p>
 
1067
Parameters:
 
1068
</p>
 
1069
<dl>
 
1070
<dt>meminfo</dt><dd> buffer to fill memory information into.</dd>
 
1071
</dl>
 
1072
<p>
 
1073
Return values: Due to an implementation bug this function always returns
 
1074
<var>False</var>, but it always succeeds.
 
1075
</p>
 
1076
<remark>
 
1077
Notes: Only the first field of the returned structure is guaranteed to
 
1078
contain a valid value. Any fields that are not supported by the DPMI host
 
1079
will be set by the host to <var>-1 (0FFFFFFFFH)</var> to indicate that the information
 
1080
is not available. The size of the pages used by the DPMI host can be
 
1081
obtained with the <link id="get_page_size"/>  function.
 
1082
</remark>
 
1083
</descr>
 
1084
<errors>
 
1085
Check the <link id="int31error"/> variable.
 
1086
</errors>
 
1087
<seealso>
 
1088
<link id="get_page_size"/> 
 
1089
</seealso>
 
1090
<example file="go32ex/meminfo"/>
 
1091
</element>
 
1092
 
 
1093
<element name="get_next_selector_increment_value">
 
1094
<short>Return selector increment value</short>
 
1095
<descr>
 
1096
<p>
 
1097
Returns the selector increment value when allocating multiple subsequent
 
1098
descriptors via <link id="allocate_ldt_descriptors"/>.
 
1099
</p>
 
1100
<p>
 
1101
Return value: Selector increment value.
 
1102
</p>
 
1103
<remark>
 
1104
Notes: Because <link id="allocate_ldt_descriptors"/> only returns the selector for the
 
1105
first descriptor and so the value returned by this function can be used to
 
1106
calculate the selectors for subsequent descriptors in the array.
 
1107
</remark>
 
1108
</descr>
 
1109
<errors>
 
1110
Check the <link id="int31error"/> variable.
 
1111
</errors>
 
1112
<seealso>
 
1113
<link id="allocate_ldt_descriptors"/> 
 
1114
<link id="free_ldt_descriptor"/> 
 
1115
</seealso>
 
1116
</element>
 
1117
 
 
1118
<element name="get_page_size">
 
1119
<short>Return the page size</short>
 
1120
<descr>
 
1121
<p>
 
1122
Returns the size of a single memory page.
 
1123
</p>
 
1124
<p>
 
1125
Return value: Size of a single page in bytes.
 
1126
</p>
 
1127
<remark>
 
1128
The returned size is typically 4096 bytes.
 
1129
</remark>
 
1130
<p>
 
1131
For an example, see <link id="get_meminfo"/>.
 
1132
</p>
 
1133
</descr>
 
1134
<errors>
 
1135
Check the <link id="int31error"/> variable.
 
1136
</errors>
 
1137
<seealso>
 
1138
<link id="get_meminfo"/> 
 
1139
</seealso>
 
1140
</element>
 
1141
 
 
1142
<element name="get_pm_interrupt">
 
1143
<short>Return protected mode interrupt handler</short>
 
1144
<descr>
 
1145
<p>
 
1146
Returns the address of a current protected mode interrupt handler.
 
1147
</p>
 
1148
<p>
 
1149
Parameters:
 
1150
</p>
 
1151
<dl>
 
1152
<dt>vector</dt><dd> interrupt handler number you want the address to.</dd>
 
1153
<dt>intaddr</dt><dd> buffer to store address.</dd>
 
1154
</dl>
 
1155
<p>
 
1156
Return values: <var>True</var> if successful, <var>False</var> if not.
 
1157
</p>
 
1158
<remark>
 
1159
The returned address is a protected mode selector:offset address.
 
1160
</remark>
 
1161
<p>
 
1162
For an example, see <link id="set_pm_interrupt"/>.
 
1163
</p>
 
1164
</descr>
 
1165
<errors>
 
1166
Check the <link id="int31error"/> variable.
 
1167
</errors>
 
1168
<seealso>
 
1169
<link id="set_pm_interrupt"/>
 
1170
<link id="set_rm_interrupt"/>
 
1171
<link id="get_rm_interrupt"/> 
 
1172
</seealso>
 
1173
</element>
 
1174
 
 
1175
<element name="get_rm_callback">
 
1176
<short>Return real mode callback</short>
 
1177
<descr>
 
1178
<p>
 
1179
Returns a unique real mode <var>segment:offset</var> address, known as a "real mode
 
1180
callback," that will transfer control from real mode to a protected mode
 
1181
procedure.
 
1182
</p>
 
1183
<p>
 
1184
Parameters:
 
1185
</p>
 
1186
<dl>
 
1187
<dt>pm_func</dt><dd>  pointer to the protected mode callback function.</dd>
 
1188
<dt>reg</dt><dd> supplied registers structure.</dd>
 
1189
<dt>rmcb</dt><dd> buffer to real mode address of callback function.</dd>
 
1190
</dl>
 
1191
<p>
 
1192
Return values: <var>True</var> if successful, otherwise <var>False</var>.
 
1193
</p>
 
1194
<remark>
 
1195
Callback addresses obtained with this function can be passed by a
 
1196
protected mode program for example to an interrupt handler, device driver,
 
1197
or TSR, so that the real mode program can call procedures within the
 
1198
protected mode program or notify the protected mode program of an event. The
 
1199
contents of the supplied regs structure is not valid after function call,
 
1200
but only at the time of the actual callback.
 
1201
</remark>
 
1202
</descr>
 
1203
<errors>
 
1204
Check the <link id="int31error"/> variable.
 
1205
</errors>
 
1206
<seealso>
 
1207
<link id="free_rm_callback"/> 
 
1208
</seealso>
 
1209
<example file="go32ex/callback"/>
 
1210
</element>
 
1211
 
 
1212
<element name="get_rm_interrupt">
 
1213
<short>Get real mode interrupt vector</short>
 
1214
<descr>
 
1215
<p>
 
1216
Returns the contents of the current machine's real mode interrupt vector for
 
1217
the specified interrupt.
 
1218
</p>
 
1219
<p>
 
1220
Parameters:
 
1221
</p>
 
1222
<dl>
 
1223
<dt>vector</dt><dd> interrupt vector number. </dd>
 
1224
<dt>intaddr</dt><dd> buffer to store real mode <var>segment:offset</var> address.</dd>
 
1225
</dl>
 
1226
<p>
 
1227
Return values: <var>True</var> if successful, <var>False</var> otherwise.
 
1228
</p>
 
1229
<remark>
 
1230
The returned address is a real mode segment address, which isn't
 
1231
valid in protected mode.
 
1232
</remark>
 
1233
</descr>
 
1234
<errors>
 
1235
Check the <link id="int31error"/> variable.
 
1236
</errors>
 
1237
<seealso>
 
1238
<link id="set_rm_interrupt"/> 
 
1239
<link id="set_pm_interrupt"/> 
 
1240
<link id="get_pm_interrupt"/> 
 
1241
</seealso>
 
1242
</element>
 
1243
 
 
1244
<element name="get_run_mode">
 
1245
<short>Return current run mode</short>
 
1246
<descr>
 
1247
<p>
 
1248
Returns the current mode your application runs with.
 
1249
</p>
 
1250
<p>
 
1251
Return values: One of the constants used by this function.
 
1252
</p>
 
1253
</descr>
 
1254
<errors>
 
1255
None. 
 
1256
</errors>
 
1257
<seealso>
 
1258
constants returned by <link id="get_run_mode"/>  
 
1259
</seealso>
 
1260
<example file="go32ex/getrunmd"/>
 
1261
</element>
 
1262
 
 
1263
<element name="get_segment_base_address">
 
1264
<short>Return base address from descriptor table</short>
 
1265
<descr>
 
1266
<p>
 
1267
Returns the 32-bit linear base address from the descriptor table for the
 
1268
specified segment.
 
1269
</p>
 
1270
<p>
 
1271
Parameters: 
 
1272
</p>
 
1273
<dl>
 
1274
<dt>d</dt><dd> selector of the descriptor you want the base address of.</dd>
 
1275
</dl>
 
1276
<p>
 
1277
Return values: Linear base address of specified descriptor.
 
1278
</p>
 
1279
<p>
 
1280
For an example, see  <link id="allocate_ldt_descriptors"/>.
 
1281
</p>
 
1282
</descr>
 
1283
<errors>
 
1284
Check the <link id="int31error"/> variable.
 
1285
</errors>
 
1286
<seealso>
 
1287
<link id="allocate_ldt_descriptors"/>
 
1288
<link id="set_segment_base_address"/> 
 
1289
<link id="allocate_ldt_descriptors"/>
 
1290
<link id="set_segment_limit"/>
 
1291
<link id="get_segment_limit"/> 
 
1292
</seealso>
 
1293
</element>
 
1294
 
 
1295
<element name="get_segment_limit">
 
1296
<short>Return segment limite from descriptor</short>
 
1297
<descr>
 
1298
<p>
 
1299
Returns a descriptors segment limit.
 
1300
</p>
 
1301
<p>
 
1302
Parameters:
 
1303
</p>
 
1304
<dl>
 
1305
<dt>d</dt><dd> selector.</dd>
 
1306
</dl>
 
1307
<p>
 
1308
Return value: Limit of the descriptor in bytes.
 
1309
</p>
 
1310
</descr>
 
1311
<errors>
 
1312
Returns zero if descriptor is invalid. 
 
1313
</errors>
 
1314
<seealso>
 
1315
<link id="allocate_ldt_descriptors"/>
 
1316
<link id="set_segment_limit"/> 
 
1317
<link id="set_segment_base_address"/>
 
1318
<link id="get_segment_base_address"/> 
 
1319
</seealso>
 
1320
</element>
 
1321
 
 
1322
<element name="get_ss">
 
1323
<short>Return SS selector</short>
 
1324
<descr>
 
1325
<p>
 
1326
Returns the ss selector.
 
1327
</p>
 
1328
<p>
 
1329
Return values: The content of the ss segment register.
 
1330
</p>
 
1331
</descr>
 
1332
<errors>
 
1333
 None.
 
1334
</errors>
 
1335
<seealso>
 
1336
<link id="get_ds"/>
 
1337
<link id="get_cs"/>
 
1338
</seealso>
 
1339
</element>
 
1340
 
 
1341
<element name="global_dos_alloc">
 
1342
<short>Allocate DOS real mode memory</short>
 
1343
<descr>
 
1344
<p>
 
1345
Allocates a block of dos real mode memory.
 
1346
</p>
 
1347
<p>
 
1348
Parameters: 
 
1349
</p>
 
1350
<dl>
 
1351
<dt>bytes</dt><dd>size of requested real mode memory.</dd>
 
1352
</dl>
 
1353
<p>
 
1354
Return values: The low word of the returned value contains the selector to
 
1355
the allocated dos memory block, the high word the corresponding real mode
 
1356
segment value. The offset value is always zero.
 
1357
This function allocates memory from dos memory pool, i.e. memory below the 1
 
1358
MB boundary that is controlled by dos. Such memory blocks are typically used
 
1359
to exchange data with real mode programs, TSRs, or device drivers. The
 
1360
function returns both the real mode segment base address of the block and
 
1361
one descriptor that can be used by protected mode applications to access the
 
1362
block. This function should only used for temporary buffers to get real mode
 
1363
information (e.g. interrupts that need a data structure in ES:(E)DI),
 
1364
because every single block needs an unique selector. The returned selector
 
1365
should only be freed by a <link id="global_dos_free"/>  call.
 
1366
</p>
 
1367
</descr>
 
1368
<errors>
 
1369
Check the <link id="int31error"/> variable.
 
1370
</errors>
 
1371
<seealso>
 
1372
<link id="global_dos_free"/> 
 
1373
</seealso>
 
1374
<example file="go32ex/buffer"/>
 
1375
</element>
 
1376
 
 
1377
<element name="global_dos_free">
 
1378
<short>Free DOS memory block</short>
 
1379
<descr>
 
1380
<p>
 
1381
Frees a previously allocated dos memory block.
 
1382
</p>
 
1383
<p>
 
1384
Parameters:
 
1385
</p>
 
1386
<dl>
 
1387
<dt>selector</dt><dd> selector to the dos memory block.</dd>
 
1388
</dl>
 
1389
<p>
 
1390
Return value: <var>True</var> if successful, <var>False</var> otherwise.
 
1391
</p>
 
1392
<remark>
 
1393
The descriptor allocated for the memory block is automatically freed
 
1394
and hence invalid for further use. This function should only be used for
 
1395
memory allocated by <link id="global_dos_alloc"/>.
 
1396
</remark>
 
1397
<p>
 
1398
For an example, see <link id="global_dos_alloc"/>.
 
1399
</p>
 
1400
</descr>
 
1401
<errors>
 
1402
Check the <link id="int31error"/> variable.
 
1403
</errors>
 
1404
<seealso>
 
1405
<link id="global_dos_alloc"/> 
 
1406
</seealso>
 
1407
</element>
 
1408
 
 
1409
<element name="inportb">
 
1410
<short>Read byte from I/O port</short>
 
1411
<descr>
 
1412
<p>
 
1413
Reads 1 byte from the selected I/O port.
 
1414
</p>
 
1415
<p>
 
1416
Parameters: 
 
1417
</p>
 
1418
<dl>
 
1419
<dt>port</dt><dd> the I/O port number which is read.</dd>
 
1420
</dl>
 
1421
<p>
 
1422
Return values: Current I/O port value.
 
1423
</p>
 
1424
</descr>
 
1425
<errors>
 
1426
 None. 
 
1427
</errors>
 
1428
<seealso>
 
1429
<link id="outportb"/>
 
1430
<link id="inportw"/>
 
1431
<link id="inportl"/>
 
1432
</seealso>
 
1433
</element>
 
1434
 
 
1435
<element name="inportl">
 
1436
<short>Read longint from I/O port</short>
 
1437
<descr>
 
1438
<p>
 
1439
Reads 1 longint from the selected I/O port.
 
1440
</p>
 
1441
<p>
 
1442
Parameters: 
 
1443
</p>
 
1444
<dl>
 
1445
<dt>port</dt><dd> the I/O port number which is read.</dd>
 
1446
</dl>
 
1447
<p>
 
1448
Return values: Current I/O port value.
 
1449
</p>
 
1450
</descr>
 
1451
<errors>
 
1452
None. 
 
1453
</errors>
 
1454
<seealso>
 
1455
<link id="outportb"/>
 
1456
<link id="inportb"/>
 
1457
<link id="inportw"/> 
 
1458
</seealso>
 
1459
</element>
 
1460
 
 
1461
<element name="inportw">
 
1462
<short>Read word from I/O port</short>
 
1463
<descr>
 
1464
<p>
 
1465
Reads 1 word from the selected I/O port.
 
1466
</p>
 
1467
<p>
 
1468
Parameters:
 
1469
</p>
 
1470
<dl>
 
1471
<dt>port</dt><dd> the I/O port number which is read.</dd>
 
1472
</dl>
 
1473
<p>
 
1474
Return values: Current I/O port value.
 
1475
</p>
 
1476
</descr>
 
1477
<errors>
 
1478
None. 
 
1479
</errors>
 
1480
<seealso>
 
1481
<link id="outportw"/> 
 
1482
<link id="inportb"/>
 
1483
<link id="inportl"/> 
 
1484
</seealso>
 
1485
</element>
 
1486
 
 
1487
<element name="lock_code">
 
1488
<short>Lock code memory range</short>
 
1489
<descr>
 
1490
<p>
 
1491
Locks a memory range which is in the code segment selector.
 
1492
</p>
 
1493
<p>
 
1494
Parameters:
 
1495
</p>
 
1496
<dl>
 
1497
<dt>functionaddr</dt><dd> address of the function to be locked.</dd>
 
1498
<dt>size</dt><dd> size in bytes to be locked.</dd>
 
1499
</dl>
 
1500
<p>
 
1501
Return values: <var>True</var> if successful, <var>False</var> otherwise.
 
1502
</p>
 
1503
<p>
 
1504
For an example, see <link id="get_rm_callback"/>.
 
1505
</p>
 
1506
</descr>
 
1507
<errors>
 
1508
Check the <link id="int31error"/> variable.
 
1509
</errors>
 
1510
<seealso>
 
1511
<link id="lock_linear_region"/>
 
1512
<link id="lock_data"/>
 
1513
<link id="unlock_linear_region"/>
 
1514
<link id="unlock_data"/>
 
1515
<link id="unlock_code"/> 
 
1516
</seealso>
 
1517
</element>
 
1518
 
 
1519
<element name="lock_data">
 
1520
<short>Lock data memory range</short>
 
1521
<descr>
 
1522
<p>
 
1523
Locks a memory range which resides in the data segment selector.
 
1524
</p>
 
1525
<p>
 
1526
Parameters:
 
1527
</p>
 
1528
<dl>
 
1529
<dt>data</dt><dd> address of data to be locked.</dd>
 
1530
<dt>size</dt><dd> length of data to be locked.</dd>
 
1531
</dl>
 
1532
<p>
 
1533
Return values: <var>True</var> if successful, <var>False</var> otherwise.
 
1534
</p>
 
1535
<p>
 
1536
For an example, see <link id="get_rm_callback"/>.
 
1537
</p>
 
1538
</descr>
 
1539
<errors>
 
1540
Check the <link id="int31error"/> variable.
 
1541
</errors>
 
1542
<seealso>
 
1543
<link id="lock_linear_region"/>
 
1544
<link id="lock_code"/>
 
1545
<link id="unlock_linear_region"/>
 
1546
<link id="unlock_data"/>
 
1547
<link id="unlock_code"/> 
 
1548
</seealso>
 
1549
</element>
 
1550
 
 
1551
<element name="lock_linear_region">
 
1552
<short>Lock linear memory region</short>
 
1553
<descr>
 
1554
<p>
 
1555
Locks a memory region to prevent swapping of it.
 
1556
</p>
 
1557
<p>
 
1558
Parameters:
 
1559
</p>
 
1560
<dl>
 
1561
<dt>linearaddr</dt><dd> the linear address of the memory are to be locked.</dd>
 
1562
<dt>size</dt><dd> size in bytes to be locked.</dd>
 
1563
</dl>
 
1564
<p>
 
1565
Return value: <var>True</var> if successful, False otherwise.
 
1566
</p>
 
1567
</descr>
 
1568
<errors>
 
1569
Check the <link id="int31error"/> variable.
 
1570
</errors>
 
1571
<seealso>
 
1572
<link id="lock_data"/>
 
1573
<link id="lock_code"/>
 
1574
<link id="unlock_linear_region"/>
 
1575
<link id="unlock_data"/>
 
1576
<link id="unlock_code"/>
 
1577
</seealso>
 
1578
</element>
 
1579
 
 
1580
<element name="outportb">
 
1581
<short>Write byte to I/O port</short>
 
1582
<descr>
 
1583
<p>
 
1584
Sends 1 byte of data to the specified I/O port.
 
1585
</p>
 
1586
<p>
 
1587
Parameters:
 
1588
</p>
 
1589
<dl>
 
1590
<dt>port</dt><dd> the I/O port number to send data to.</dd>
 
1591
<dt>data</dt><dd> value sent to I/O port.</dd>
 
1592
</dl>
 
1593
<p>
 
1594
Return values: None.
 
1595
</p>
 
1596
</descr>
 
1597
<errors>
 
1598
 None. 
 
1599
</errors>
 
1600
<seealso>
 
1601
<link id="inportb"/>
 
1602
<link id="outportl"/>
 
1603
<link id="outportw"/> 
 
1604
</seealso>
 
1605
<example file="go32ex/outport"/>
 
1606
</element>
 
1607
 
 
1608
<element name="outportl">
 
1609
<short>Write longint to I/O port</short>
 
1610
<descr>
 
1611
<p>
 
1612
Sends 1 longint of data to the specified I/O port.
 
1613
</p>
 
1614
<p>
 
1615
Parameters:
 
1616
</p>
 
1617
<dl>
 
1618
<dt>port</dt><dd> the I/O port number to send data to.</dd>
 
1619
<dt>data</dt><dd> value sent to I/O port.</dd>
 
1620
</dl>
 
1621
<p>
 
1622
Return values: None.
 
1623
</p>
 
1624
<p>
 
1625
For an example, see <link id="outportb"/>.
 
1626
</p>
 
1627
</descr>
 
1628
<errors>
 
1629
None. 
 
1630
</errors>
 
1631
<seealso>
 
1632
<link id="inportl"/>
 
1633
<link id="outportw"/>
 
1634
<link id="outportb"/>
 
1635
</seealso>
 
1636
</element>
 
1637
 
 
1638
<element name="outportw">
 
1639
<short>Write word to I/O port</short>
 
1640
<descr>
 
1641
<p>
 
1642
Sends 1 word of data to the specified I/O port.
 
1643
</p>
 
1644
<p>
 
1645
Parameters:
 
1646
</p>
 
1647
<dl>
 
1648
<dt>port</dt><dd> the I/O port number to send data to.</dd>
 
1649
<dt>data</dt><dd> value sent to I/O port.</dd>
 
1650
</dl>
 
1651
<p>
 
1652
Return values: None.
 
1653
</p>
 
1654
<p>
 
1655
For an example, see <link id="outportb"/>.
 
1656
</p>
 
1657
</descr>
 
1658
<errors>
 
1659
 None. 
 
1660
</errors>
 
1661
<seealso>
 
1662
<link id="inportw"/>
 
1663
<link id="outportl"/>
 
1664
<link id="outportb"/>
 
1665
</seealso>
 
1666
</element>
 
1667
 
 
1668
<element name="realintr">
 
1669
<short>Simulate interrupt</short>
 
1670
<descr>
 
1671
<p>
 
1672
Simulates an interrupt in real mode.
 
1673
</p>
 
1674
<p>
 
1675
Parameters:
 
1676
</p>
 
1677
<dl>
 
1678
<dt>intnr</dt><dd> interrupt number to issue in real mode.</dd>
 
1679
<dt>regs</dt><dd> registers data structure.</dd>
 
1680
</dl>
 
1681
<p>
 
1682
Return values: The supplied registers data structure contains the values
 
1683
that were returned by the real mode interrupt. <var>True</var> if successful, <var>False</var> if
 
1684
not.
 
1685
</p>
 
1686
<remark>
 
1687
The function transfers control to the address specified by the real
 
1688
mode interrupt vector of intnr. The real mode handler must return by
 
1689
executing an IRET.
 
1690
</remark>
 
1691
</descr>
 
1692
<errors>
 
1693
Check the <link id="int31error"/> variable.
 
1694
</errors>
 
1695
<seealso>
 
1696
</seealso>
 
1697
<example file="go32ex/flags"/>
 
1698
</element>
 
1699
 
 
1700
<element name="seg_fillchar">
 
1701
<short>Fill segment with byte value</short>
 
1702
<descr>
 
1703
<p>
 
1704
Sets a memory area to a specific value.
 
1705
</p>
 
1706
<p>
 
1707
Parameters:
 
1708
</p>
 
1709
<dl>
 
1710
<dt>seg</dt><dd> selector to memory area.</dd>
 
1711
<dt>ofs</dt><dd> offset to memory.</dd>
 
1712
<dt>count</dt><dd> number of bytes to set.</dd>
 
1713
<dt>c</dt><dd> byte data which is set.</dd>
 
1714
</dl>
 
1715
<p>
 
1716
Return values: None.
 
1717
</p>
 
1718
<p>
 
1719
Notes: No range check is done in any way.
 
1720
</p>
 
1721
</descr>
 
1722
<errors>
 
1723
 None. 
 
1724
</errors>
 
1725
<seealso>
 
1726
<link id="seg_move"/>
 
1727
<link id="seg_fillword"/>
 
1728
<link id="dosmemfillchar"/>
 
1729
<link id="dosmemfillword"/>
 
1730
<link id="dosmemget"/>
 
1731
<link id="dosmemput"/>
 
1732
<link id="dosmemmove"/> 
 
1733
</seealso>
 
1734
<example file="go32ex/vgasel"/>
 
1735
</element>
 
1736
 
 
1737
<element name="seg_fillword">
 
1738
<short>Fill segment with word value</short>
 
1739
<descr>
 
1740
<p>
 
1741
Sets a memory area to a specific value.
 
1742
</p>
 
1743
<p>
 
1744
Parameters:
 
1745
</p>
 
1746
<dl>
 
1747
<dt>seg</dt><dd> selector to memory area.</dd>
 
1748
<dt>ofs</dt><dd> offset to memory.</dd>
 
1749
<dt>count</dt><dd> number of words to set.</dd>
 
1750
<dt>w</dt><dd> word data which is set.</dd>
 
1751
</dl>
 
1752
<p>
 
1753
Return values: None.
 
1754
</p>
 
1755
<p>
 
1756
Notes: No range check is done in any way.
 
1757
</p>
 
1758
<p>
 
1759
For an example, see <link id="allocate_ldt_descriptors"/>.
 
1760
</p>
 
1761
</descr>
 
1762
<errors>
 
1763
None. 
 
1764
</errors>
 
1765
<seealso>
 
1766
<link id="seg_move"/>
 
1767
<link id="seg_fillchar"/> 
 
1768
<link id="dosmemfillchar"/> 
 
1769
<link id="dosmemfillword"/>
 
1770
<link id="dosmemget"/>
 
1771
<link id="dosmemput"/>
 
1772
<link id="dosmemmove"/> 
 
1773
</seealso>
 
1774
</element>
 
1775
 
 
1776
<element name="segment_to_descriptor">
 
1777
<short>Map segment address to descriptor</short>
 
1778
<descr>
 
1779
<p>
 
1780
Maps a real mode segment (paragraph) address onto an descriptor that can be
 
1781
used by a protected mode program to access the same memory.
 
1782
</p>
 
1783
<p>
 
1784
Parameters:
 
1785
</p>
 
1786
<dl>
 
1787
<dt>seg</dt><dd>the real mode segment you want the descriptor to.</dd>
 
1788
</dl>
 
1789
<p>
 
1790
Return values: Descriptor to real mode segment address.
 
1791
</p>
 
1792
<remark>
 
1793
The returned descriptors limit will be set to 64 kB. Multiple calls
 
1794
to this function with the same segment address will return the same
 
1795
selector. Descriptors created by this function can never be modified or
 
1796
freed. Programs which need to examine various real mode addresses using the
 
1797
same selector should use the function 
 
1798
<link id="allocate_ldt_descriptors"/> and change
 
1799
the base address as necessary.
 
1800
</remark>
 
1801
<p>
 
1802
For an example, see <link id="seg_fillchar"/>.
 
1803
</p>
 
1804
</descr>
 
1805
<errors>
 
1806
Check the <link id="int31error"/> variable. 
 
1807
</errors>
 
1808
<seealso>
 
1809
<link id="allocate_ldt_descriptors"/>
 
1810
<link id="free_ldt_descriptor"/>
 
1811
<link id="set_segment_base_address"/> 
 
1812
</seealso>
 
1813
</element>
 
1814
 
 
1815
<element name="seg_move">
 
1816
<short>Move data between 2 locations</short>
 
1817
<descr>
 
1818
<p>
 
1819
Copies data between two memory locations.
 
1820
</p>
 
1821
<p>
 
1822
Parameters:
 
1823
</p>
 
1824
<dl>
 
1825
<dt>sseg</dt><dd> source selector. </dd>
 
1826
<dt>source</dt><dd> source offset. </dd>
 
1827
<dt>dseg</dt><dd> destination selector.</dd>
 
1828
<dt>dest</dt><dd> destination offset.</dd>
 
1829
<dt>count</dt><dd> size in bytes to copy.</dd>
 
1830
</dl>
 
1831
<p>
 
1832
Return values: None.
 
1833
</p>
 
1834
<remark>
 
1835
Overlapping is only checked if the source selector is equal to the
 
1836
destination selector. No range check is done.
 
1837
</remark>
 
1838
<p>
 
1839
For an example, see <link id="allocate_ldt_descriptors"/>.
 
1840
</p>
 
1841
</descr>
 
1842
<errors>
 
1843
 None.
 
1844
</errors>
 
1845
<seealso>
 
1846
<link id="seg_fillchar"/>
 
1847
<link id="seg_fillword"/>
 
1848
<link id="dosmemfillchar"/>
 
1849
<link id="dosmemfillword"/>
 
1850
<link id="dosmemget"/>
 
1851
<link id="dosmemput"/>
 
1852
<link id="dosmemmove"/> 
 
1853
</seealso>
 
1854
</element>
 
1855
 
 
1856
<element name="set_descriptor_access_rights">
 
1857
<short>Set descriptor access rights</short>
 
1858
<descr>
 
1859
<p>
 
1860
Sets the access rights of a descriptor.
 
1861
</p>
 
1862
<p>
 
1863
Parameters:
 
1864
</p>
 
1865
<dl>
 
1866
<dt>d</dt><dd> selector.</dd>
 
1867
<dt>w</dt><dd> new descriptor access rights.</dd>
 
1868
</dl>
 
1869
</descr>
 
1870
<errors>
 
1871
Check the <link id="int31error"/> variable.
 
1872
</errors>
 
1873
<seealso>
 
1874
<link id="get_descriptor_access_rights"/> 
 
1875
</seealso>
 
1876
</element>
 
1877
 
 
1878
<element name="set_pm_interrupt">
 
1879
<short>Set protected mode interrupt handler</short>
 
1880
<descr>
 
1881
<p>
 
1882
Sets the address of the protected mode handler for an interrupt.
 
1883
</p>
 
1884
<p>
 
1885
Parameters:
 
1886
</p>
 
1887
<dl>
 
1888
<dt>vector</dt><dd> number of protected mode interrupt to set.</dd>
 
1889
<dt>intaddr</dt><dd> selector:offset address to the interrupt vector.</dd>
 
1890
</dl>
 
1891
<p>
 
1892
Return values: <var>True</var> if successful, <var>False</var> otherwise.
 
1893
</p>
 
1894
<remark>
 
1895
The address supplied must be a valid <var>selector:offset</var> 
 
1896
protected mode address.
 
1897
</remark>
 
1898
</descr>
 
1899
<errors>
 
1900
 Check the <link id="int31error"/> variable.
 
1901
</errors>
 
1902
<seealso>
 
1903
<link id="get_pm_interrupt"/> 
 
1904
<link id="set_rm_interrupt"/>
 
1905
<link id="get_rm_interrupt"/> 
 
1906
</seealso>
 
1907
<example file="go32ex/intpm"/>
 
1908
</element>
 
1909
 
 
1910
<element name="set_rm_interrupt">
 
1911
<short>Set real mode interrupt handler</short>
 
1912
<descr>
 
1913
<p>
 
1914
Sets a real mode interrupt handler.
 
1915
</p>
 
1916
<p>
 
1917
Parameters:
 
1918
</p>
 
1919
<dl>
 
1920
<dt>vector</dt><dd> the interrupt vector number to set.</dd>
 
1921
<dt>intaddr</dt><dd> address of new interrupt vector.</dd>
 
1922
</dl>
 
1923
<p>
 
1924
Return values: <var>True</var> if successful, otherwise <var>False</var>.
 
1925
</p>
 
1926
<remark>
 
1927
The address supplied MUST be a real mode segment address, not a
 
1928
<var>selector:offset</var> address. So the interrupt handler must either reside in dos
 
1929
memory (below 1 Mb boundary) or the application must allocate a real mode
 
1930
callback address with <link id="get_rm_callback"/>.
 
1931
</remark>
 
1932
</descr>
 
1933
<errors>
 
1934
Check the <link id="int31error"/> variable.
 
1935
</errors>
 
1936
<seealso>
 
1937
<link id="get_rm_interrupt"/> 
 
1938
<link id="set_pm_interrupt"/>
 
1939
<link id="get_pm_interrupt"/> 
 
1940
<link id="get_rm_callback"/> 
 
1941
</seealso>
 
1942
</element>
 
1943
 
 
1944
<element name="set_segment_base_address">
 
1945
<short>Set descriptor's base address</short>
 
1946
<descr>
 
1947
<p>
 
1948
Sets the 32-bit linear base address of a descriptor.
 
1949
</p>
 
1950
<p>
 
1951
Parameters:
 
1952
</p>
 
1953
<dl>
 
1954
<dt>d</dt><dd> selector.</dd>
 
1955
<dt>s</dt><dd> new base address of the descriptor.</dd>
 
1956
</dl>
 
1957
</descr>
 
1958
<errors>
 
1959
Check the <link id="int31error"/> variable.
 
1960
</errors>
 
1961
<seealso>
 
1962
<link id="allocate_ldt_descriptors"/>
 
1963
<link id="get_segment_base_address"/> 
 
1964
<link id="allocate_ldt_descriptors"/> 
 
1965
<link id="set_segment_limit"/>
 
1966
<link id="get_segment_base_address"/>
 
1967
<link id="get_segment_limit"/> 
 
1968
</seealso>
 
1969
</element>
 
1970
 
 
1971
<element name="set_segment_limit">
 
1972
<short>Set descriptor limit</short>
 
1973
<descr>
 
1974
<p>
 
1975
Sets the limit of a descriptor.
 
1976
</p>
 
1977
<p>
 
1978
Parameters:
 
1979
</p>
 
1980
<dl>
 
1981
<dt>d</dt><dd> selector.</dd>
 
1982
<dt>s</dt><dd> new limit of the descriptor.</dd>
 
1983
</dl>
 
1984
<p>
 
1985
Return values: Returns <var>True</var> if successful, else <var>False</var>.
 
1986
</p>
 
1987
<remark>
 
1988
The new limit specified must be the byte length of the segment - 1.
 
1989
Segment limits bigger than or equal to 1MB must be page aligned, they must
 
1990
have the lower 12 bits set.
 
1991
</remark>
 
1992
<p>
 
1993
For an example, see <link id="allocate_ldt_descriptors"/>.
 
1994
</p>
 
1995
</descr>
 
1996
<errors>
 
1997
Check the <link id="int31error"/> variable.
 
1998
</errors>
 
1999
<seealso>
 
2000
<link id="allocate_ldt_descriptors"/>
 
2001
<link id="set_segment_base_address"/>
 
2002
<link id="get_segment_limit"/> 
 
2003
<link id="set_segment_limit"/> 
 
2004
</seealso>
 
2005
</element>
 
2006
 
 
2007
<element name="tb_size">
 
2008
<short>Return DOS transfer memory buffer size</short>
 
2009
<descr>
 
2010
<p>
 
2011
Returns the size of the pre-allocated dos memory buffer.
 
2012
</p>
 
2013
<p>
 
2014
Return values: The size of the pre-allocated dos memory buffer.
 
2015
This block always seems to be 16k in size, but don't rely on this.
 
2016
</p>
 
2017
</descr>
 
2018
<errors>
 
2019
None.
 
2020
</errors>
 
2021
<seealso>
 
2022
<link id="transfer_buffer"/>
 
2023
<link id="copyfromdos"/>
 
2024
<link id="copytodos"/>
 
2025
</seealso>
 
2026
</element>
 
2027
 
 
2028
 
 
2029
<element name="transfer_buffer">
 
2030
<short>Return offset of DOS transfer buffer</short>
 
2031
<descr>
 
2032
<var>transfer_buffer</var> returns the offset of the transfer buffer.
 
2033
</descr>
 
2034
<errors>
 
2035
None.
 
2036
</errors>
 
2037
<seealso>
 
2038
<link id="tb_size"/>
 
2039
</seealso>
 
2040
</element>
 
2041
 
 
2042
 
 
2043
<element name="unlock_code">
 
2044
<short>Unlock code segment</short>
 
2045
<descr>
 
2046
<p>
 
2047
Unlocks a memory range which resides in the code segment selector.
 
2048
</p>
 
2049
<p>
 
2050
Parameters:
 
2051
</p>
 
2052
<dl>
 
2053
<dt>functionaddr</dt><dd> address of function to be unlocked. </dd>
 
2054
<dt>size</dt><dd> size bytes to be unlocked.</dd>
 
2055
</dl>
 
2056
<p>
 
2057
Return value: <var>True</var> if successful, <var>False</var> otherwise.
 
2058
</p>
 
2059
<p>
 
2060
For an example, see <link id="get_rm_callback"/>.
 
2061
</p>
 
2062
</descr>
 
2063
<errors>
 
2064
Check the <link id="int31error"/> variable.
 
2065
</errors>
 
2066
<seealso>
 
2067
<link id="unlock_linear_region"/>
 
2068
<link id="unlock_data"/>
 
2069
<link id="lock_linear_region"/>
 
2070
<link id="lock_data"/>
 
2071
<link id="lock_code"/> 
 
2072
</seealso>
 
2073
</element>
 
2074
 
 
2075
<element name="unlock_data">
 
2076
<short>Unlock data segment</short>
 
2077
<descr>
 
2078
<p>
 
2079
Unlocks a memory range which resides in the data segment selector.
 
2080
</p>
 
2081
<p>
 
2082
Parameters:
 
2083
</p>
 
2084
<dl>
 
2085
<dt>data</dt><dd> address of memory to be unlocked. </dd>
 
2086
<dt>size</dt><dd> size bytes to be unlocked.</dd>
 
2087
</dl>
 
2088
<p>
 
2089
Return values: <var>True</var> if successful, <var>False</var> otherwise.
 
2090
</p>
 
2091
<p>
 
2092
For an example, see <link id="get_rm_callback"/>.
 
2093
</p>
 
2094
</descr>
 
2095
<errors>
 
2096
Check the <link id="int31error"/> variable.
 
2097
</errors>
 
2098
<seealso>
 
2099
<link id="unlock_linear_region"/>
 
2100
<link id="unlock_code"/>
 
2101
<link id="lock_linear_region"/>
 
2102
<link id="lock_data"/>
 
2103
<link id="lock_code"/> 
 
2104
</seealso>
 
2105
</element>
 
2106
 
 
2107
<element name="unlock_linear_region">
 
2108
<short>Unlock linear memory region</short>
 
2109
<descr>
 
2110
<p>
 
2111
Unlocks a previously locked linear region range to allow it to be swapped
 
2112
out again if needed.
 
2113
</p>
 
2114
<p>
 
2115
Parameters:
 
2116
</p>
 
2117
<dl>
 
2118
<dt>linearaddr</dt><dd> linear address of the memory to be unlocked. </dd>
 
2119
<dt>size</dt><dd> size bytes to be unlocked.</dd>
 
2120
</dl>
 
2121
<p>
 
2122
Return values: <var>True</var> if successful, <var>False</var> otherwise.
 
2123
</p>
 
2124
</descr>
 
2125
<errors>
 
2126
Check the <link id="int31error"/> variable.
 
2127
</errors>
 
2128
<seealso>
 
2129
<link id="unlock_data"/>
 
2130
<link id="unlock_code"/>
 
2131
<link id="lock_linear_region"/>
 
2132
<link id="lock_data"/>
 
2133
<link id="lock_code"/>
 
2134
</seealso>
 
2135
</element>
 
2136
 
 
2137
<!-- variable Visibility: default -->
 
2138
<element name="tmeminfo.reserved0">
 
2139
<short>Unused</short>
 
2140
</element>
 
2141
 
 
2142
<!-- variable Visibility: default -->
 
2143
<element name="tmeminfo.reserved1">
 
2144
<short>Unused</short>
 
2145
</element>
 
2146
 
 
2147
<!-- variable Visibility: default -->
 
2148
<element name="tmeminfo.reserved2">
 
2149
<short>Unused</short>
 
2150
</element>
 
2151
 
 
2152
<!-- function Visibility: default -->
 
2153
<element name="set_descriptor_access_right">
 
2154
<short>Set access rights to memory descriptor</short>
 
2155
<descr>
 
2156
<var>set_descriptor_access_right</var> sets the access rights for descriptor
 
2157
<var>d</var> to <var>w</var>
 
2158
</descr>
 
2159
</element>
 
2160
 
 
2161
<!-- function Visibility: default -->
 
2162
<element name="map_device_in_memory_block">
 
2163
<short>Map a device into program's memory space</short>
 
2164
<descr>
 
2165
<var>map_device_in_memory_block</var> allows to map a device in memory. This
 
2166
function is a direct call of the extender. For more information about it's
 
2167
arguments, see the extender documentation.
 
2168
</descr>
 
2169
</element>
 
2170
 
 
2171
<!-- function Visibility: default -->
 
2172
<element name="get_exception_handler">
 
2173
<short>Return current exception handler</short>
 
2174
<descr>
 
2175
<var>get_exception_handler</var> returns the exception handler for exception
 
2176
<var>E</var> in <var>intaddr</var>. It returns <var>True</var> if the call
 
2177
was successful, <var>False</var> if not.
 
2178
</descr>
 
2179
<seealso>
 
2180
<link id="set_exception_handler"/>
 
2181
<link id="get_pm_exception_handler"/>
 
2182
</seealso>
 
2183
</element>
 
2184
 
 
2185
<!-- function Visibility: default -->
 
2186
<element name="set_exception_handler">
 
2187
<short>Set exception handler</short>
 
2188
<descr>
 
2189
<var>set_exception_handler</var> sets the exception handler for exception
 
2190
<var>E</var> to <var>intaddr</var>. It returns <var>True</var> if the call
 
2191
was successful, <var>False</var> if not.
 
2192
</descr>
 
2193
<seealso>
 
2194
<link id="get_exception_handler"/>
 
2195
<link id="set_pm_exception_handler"/>
 
2196
</seealso>
 
2197
</element>
 
2198
 
 
2199
<!-- function Visibility: default -->
 
2200
<element name="get_pm_exception_handler">
 
2201
<short>Get protected mode exception handler</short>
 
2202
<descr>
 
2203
<var>get_pm_exception_handler</var> returns the protected mode exception handler for exception
 
2204
<var>E</var> in <var>intaddr</var>. It returns <var>True</var> if the call
 
2205
was successful, <var>False</var> if not.
 
2206
</descr>
 
2207
<seealso>
 
2208
<link id="get_exception_handler"/>
 
2209
<link id="set_pm_exception_handler"/>
 
2210
</seealso>
 
2211
</element>
 
2212
 
 
2213
<!-- function Visibility: default -->
 
2214
<element name="set_pm_exception_handler">
 
2215
<short>Set protected mode exception handler</short>
 
2216
<descr>
 
2217
<var>set_pm_exception_handler</var> sets the protected mode exception handler for exception
 
2218
<var>E</var> to <var>intaddr</var>. It returns <var>True</var> if the call
 
2219
was successful, <var>False</var> if not.
 
2220
</descr>
 
2221
<seealso>
 
2222
<link id="set_exception_handler"/>
 
2223
<link id="get_pm_exception_handler"/>
 
2224
</seealso>
 
2225
</element>
 
2226
 
 
2227
<!-- function Visibility: default -->
 
2228
<element name="request_linear_region">
 
2229
<short>Request linear address region.</short>
 
2230
<descr>
 
2231
<var>request_linear_region</var> requests a linear range of addresses of
 
2232
size <var>Size</var>, starting at <var>linearaddr</var>. If successful,
 
2233
<var>True</var> is returned, and a handle to the address region is returned in
 
2234
<var>blockhandle</var>.
 
2235
</descr>
 
2236
<errors>
 
2237
On error, <var>False</var> is returned.
 
2238
</errors>
 
2239
</element>
 
2240
 
 
2241
<!-- function Visibility: default -->
 
2242
<element name="tb_segment">
 
2243
<short>Return DOS transfer buffer segment</short>
 
2244
<descr>
 
2245
<var>tb_segment</var> returns the DOS transfer buffer segment.
 
2246
</descr>
 
2247
<seealso>
 
2248
<link id="transfer_buffer"/>
 
2249
<link id="tb_offset"/>
 
2250
<link id="tb_size"/>
 
2251
</seealso>
 
2252
</element>
 
2253
 
 
2254
<!-- function Visibility: default -->
 
2255
<element name="tb_offset">
 
2256
<short>Return DOS transfer buffer offset</short>
 
2257
<descr>
 
2258
<var>tb_offset</var> returns the DOS transfer buffer segment.
 
2259
</descr>
 
2260
<seealso>
 
2261
<link id="transfer_buffer"/>
 
2262
<link id="tb_segment"/>
 
2263
<link id="tb_size"/>
 
2264
</seealso>
 
2265
</element>
 
2266
 
 
2267
<!-- procedure Visibility: default -->
 
2268
<element name="dpmi_dosmemput">
 
2269
<short>Move data from DPMI memory to DOS memory.</short>
 
2270
<descr>
 
2271
<var>dpmi_dosmemput</var> moves <var>count</var> bytes of data from
 
2272
<var>data</var> to the DOS memory location indicated by <var>seg</var> and
 
2273
<var>ofs</var>.
 
2274
</descr>
 
2275
<seealso>
 
2276
<link id="dpmi_dosmemget"/>
 
2277
<link id="dpmi_dosmemmove"/>
 
2278
<link id="dpmi_dosmemfillchar"/>
 
2279
<link id="dpmi_dosmemfillword"/>
 
2280
</seealso>
 
2281
</element>
 
2282
 
 
2283
<!-- procedure Visibility: default -->
 
2284
<element name="dpmi_dosmemget">
 
2285
<short>Move data from DOS memory to DPMI memory</short>
 
2286
<descr>
 
2287
<var>dpmi_dosmemput</var> moves <var>count</var> bytes of data from
 
2288
the DOS memory location indicated by <var>seg</var> and
 
2289
<var>ofs</var> to DPMI memory indicated by <var>data</var>.
 
2290
</descr>
 
2291
<seealso>
 
2292
<link id="dpmi_dosmemput"/>
 
2293
<link id="dpmi_dosmemmove"/>
 
2294
<link id="dpmi_dosmemfillchar"/>
 
2295
<link id="dpmi_dosmemfillword"/>
 
2296
</seealso>
 
2297
</element>
 
2298
 
 
2299
<!-- procedure Visibility: default -->
 
2300
<element name="dpmi_dosmemmove">
 
2301
<short>Move DOS memory</short>
 
2302
<descr>
 
2303
<var>dpmi_dosmemmove</var> moves <var>count</var> bytes from DOS memory
 
2304
<var>sseg</var>,<var>sofs</var> to <var>dseg</var>,<var>dofs</var>.
 
2305
</descr>
 
2306
<seealso>
 
2307
<link id="dpmi_dosmemput"/>
 
2308
<link id="dpmi_dosmemget"/>
 
2309
<link id="dpmi_dosmemfillchar"/>
 
2310
<link id="dpmi_dosmemfillword"/>
 
2311
</seealso>
 
2312
</element>
 
2313
 
 
2314
<!-- procedure Visibility: default -->
 
2315
<element name="dpmi_dosmemfillchar">
 
2316
<short>Fill DOS memory with a character</short>
 
2317
<descr>
 
2318
<var>dpmi_dosmemfillchar</var> fills the DOS memory reagion indicated by
 
2319
<var>seg</var>,<var>ofs</var> with <var>count</var> characters <var>c</var>.
 
2320
</descr>
 
2321
<seealso>
 
2322
<link id="dpmi_dosmemput"/>
 
2323
<link id="dpmi_dosmemget"/>
 
2324
<link id="dpmi_dosmemmove"/>
 
2325
<link id="dpmi_dosmemfillword"/>
 
2326
</seealso>
 
2327
</element>
 
2328
 
 
2329
<!-- procedure Visibility: default -->
 
2330
<element name="dpmi_dosmemfillword">
 
2331
<short>Fill DOS memory with a word value</short>
 
2332
<descr>
 
2333
<var>dpmi_dosmemfillword</var> fills the DOS memory reagion indicated by
 
2334
<var>seg</var>,<var>ofs</var> with <var>count</var> words <var>W</var>.
 
2335
</descr>
 
2336
<seealso>
 
2337
<link id="dpmi_dosmemput"/>
 
2338
<link id="dpmi_dosmemget"/>
 
2339
<link id="dpmi_dosmemfillchar"/>
 
2340
<link id="dpmi_dosmemmove"/>
 
2341
</seealso>
 
2342
</element>
 
2343
 
 
2344
</module>
 
2345
</package>
 
2346
</fpdoc-descriptions>
 
 
b'\\ No newline at end of file'