Sign in Join
FPDoc Onlineexperiment

go32 unit

GO32 - access to the 32-bit DOS extender.

This document describes the GO32 unit for the Free Pascal compiler under dos. It was donated by Thomas Schatzl (tom_at_work@geocities.com), for which my thanks. This unit was first written for dos by Florian Klaempfl.

Only the GO32V2 DPMI mode is discussed by me here due to the fact that new applications shouldn't be created with the older GO32V1 model. The go32v2 version is much more advanced and better. Additionally a lot of functions only work in DPMI mode anyway. I hope the following explanations and introductions aren't too confusing at all. If you notice an error or bug send it to the FPC mailing list or directly to me. So let's get started and happy and error free coding I wish you.... Thomas Schatzl, 25. August 1998

Classes and records

tdpmiversioninforecordStructure describing DPMI version.
tmeminforecordMemory information record.
trealregsrecordRecord describing all processor registers.
tseginforecordRecord to store 48-bits pointer.

Procedures and functions

allocate_ldt_descriptorsfunctionAllocate a number of descriptors.
allocate_memory_blockfunctionAllocate a block of linear memory.
copyfromdosprocedureCopy data from DOS to heap.
copytodosprocedureCopy data from heap to DOS memory.
create_code_segment_alias_descriptorfunctionCreate new descriptor from existing descriptor.
disableprocedureDisable hardware interrupts.
dpmi_dosmemfillcharprocedureFill DOS memory with a character.
dpmi_dosmemfillwordprocedureFill DOS memory with a word value.
dpmi_dosmemgetprocedureMove data from DOS memory to DPMI memory.
dpmi_dosmemmoveprocedureMove DOS memory.
dpmi_dosmemputprocedureMove data from DPMI memory to DOS memory.
enableprocedureEnable hardware interrupts.
free_ldt_descriptorfunctionFree a descriptor.
free_linear_addr_mappingfunction? No description available.
free_memory_blockfunctionFree allocated memory block.
free_rm_callbackfunctionRelease real mode callback.
get_csfunctionGet CS selector.
get_descriptor_access_rightfunctionGet descriptor's access rights.
get_dpmi_versionfunctionReturn DPMI information.
get_dsfunctionGet DS Selector.
get_exception_handlerfunctionReturn current exception handler.
get_linear_addrfunctionConvert physical to linear address.
get_meminfofunctionReturn information on the available memory.
get_next_selector_increment_valuefunctionReturn selector increment value.
get_page_attributesfunction? No description available.
get_page_sizefunctionReturn the page size.
get_pm_exception_handlerfunctionGet protected mode exception handler.
get_pm_interruptfunctionReturn protected mode interrupt handler.
get_rm_callbackfunctionReturn real mode callback.
get_rm_interruptfunctionGet real mode interrupt vector.
get_run_modefunctionReturn current run mode.
get_segment_base_addressfunctionReturn base address from descriptor table.
get_segment_limitfunctionReturn segment limits from descriptor.
get_ssfunctionReturn SS selector.
global_dos_allocfunctionAllocate DOS real mode memory.
global_dos_freefunctionFree DOS memory block.
inportbfunctionRead byte from I/O port.
inportlfunctionRead longint from I/O port.
inportwfunctionRead word from I/O port.
lock_codefunctionLock code memory range.
lock_datafunctionLock data memory range.
lock_linear_regionfunctionLock linear memory region.
map_device_in_memory_blockfunctionMap a device into program's memory space.
outportbprocedureWrite byte to I/O port.
outportlprocedureWrite longint to I/O port.
outportwprocedureWrite word to I/O port.
realintrfunctionSimulate interrupt.
request_linear_regionfunctionRequest linear address region.
seg_fillcharprocedureFill segment with byte value.
seg_fillwordprocedureFill segment with word value.
seg_moveprocedureMove data between 2 locations.
segment_to_descriptorfunctionMap segment address to descriptor.
set_descriptor_access_rightfunctionSet access rights to memory descriptor.
set_exception_handlerfunctionSet exception handler.
set_page_attributesfunction? No description available.
set_pm_exception_handlerfunctionSet protected mode exception handler.
set_pm_interruptfunctionSet protected mode interrupt handler.
set_rm_interruptfunctionSet real mode interrupt handler.
set_segment_base_addressfunctionSet descriptor's base address.
set_segment_limitfunctionSet descriptor limit.
tb_offsetfunctionReturn DOS transfer buffer offset.
tb_segmentfunctionReturn DOS transfer buffer segment.
tb_sizefunctionReturn DOS transfer memory buffer size.
transfer_bufferfunctionReturn offset of DOS transfer buffer.
unlock_codefunctionUnlock code segment.
unlock_datafunctionUnlock data segment.
unlock_linear_regionfunctionUnlock linear memory region.

Types

registerstypeAlias for .

Constants

auxcarryflagconstantCheck for auxiliary carry flag in .
carryflagconstantCheck for carry flag in .
directionflagconstantCheck for direction flag in .
dosmemfillcharconstantFill a region of DOS memory with a specific byte-sized value.
dosmemfillwordconstantFill a region of DOS memory with a specific word-sized value.
dosmemgetconstantCopy data from DOS memory to the heap.
dosmemmoveconstantMove data between 2 DOS real mode memory locations.
dosmemputconstantCopy data from the heap to DOS real mode memory.
interruptflagconstantCheck for interrupt flag in .
overflowflagconstantCheck for overflow flag in .
parityflagconstantCheck for parity flag in .
rm_dpmiconstantreturn value: DPMI (e.g. dos box or 386Max).
rm_rawconstantreturn value: raw (without HIMEM).
rm_unknownconstantreturn value: Unknown runmode.
rm_vcpiconstantreturn value: VCPI (with HIMEM and EMM386).
rm_xmsconstantreturn value: XMS (with HIMEM, without EMM386).
signflagconstantCheck for sign flag in .
trapflagconstantCheck for trap flag in .
zeroflagconstantCheck for zero flag in .

Variables

dosmemselectorvariableSelector to DOS memory.
int31errorvariableDPMI interrupt call result.

Topics

CreatingInterruptHandlerstopicCreating your own interrupt handlers.
DisablingInterruptstopicDisabling interrupts.
DosMemorytopicdos memory access.
DPMItopicWhat is DPMI.
DPMIInterruptstopicHandling interrupts with DPMI.
DPMIvsProtectedInterruptstopicProtected mode interrupts vs. Real mode interrupts.
ExecutingInterruptstopicExecuting software interrupts.
FPCspecstopicFPC specialities.
HardwareInterruptstopicHardware interrupts.
InterruptHandlingtopicInterrupt redirection.
IOPortstopicI/O port access.
ProcessorAccesstopicProcessor access.
RealModeCallBackstopicReal mode callbacks.
SelectorsDescriptorstopicSelectors and descriptors.
SoftwareInterruptstopicSoftware interrupts.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.