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
tdpmiversioninfo | record | Structure describing DPMI version. |
tmeminfo | record | Memory information record. |
trealregs | record | Record describing all processor registers. |
tseginfo | record | Record to store 48-bits pointer. |
Procedures and functions
allocate_ldt_descriptors | function | Allocate a number of descriptors. |
allocate_memory_block | function | Allocate a block of linear memory. |
copyfromdos | procedure | Copy data from DOS to heap. |
copytodos | procedure | Copy data from heap to DOS memory. |
create_code_segment_alias_descriptor | function | Create new descriptor from existing descriptor. |
disable | procedure | Disable hardware interrupts. |
dpmi_dosmemfillchar | procedure | Fill DOS memory with a character. |
dpmi_dosmemfillword | procedure | Fill DOS memory with a word value. |
dpmi_dosmemget | procedure | Move data from DOS memory to DPMI memory. |
dpmi_dosmemmove | procedure | Move DOS memory. |
dpmi_dosmemput | procedure | Move data from DPMI memory to DOS memory. |
enable | procedure | Enable hardware interrupts. |
free_ldt_descriptor | function | Free a descriptor. |
free_linear_addr_mapping | function | ? No description available. |
free_memory_block | function | Free allocated memory block. |
free_rm_callback | function | Release real mode callback. |
get_cs | function | Get CS selector. |
get_descriptor_access_right | function | Get descriptor's access rights. |
get_dpmi_version | function | Return DPMI information. |
get_ds | function | Get DS Selector. |
get_exception_handler | function | Return current exception handler. |
get_linear_addr | function | Convert physical to linear address. |
get_meminfo | function | Return information on the available memory. |
get_next_selector_increment_value | function | Return selector increment value. |
get_page_attributes | function | ? No description available. |
get_page_size | function | Return the page size. |
get_pm_exception_handler | function | Get protected mode exception handler. |
get_pm_interrupt | function | Return protected mode interrupt handler. |
get_rm_callback | function | Return real mode callback. |
get_rm_interrupt | function | Get real mode interrupt vector. |
get_run_mode | function | Return current run mode. |
get_segment_base_address | function | Return base address from descriptor table. |
get_segment_limit | function | Return segment limits from descriptor. |
get_ss | function | Return SS selector. |
global_dos_alloc | function | Allocate DOS real mode memory. |
global_dos_free | function | Free DOS memory block. |
inportb | function | Read byte from I/O port. |
inportl | function | Read longint from I/O port. |
inportw | function | Read word from I/O port. |
lock_code | function | Lock code memory range. |
lock_data | function | Lock data memory range. |
lock_linear_region | function | Lock linear memory region. |
map_device_in_memory_block | function | Map a device into program's memory space. |
outportb | procedure | Write byte to I/O port. |
outportl | procedure | Write longint to I/O port. |
outportw | procedure | Write word to I/O port. |
realintr | function | Simulate interrupt. |
request_linear_region | function | Request linear address region. |
seg_fillchar | procedure | Fill segment with byte value. |
seg_fillword | procedure | Fill segment with word value. |
seg_move | procedure | Move data between 2 locations. |
segment_to_descriptor | function | Map segment address to descriptor. |
set_descriptor_access_right | function | Set access rights to memory descriptor. |
set_exception_handler | function | Set exception handler. |
set_page_attributes | function | ? No description available. |
set_pm_exception_handler | function | Set protected mode exception handler. |
set_pm_interrupt | function | Set protected mode interrupt handler. |
set_rm_interrupt | function | Set real mode interrupt handler. |
set_segment_base_address | function | Set descriptor's base address. |
set_segment_limit | function | Set descriptor limit. |
tb_offset | function | Return DOS transfer buffer offset. |
tb_segment | function | Return DOS transfer buffer segment. |
tb_size | function | Return DOS transfer memory buffer size. |
transfer_buffer | function | Return offset of DOS transfer buffer. |
unlock_code | function | Unlock code segment. |
unlock_data | function | Unlock data segment. |
unlock_linear_region | function | Unlock linear memory region. |
Types
registers | type | Alias for . |
Constants
auxcarryflag | constant | Check for auxiliary carry flag in . |
carryflag | constant | Check for carry flag in . |
directionflag | constant | Check for direction flag in . |
dosmemfillchar | constant | Fill a region of DOS memory with a specific byte-sized value. |
dosmemfillword | constant | Fill a region of DOS memory with a specific word-sized value. |
dosmemget | constant | Copy data from DOS memory to the heap. |
dosmemmove | constant | Move data between 2 DOS real mode memory locations. |
dosmemput | constant | Copy data from the heap to DOS real mode memory. |
interruptflag | constant | Check for interrupt flag in . |
overflowflag | constant | Check for overflow flag in . |
parityflag | constant | Check for parity flag in . |
rm_dpmi | constant | return value: DPMI (e.g. dos box or 386Max). |
rm_raw | constant | return value: raw (without HIMEM). |
rm_unknown | constant | return value: Unknown runmode. |
rm_vcpi | constant | return value: VCPI (with HIMEM and EMM386). |
rm_xms | constant | return value: XMS (with HIMEM, without EMM386). |
signflag | constant | Check for sign flag in . |
trapflag | constant | Check for trap flag in . |
zeroflag | constant | Check for zero flag in . |
Variables
dosmemselector | variable | Selector to DOS memory. |
int31error | variable | DPMI interrupt call result. |
Topics
CreatingInterruptHandlers | topic | Creating your own interrupt handlers. |
DisablingInterrupts | topic | Disabling interrupts. |
DosMemory | topic | dos memory access. |
DPMI | topic | What is DPMI. |
DPMIInterrupts | topic | Handling interrupts with DPMI. |
DPMIvsProtectedInterrupts | topic | Protected mode interrupts vs. Real mode interrupts. |
ExecutingInterrupts | topic | Executing software interrupts. |
FPCspecs | topic | FPC specialities. |
HardwareInterrupts | topic | Hardware interrupts. |
InterruptHandling | topic | Interrupt redirection. |
IOPorts | topic | I/O port access. |
ProcessorAccess | topic | Processor access. |
RealModeCallBacks | topic | Real mode callbacks. |
SelectorsDescriptors | topic | Selectors and descriptors. |
SoftwareInterrupts | topic | Software interrupts. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
