1
<?xml version="1.0" encoding="ISO8859-1"?>
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
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.
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.
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.
26
<short>GO32 - acces to the 32-bit DOS extender</short>
27
<!-- \FPCexampledir{go32ex} -->
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.
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
43
So let's get started and happy and error free coding I wish you....
44
Thomas Schatzl, 25. August 1998
49
<short>What is DPMI</short>
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.
61
<topic name="SelectorsDescriptors">
62
<short>Selectors and descriptors</short>
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,
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
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
84
<topic name="FPCspecs">
85
<short>FPC specialities</short>
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
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"/>
111
<topic name="DosMemory">
112
<short>dos memory access</short>
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.
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"/>
138
<topic name="IOPorts">
139
<short>I/O port access</short>
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.
148
<link id="outportb"/>
153
<topic name="ProcessorAccess">
154
<short>Processor access</short>
156
These are some functions to access various segment registers (%cs, %ds, %ss)
157
which makes your work a bit easier.
166
<topic name="InterruptHandling">
167
<short>Interrupt redirection</short>
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.
178
<topic name="DPMIInterrupts">
179
<short>Handling interrupts with DPMI</short>
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.
195
<topic name="DPMIvsProtectedInterrupts">
196
<short>Protected mode interrupts vs. Real mode interrupts</short>
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 (<1MB) or the application must
204
allocate a real mode callback address via the get_rm_callback() function.
208
<topic name="CreatingInterruptHandlers">
209
<short>Creating your own interrupt handlers</short>
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
217
<topic name="DisablingInterrupts">
218
<short>Disabling interrupts</short>
220
The GO32 unit provides the two procedures disable() and enable() to disable
221
and enable all interrupts.
225
<topic name="HardwareInterrupts">
226
<short>Hardware interrupts</short>
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
249
The following example shows how to redirect the keyboard interrupt.
251
<example file="go32ex/keyclick"/>
254
<topic name="SoftwareInterrupts">
255
<short>Software interrupts</short>
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"/>.
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"/>
273
<link id="outportb"/>
277
<topic name="ExecutingInterrupts">
278
<short>Executing software interrupts</short>
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.
297
<link id="transfer_buffer"/>
298
<link id="global_dos_alloc"/>
299
<link id="global_dos_free"/>
300
<link id="realintr"/>
302
<example file="go32ex/softint"/>
303
<example file="go32ex/rmpmint"/>
306
<topic name="RealModeCallBacks">
307
<short>Real mode callbacks</short>
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
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
331
<li> <var>%SS:%ESP</var> = locked protected mode stack</li>
332
<li> All other registers undefined</li>
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
354
All variables and code touched by the callback procedure MUST be locked to
359
<link id="get_rm_callback"/>
360
<link id="free_rm_callback"/>
361
<link id="lock_code"/>
362
<link id="lock_data"/>
366
<element name="rm_unknown">
367
<short><link id="get_run_mode"/> return value: Unknown runmode</short>
369
<element name="rm_raw">
370
<short><link id="get_run_mode"/> return value: raw (without HIMEM)</short>
372
<element name="rm_xms">
373
<short><link id="get_run_mode"/> return value: XMS (with HIMEM, without EMM386)</short>
375
<element name="rm_vcpi">
376
<short><link id="get_run_mode"/> return value: VCPI (with HIMEM and EMM386)</short>
378
<element name="rm_dpmi">
379
<short><link id="get_run_mode"/> return value: DPMI (e.g. dos box or 386Max)</short>
382
<element name="carryflag">
383
<short>Check for carry flag in <link id="trealregs"/></short>
385
<element name="parityflag">
386
<short>Check for parity flag in <link id="trealregs"/></short>
388
<element name="auxcarryflag">
389
<short>Check for auxiliary carry flag in <link id="trealregs"/></short>
391
<element name="zeroflag">
392
<short>Check for zero flag in <link id="trealregs"/></short>
394
<element name="signflag">
395
<short>Check for sign flag in <link id="trealregs"/></short>
397
<element name="trapflag">
398
<short>Check for trap flag in <link id="trealregs"/></short>
400
<element name="interruptflag">
401
<short>Check for interrupt flag in <link id="trealregs"/></short>
403
<element name="directionflag">
404
<short>Check for direction flag in <link id="trealregs"/></short>
406
<element name="overflowflag">
407
<short>Check for overflow flag in <link id="trealregs"/></short>
410
<element name="tmeminfo">
411
<short>Memory information record</short>
414
<var>tmeminfo</var> Holds information about the memory allocation, etc.
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.
423
<element name="TMemInfo.available_memory">
424
<short>Largest available free block in bytes. </short>
426
<element name="TMemInfo.available_pages">
427
<short>Maximum unlocked page allocation in pages </short>
429
<element name="TMemInfo.available_lockable_pages">
430
<short>Maximum locked page allocation in pages. </short>
432
<element name="TMemInfo.linear_space">
433
<short>Linear address space size in pages. </short>
435
<element name="TMemInfo.unlocked_pages">
436
<short>Total number of unlocked pages. </short>
438
<element name="TMemInfo.available_physical_pages">
439
<short>Total number of free pages.</short>
441
<element name="TMemInfo.total_physical_pages">
442
<short>Total number of physical pages. </short>
444
<element name="TMemInfo.free_linear_space">
445
<short>Free linear address space in pages.</short>
447
<element name="TMemInfo.max_pages_in_paging_file">
448
<short> Size of paging file/partition in pages</short>
451
<element name="trealregs">
452
<short>Record describing all processor registers</short>
454
The <var>trealregs</var> type contains the data structure to pass register values to a
455
interrupt handler or real mode callback.
459
<element name="registers">
460
<short>Alias for <link id="trealregs"/></short>
463
<element name="tseginfo">
464
<short>Record to store 48-bits pointer</short>
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.
472
See also: Selectors and descriptors, dos memory access, Interrupt
478
<element name="tseginfo.offset">
479
<short>Offset in segment</short>
481
<element name="tseginfo.Segment">
482
<short>Segment</short>
485
<element name="dosmemselector">
486
<short>Selector to DOS memory</short>
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
494
<element name="int31error">
495
<short>DPMI interrupt call result</short>
497
This variable holds the result of a DPMI interrupt call. Any nonzero value
498
must be treated as a critical failure.
502
<element name="allocate_ldt_descriptors">
503
<short>Allocate a number of descriptors</short>
506
Allocates a number of new descriptors.
512
<dt>count:\ </dt><dd> specifies the number of requested unique descriptors.</dd>
515
Return value: The base selector.
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"/>
529
Check the <link id="int31error"/> variable.
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"/>
539
<example file="go32ex/seldes"/>
542
<element name="allocate_memory_block">
543
<short>Allocate a block of linear memory</short>
546
Allocates a block of linear memory.
552
<dt>size:</dt><dd> Size of requested linear memory block in bytes.</dd>
555
Returned values: blockhandle - the memory handle to this memory block. Linear
556
address of the requested memory.
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
571
Check the <link id="int31error"/> variable.
574
<link id="free_memory_block"/>
578
<element name="copyfromdos">
579
<short>Copy data from DOS to to heap</short>
582
Copies data from the pre-allocated dos memory transfer buffer to the heap.
588
<dt>addr</dt><dd>data to copy to.</dd>
589
<dt>len</dt><dd>number of bytes to copy to heap.</dd>
593
Can only be used in conjunction with the dos memory transfer buffer.
597
Check the <link id="int31error"/> variable.
601
<link id="transfer_buffer"/>
602
<link id="copytodos"/>
607
<element name="copytodos">
608
<short>Copy data from heap to DOS memory</short>
611
Copies data from heap to the pre-allocated dos memory buffer.
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>
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
627
Check the <link id="int31error"/> variable.
631
<link id="transfer_buffer"/>
632
<link id="copyfromdos"/>
636
<element name="create_code_segment_alias_descriptor">
637
<short>Create new descriptor from existing descriptor</short>
640
Creates a new descriptor that has the same base and limit as the specified
647
<dt>seg</dt><dd> Descriptor.</dd>
650
Return values: The data selector (alias).
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.
661
Check the <link id="int31error"/> variable.
664
<link id="allocate_ldt_descriptors"/>
665
<link id="set_segment_limit"/>
666
<link id="set_segment_base_address"/>
670
<element name="disable">
671
<short>Disable hardware interrupts</short>
674
Disables all hardware interrupts by execution a CLI instruction.
685
<element name="dosmemfillchar">
686
<short>Fill a region of DOS memory with a specific byte-sized value</short>
689
Sets a region of dos memory to a specific byte value.
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>
701
Notes: No range check is performed.
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"/>
716
<example file="go32ex/textmess"/>
719
<element name="dosmemfillword">
720
<short>Fill a region of DOS memory with a specific word-sized value</short>
723
Sets a region of dos memory to a specific word value.
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>
735
Notes: No range check is performed.
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"/>
752
<element name="dosmemget">
753
<short>Copy data from DOS memory to the heap.</short>
756
Copies data from the dos memory onto the heap.
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>
768
Notes: No range checking is performed.
771
For an example, see <link id="global_dos_alloc"/>.
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"/>
788
<element name="dosmemmove">
789
<short>Move data between 2 DOS real mode memory locations</short>
792
Copies count bytes of data between two dos real mode memory locations.
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>
805
Notes: No range check is performed in any way.
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"/>
821
For an example, see <link id="seg_fillchar"/>.
823
<element name="dosmemput">
824
<short>Copy data from the heap to DOS real mode memory</short>
827
Copies heap data to dos real mode memory.
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>
839
Notes: No range checking is performed.
842
For an example, see <link id="global_dos_alloc"/>.
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"/>
859
<element name="enable">
860
<short>Enable hardware interrupts</short>
862
Enables all hardware interrupts by executing a STI instruction.
872
<element name="free_ldt_descriptor">
873
<short>Free a descriptor</short>
876
Frees a previously allocated descriptor.
882
<dt>des</dt><dd> The descriptor to be freed.</dd>
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
894
For an example, see <link id="allocate_ldt_descriptors"/>.
898
Check the <link id="int31error"/> variable.
901
<link id="allocate_ldt_descriptors"/>
902
<link id="get_next_selector_increment_value"/>
906
<element name="free_memory_block">
907
<short>Free allocated memory block</short>
910
Frees a previously allocated memory block.
916
<dt>blockhandle</dt><dd> the handle to the memory area to free.</dd>
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.
927
Check <link id="int31error"/> variable.
930
<link id="allocate_memory_block"/>
934
<element name="free_rm_callback">
935
<short>Release real mode callback.</short>
938
Releases a real mode callback address that was previously allocated with the
939
<link id="get_rm_callback"/> function.
945
<dt>intaddr</dt><dd> real mode address buffer returned by <link id="get_rm_callback"/> .
949
Return values: <var>True</var> if successful, <var>False</var> if not
952
For an example, see <link id="get_rm_callback"/>.
956
Check the <link id="int31error"/> variable.
959
<link id="set_rm_interrupt"/>
960
<link id="get_rm_callback"/>
964
<element name="get_cs">
965
<short>Get CS selector</short>
968
Returns the cs selector.
971
Return value: The content of the cs segment register.
974
For an example, see <link id="set_pm_interrupt"/>.
986
<element name="get_descriptor_access_right">
987
<short>Get descriptor's access rights</short>
990
Gets the access rights of a descriptor.
996
<dt>d</dt><dd> selector to descriptor.</dd>
999
Return value: Access rights bit field.
1003
Check the <link id="int31error"/> variable.
1006
<link id="set_descriptor_access_right"/>
1010
<element name="get_ds">
1011
<short>Get DS Selector</short>
1014
Returns the ds selector.
1017
Return values: The content of the ds segment register.
1029
<element name="get_linear_addr">
1030
<short>Convert physical to linear address</short>
1033
Converts a physical address into a linear address.
1039
<dt>phys_addr</dt><dd>physical address of device.</dd>
1040
<dt>size</dt><dd>Size of region to map in bytes.</dd>
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.
1050
Check the <link id="int31error"/> variable.
1053
<link id="allocate_ldt_descriptors"/>
1054
<link id="set_segment_limit"/>
1055
<link id="set_segment_base_address"/>
1059
<element name="get_meminfo">
1060
<short>Return information on the available memory</short>
1063
Returns information about the amount of available physical memory, linear
1064
address space, and disk space for page swapping.
1070
<dt>meminfo</dt><dd> buffer to fill memory information into.</dd>
1073
Return values: Due to an implementation bug this function always returns
1074
<var>False</var>, but it always succeeds.
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.
1085
Check the <link id="int31error"/> variable.
1088
<link id="get_page_size"/>
1090
<example file="go32ex/meminfo"/>
1093
<element name="get_next_selector_increment_value">
1094
<short>Return selector increment value</short>
1097
Returns the selector increment value when allocating multiple subsequent
1098
descriptors via <link id="allocate_ldt_descriptors"/>.
1101
Return value: Selector increment value.
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.
1110
Check the <link id="int31error"/> variable.
1113
<link id="allocate_ldt_descriptors"/>
1114
<link id="free_ldt_descriptor"/>
1118
<element name="get_page_size">
1119
<short>Return the page size</short>
1122
Returns the size of a single memory page.
1125
Return value: Size of a single page in bytes.
1128
The returned size is typically 4096 bytes.
1131
For an example, see <link id="get_meminfo"/>.
1135
Check the <link id="int31error"/> variable.
1138
<link id="get_meminfo"/>
1142
<element name="get_pm_interrupt">
1143
<short>Return protected mode interrupt handler</short>
1146
Returns the address of a current protected mode interrupt handler.
1152
<dt>vector</dt><dd> interrupt handler number you want the address to.</dd>
1153
<dt>intaddr</dt><dd> buffer to store address.</dd>
1156
Return values: <var>True</var> if successful, <var>False</var> if not.
1159
The returned address is a protected mode selector:offset address.
1162
For an example, see <link id="set_pm_interrupt"/>.
1166
Check the <link id="int31error"/> variable.
1169
<link id="set_pm_interrupt"/>
1170
<link id="set_rm_interrupt"/>
1171
<link id="get_rm_interrupt"/>
1175
<element name="get_rm_callback">
1176
<short>Return real mode callback</short>
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
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>
1192
Return values: <var>True</var> if successful, otherwise <var>False</var>.
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.
1204
Check the <link id="int31error"/> variable.
1207
<link id="free_rm_callback"/>
1209
<example file="go32ex/callback"/>
1212
<element name="get_rm_interrupt">
1213
<short>Get real mode interrupt vector</short>
1216
Returns the contents of the current machine's real mode interrupt vector for
1217
the specified interrupt.
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>
1227
Return values: <var>True</var> if successful, <var>False</var> otherwise.
1230
The returned address is a real mode segment address, which isn't
1231
valid in protected mode.
1235
Check the <link id="int31error"/> variable.
1238
<link id="set_rm_interrupt"/>
1239
<link id="set_pm_interrupt"/>
1240
<link id="get_pm_interrupt"/>
1244
<element name="get_run_mode">
1245
<short>Return current run mode</short>
1248
Returns the current mode your application runs with.
1251
Return values: One of the constants used by this function.
1258
constants returned by <link id="get_run_mode"/>
1260
<example file="go32ex/getrunmd"/>
1263
<element name="get_segment_base_address">
1264
<short>Return base address from descriptor table</short>
1267
Returns the 32-bit linear base address from the descriptor table for the
1274
<dt>d</dt><dd> selector of the descriptor you want the base address of.</dd>
1277
Return values: Linear base address of specified descriptor.
1280
For an example, see <link id="allocate_ldt_descriptors"/>.
1284
Check the <link id="int31error"/> variable.
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"/>
1295
<element name="get_segment_limit">
1296
<short>Return segment limite from descriptor</short>
1299
Returns a descriptors segment limit.
1305
<dt>d</dt><dd> selector.</dd>
1308
Return value: Limit of the descriptor in bytes.
1312
Returns zero if descriptor is invalid.
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"/>
1322
<element name="get_ss">
1323
<short>Return SS selector</short>
1326
Returns the ss selector.
1329
Return values: The content of the ss segment register.
1341
<element name="global_dos_alloc">
1342
<short>Allocate DOS real mode memory</short>
1345
Allocates a block of dos real mode memory.
1351
<dt>bytes</dt><dd>size of requested real mode memory.</dd>
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.
1369
Check the <link id="int31error"/> variable.
1372
<link id="global_dos_free"/>
1374
<example file="go32ex/buffer"/>
1377
<element name="global_dos_free">
1378
<short>Free DOS memory block</short>
1381
Frees a previously allocated dos memory block.
1387
<dt>selector</dt><dd> selector to the dos memory block.</dd>
1390
Return value: <var>True</var> if successful, <var>False</var> otherwise.
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"/>.
1398
For an example, see <link id="global_dos_alloc"/>.
1402
Check the <link id="int31error"/> variable.
1405
<link id="global_dos_alloc"/>
1409
<element name="inportb">
1410
<short>Read byte from I/O port</short>
1413
Reads 1 byte from the selected I/O port.
1419
<dt>port</dt><dd> the I/O port number which is read.</dd>
1422
Return values: Current I/O port value.
1429
<link id="outportb"/>
1430
<link id="inportw"/>
1431
<link id="inportl"/>
1435
<element name="inportl">
1436
<short>Read longint from I/O port</short>
1439
Reads 1 longint from the selected I/O port.
1445
<dt>port</dt><dd> the I/O port number which is read.</dd>
1448
Return values: Current I/O port value.
1455
<link id="outportb"/>
1456
<link id="inportb"/>
1457
<link id="inportw"/>
1461
<element name="inportw">
1462
<short>Read word from I/O port</short>
1465
Reads 1 word from the selected I/O port.
1471
<dt>port</dt><dd> the I/O port number which is read.</dd>
1474
Return values: Current I/O port value.
1481
<link id="outportw"/>
1482
<link id="inportb"/>
1483
<link id="inportl"/>
1487
<element name="lock_code">
1488
<short>Lock code memory range</short>
1491
Locks a memory range which is in the code segment selector.
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>
1501
Return values: <var>True</var> if successful, <var>False</var> otherwise.
1504
For an example, see <link id="get_rm_callback"/>.
1508
Check the <link id="int31error"/> variable.
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"/>
1519
<element name="lock_data">
1520
<short>Lock data memory range</short>
1523
Locks a memory range which resides in the data segment selector.
1529
<dt>data</dt><dd> address of data to be locked.</dd>
1530
<dt>size</dt><dd> length of data to be locked.</dd>
1533
Return values: <var>True</var> if successful, <var>False</var> otherwise.
1536
For an example, see <link id="get_rm_callback"/>.
1540
Check the <link id="int31error"/> variable.
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"/>
1551
<element name="lock_linear_region">
1552
<short>Lock linear memory region</short>
1555
Locks a memory region to prevent swapping of it.
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>
1565
Return value: <var>True</var> if successful, False otherwise.
1569
Check the <link id="int31error"/> variable.
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"/>
1580
<element name="outportb">
1581
<short>Write byte to I/O port</short>
1584
Sends 1 byte of data to the specified I/O port.
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>
1594
Return values: None.
1601
<link id="inportb"/>
1602
<link id="outportl"/>
1603
<link id="outportw"/>
1605
<example file="go32ex/outport"/>
1608
<element name="outportl">
1609
<short>Write longint to I/O port</short>
1612
Sends 1 longint of data to the specified I/O port.
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>
1622
Return values: None.
1625
For an example, see <link id="outportb"/>.
1632
<link id="inportl"/>
1633
<link id="outportw"/>
1634
<link id="outportb"/>
1638
<element name="outportw">
1639
<short>Write word to I/O port</short>
1642
Sends 1 word of data to the specified I/O port.
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>
1652
Return values: None.
1655
For an example, see <link id="outportb"/>.
1662
<link id="inportw"/>
1663
<link id="outportl"/>
1664
<link id="outportb"/>
1668
<element name="realintr">
1669
<short>Simulate interrupt</short>
1672
Simulates an interrupt in real mode.
1678
<dt>intnr</dt><dd> interrupt number to issue in real mode.</dd>
1679
<dt>regs</dt><dd> registers data structure.</dd>
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
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
1693
Check the <link id="int31error"/> variable.
1697
<example file="go32ex/flags"/>
1700
<element name="seg_fillchar">
1701
<short>Fill segment with byte value</short>
1704
Sets a memory area to a specific value.
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>
1716
Return values: None.
1719
Notes: No range check is done in any way.
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"/>
1734
<example file="go32ex/vgasel"/>
1737
<element name="seg_fillword">
1738
<short>Fill segment with word value</short>
1741
Sets a memory area to a specific value.
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>
1753
Return values: None.
1756
Notes: No range check is done in any way.
1759
For an example, see <link id="allocate_ldt_descriptors"/>.
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"/>
1776
<element name="segment_to_descriptor">
1777
<short>Map segment address to descriptor</short>
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.
1787
<dt>seg</dt><dd>the real mode segment you want the descriptor to.</dd>
1790
Return values: Descriptor to real mode segment address.
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.
1802
For an example, see <link id="seg_fillchar"/>.
1806
Check the <link id="int31error"/> variable.
1809
<link id="allocate_ldt_descriptors"/>
1810
<link id="free_ldt_descriptor"/>
1811
<link id="set_segment_base_address"/>
1815
<element name="seg_move">
1816
<short>Move data between 2 locations</short>
1819
Copies data between two memory locations.
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>
1832
Return values: None.
1835
Overlapping is only checked if the source selector is equal to the
1836
destination selector. No range check is done.
1839
For an example, see <link id="allocate_ldt_descriptors"/>.
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"/>
1856
<element name="set_descriptor_access_rights">
1857
<short>Set descriptor access rights</short>
1860
Sets the access rights of a descriptor.
1866
<dt>d</dt><dd> selector.</dd>
1867
<dt>w</dt><dd> new descriptor access rights.</dd>
1871
Check the <link id="int31error"/> variable.
1874
<link id="get_descriptor_access_rights"/>
1878
<element name="set_pm_interrupt">
1879
<short>Set protected mode interrupt handler</short>
1882
Sets the address of the protected mode handler for an interrupt.
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>
1892
Return values: <var>True</var> if successful, <var>False</var> otherwise.
1895
The address supplied must be a valid <var>selector:offset</var>
1896
protected mode address.
1900
Check the <link id="int31error"/> variable.
1903
<link id="get_pm_interrupt"/>
1904
<link id="set_rm_interrupt"/>
1905
<link id="get_rm_interrupt"/>
1907
<example file="go32ex/intpm"/>
1910
<element name="set_rm_interrupt">
1911
<short>Set real mode interrupt handler</short>
1914
Sets a real mode interrupt handler.
1920
<dt>vector</dt><dd> the interrupt vector number to set.</dd>
1921
<dt>intaddr</dt><dd> address of new interrupt vector.</dd>
1924
Return values: <var>True</var> if successful, otherwise <var>False</var>.
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"/>.
1934
Check the <link id="int31error"/> variable.
1937
<link id="get_rm_interrupt"/>
1938
<link id="set_pm_interrupt"/>
1939
<link id="get_pm_interrupt"/>
1940
<link id="get_rm_callback"/>
1944
<element name="set_segment_base_address">
1945
<short>Set descriptor's base address</short>
1948
Sets the 32-bit linear base address of a descriptor.
1954
<dt>d</dt><dd> selector.</dd>
1955
<dt>s</dt><dd> new base address of the descriptor.</dd>
1959
Check the <link id="int31error"/> variable.
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"/>
1971
<element name="set_segment_limit">
1972
<short>Set descriptor limit</short>
1975
Sets the limit of a descriptor.
1981
<dt>d</dt><dd> selector.</dd>
1982
<dt>s</dt><dd> new limit of the descriptor.</dd>
1985
Return values: Returns <var>True</var> if successful, else <var>False</var>.
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.
1993
For an example, see <link id="allocate_ldt_descriptors"/>.
1997
Check the <link id="int31error"/> variable.
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"/>
2007
<element name="tb_size">
2008
<short>Return DOS transfer memory buffer size</short>
2011
Returns the size of the pre-allocated dos memory buffer.
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.
2022
<link id="transfer_buffer"/>
2023
<link id="copyfromdos"/>
2024
<link id="copytodos"/>
2029
<element name="transfer_buffer">
2030
<short>Return offset of DOS transfer buffer</short>
2032
<var>transfer_buffer</var> returns the offset of the transfer buffer.
2038
<link id="tb_size"/>
2043
<element name="unlock_code">
2044
<short>Unlock code segment</short>
2047
Unlocks a memory range which resides in the code segment selector.
2053
<dt>functionaddr</dt><dd> address of function to be unlocked. </dd>
2054
<dt>size</dt><dd> size bytes to be unlocked.</dd>
2057
Return value: <var>True</var> if successful, <var>False</var> otherwise.
2060
For an example, see <link id="get_rm_callback"/>.
2064
Check the <link id="int31error"/> variable.
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"/>
2075
<element name="unlock_data">
2076
<short>Unlock data segment</short>
2079
Unlocks a memory range which resides in the data segment selector.
2085
<dt>data</dt><dd> address of memory to be unlocked. </dd>
2086
<dt>size</dt><dd> size bytes to be unlocked.</dd>
2089
Return values: <var>True</var> if successful, <var>False</var> otherwise.
2092
For an example, see <link id="get_rm_callback"/>.
2096
Check the <link id="int31error"/> variable.
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"/>
2107
<element name="unlock_linear_region">
2108
<short>Unlock linear memory region</short>
2111
Unlocks a previously locked linear region range to allow it to be swapped
2112
out again if needed.
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>
2122
Return values: <var>True</var> if successful, <var>False</var> otherwise.
2126
Check the <link id="int31error"/> variable.
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"/>
2137
<!-- variable Visibility: default -->
2138
<element name="tmeminfo.reserved0">
2139
<short>Unused</short>
2142
<!-- variable Visibility: default -->
2143
<element name="tmeminfo.reserved1">
2144
<short>Unused</short>
2147
<!-- variable Visibility: default -->
2148
<element name="tmeminfo.reserved2">
2149
<short>Unused</short>
2152
<!-- function Visibility: default -->
2153
<element name="set_descriptor_access_right">
2154
<short>Set access rights to memory descriptor</short>
2156
<var>set_descriptor_access_right</var> sets the access rights for descriptor
2157
<var>d</var> to <var>w</var>
2161
<!-- function Visibility: default -->
2162
<element name="map_device_in_memory_block">
2163
<short>Map a device into program's memory space</short>
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.
2171
<!-- function Visibility: default -->
2172
<element name="get_exception_handler">
2173
<short>Return current exception handler</short>
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.
2180
<link id="set_exception_handler"/>
2181
<link id="get_pm_exception_handler"/>
2185
<!-- function Visibility: default -->
2186
<element name="set_exception_handler">
2187
<short>Set exception handler</short>
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.
2194
<link id="get_exception_handler"/>
2195
<link id="set_pm_exception_handler"/>
2199
<!-- function Visibility: default -->
2200
<element name="get_pm_exception_handler">
2201
<short>Get protected mode exception handler</short>
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.
2208
<link id="get_exception_handler"/>
2209
<link id="set_pm_exception_handler"/>
2213
<!-- function Visibility: default -->
2214
<element name="set_pm_exception_handler">
2215
<short>Set protected mode exception handler</short>
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.
2222
<link id="set_exception_handler"/>
2223
<link id="get_pm_exception_handler"/>
2227
<!-- function Visibility: default -->
2228
<element name="request_linear_region">
2229
<short>Request linear address region.</short>
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>.
2237
On error, <var>False</var> is returned.
2241
<!-- function Visibility: default -->
2242
<element name="tb_segment">
2243
<short>Return DOS transfer buffer segment</short>
2245
<var>tb_segment</var> returns the DOS transfer buffer segment.
2248
<link id="transfer_buffer"/>
2249
<link id="tb_offset"/>
2250
<link id="tb_size"/>
2254
<!-- function Visibility: default -->
2255
<element name="tb_offset">
2256
<short>Return DOS transfer buffer offset</short>
2258
<var>tb_offset</var> returns the DOS transfer buffer segment.
2261
<link id="transfer_buffer"/>
2262
<link id="tb_segment"/>
2263
<link id="tb_size"/>
2267
<!-- procedure Visibility: default -->
2268
<element name="dpmi_dosmemput">
2269
<short>Move data from DPMI memory to DOS memory.</short>
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
2276
<link id="dpmi_dosmemget"/>
2277
<link id="dpmi_dosmemmove"/>
2278
<link id="dpmi_dosmemfillchar"/>
2279
<link id="dpmi_dosmemfillword"/>
2283
<!-- procedure Visibility: default -->
2284
<element name="dpmi_dosmemget">
2285
<short>Move data from DOS memory to DPMI memory</short>
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>.
2292
<link id="dpmi_dosmemput"/>
2293
<link id="dpmi_dosmemmove"/>
2294
<link id="dpmi_dosmemfillchar"/>
2295
<link id="dpmi_dosmemfillword"/>
2299
<!-- procedure Visibility: default -->
2300
<element name="dpmi_dosmemmove">
2301
<short>Move DOS memory</short>
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>.
2307
<link id="dpmi_dosmemput"/>
2308
<link id="dpmi_dosmemget"/>
2309
<link id="dpmi_dosmemfillchar"/>
2310
<link id="dpmi_dosmemfillword"/>
2314
<!-- procedure Visibility: default -->
2315
<element name="dpmi_dosmemfillchar">
2316
<short>Fill DOS memory with a character</short>
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>.
2322
<link id="dpmi_dosmemput"/>
2323
<link id="dpmi_dosmemget"/>
2324
<link id="dpmi_dosmemmove"/>
2325
<link id="dpmi_dosmemfillword"/>
2329
<!-- procedure Visibility: default -->
2330
<element name="dpmi_dosmemfillword">
2331
<short>Fill DOS memory with a word value</short>
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>.
2337
<link id="dpmi_dosmemput"/>
2338
<link id="dpmi_dosmemget"/>
2339
<link id="dpmi_dosmemfillchar"/>
2340
<link id="dpmi_dosmemmove"/>
2346
</fpdoc-descriptions>
b'\\ No newline at end of file'