go32.xml 54 KB

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